From: tb Date: Mon, 1 Jan 2024 15:43:02 +0000 (+0000) Subject: pkey_is_pss() and pkey_ctx_is_pss() to rsa_ameth.c X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a21c64b7e6fdb8f2d8a92610d7a9ef3dbce8440f;p=openbsd pkey_is_pss() and pkey_ctx_is_pss() to rsa_ameth.c These aren't particularly helpful and should probably both be expanded. For now move them to the only place where they are actually used. --- diff --git a/lib/libcrypto/rsa/rsa_ameth.c b/lib/libcrypto/rsa/rsa_ameth.c index a43bcf9f9a0..2266f0cbd53 100644 --- a/lib/libcrypto/rsa/rsa_ameth.c +++ b/lib/libcrypto/rsa/rsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_ameth.c,v 1.53 2023/12/28 21:58:12 tb Exp $ */ +/* $OpenBSD: rsa_ameth.c,v 1.54 2024/01/01 15:43:02 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -74,6 +74,10 @@ #include "rsa_local.h" #include "x509_local.h" +/* Macros to test if a pkey or ctx is for a PSS key */ +#define pkey_is_pss(pkey) (pkey->ameth->pkey_id == EVP_PKEY_RSA_PSS) +#define pkey_ctx_is_pss(ctx) (ctx->pmeth->pkey_id == EVP_PKEY_RSA_PSS) + #ifndef OPENSSL_NO_CMS static int rsa_cms_sign(CMS_SignerInfo *si); static int rsa_cms_verify(CMS_SignerInfo *si); diff --git a/lib/libcrypto/rsa/rsa_local.h b/lib/libcrypto/rsa/rsa_local.h index f2639d59b10..d537ab9c77c 100644 --- a/lib/libcrypto/rsa/rsa_local.h +++ b/lib/libcrypto/rsa/rsa_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_local.h,v 1.7 2023/11/29 21:35:57 tb Exp $ */ +/* $OpenBSD: rsa_local.h,v 1.8 2024/01/01 15:43:02 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -60,10 +60,6 @@ __BEGIN_HIDDEN_DECLS #define RSA_MIN_MODULUS_BITS 512 -/* Macros to test if a pkey or ctx is for a PSS key */ -#define pkey_is_pss(pkey) (pkey->ameth->pkey_id == EVP_PKEY_RSA_PSS) -#define pkey_ctx_is_pss(ctx) (ctx->pmeth->pkey_id == EVP_PKEY_RSA_PSS) - struct rsa_meth_st { char *name; int (*rsa_pub_enc)(int flen, const unsigned char *from,