Skip to content

Commit

Permalink
KEYS: checking the input id parameters before finding asymmetric key
Browse files Browse the repository at this point in the history
For finding asymmetric key, the input id_0 and id_1 parameters can
not be NULL at the same time. This patch adds the BUG_ON checking
for id_0 and id_1.

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>
  • Loading branch information
Chun-Yi Lee authored and dhowells committed Oct 18, 2017
1 parent 6a6d2a7 commit b3811d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crypto/asymmetric_keys/asymmetric_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ struct key *find_asymmetric_key(struct key *keyring,
char *req, *p;
int len;

BUG_ON(!id_0 && !id_1);

if (id_0) {
lookup = id_0->data;
len = id_0->len;
Expand Down

0 comments on commit b3811d3

Please sign in to comment.