dissect-image: take policy into consideration when unlocking verity, too

Previously, we'd take the image policy only into consideration when
dissecting the mage, but for the unlock/verity step we'd go via best
effort. Change that. This means we can now enforce policies such as
activating by root hash only even if a signature exists and similar.

Also, introduce a separate error code if we try to unlock a Verity
volume but have no root hash. Previously we'd return ENOKEY for that,
exactly like we do for encrypted volumes where we have no passparse. The
interctive unlock loop dissected_image_decrypt_interactively() is
otherwise very confused and will ask for a root hash, which makes no
sense. Hence use two distinct errors for this.
This commit is contained in:
Lennart Poettering
2025-10-13 22:26:34 +02:00
parent 57d1ceffb3
commit d20dff2814
8 changed files with 89 additions and 29 deletions
+1
View File
@@ -6301,6 +6301,7 @@ static int run(int argc, char *argv[]) {
dissected_image,
NULL,
&arg_verity_settings,
arg_image_policy ?: &image_policy_container,
dissect_image_flags);
if (r < 0)
goto finish;