diff options
author | Paul Yang <kaishen.yy@antfin.com> | 2020-03-04 23:49:43 +0800 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-09-22 08:18:09 +0100 |
commit | d0b79f8631c0f522c514175be4e4fbe984cf8f6c (patch) | |
tree | 4606888f35caaf5c2d6646ac4da4d98d75ab5d56 /crypto/evp/pmeth_lib.c | |
parent | 7ee511d093758360ed421e420cc29d9aaf11f143 (diff) |
Add SM2 signature algorithm to default provider
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12536)
Diffstat (limited to 'crypto/evp/pmeth_lib.c')
-rw-r--r-- | crypto/evp/pmeth_lib.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index fcd7266975..0d719943f0 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -175,28 +175,6 @@ static int get_legacy_alg_type_from_keymgmt(const EVP_KEYMGMT *keymgmt) } #endif /* FIPS_MODULE */ -static int is_legacy_alg(int id, const char *keytype) -{ -#ifndef FIPS_MODULE - /* Certain EVP_PKEY keytypes are only available in legacy form */ - if (id == -1) - id = evp_pkey_name2type(keytype); - - switch (id) { - /* - * TODO(3.0): Remove SM2 when they are converted to have provider - * support - */ - case EVP_PKEY_SM2: - return 1; - default: - return 0; - } -#else - return 0; -#endif -} - static EVP_PKEY_CTX *int_ctx_new(OPENSSL_CTX *libctx, EVP_PKEY *pkey, ENGINE *e, const char *keytype, const char *propquery, @@ -284,16 +262,8 @@ static EVP_PKEY_CTX *int_ctx_new(OPENSSL_CTX *libctx, * implementation. */ if (e == NULL && keytype != NULL) { - int legacy = is_legacy_alg(id, keytype); - - /* This could fail so ignore errors */ - if (legacy) - ERR_set_mark(); - keymgmt = EVP_KEYMGMT_fetch(libctx, keytype, propquery); - if (legacy) - ERR_pop_to_mark(); - else if (keymgmt == NULL) + if (keymgmt == NULL) return NULL; /* EVP_KEYMGMT_fetch() recorded an error */ #ifndef FIPS_MODULE |