]> git.baikalelectronics.ru Git - uboot.git/commit
efi_loader: correctly handle mixed hashes and signatures in db
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Fri, 28 Jan 2022 22:20:31 +0000 (00:20 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 29 Jan 2022 09:23:40 +0000 (10:23 +0100)
commiteb9be5c20c6756a533e3917fe0a46e0e41f55669
tree5af800e3a6ab14d5029ccdd9ef36add5df512441
parent599df1e72110a7e8eaa24a775a04a924dd7f88af
efi_loader: correctly handle mixed hashes and signatures in db

A mix of signatures and hashes in db doesn't always work as intended.
Currently if the digest algorithm is not explicitly set to sha256 we
stop walking the security database and reject the image.

That's problematic in case we find and try to check a signature before
inspecting the sha256 hash.  If the image is unsigned we will reject it
even if the digest matches.

Since we no longer reject the image on unknown algorithms add an explicit
check and reject the image if any other hash algorithm apart from sha256
is detected on dbx.

Suggested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
include/efi_api.h
include/efi_loader.h
lib/efi_loader/efi_image_loader.c
lib/efi_loader/efi_signature.c