summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorChun-Yi Lee <joeyli.kernel@gmail.com>2017-10-04 19:18:22 +0800
committerDavid Howells <dhowells@redhat.com>2017-10-18 09:12:40 +0100
commit17e9e3a72ffab22ea5a44f4e3490f4570950a47f (patch)
tree32a07f477ed1b05326af3c50a6a77c070dd0e659 /crypto
parent508f8d23a372beae647185ce896a0c1109406b83 (diff)
downloadlinux-crypto-17e9e3a72ffab22ea5a44f4e3490f4570950a47f.tar.gz
linux-crypto-17e9e3a72ffab22ea5a44f4e3490f4570950a47f.zip
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: 5e3641dcbb58 (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>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asymmetric_keys/asymmetric_type.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c
index e4b0ed38..a597f5c5 100644
--- a/crypto/asymmetric_keys/asymmetric_type.c
+++ b/crypto/asymmetric_keys/asymmetric_type.c
@@ -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;
}