Skip to content

Commit 6a6d2a7

Browse files
Chun-Yi Leedhowells
authored andcommitted
KEYS: Fix the wrong index when checking the existence of second id
Fix the wrong index number when checking the existence of second id in function of finding asymmetric key. The id_1 is the second id that the index in array must be 1 but not 0. Fixes: 9eb0298 (KEYS: Generalise x509_request_asymmetric_key()) Cc: David Howells <dhowells@redhat.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Chun-Yi Lee <jlee@suse.com> Signed-off-by: David Howells <dhowells@redhat.com>
1 parent 3cd18d1 commit 6a6d2a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/asymmetric_keys/asymmetric_type.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ struct key *find_asymmetric_key(struct key *keyring,
105105
if (id_0 && id_1) {
106106
const struct asymmetric_key_ids *kids = asymmetric_key_ids(key);
107107

108-
if (!kids->id[0]) {
108+
if (!kids->id[1]) {
109109
pr_debug("First ID matches, but second is missing\n");
110110
goto reject;
111111
}

0 commit comments

Comments
 (0)