summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.ibm.com>2024-04-04 10:18:56 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2024-04-12 15:07:52 +0800
commitd6d691c4184baea2b31b92fbae7275649a0c9e6a (patch)
tree023d3abe47becf6e0455fc71d8115a6c1438ce6a
parentac4cf77b106feb9dfa4c0f192a4fe7f59818f48b (diff)
downloadlinux-crypto-d6d691c4184baea2b31b92fbae7275649a0c9e6a.tar.gz
linux-crypto-d6d691c4184baea2b31b92fbae7275649a0c9e6a.zip
crypto: x509 - Add OID for NIST P521 and extend parser for it
Enable the x509 parser to accept NIST P521 certificates and add the OID for ansip521r1, which is the identifier for NIST P521. Cc: David Howells <dhowells@redhat.com> Tested-by: Lukas Wunner <lukas@wunner.de> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/asymmetric_keys/x509_cert_parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
index bb0bffa2..964208d1 100644
--- a/crypto/asymmetric_keys/x509_cert_parser.c
+++ b/crypto/asymmetric_keys/x509_cert_parser.c
@@ -546,6 +546,9 @@ int x509_extract_key_data(void *context, size_t hdrlen,
case OID_id_ansip384r1:
ctx->cert->pub->pkey_algo = "ecdsa-nist-p384";
break;
+ case OID_id_ansip521r1:
+ ctx->cert->pub->pkey_algo = "ecdsa-nist-p521";
+ break;
default:
return -ENOPKG;
}