diff options
Diffstat (limited to 'test/evp_extra_test2.c')
-rw-r--r-- | test/evp_extra_test2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/evp_extra_test2.c b/test/evp_extra_test2.c index a06bd69794..32ca15bc9a 100644 --- a/test/evp_extra_test2.c +++ b/test/evp_extra_test2.c @@ -1326,6 +1326,24 @@ err: } #endif +/* + * Currently, EVP_<OBJ>_fetch doesn't support + * colon separated alternative names for lookup + * so add a test here to ensure that when one is provided + * libcrypto returns an error + */ +static int evp_test_name_parsing(void) +{ + EVP_MD *md; + + if (!TEST_ptr_null(md = EVP_MD_fetch(mainctx, "SHA256:BogusName", NULL))) { + EVP_MD_free(md); + return 0; + } + + return 1; +} + int setup_tests(void) { if (!test_get_libctx(&mainctx, &nullprov, NULL, NULL, NULL)) { @@ -1334,6 +1352,7 @@ int setup_tests(void) return 0; } + ADD_TEST(evp_test_name_parsing); ADD_TEST(test_alternative_default); ADD_ALL_TESTS(test_d2i_AutoPrivateKey_ex, OSSL_NELEM(keydata)); #ifndef OPENSSL_NO_EC |