]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix KMAC bounds checks.
authorShane Lontis <shane.lontis@oracle.com>
Sat, 1 May 2021 04:49:25 +0000 (14:49 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Wed, 5 May 2021 07:39:27 +0000 (17:39 +1000)
commit2b05439f8441a5483da65fd4208d82d9e007f448
tree82dee791ba1aa5f7e8cb99fdef48c46437100fd9
parent029875dc5ba28f18e3067c883fb53c9ae91d6954
Fix KMAC bounds checks.

Setting an output length higher than 8191 was causing a buffer overflow.
This was reported by Acumen (FIPS lab).

The max output size has increased to ~2M and it now checks this during set_parameters.

The encoder related functions now pass in the maximum size of the output buffer so they
can correctly check their size. kmac_bytepad_encode_key() calls bytepad twice in
order to calculate and check the length before encoding.

Note that right_encode() is currently only used in one place but this
may change if other algorithms are supported (such as TupleHash).

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15106)
crypto/err/openssl.txt
include/openssl/proverr.h
providers/common/provider_err.c
providers/fips-sources.checksums
providers/fips.checksum
providers/implementations/macs/kmac_prov.c
test/recipes/30-test_evp_data/evpmac_common.txt