]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Correctly detect decode errors when checking if a key is supported
authorMatt Caswell <matt@openssl.org>
Mon, 7 Jun 2021 13:54:24 +0000 (14:54 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 8 Jun 2021 17:53:39 +0000 (18:53 +0100)
If we have an unsupported key type we may get a decode error and
therefore we should detect that.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15504)

test/evp_test.c

index 059de1251f7e1c17bfe3110f0f39583732b4ea8d..6ba72b405b7af7ff0589b1b4dacb4ce2a763e06a 100644 (file)
@@ -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;