From 4bf696c1d05d19ad495995309981f91f265cdaf2 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 7 Jun 2021 14:54:24 +0100 Subject: [PATCH] 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) --- test/evp_test.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.47.2