Message ID | 20180207011012.5928-9-ebiggers3@gmail.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Herbert Xu |
Headers | show |
Eric Biggers <ebiggers3@gmail.com> wrote: > The X.509 parser is guaranteed to set cert->sig->pkey_algo and > cert->sig->hash_algo, since x509_note_pkey_algo() is a mandatory action > in the X.509 ASN.1 grammar, and it returns an error code if an > unrecognized AlgorithmIdentifier is given rather than leaving the > algorithms as NULL. I'm leaning towards ENOPKG production here being deferred so that X.509 certs that we can't verify can still be built into the kernel or loaded from 'trusted' sources. Let me think about this a bit more. David
diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c index 514007932ec9..1a7c63003bc6 100644 --- a/crypto/asymmetric_keys/x509_public_key.c +++ b/crypto/asymmetric_keys/x509_public_key.c @@ -34,15 +34,6 @@ int x509_get_sig_params(struct x509_certificate *cert) pr_devel("==>%s()\n", __func__); - if (!sig->pkey_algo) - cert->unsupported_sig = true; - - /* We check the hash if we can - even if we can't then verify it */ - if (!sig->hash_algo) { - cert->unsupported_sig = true; - return 0; - } - sig->s = kmemdup(cert->raw_sig, cert->raw_sig_size, GFP_KERNEL); if (!sig->s) return -ENOMEM;