Message ID | 20180207011012.5928-7-ebiggers3@gmail.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Herbert Xu |
Headers | show |
Eric Biggers <ebiggers3@gmail.com> wrote: > The PKCS#7 parser is guaranteed to set ->sig->hash_algo for every > SignerInfo, since pkcs7_sig_note_digest_algo() is a mandatory action in > the PKCS#7 ASN.1 grammar, and it returns an error code if an > unrecognized DigestAlgorithmIdentifier is given rather than leaving the > algorithm as NULL. Therefore, remove the unnecessary NULL check. Actually, we might be better off deferring ENOPKG generation as we might have multiple signatures, at least one of which does have a digest algorithm that we can handle. David
diff --git a/crypto/asymmetric_keys/pkcs7_verify.c b/crypto/asymmetric_keys/pkcs7_verify.c index 97c77f66b20d..a9e03f5c52e7 100644 --- a/crypto/asymmetric_keys/pkcs7_verify.c +++ b/crypto/asymmetric_keys/pkcs7_verify.c @@ -33,9 +33,6 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7, kenter(",%u,%s", sinfo->index, sinfo->sig->hash_algo); - if (!sinfo->sig->hash_algo) - return -ENOPKG; - /* Allocate the hashing algorithm we're going to need and find out how * big the hash operational data will be. */