Commit 8bdc3e05 authored by Eric Biggers's avatar Eric Biggers Committed by Jarkko Sakkinen

KEYS: x509: remove dead code that set ->unsupported_sig

The X.509 parser always sets cert->sig->pkey_algo and
cert->sig->hash_algo on success, since x509_note_sig_algo() is a
mandatory action in the X.509 ASN.1 grammar, and it returns an error if
the signature's algorithm is unknown.  Thus, remove the dead code which
handled these fields being NULL.
Acked-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
parent 9f8b3f32
...@@ -33,15 +33,6 @@ int x509_get_sig_params(struct x509_certificate *cert) ...@@ -33,15 +33,6 @@ int x509_get_sig_params(struct x509_certificate *cert)
sig->data = cert->tbs; sig->data = cert->tbs;
sig->data_size = cert->tbs_size; sig->data_size = cert->tbs_size;
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); sig->s = kmemdup(cert->raw_sig, cert->raw_sig_size, GFP_KERNEL);
if (!sig->s) if (!sig->s)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment