Skip to content

Commit

Permalink
KEYS: x509: remove dead code that set ->unsupported_sig
Browse files Browse the repository at this point in the history
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: Jarkko Sakkinen <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
ebiggers authored and jarkkojs committed Mar 8, 2022
1 parent 9f8b3f3 commit 8bdc3e0
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions crypto/asymmetric_keys/x509_public_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ int x509_get_sig_params(struct x509_certificate *cert)
sig->data = cert->tbs;
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);
if (!sig->s)
return -ENOMEM;
Expand Down

0 comments on commit 8bdc3e0

Please sign in to comment.