diff options
| author | jsing <> | 2016-04-13 13:18:05 +0000 |
|---|---|---|
| committer | jsing <> | 2016-04-13 13:18:05 +0000 |
| commit | a4eed51eaeff5b22538f20b7ec49bfb70ab98b31 (patch) | |
| tree | 014393702885f3e92d906efc8f67af6e97e909df /src | |
| parent | 816005f197bca1834110941c464c6ffa909398c1 (diff) | |
| download | openbsd-a4eed51eaeff5b22538f20b7ec49bfb70ab98b31.tar.gz openbsd-a4eed51eaeff5b22538f20b7ec49bfb70ab98b31.tar.bz2 openbsd-a4eed51eaeff5b22538f20b7ec49bfb70ab98b31.zip | |
After opening an AEAD, ensure that the decrypted output matches the
plaintext for the regress test case.
Diffstat (limited to '')
| -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])) { |
