]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
TEST: Adapt the EVP test
authorRichard Levitte <levitte@openssl.org>
Fri, 16 Apr 2021 08:08:38 +0000 (10:08 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 21 Apr 2021 08:53:03 +0000 (10:53 +0200)
The EVP test didn't recognise ERR_R_UNSUPPORTED, now does

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

test/evp_test.c
test/recipes/30-test_evp.t

index 08341e46178d451735dd0079abccf471ec5ac0dd..7bfe97f4aeca952632aa9cf7bfafeb1b46b40ea9 100644 (file)
@@ -3264,9 +3264,11 @@ static void free_key_list(KEY_LIST *lst)
 static int key_unsupported(void)
 {
     long err = ERR_peek_last_error();
+    int lib = ERR_GET_LIB(err);
+    long reason = ERR_GET_REASON(err);
 
-    if (ERR_GET_LIB(err) == ERR_LIB_EVP
-            && (ERR_GET_REASON(err) == EVP_R_UNSUPPORTED_ALGORITHM)) {
+    if ((lib == ERR_LIB_EVP && reason == EVP_R_UNSUPPORTED_ALGORITHM)
+        || reason == ERR_R_UNSUPPORTED) {
         ERR_clear_error();
         return 1;
     }
@@ -3276,9 +3278,9 @@ static int key_unsupported(void)
      * hint to an unsupported algorithm/curve (e.g. if binary EC support is
      * disabled).
      */
-    if (ERR_GET_LIB(err) == ERR_LIB_EC
-        && (ERR_GET_REASON(err) == EC_R_UNKNOWN_GROUP
-            || ERR_GET_REASON(err) == EC_R_INVALID_CURVE)) {
+    if (lib == ERR_LIB_EC
+        && (reason == EC_R_UNKNOWN_GROUP
+            || reason == EC_R_INVALID_CURVE)) {
         ERR_clear_error();
         return 1;
     }
index 87bb501095b78463d7c444f966e61366ea571545..2cb25478d71bd6625c0c6ad354bfad44d98f2d94 100644 (file)
@@ -171,7 +171,7 @@ SKIP: {
     ok(test_errors(key => 'server-dsa-pubkey.pem',
                    out => 'server-dsa-pubkey.err',
                    args => [ '-pubin' ],
-                   expected => 'unsupported algorithm'),
+                   expected => 'unsupported'),
        "expected error loading unsupported dsa public key");
 }