From: Matt Caswell Date: Fri, 12 Dec 2025 12:01:56 +0000 (+0000) Subject: Clean up some final vistigial remnants of EVP_PKEY_METHOD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60d4b986e7e11bf6addf2bc8a17c4abb17b98ce4;p=thirdparty%2Fopenssl.git Clean up some final vistigial remnants of EVP_PKEY_METHOD We retain the opaque type because it is still used by the ENGINE stubs. Reviewed-by: Shane Lontis Reviewed-by: Paul Yang (Merged from https://github.com/openssl/openssl/pull/29384) --- diff --git a/crypto/dh/dh_backend.c b/crypto/dh/dh_backend.c index 4a3e2b2e423..264389e0b3e 100644 --- a/crypto/dh/dh_backend.c +++ b/crypto/dh/dh_backend.c @@ -24,8 +24,8 @@ /* * The intention with the "backend" source file is to offer backend functions - * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider - * implementations alike. + * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations + * alike. */ static int dh_ffc_params_fromdata(DH *dh, const OSSL_PARAM params[]) diff --git a/crypto/dsa/dsa_backend.c b/crypto/dsa/dsa_backend.c index e4c1c7bb01e..aca659c82fe 100644 --- a/crypto/dsa/dsa_backend.c +++ b/crypto/dsa/dsa_backend.c @@ -22,9 +22,9 @@ #include "dsa_local.h" /* - * The intention with the "backend" source file is to offer backend support - * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider - * implementations alike. + * The intention with the "backend" source file is to offer backend functions + * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations + * alike. */ int ossl_dsa_key_fromdata(DSA *dsa, const OSSL_PARAM params[], diff --git a/crypto/ec/ec_backend.c b/crypto/ec/ec_backend.c index b100af0c60f..52cb8683238 100644 --- a/crypto/ec/ec_backend.c +++ b/crypto/ec/ec_backend.c @@ -351,9 +351,9 @@ err: } /* - * The intention with the "backend" source file is to offer backend support - * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider - * implementations alike. + * The intention with the "backend" source file is to offer backend functions + * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations + * alike. */ int ossl_ec_set_ecdh_cofactor_mode(EC_KEY *ec, int mode) { diff --git a/crypto/ec/ecx_backend.c b/crypto/ec/ecx_backend.c index 40daf30e1aa..710ad31a667 100644 --- a/crypto/ec/ecx_backend.c +++ b/crypto/ec/ecx_backend.c @@ -20,9 +20,9 @@ #include "ecx_backend.h" /* - * The intention with the "backend" source file is to offer backend support - * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider - * implementations alike. + * The intention with the "backend" source file is to offer backend functions + * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations + * alike. */ int ossl_ecx_public_from_private(ECX_KEY *key) diff --git a/crypto/evp/keymgmt_meth.c b/crypto/evp/keymgmt_meth.c index 465e669a712..b57e817e510 100644 --- a/crypto/evp/keymgmt_meth.c +++ b/crypto/evp/keymgmt_meth.c @@ -401,8 +401,8 @@ int evp_keymgmt_gen_set_template(const EVP_KEYMGMT *keymgmt, void *genctx, /* * It's arguable if we actually should return success in this case, as * it allows the caller to set a template key, which is then ignored. - * However, this is how the legacy methods (EVP_PKEY_METHOD) operate, - * so we do this in the interest of backward compatibility. + * However, this is how the legacy methods used to operate, so we do this in + * the interest of backward compatibility. */ if (keymgmt->gen_set_template == NULL) return 1; diff --git a/crypto/ffc/ffc_backend.c b/crypto/ffc/ffc_backend.c index fa3182bc80a..cc54d38b0b6 100644 --- a/crypto/ffc/ffc_backend.c +++ b/crypto/ffc/ffc_backend.c @@ -12,9 +12,9 @@ #include "internal/sizes.h" /* - * The intention with the "backend" source file is to offer backend support - * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider - * implementations alike. + * The intention with the "backend" source file is to offer backend functions + * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations + * alike. */ int ossl_ffc_params_fromdata(FFC_PARAMS *ffc, const OSSL_PARAM params[]) diff --git a/crypto/rsa/rsa_backend.c b/crypto/rsa/rsa_backend.c index 8ed857414dc..119ed3f6604 100644 --- a/crypto/rsa/rsa_backend.c +++ b/crypto/rsa/rsa_backend.c @@ -28,9 +28,9 @@ #include "rsa_local.h" /* - * The intention with the "backend" source file is to offer backend support - * for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider - * implementations alike. + * The intention with the "backend" source file is to offer backend functions + * for legacy backends (EVP_PKEY_ASN1_METHOD) and provider implementations + * alike. */ DEFINE_STACK_OF(BIGNUM) diff --git a/include/crypto/evp.h b/include/crypto/evp.h index 1141ca994ee..43f5068f077 100644 --- a/include/crypto/evp.h +++ b/include/crypto/evp.h @@ -136,70 +136,8 @@ struct evp_pkey_ctx_st { #define EVP_PKEY_FLAG_DYNAMIC 1 -struct evp_pkey_method_st { - int pkey_id; - int flags; - int (*init)(EVP_PKEY_CTX *ctx); - int (*copy)(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src); - void (*cleanup)(EVP_PKEY_CTX *ctx); - int (*paramgen_init)(EVP_PKEY_CTX *ctx); - int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); - int (*keygen_init)(EVP_PKEY_CTX *ctx); - int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); - int (*sign_init)(EVP_PKEY_CTX *ctx); - int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, - const unsigned char *tbs, size_t tbslen); - int (*verify_init)(EVP_PKEY_CTX *ctx); - int (*verify)(EVP_PKEY_CTX *ctx, - const unsigned char *sig, size_t siglen, - const unsigned char *tbs, size_t tbslen); - int (*verify_recover_init)(EVP_PKEY_CTX *ctx); - int (*verify_recover)(EVP_PKEY_CTX *ctx, - unsigned char *rout, size_t *routlen, - const unsigned char *sig, size_t siglen); - int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); - int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, - EVP_MD_CTX *mctx); - int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); - int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen, - EVP_MD_CTX *mctx); - int (*encrypt_init)(EVP_PKEY_CTX *ctx); - int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, - const unsigned char *in, size_t inlen); - int (*decrypt_init)(EVP_PKEY_CTX *ctx); - int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, - const unsigned char *in, size_t inlen); - int (*derive_init)(EVP_PKEY_CTX *ctx); - int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); - int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); - int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value); - int (*digestsign)(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, - const unsigned char *tbs, size_t tbslen); - int (*digestverify)(EVP_MD_CTX *ctx, const unsigned char *sig, - size_t siglen, const unsigned char *tbs, - size_t tbslen); - int (*check)(EVP_PKEY *pkey); - int (*public_check)(EVP_PKEY *pkey); - int (*param_check)(EVP_PKEY *pkey); - - int (*digest_custom)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); -} /* EVP_PKEY_METHOD */; - -DEFINE_STACK_OF_CONST(EVP_PKEY_METHOD) - void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx); -const EVP_PKEY_METHOD *ossl_dh_pkey_method(void); -const EVP_PKEY_METHOD *ossl_dhx_pkey_method(void); -const EVP_PKEY_METHOD *ossl_dsa_pkey_method(void); -const EVP_PKEY_METHOD *ossl_ec_pkey_method(void); -const EVP_PKEY_METHOD *ossl_ecx25519_pkey_method(void); -const EVP_PKEY_METHOD *ossl_ecx448_pkey_method(void); -const EVP_PKEY_METHOD *ossl_ed25519_pkey_method(void); -const EVP_PKEY_METHOD *ossl_ed448_pkey_method(void); -const EVP_PKEY_METHOD *ossl_rsa_pkey_method(void); -const EVP_PKEY_METHOD *ossl_rsa_pss_pkey_method(void); - struct evp_mac_st { OSSL_PROVIDER *prov; int name_id;