Add tests for new EVP_CIPHER_CTX IV accessors
authorBenjamin Kaduk <bkaduk@akamai.com>
Sat, 20 Jun 2020 03:42:29 +0000 (20:42 -0700)
committerBenjamin Kaduk <bkaduk@akamai.com>
Tue, 11 Aug 2020 14:07:57 +0000 (07:07 -0700)
commit440b852a0f79ac4a7e101606a7c32d212e06d203
tree4b6dbddc7841436022d7cbead23cc77d4885d5ab
parent79f4417ed940793fe7d48d613c9b903d00630b69
Add tests for new EVP_CIPHER_CTX IV accessors

Test that EVP_CIPHER_CTX_get_iv() returns the same IV that was
given at initialization time, and that EVP_CIPHER_CTX_get_iv_state()
returns the expected value after performing an encryption operation
(which will differ from the previous value for CBC and OFB modes),
for various modes of AES.

Do this both for the implicit fetch and explicit fetch paths,
at the cost of a slightly more complicated switch statement.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12233)
test/evp_extra_test.c