linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org,
	davem@davemloft.net, herbert@gondor.apana.org.au,
	dhowells@redhat.com, zohar@linux.ibm.com, jarkko@kernel.org
Cc: linux-kernel@vger.kernel.org, patrick@puiterwijk.org,
	linux-integrity@vger.kernel.org,
	Saulo Alessandre <saulo.alessandre@tse.jus.br>,
	Stefan Berger <stefanb@linux.ibm.com>
Subject: [PATCH v11 09/10] x509: Add OID for NIST P384 and extend parser for it
Date: Fri,  5 Mar 2021 15:59:55 -0500	[thread overview]
Message-ID: <20210305205956.3594375-10-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <20210305205956.3594375-1-stefanb@linux.vnet.ibm.com>

From: Saulo Alessandre <saulo.alessandre@tse.jus.br>

Prepare the x509 parser to accept NIST P384 certificates and add the
OID for ansip384r1, which is the identifier for NIST P384.

Summary of changes:

* crypto/asymmetric_keys/x509_cert_parser.c
  - prepare x509 parser to load NIST P384

* include/linux/oid_registry.h
  - add OID_ansip384r1

Signed-off-by: Saulo Alessandre <saulo.alessandre@tse.jus.br>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>

---

v10->v11:
 - renamed OID_id_secp384r1 to OID_id_ansip384r1 (spec name)
---
 crypto/asymmetric_keys/x509_cert_parser.c | 3 +++
 include/linux/oid_registry.h              | 1 +
 2 files changed, 4 insertions(+)

diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
index f5d547c6dfb5..6d003096b5bc 100644
--- a/crypto/asymmetric_keys/x509_cert_parser.c
+++ b/crypto/asymmetric_keys/x509_cert_parser.c
@@ -510,6 +510,9 @@ int x509_extract_key_data(void *context, size_t hdrlen,
 		case OID_id_prime256v1:
 			ctx->cert->pub->pkey_algo = "ecdsa-nist-p256";
 			break;
+		case OID_id_ansip384r1:
+			ctx->cert->pub->pkey_algo = "ecdsa-nist-p384";
+			break;
 		default:
 			return -ENOPKG;
 		}
diff --git a/include/linux/oid_registry.h b/include/linux/oid_registry.h
index 3583908cf1ca..cc64d9419746 100644
--- a/include/linux/oid_registry.h
+++ b/include/linux/oid_registry.h
@@ -64,6 +64,7 @@ enum OID {
 
 	OID_certAuthInfoAccess,		/* 1.3.6.1.5.5.7.1.1 */
 	OID_sha1,			/* 1.3.14.3.2.26 */
+	OID_id_ansip384r1,		/* 1.3.132.0.34 */
 	OID_sha256,			/* 2.16.840.1.101.3.4.2.1 */
 	OID_sha384,			/* 2.16.840.1.101.3.4.2.2 */
 	OID_sha512,			/* 2.16.840.1.101.3.4.2.3 */
-- 
2.29.2


  parent reply	other threads:[~2021-03-05 21:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 20:59 [PATCH v11 00/10] Add support for x509 certs with NIST P384/256/192 keys Stefan Berger
2021-03-05 20:59 ` [PATCH v11 01/10] oid_registry: Add OIDs for ECDSA with sha224/256/384/512 Stefan Berger
2021-03-10 15:35   ` Jarkko Sakkinen
2021-03-10 18:38     ` Stefan Berger
2021-03-10 21:41       ` Jarkko Sakkinen
2021-03-05 20:59 ` [PATCH v11 02/10] crypto: Add support for ECDSA signature verification Stefan Berger
2021-03-08 17:00   ` Stefan Berger
2021-03-05 20:59 ` [PATCH v11 03/10] crypto: Add NIST P384 curve parameters Stefan Berger
2021-03-10 15:36   ` Jarkko Sakkinen
2021-03-05 20:59 ` [PATCH v11 04/10] crypto: Add math to support fast NIST P384 Stefan Berger
2021-03-05 20:59 ` [PATCH v11 05/10] ecdsa: Register NIST P384 and extend test suite Stefan Berger
2021-03-10 17:18   ` Jarkko Sakkinen
2021-03-05 20:59 ` [PATCH v11 06/10] x509: Detect sm2 keys by their parameters OID Stefan Berger
2021-03-05 20:59 ` [PATCH v11 07/10] x509: Add support for parsing x509 certs with ECDSA keys Stefan Berger
2021-03-05 20:59 ` [PATCH v11 08/10] ima: Support EC keys for signature verification Stefan Berger
2021-03-05 20:59 ` Stefan Berger [this message]
2021-03-05 20:59 ` [PATCH v11 10/10] certs: Add support for using elliptic curve keys for signing modules Stefan Berger
2021-03-10 17:31   ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210305205956.3594375-10-stefanb@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jarkko@kernel.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrick@puiterwijk.org \
    --cc=saulo.alessandre@tse.jus.br \
    --cc=stefanb@linux.ibm.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).