diff options
author | Matt Caswell <matt@openssl.org> | 2020-02-06 16:17:28 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-02-08 00:26:43 +0100 |
commit | ad5b71be73f0450a9eb51c8b845796fe4183601f (patch) | |
tree | 5dc74329a973f113db3e4d3008ba65fdd4db373a | |
parent | Use swapcontext for Intel CET (diff) | |
download | openssl-ad5b71be73f0450a9eb51c8b845796fe4183601f.tar.xz openssl-ad5b71be73f0450a9eb51c8b845796fe4183601f.zip |
Fix no-ec
Recent SM2 related changes were not properly guarded with OPENSSL_NO_EC
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/11029)
-rw-r--r-- | crypto/evp/p_lib.c | 2 | ||||
-rw-r--r-- | crypto/x509/x_all.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 95dd96e86b..76b4df1dc3 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -403,12 +403,14 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) { int alias = type; +#ifndef OPENSSL_NO_EC if (EVP_PKEY_type(type) == EVP_PKEY_EC) { const EC_GROUP *group = EC_KEY_get0_group(key); if (group != NULL && EC_GROUP_get_curve_name(group) == NID_sm2) alias = EVP_PKEY_SM2; } +#endif if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) return 0; diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c index 5a5f098558..89940a0cc9 100644 --- a/crypto/x509/x_all.c +++ b/crypto/x509/x_all.c @@ -44,12 +44,14 @@ static EVP_MD_CTX *make_id_ctx(EVP_PKEY *r, ASN1_OCTET_STRING *id) goto error; } +#ifndef OPENSSL_NO_EC if (id != NULL) { if (EVP_PKEY_CTX_set1_id(pctx, id->data, id->length) <= 0) { X509err(0, ERR_R_MALLOC_FAILURE); goto error; } } +#endif EVP_MD_CTX_set_pkey_ctx(ctx, pctx); |