diff --git a/crypto/evp/s_lib.c b/crypto/evp/s_lib.c index 9c901448a5fff..ff42d4083ec8b 100644 --- a/crypto/evp/s_lib.c +++ b/crypto/evp/s_lib.c @@ -65,8 +65,15 @@ EVP_SKEY *EVP_SKEY_import(OSSL_LIB_CTX *libctx, const char *skeymgmtname, const skeymgmt = EVP_SKEYMGMT_fetch(libctx, skeymgmtname, propquery); if (skeymgmt == NULL) { - ERR_raise(ERR_LIB_EVP, ERR_R_FETCH_FAILED); - goto err; + /* + * if the specific key_type is unknown, attempt to use the generic + * key management + */ + skeymgmt = EVP_SKEYMGMT_fetch(libctx, OSSL_SKEY_TYPE_GENERIC, propquery); + if (skeymgmt == NULL) { + ERR_raise(ERR_LIB_EVP, ERR_R_FETCH_FAILED); + goto err; + } } skey->skeymgmt = skeymgmt; diff --git a/test/evp_skey_test.c b/test/evp_skey_test.c index 618d8738c26a8..92e435471da98 100644 --- a/test/evp_skey_test.c +++ b/test/evp_skey_test.c @@ -206,8 +206,8 @@ static int test_des_raw_skey(void) goto end; /* Create EVP_SKEY */ - skey = EVP_SKEY_import_raw_key(libctx, "GENERIC-SECRET", des_key, - sizeof(des_key), NULL); + skey = EVP_SKEY_import_raw_key(libctx, "DES", des_key, sizeof(des_key), + NULL); if (!TEST_ptr(skey)) goto end;