From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 1/4] public keys: make error message more informative
Date: Wed, 27 May 2026 12:54:41 +0200 [thread overview]
Message-ID: <20260527-public-keys-v1-1-c87a1cc61d1b@pengutronix.de> (raw)
In-Reply-To: <20260527-public-keys-v1-0-c87a1cc61d1b@pengutronix.de>
When adding a key to a keyring fails because a key with the same name hint
already exists, print which keyring and which hint is duplicate. This also
removes the string "fit" from the error message which seems to be a remnant
of days when only FIT images used keys.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
crypto/public-keys.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/public-keys.c b/crypto/public-keys.c
index a2d31f4bc2..ecf255bbb4 100644
--- a/crypto/public-keys.c
+++ b/crypto/public-keys.c
@@ -29,7 +29,8 @@ int public_key_add(struct public_key *key)
}
if (public_key_get(key->key_name_hint, key->keyring)) {
- pr_warn("Aborting addition of public key: Duplicate fit name hint\n");
+ pr_warn("Cannot add key: key_name_hint %s already exists in keyring %s\n",
+ key->key_name_hint, key->keyring);
return -EEXIST;
}
--
2.47.3
next prev parent reply other threads:[~2026-05-27 10:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 10:54 [PATCH 0/4] public keys: rework keyrings as nested containers Sascha Hauer
2026-05-27 10:54 ` Sascha Hauer [this message]
2026-05-27 10:54 ` [PATCH 2/4] public keys: make key_name_hint optional Sascha Hauer
2026-05-27 10:54 ` [PATCH 3/4] public keys: rework keyrings as nested containers Sascha Hauer
2026-05-27 10:54 ` [PATCH 4/4] public keys: allow keys to be members of multiple keyrings Sascha Hauer
2026-05-29 11:43 ` [PATCH 0/4] public keys: rework keyrings as nested containers Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260527-public-keys-v1-1-c87a1cc61d1b@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox