From 418609e115bd694438171ca1f491b04aa3605a43 Mon Sep 17 00:00:00 2001 From: Nicolas Blais-Miko Date: Wed, 26 Mar 2025 10:56:39 -0400 Subject: [PATCH] Test that there is no silent error in EVP_CIPHER_CTX_get_updated_iv in evp_test Reviewed-by: Paul Dale Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/27120) --- test/evp_extra_test.c | 5 +++++ test/evp_test.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index d6d973d5b92..769abfadeb0 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -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)) { diff --git a/test/evp_test.c b/test/evp_test.c index db5271385e5..adcdf6e4e33 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -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; + } } } -- 2.47.2