efi_loader: hash the image once before checking against db/dbx
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Fri, 28 Jan 2022 22:20:32 +0000 (00:20 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 29 Jan 2022 09:23:40 +0000 (10:23 +0100)
commit5ee900c14ff57b8c9201d7d42f018b33df3ea42a
tree75cd9f3eb5899e9e1ed5a4936dbdaec48a46a66d
parent4b634313232ed4a17bbf66d228764fef639e1f65
efi_loader: hash the image once before checking against db/dbx

We don't have to recalculate the image hash every time we check against a
new db/dbx entry.  So let's add a flag forcing it to run once since we only
support sha256 hashes

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>
lib/efi_loader/efi_signature.c