Test that there is no silent error in EVP_CIPHER_CTX_get_updated_iv in evp_test

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27120)
This commit is contained in:
Nicolas Blais-Miko
2025-03-26 10:56:39 -04:00
committed by Matt Caswell
parent 24bc185439
commit 418609e115
2 changed files with 15 additions and 0 deletions
+5
View 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)) {
+10
View 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;
}
}
}