From: Richard Levitte Date: Fri, 16 Apr 2021 08:08:38 +0000 (+0200) Subject: TEST: Adapt the EVP test X-Git-Tag: openssl-3.0.0-alpha15~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7aef200089fbf4b306d13905d55772d646ceef76;p=thirdparty%2Fopenssl.git TEST: Adapt the EVP test The EVP test didn't recognise ERR_R_UNSUPPORTED, now does Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14834) --- diff --git a/test/evp_test.c b/test/evp_test.c index 08341e46178..7bfe97f4aec 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -3264,9 +3264,11 @@ static void free_key_list(KEY_LIST *lst) static int key_unsupported(void) { long err = ERR_peek_last_error(); + int lib = ERR_GET_LIB(err); + long reason = ERR_GET_REASON(err); - if (ERR_GET_LIB(err) == ERR_LIB_EVP - && (ERR_GET_REASON(err) == EVP_R_UNSUPPORTED_ALGORITHM)) { + if ((lib == ERR_LIB_EVP && reason == EVP_R_UNSUPPORTED_ALGORITHM) + || reason == ERR_R_UNSUPPORTED) { ERR_clear_error(); return 1; } @@ -3276,9 +3278,9 @@ static int key_unsupported(void) * hint to an unsupported algorithm/curve (e.g. if binary EC support is * disabled). */ - if (ERR_GET_LIB(err) == ERR_LIB_EC - && (ERR_GET_REASON(err) == EC_R_UNKNOWN_GROUP - || ERR_GET_REASON(err) == EC_R_INVALID_CURVE)) { + if (lib == ERR_LIB_EC + && (reason == EC_R_UNKNOWN_GROUP + || reason == EC_R_INVALID_CURVE)) { ERR_clear_error(); return 1; } diff --git a/test/recipes/30-test_evp.t b/test/recipes/30-test_evp.t index 87bb501095b..2cb25478d71 100644 --- a/test/recipes/30-test_evp.t +++ b/test/recipes/30-test_evp.t @@ -171,7 +171,7 @@ SKIP: { ok(test_errors(key => 'server-dsa-pubkey.pem', out => 'server-dsa-pubkey.err', args => [ '-pubin' ], - expected => 'unsupported algorithm'), + expected => 'unsupported'), "expected error loading unsupported dsa public key"); }