mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
integrity: Check for NULL returned by asymmetric_key_public_key
Check for a NULL pointer returned by asymmetric_key_public_key and return -ENOKEY in this case. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Tested-by: Kamlesh Kumar <kam@juniper.net> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
69fc647423
commit
c93a5f038c
|
|
@ -108,6 +108,10 @@ int asymmetric_verify(struct key *keyring, const char *sig,
|
|||
pks.hash_algo = hash_algo_name[hdr->hash_algo];
|
||||
|
||||
pk = asymmetric_key_public_key(key);
|
||||
if (!pk) {
|
||||
ret = -ENOKEY;
|
||||
goto out;
|
||||
}
|
||||
pks.pkey_algo = pk->pkey_algo;
|
||||
if (!strcmp(pk->pkey_algo, "rsa")) {
|
||||
pks.encoding = "pkcs1";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user