From 88c1d0c1daa93571570cdaac04bb9e3dae8b971f Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sat, 29 Aug 2020 20:38:25 +0200 Subject: [PATCH] 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) --- test/evp_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3