]> git.dujemihanovic.xyz Git - u-boot.git/commit
crypto: Fix the logic to calculate hash with authattributes set
authorSughosh Ganu <sughosh.ganu@linaro.org>
Wed, 30 Dec 2020 13:57:01 +0000 (19:27 +0530)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 31 Dec 2020 13:41:31 +0000 (14:41 +0100)
commit4366a2440ae141c44d2041c92f3662016c6869e6
treed4f0fa436051e25ab887930ce92dcdb21fa1ce72
parente1ee06dde7b133267d5780d48dc5a47e672fc36c
crypto: Fix the logic to calculate hash with authattributes set

RFC 2315 Section 9.3 describes the message digesting process. The
digest calculated depends on whether the authenticated attributes are
present. In case of a scenario where the authenticated attributes are
present, the message digest that gets signed and is part of the pkcs7
message is computed from the auth attributes rather than the contents
field.

Check if the auth attributes are present, and if set, use the auth
attributes to compute the hash that would be compared with the
encrypted hash on the pkcs7 message.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
lib/crypto/pkcs7_verify.c