All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm verity: fallback to platform keyring also if key in trusted keyring is rejected
@ 2024-09-22 16:17 luca.boccassi
  2024-09-23 14:04 ` Mikulas Patocka
  2024-09-25 15:37 ` Mikulas Patocka
  0 siblings, 2 replies; 19+ messages in thread
From: luca.boccassi @ 2024-09-22 16:17 UTC (permalink / raw)
  To: dm-devel; +Cc: snitzer, serge, mpatocka, wufan

From: Luca Boccassi <bluca@debian.org>

If enabled, we fallback to the platform keyring if the trusted keyring doesn't have
the key used to sign the roothash. But if pkcs7_verify() rejects the key for other
reasons, such as usage restrictions, we do not fallback. Do so.

Follow-up for 6fce1f40e95182ebbfe1ee3096b8fc0b37903269

Suggested-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Luca Boccassi <bluca@debian.org>
---
 drivers/md/dm-verity-verify-sig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-verity-verify-sig.c b/drivers/md/dm-verity-verify-sig.c
index d351d7d39c60..a9e2c6c0a33c 100644
--- a/drivers/md/dm-verity-verify-sig.c
+++ b/drivers/md/dm-verity-verify-sig.c
@@ -127,7 +127,7 @@ int verity_verify_root_hash(const void *root_hash, size_t root_hash_len,
 #endif
 				VERIFYING_UNSPECIFIED_SIGNATURE, NULL, NULL);
 #ifdef CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING
-	if (ret == -ENOKEY)
+	if (ret == -ENOKEY || ret == -EKEYREJECTED)
 		ret = verify_pkcs7_signature(root_hash, root_hash_len, sig_data,
 					sig_len,
 					VERIFY_USE_PLATFORM_KEYRING,
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-09-27  7:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 16:17 [PATCH] dm verity: fallback to platform keyring also if key in trusted keyring is rejected luca.boccassi
2024-09-23 14:04 ` Mikulas Patocka
2024-09-24 15:54   ` Jarkko Sakkinen
2024-09-24 18:27     ` Mikulas Patocka
2024-09-24 21:36       ` Jarkko Sakkinen
2024-09-24 21:59         ` Eric Biggers
2024-09-25  7:51           ` Jarkko Sakkinen
2024-09-25  8:03           ` Milan Broz
2024-09-25  9:05             ` Jarkko Sakkinen
2024-09-25 12:57               ` Serge E. Hallyn
2024-09-25 14:50                 ` Jarkko Sakkinen
2024-09-25 16:53               ` Eric Biggers
2024-09-25 17:15                 ` Jarkko Sakkinen
2024-09-25 21:28             ` Luca Boccassi
2024-09-27  7:12               ` Milan Broz
2024-09-25 15:37 ` Mikulas Patocka
2024-09-25 21:37   ` Luca Boccassi
2024-09-26 15:02     ` Mikulas Patocka
2024-09-26 15:41       ` Luca Boccassi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.