diff options
author | Andrew Lutomirski <luto@kernel.org> | 2017-01-10 15:24:46 -0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-01-13 00:26:45 +0800 |
commit | e93acd6f6778825a4e0b5a1a9b70324bf901d516 (patch) | |
tree | 7be6dcc962f1b596b3d0ad6ed3e34439c71fae91 /arch/x86/crypto | |
parent | f283148a0774e9b2de5ae4b42bb7dff50410f8cc (diff) |
crypto: testmgr - Allocate only the required output size for hash tests
There are some hashes (e.g. sha224) that have some internal trickery
to make sure that only the correct number of output bytes are
generated. If something goes wrong, they could potentially overrun
the output buffer.
Make the test more robust by allocating only enough space for the
correct output size so that memory debugging will catch the error if
the output is overrun.
Tested by intentionally breaking sha224 to output all 256
internally-generated bits while running on KASAN.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/x86/crypto')
0 files changed, 0 insertions, 0 deletions