From: Nicolas Blais-Miko Date: Wed, 26 Mar 2025 14:56:39 +0000 (-0400) Subject: Test that there is no silent error in EVP_CIPHER_CTX_get_updated_iv in evp_test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=418609e115;p=thirdparty%2Fopenssl.git 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) --- 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; + } } }