[PATCH 09/15] KEYS: Fix the wrong index when checking the existence of second id
David Howells
dhowells at redhat.com
Thu Oct 12 20:17:02 UTC 2017
From: Lee, Chun-Yi <joeyli.kernel at gmail.com>
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.
Fix: 9eb029893(KEYS: Generalise x509_request_asymmetric_key())
Cc: David Howells <dhowells at redhat.com>
Cc: Herbert Xu <herbert at gondor.apana.org.au>
Cc: "David S. Miller" <davem at davemloft.net>
Signed-off-by: "Lee, Chun-Yi" <jlee at suse.com>
Signed-off-by: David Howells <dhowells at redhat.com>
---
crypto/asymmetric_keys/asymmetric_type.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c
index e4b0ed386bc8..a597f5c5a222 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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the Linux-security-module-archive
mailing list