diff options
author | Daniel Axtens <dja@axtens.net> | 2021-06-21 18:26:41 +1000 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2021-12-09 08:44:38 +0100 |
commit | a521dce994b4e9b96d274f31d0a7b2a0191ee0dd (patch) | |
tree | b202f8993acc5068756fe5ed483e7266106918ab /skiboot.spec | |
parent | b985ee6de064f721648bd2611658ff9fef05495c (diff) | |
download | skiboot-a521dce994b4e9b96d274f31d0a7b2a0191ee0dd.zip skiboot-a521dce994b4e9b96d274f31d0a7b2a0191ee0dd.tar.gz skiboot-a521dce994b4e9b96d274f31d0a7b2a0191ee0dd.tar.bz2 |
secvar/pkcs7: fix a wrong sizeof()
This code isn't directly used by skiboot, but it is wrong and potentially
insecure so I'm fixing it in case it's used in the future.
We pass sizeof(hash) into mbedtls_pk_verify(). However, hash is a pointer,
not an array, so rather than passing the length of the hash to verify we'll
pass in 8, and only compare the first 8 bytes of the hash rather than all 32.
Pass in 0 instead. That tells mbedtls to work out the length based on the
hash type. We allocated enough memory for whatever hash type the PKCS#7
message declared so this will be safe.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'skiboot.spec')
0 files changed, 0 insertions, 0 deletions