[Skiboot] [PATCH v3] secvar/backend: require sha256 in our PKCS#7 messages
hegdevasant at linux.vnet.ibm.com
Fri Jun 25 18:38:34 AEST 2021
On 6/24/21 2:13 PM, Daniel Axtens wrote:
> We only handle sha256 hashes in auth structures.
> In the process of verifying an auth structure, we extract the pkcs7
> message and we calculate the hopefully-matching hash, which is
> sha256(name || vendor guid || attributes || timestamp || newcontent)
> We then verify that the PKCS#7 signature matches that calculated hash.
> However, at no point do we check that the PKCS#7 hash algorithm is
> sha256. So if the PKCS#7 message says that it is a signature on a sha512,
> mbedtls will compare 64 bytes of hash from the signature with 64 bytes
> from our hash, resulting in a 32 byte overread.
> Verify that the hash algorithm in the PKCS#7 message is sha256.
> Add a test.
> Signed-off-by: Daniel Axtens <dja at axtens.net>
Thanks! Merged to master as 9d52c580d3.
More information about the Skiboot