summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-03-17 14:37:47 +0100
committerRichard Levitte <levitte@openssl.org>2020-03-21 09:28:11 +0100
commit4b9e90f42a367a880af2dae6f6c4b455a0d2c0f4 (patch)
treea64f44c6f27a4f4c70fe671d0f984f859ef94990 /include
parent9a1c170d6309bb814ba8d720503069337f628b32 (diff)
EVP: fetch the EVP_KEYMGMT earlier
Instead of fetching the EVP_KEYMGMT in the init for every different operation, do it when creating the EVP_PKEY_CTX. This allows certain control functions to be called between the creation of the EVP_PKEY_CTX and the call of the operation's init function. Use case: EVP_PKEY_CTX_set1_id(), which is allowed to be called very early with the legacy implementation, this should still be allowed with provider implementations. Reviewed-by: Paul Yang <kaishen.yy@antfin.com> (Merged from https://github.com/openssl/openssl/pull/11343)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/evp.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h
index c9d3075b82..2e0322fa98 100644
--- a/include/crypto/evp.h
+++ b/include/crypto/evp.h
@@ -23,14 +23,12 @@ struct evp_pkey_ctx_st {
int operation;
/*
- * Library context, Key type name and properties associated
- * with this context
+ * Library context, property query, keytype and keymgmt associated with
+ * this context
*/
OPENSSL_CTX *libctx;
- const char *keytype;
const char *propquery;
-
- /* cached key manager */
+ const char *keytype;
EVP_KEYMGMT *keymgmt;
union {