aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-09-22 15:56:11 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-09-23 17:31:40 +1000
commit0ecec0fa081a717db49d2ae10135cf285b95409d (patch)
treedb7a37b33eab4b8f4cdafad96d915ce51484f603
parent851886b061c9c9e5574fd23ea95149ffd52e8693 (diff)
downloadopenssl-0ecec0fa081a717db49d2ae10135cf285b95409d.tar.gz
Fix missing propq in sm2
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12944)
-rw-r--r--crypto/sm2/sm2_pmeth.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/sm2/sm2_pmeth.c b/crypto/sm2/sm2_pmeth.c
index 665e278d1f..32713a5ac4 100644
--- a/crypto/sm2/sm2_pmeth.c
+++ b/crypto/sm2/sm2_pmeth.c
@@ -130,6 +130,7 @@ static int pkey_sm2_encrypt(EVP_PKEY_CTX *ctx,
SM2_PKEY_CTX *dctx = ctx->data;
const EVP_MD *md = (dctx->md == NULL) ? EVP_sm3() : dctx->md;
OPENSSL_CTX *libctx = ec_key_get_libctx(ec);
+ const char *propq = ec_key_get0_propq(ec);
EVP_MD *fetched_md = NULL;
if (out == NULL) {
@@ -139,7 +140,7 @@ static int pkey_sm2_encrypt(EVP_PKEY_CTX *ctx,
return 1;
}
- fetched_md = EVP_MD_fetch(libctx, EVP_MD_name(md), 0);
+ fetched_md = EVP_MD_fetch(libctx, EVP_MD_name(md), propq);
if (fetched_md == NULL)
return 0;
ret = sm2_encrypt(ec, fetched_md, in, inlen, out, outlen);
@@ -156,6 +157,7 @@ static int pkey_sm2_decrypt(EVP_PKEY_CTX *ctx,
SM2_PKEY_CTX *dctx = ctx->data;
const EVP_MD *md = (dctx->md == NULL) ? EVP_sm3() : dctx->md;
OPENSSL_CTX *libctx = ec_key_get_libctx(ec);
+ const char *propq = ec_key_get0_propq(ec);
EVP_MD *fetched_md = NULL;
if (out == NULL) {
@@ -165,7 +167,7 @@ static int pkey_sm2_decrypt(EVP_PKEY_CTX *ctx,
return 1;
}
- fetched_md = EVP_MD_fetch(libctx, EVP_MD_name(md), 0);
+ fetched_md = EVP_MD_fetch(libctx, EVP_MD_name(md), propq);
if (fetched_md == NULL)
return 0;
ret = sm2_decrypt(ec, fetched_md, in, inlen, out, outlen);