diff options
author | Richard Levitte <levitte@openssl.org> | 2020-09-02 09:30:42 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-09-08 06:25:27 +0200 |
commit | 509144964ba69b69a90269da52a2dc3acb3149e6 (patch) | |
tree | 0dacf1c9eb45dd8bf460288ef08f2b410b1f8ae7 /include/crypto | |
parent | 884baafba4a5fec6502b828a73188d7133b9179b (diff) |
EVP: Preserve the EVP_PKEY id in a few more spots
As long as there are internal legacy keys for EVP_PKEY, we need to preserve
the EVP_PKEY numeric identity when generating a key, and when creating the
EVP_PKEY_CTX.
For added consistency, the EVP_PKEY_CTX contructor tries a little
harder to find a EVP_PKEY_METHOD. Otherwise, we may run into
situations where the EVP_PKEY_CTX ends up having no associated methods
at all.
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/12785)
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/evp.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h index b00634234c..43ecc79f52 100644 --- a/include/crypto/evp.h +++ b/include/crypto/evp.h @@ -62,6 +62,8 @@ struct evp_pkey_ctx_st { /* Legacy fields below */ + /* EVP_PKEY identity */ + int legacy_keytype; /* Method associated with this operation */ const EVP_PKEY_METHOD *pmeth; /* Engine that implements this method or NULL if builtin */ @@ -766,6 +768,7 @@ int evp_pkey_ctx_get_params_strict(EVP_PKEY_CTX *ctx, OSSL_PARAM *params); EVP_MD_CTX *evp_md_ctx_new_with_libctx(EVP_PKEY *pkey, const ASN1_OCTET_STRING *id, OPENSSL_CTX *libctx, const char *propq); +int evp_pkey_name2type(const char *name); #endif /* !defined(FIPS_MODULE) */ void evp_method_store_flush(OPENSSL_CTX *libctx); int evp_set_default_properties_int(OPENSSL_CTX *libctx, const char *propq, |