]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Test that there is no silent error in EVP_CIPHER_CTX_get_updated_iv in evp_test
authorNicolas Blais-Miko <n.blaismiko@gmail.com>
Wed, 26 Mar 2025 14:56:39 +0000 (10:56 -0400)
committerMatt Caswell <matt@openssl.org>
Wed, 16 Apr 2025 07:44:12 +0000 (08:44 +0100)
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27120)

test/evp_extra_test.c
test/evp_test.c

index d6d973d5b925be92e8ec5545d1bfad58f7ec70c3..769abfadeb0c58d0cf3d286373cd11e0de19b0b0 100644 (file)
@@ -5171,6 +5171,11 @@ static int test_evp_updated_iv(int idx)
     if (!TEST_true(EVP_CIPHER_CTX_get_updated_iv(ctx, updated_iv, sizeof(updated_iv)))) {
         errmsg = "CIPHER_CTX_GET_UPDATED_IV";
         goto err;
+    } else {
+        if (!TEST_false(ERR_peek_error())) {
+            errmsg = "CIPHER_CTX_GET_UPDATED_IV_SILENT_ERROR";
+            goto err;
+        }
     }
     iv_len = EVP_CIPHER_CTX_get_iv_length(ctx);
     if (!TEST_int_ge(iv_len,0)) {
index db5271385e5f63cb3da1a6a7bd7f4b58a4817cb7..adcdf6e4e33e553879566da3e39292168e4c11d0 100644 (file)
@@ -1218,6 +1218,11 @@ static int cipher_test_enc(EVP_TEST *t, int enc, size_t out_misalign,
                                 expected->iv_len))) {
             t->err = "INVALID_IV";
             goto err;
+        } else {
+            if (!TEST_false(ERR_peek_error())) {
+                t->err = "GET_UPDATED_IV_SILENT_ERROR";
+                goto err;
+            }
         }
     }
 
@@ -1509,6 +1514,11 @@ static int cipher_test_enc(EVP_TEST *t, int enc, size_t out_misalign,
                                 expected->iv_len))) {
             t->err = "INVALID_NEXT_IV";
             goto err;
+        } else {
+            if (!TEST_false(ERR_peek_error())) {
+                t->err = "GET_UPDATED_IV_SILENT_ERROR";
+                goto err;
+            }
         }
     }