diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2022-11-22 19:53:38 +0000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-24 16:29:38 +0100 |
commit | 3f32d29ad464591ed968a1e430111e1525280f4c (patch) | |
tree | e3a04e5425066c693303ef2a1652905e4f17dd3d /crypto/evp | |
parent | cba0e2afd6a222aa041e05f8455e83c9e959d05b (diff) |
Add SM2 support for EVP_PKEY_Q_keygen
There is no reason preventing this API to support SM2,
which gives us a simple method to do SM2 key gen.
CLA: trivial
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19736)
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/evp_lib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 98bb25655d..a8dbfbfada 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -1215,7 +1215,8 @@ EVP_PKEY *EVP_PKEY_Q_keygen(OSSL_LIB_CTX *libctx, const char *propq, } else if (OPENSSL_strcasecmp(type, "ED25519") != 0 && OPENSSL_strcasecmp(type, "X25519") != 0 && OPENSSL_strcasecmp(type, "ED448") != 0 - && OPENSSL_strcasecmp(type, "X448") != 0) { + && OPENSSL_strcasecmp(type, "X448") != 0 + && OPENSSL_strcasecmp(type, "SM2") != 0) { ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT); goto end; } |