Skip to contentSkip to conversation

Fix not passing all arguments to keyctl_pkey_query

PATCH In review Denis Kenzior 2 participants 2 messages Aug 2, 2018 – Aug 23, 2018 Keys/keyrings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix not passing all arguments to keyctl_pkey_query

pkey_parse_info was being called starting with the 3rd argument. This resulted in calls such as:

	'keyctl pkey_query 805557749 enc=pkcs1'

not passing the enc=pkcs1 parameter and resulting in the query always returning the results for the 'raw' encoding.

---

NOTE: This is a patch against keyutils 'pkey' branch. Hopefully I got the right list.

 keyctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
keyctl.c +1 -1
index 3c43f51..d4c9cb6 100644
@@ -1732,7 +1732,7 @@ static void act_keyctl_pkey_query(int argc, char *argv[])
 
 	if (argc < 3)
 		format();
-	pkey_parse_info(argv + 3, info);
+	pkey_parse_info(argv + 2, info);
 
 	key = get_key_id(argv[1]);
 
Signature · 1 line
2.16.1
maintainer
#1 lore raw
Quoted 9 lines · Denis Kenzior

pkey_parse_info was being called starting with the 3rd argument. This resulted in calls such as:

	'keyctl pkey_query 805557749 enc=pkcs1'

not passing the enc=pkcs1 parameter and resulting in the query always returning the results for the 'raw' encoding.

I've folded this in.

David