Commit 60d4b986e7 for openssl.org
commit 60d4b986e7e11bf6addf2bc8a17c4abb17b98ce4
Author: Matt Caswell <matt@openssl.org>
Date: Fri Dec 12 12:01:56 2025 +0000
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 <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
diff --git a/crypto/dh/dh_backend.c b/crypto/dh/dh_backend.c
index 4a3e2b2e42..264389e0b3 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 e4c1c7bb01..aca659c82f 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 b100af0c60..52cb868323 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 40daf30e1a..710ad31a66 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 465e669a71..b57e817e51 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 fa3182bc80..cc54d38b0b 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 8ed857414d..119ed3f660 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 1141ca994e..43f5068f07 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;