From: Richard Levitte Date: Sat, 29 Aug 2020 18:38:25 +0000 (+0200) Subject: TEST: have key_unsupported() in evp_test.c look at the last error X-Git-Tag: openssl-3.0.0-alpha7~396 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88c1d0c1daa93571570cdaac04bb9e3dae8b971f;p=thirdparty%2Fopenssl.git TEST: have key_unsupported() in evp_test.c look at the last error key_unsupported() looked at the first error in the queue to see if a key algorithm is supported or not. However, there are situations where the errors it looks for is preceded by others. It's much safer to look at the last recorded error. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/12587) --- diff --git a/test/evp_test.c b/test/evp_test.c index 238bbaf3d5c..d5ec08c469e 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -3253,7 +3253,7 @@ static void free_key_list(KEY_LIST *lst) */ static int key_unsupported(void) { - long err = ERR_peek_error(); + long err = ERR_peek_last_error(); if (ERR_GET_LIB(err) == ERR_LIB_EVP && (ERR_GET_REASON(err) == EVP_R_UNSUPPORTED_ALGORITHM