summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-12-01 13:53:26 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-12-11 16:37:00 +0800
commiteb455dbd02cb1074b37872ffca30a81cb2a18eaa (patch)
treebe075acd0785171e3d214f8703b44518db873ea9 /include
parent7bada03311b62288035b0f5454cc154a44f33c56 (diff)
downloadcachepc-linux-eb455dbd02cb1074b37872ffca30a81cb2a18eaa.tar.gz
cachepc-linux-eb455dbd02cb1074b37872ffca30a81cb2a18eaa.zip
crypto: testmgr - don't try to decrypt uninitialized buffers
Currently if the comparison fuzz tests encounter an encryption error when generating an skcipher or AEAD test vector, they will still test the decryption side (passing it the uninitialized ciphertext buffer) and expect it to fail with the same error. This is sort of broken because it's not well-defined usage of the API to pass an uninitialized buffer, and furthermore in the AEAD case it's acceptable for the decryption error to be EBADMSG (meaning "inauthentic input") even if the encryption error was something else like EINVAL. Fix this for skcipher by explicitly initializing the ciphertext buffer on error, and for AEAD by skipping the decryption test on error. Reported-by: Pascal Van Leeuwen <pvanleeuwen@verimatrix.com> Fixes: d435e10e67be ("crypto: testmgr - fuzz skciphers against their generic implementation") Fixes: 40153b10d91c ("crypto: testmgr - fuzz AEADs against their generic implementation") Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions