Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ltc: check range in _rijndael_ecb_ functions
There is no check that the 'skey' structure has been properly initialized. For example, the skey->rijndael.Nr is assumed to contain a positive number corresponding to the number of AES rounds to perform. In _rijndael_ecb_encrypt the skey->rijndael.Nr is subtracted by two, which can result in an integer underflow if the structure hasn't been initialized correctly. By clamping the value for skey->rijndael.Nr into the valid rounds for AES we can return an error instead of ending up reading outside the boundaries (of skey->rijndael.eK). Patch manually picked from [1]. Link: [1] libtom/libtomcrypt@7b4a5c1 Signed-off-by: Joakim Bech <[email protected]> Tested-by: Joakim Bech <[email protected]> (QEMU v7) Reported-by: Martijn Bogaard <[email protected]> Acked-by: Jerome Forissier <[email protected]>
- Loading branch information