diff options
author | Ilias Apalodimas | 2022-01-29 00:20:31 +0200 |
---|---|---|
committer | Heinrich Schuchardt | 2022-01-29 10:23:40 +0100 |
commit | 4b634313232ed4a17bbf66d228764fef639e1f65 (patch) | |
tree | 5af800e3a6ab14d5029ccdd9ef36add5df512441 /include/efi_loader.h | |
parent | 8d4c4265327263191a3b9d42bb3e5321a1b61f20 (diff) |
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>
Diffstat (limited to 'include/efi_loader.h')
-rw-r--r-- | include/efi_loader.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h index 1fa75b40fea..4e50f2d0c36 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -912,7 +912,8 @@ struct x509_certificate; struct pkcs7_message; bool efi_signature_lookup_digest(struct efi_image_regions *regs, - struct efi_signature_store *db); + struct efi_signature_store *db, + bool dbx); bool efi_signature_verify(struct efi_image_regions *regs, struct pkcs7_message *msg, struct efi_signature_store *db, |