diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-04-27 16:01:13 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-05-13 13:30:07 +0200 |
commit | b4c4a2c68817ea0b2df8012673fa4e0712681704 (patch) | |
tree | 0e9ef2698c96e048dda681af0aadc9f7daac384a /crypto/ec/ec_key.c | |
parent | e9fe0f7e9df7e0909ca52a024b889e48616a29d9 (diff) |
Implement pem_read_key directly through OSSL_DECODER
Using OSSL_STORE is too heavy and breaks things.
There were also needed various fixes mainly for missing proper
handling of the SM2 keys in the OSSL_DECODER.
Fixes #14788
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15045)
Diffstat (limited to 'crypto/ec/ec_key.c')
-rw-r--r-- | crypto/ec/ec_key.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index f06715fa6b..ea2bad3e26 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -678,6 +678,9 @@ int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group) return 0; EC_GROUP_free(key->group); key->group = EC_GROUP_dup(group); + if (key->group != NULL && EC_GROUP_get_curve_name(key->group) == NID_sm2) + EC_KEY_set_flags(key, EC_FLAG_SM2_RANGE); + key->dirty_cnt++; return (key->group == NULL) ? 0 : 1; } |