From: Matt Caswell Date: Mon, 7 Jun 2021 13:54:24 +0000 (+0100) Subject: Correctly detect decode errors when checking if a key is supported X-Git-Tag: openssl-3.0.0-beta1~128 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4bf696c1d05d19ad495995309981f91f265cdaf2;p=thirdparty%2Fopenssl.git Correctly detect decode errors when checking if a key is supported If we have an unsupported key type we may get a decode error and therefore we should detect that. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15504) --- diff --git a/test/evp_test.c b/test/evp_test.c index 059de1251f7..6ba72b405b7 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -3348,6 +3348,7 @@ static int key_unsupported(void) long reason = ERR_GET_REASON(err); if ((lib == ERR_LIB_EVP && reason == EVP_R_UNSUPPORTED_ALGORITHM) + || (lib == ERR_LIB_EVP && reason == EVP_R_DECODE_ERROR) || reason == ERR_R_UNSUPPORTED) { ERR_clear_error(); return 1;