Skip to content
Commit a99609e2 authored by Eric Biggers's avatar Eric Biggers Committed by Paul Gortmaker
Browse files

crypto: testmgr - don't try to decrypt uninitialized buffers



commit eb455dbd upstream.

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: default avatarPascal Van Leeuwen <pvanleeuwen@verimatrix.com>
Fixes: d435e10e ("crypto: testmgr - fuzz skciphers against their generic implementation")
Fixes: 40153b10 ("crypto: testmgr - fuzz AEADs against their generic implementation")
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 14c8bd59
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment