Skip to content

Commit

Permalink
KEYS: Fix the wrong index when checking the existence of second id
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Signed-off-by: Chun-Yi Lee <[email protected]>
Signed-off-by: David Howells <[email protected]>
  • Loading branch information
Chun-Yi Lee authored and dhowells committed Oct 18, 2017
1 parent 3cd18d1 commit 6a6d2a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/asymmetric_keys/asymmetric_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct key *find_asymmetric_key(struct key *keyring,
if (id_0 && id_1) {
const struct asymmetric_key_ids *kids = asymmetric_key_ids(key);

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

0 comments on commit 6a6d2a7

Please sign in to comment.