Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9328)
t->err = "KEY_SET_ERROR";
goto err;
}
+ /* Check that we get the same IV back */
+ if (expected->iv != NULL
+ && (EVP_CIPHER_flags(expected->cipher) & EVP_CIPH_CUSTOM_IV) == 0
+ && !TEST_mem_eq(expected->iv, expected->iv_len,
+ EVP_CIPHER_CTX_iv(ctx), expected->iv_len)) {
+ t->err = "INVALID_IV";
+ goto err;
+ }
if (expected->aead == EVP_CIPH_CCM_MODE) {
if (!EVP_CipherUpdate(ctx, NULL, &tmplen, NULL, out_len)) {