summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCsókás Bence <csokas.bence@prolan.hu>2024-01-05 15:08:03 +0100
committerTom Rini <trini@konsulko.com>2024-01-18 17:50:27 -0500
commit11ad2bbfa2d83501a3d7b9fdbd567f55214fde0d (patch)
tree616d5c48f71dc37bc430bbb5f6fc2271d827bd70 /lib
parent10fee88d42fe37d83f0a37b3dae69b674f8055f3 (diff)
downloadu-boot-11ad2bbfa2d83501a3d7b9fdbd567f55214fde0d.tar.gz
u-boot-11ad2bbfa2d83501a3d7b9fdbd567f55214fde0d.tar.bz2
u-boot-11ad2bbfa2d83501a3d7b9fdbd567f55214fde0d.zip
lib: rsa: Fix PKCS11 URI if one is not given in `keydir`
If `keydir` is not present, we need to build a PKCS11 URI from just the key name. In this case, we *do* need 'pkcs11:' Fixes: ece85cc020 rsa: use pkcs11 uri as defined in rfc7512 Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
Diffstat (limited to 'lib')
-rw-r--r--lib/rsa/rsa-sign.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
index 858ad92a6f..fd587d8deb 100644
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -124,7 +124,7 @@ static int rsa_engine_get_pub_key(const char *keydir, const char *name,
keydir, name);
else
snprintf(key_id, sizeof(key_id),
- "object=%s;type=public",
+ "pkcs11:object=%s;type=public",
name);
} else if (engine_id) {
if (keydir)
@@ -246,7 +246,7 @@ static int rsa_engine_get_priv_key(const char *keydir, const char *name,
keydir, name);
else
snprintf(key_id, sizeof(key_id),
- "object=%s;type=private",
+ "pkcs11:object=%s;type=private",
name);
} else if (engine_id) {
if (keydir && name)