diff options
author | jsing <> | 2016-04-13 13:18:05 +0000 |
---|---|---|
committer | jsing <> | 2016-04-13 13:18:05 +0000 |
commit | 71026828638d42825ee60eebdd9136548b30d56c (patch) | |
tree | 014393702885f3e92d906efc8f67af6e97e909df | |
parent | 066a9c978de13605caa956af2d69c0dda2be191e (diff) | |
download | openbsd-71026828638d42825ee60eebdd9136548b30d56c.tar.gz openbsd-71026828638d42825ee60eebdd9136548b30d56c.tar.bz2 openbsd-71026828638d42825ee60eebdd9136548b30d56c.zip |
After opening an AEAD, ensure that the decrypted output matches the
plaintext for the regress test case.
-rw-r--r-- | src/regress/lib/libcrypto/aead/aeadtest.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/regress/lib/libcrypto/aead/aeadtest.c b/src/regress/lib/libcrypto/aead/aeadtest.c index 72209f5caa..270d68666e 100644 --- a/src/regress/lib/libcrypto/aead/aeadtest.c +++ b/src/regress/lib/libcrypto/aead/aeadtest.c | |||
@@ -199,6 +199,11 @@ run_test_case(const EVP_AEAD* aead, unsigned char bufs[NUM_TYPES][BUF_MAX], | |||
199 | return 0; | 199 | return 0; |
200 | } | 200 | } |
201 | 201 | ||
202 | if (memcmp(out2, bufs[IN], out_len2) != 0) { | ||
203 | fprintf(stderr, "Plaintext mismatch on line %u\n", line_no); | ||
204 | return 0; | ||
205 | } | ||
206 | |||
202 | out[0] ^= 0x80; | 207 | out[0] ^= 0x80; |
203 | if (EVP_AEAD_CTX_open(&ctx, out2, &out_len2, lengths[IN], bufs[NONCE], | 208 | if (EVP_AEAD_CTX_open(&ctx, out2, &out_len2, lengths[IN], bufs[NONCE], |
204 | lengths[NONCE], out, out_len, bufs[AD], lengths[AD])) { | 209 | lengths[NONCE], out, out_len, bufs[AD], lengths[AD])) { |