summaryrefslogtreecommitdiffstats
path: root/crypto/evp/pmeth_gn.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-12-18 13:24:27 +0100
committerRichard Levitte <levitte@openssl.org>2020-01-09 15:01:28 +0100
commitf23bc0b770efd229e27519786d9f28da56752d0a (patch)
tree9ed18bbd3e8a3cc97c6a78a387fc1f7c585c78cd /crypto/evp/pmeth_gn.c
parente62a45b60e3166d995eb83840f437debf575c328 (diff)
EVP: Adapt KEYEXCH, SIGNATURE and ASYM_CIPHER to handle key types better
The adaptation is to handle the case when key types and operations that use these keys have different names. For example, EC keys can be used for ECDSA and ECDH. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10647)
Diffstat (limited to 'crypto/evp/pmeth_gn.c')
-rw-r--r--crypto/evp/pmeth_gn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c
index a5f7dbaf53..100931cda7 100644
--- a/crypto/evp/pmeth_gn.c
+++ b/crypto/evp/pmeth_gn.c
@@ -19,13 +19,13 @@
static int fromdata_init(EVP_PKEY_CTX *ctx, int operation)
{
- if (ctx == NULL || ctx->algorithm == NULL)
+ if (ctx == NULL || ctx->keytype == NULL)
goto not_supported;
evp_pkey_ctx_free_old_ops(ctx);
ctx->operation = operation;
if (ctx->keymgmt == NULL)
- ctx->keymgmt = EVP_KEYMGMT_fetch(NULL, ctx->algorithm, ctx->propquery);
+ ctx->keymgmt = EVP_KEYMGMT_fetch(NULL, ctx->keytype, ctx->propquery);
if (ctx->keymgmt == NULL)
goto not_supported;