Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp24547lqg; Thu, 29 Feb 2024 18:21:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQ4zrMD9wW8Ib8ExYoEMUwSy1fib4OjBadOvqLibRJwWyMcPFfItx5nRT/ZmstiJ+IToSY0wvpnB2zNqWzkxsC0xoTHb9yt/MoXHCR7A== X-Google-Smtp-Source: AGHT+IHdPedsH4zWgR+u41leDfpUsi8uZgVO1XT0teM91phTnVtbqL9fxe5RepPRz/6uct76ButB X-Received: by 2002:a05:6102:31a7:b0:472:6e7a:fd2a with SMTP id d7-20020a05610231a700b004726e7afd2amr167981vsh.31.1709259704992; Thu, 29 Feb 2024 18:21:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709259704; cv=pass; d=google.com; s=arc-20160816; b=RO4FkReXu3DnRTWAi8oUDglt4ghCMt+k1zE5vFqYpLyDhFjgT3rxz/9Foua1NCnMdA 5Bje5iJYdjA4EEWu8hEBUQYHQnPZxCqC7OznYDtr51dKO7qWv2dbOXLZSkJWBqzNvfgW dq9bpcpn6YgiZTdxEY8GPUIerGMNa1FQjKK74zdGoJQfkVZLhgFaGHMEmVrZSZs+mrEy iWESQyjJZKb6JmbwGRGgc6xoE/grQivnoOpAYbri2/Oi5tSHOZK1gWdM94mcqIpOoUx6 gFVohUUq96FsAgRPEbEkKdIxJR5lUJvXhhVbzL4sYrQ1sn/Wm7sH/RSf45XINRd5CMcY Py5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=WscJRectOOpbFSdEkRLSkxTx5f/ng+ZZJOEX2Ey0I9k=; fh=lpYxL1R/2q+ah9fKjyMCFafr1KiMKaWUmEOUTWH+tFQ=; b=KMQ4kJ35PkOSRaI8PpJdoH6oWD9fz6DPxAb4KLSkwDbxP4+amOIFXgJ/ytGloTp09S tTdJkMbV58oFiTkgSieSc2EM7p2vhSK/ocLDQeN9MzPfPLql5D9cMPTkUKAcaIPkfoDB /cq8/Mj+LQME+rhK0WBZ02RrO+UQ+KESrS6/7UMMpRExmmKuPiFKE3wSEoeq8TVpUvi4 59W4Ns7eAmNzlA3OAaa15XIx8Rkm1dH4RNt4rUSDLVs3GIPVCf6VOd1KGX+0LZ4KCVuO LfTkJ7YlQipY7l4zXnKc/dXW9OfXgw5OEgt/8LWMGhE2qJOnO2gGU4JjgMMddOPNlZkR o1Iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=aCJGGgGh; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-crypto+bounces-2417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2417-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w7-20020a05622a134700b0042ec2ab844esi1902105qtk.779.2024.02.29.18.21.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 18:21:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=aCJGGgGh; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-crypto+bounces-2417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2417-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 50F211C22BE2 for ; Fri, 1 Mar 2024 02:21:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FDDE3C46D; Fri, 1 Mar 2024 02:20:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="aCJGGgGh" X-Original-To: linux-crypto@vger.kernel.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 935CE3B1B7; Fri, 1 Mar 2024 02:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709259625; cv=none; b=K/IAI6xGQcboZwHj1Sy3q7CLYatswj57cJ0880+vJE48GuJZtT7F343eBKzrW4bXxkYOiuHnaxeZ4mSiGWlMuARwCCr4jMB2bhe0TBMgL8QiYQDaxvgLNgJ7UVXpLPnktTvJWY1+SUr+PnvX1KIbCpCH/y0Llxd4KQRDJ+WP5/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709259625; c=relaxed/simple; bh=CLARtP2DQJAVQ0De+jgJ+swpoDvVcBFDP0cS0U0AByc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mLZY9BQNvLXhhQo7aQT69gMBPv5GO98OOXSp/3tdlM/O9ou5C7qI4kV+ibsJZeYJYhdwW8Sw1B9XiqDzlqMm+v2z1lsVIeaXIEmPJBjrF+MFa+/RyAHrM24mVzdhxGdHdTawqqXiXUQqnJoyjsnUOD1PhS9tm41rLdufkITS1y0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=aCJGGgGh; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4211p8XZ026967; Fri, 1 Mar 2024 02:20:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=WscJRectOOpbFSdEkRLSkxTx5f/ng+ZZJOEX2Ey0I9k=; b=aCJGGgGhomFIRs5vnjZajZrs2GiZpNtdE0rdX5URuLzetGIEhf0I1HgRwCJ5KvFlyT2c f3fEUGlJ+YzmhqE78aGRoxbYlCyprCTs77lvFQExx2UY1nIouMwaKPI5YcESwJ3o/9MZ GV8WIQ7Lwk2rRnpG+BRoM4QOoIsY7et6yRT81Sw2dGWeR7w6nRow+FDEiMVeGQEi+wxw V0v4AxFzTL+nLfc4ef9RAwZtWQIhX2HJ+gcxMVUd2KSfJApRtAi5+7nx6xNN/W+uohjk iTVhAnD3wE+0lAwFmXbRVSG2vwjfYI6Eshx9taqy7/4MR9vh4S9KzXIYNRMhSbxuWUxZ Rg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wk57h1dqj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 Mar 2024 02:20:20 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 4211xX2N017290; Fri, 1 Mar 2024 02:20:20 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wk57h1dpf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 Mar 2024 02:20:20 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41TNwnoF008827; Fri, 1 Mar 2024 02:20:19 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wftsu1w70-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 Mar 2024 02:20:19 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4212KGVb44564750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 1 Mar 2024 02:20:18 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9360A58056; Fri, 1 Mar 2024 02:20:16 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 12ED25805D; Fri, 1 Mar 2024 02:20:16 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 1 Mar 2024 02:20:15 +0000 (GMT) From: Stefan Berger To: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, saulo.alessandre@tse.jus.br, lukas@wunner.de, Stefan Berger , David Howells Subject: [PATCH v4 12/12] crypto: x509 - Add OID for NIST P521 and extend parser for it Date: Thu, 29 Feb 2024 21:20:07 -0500 Message-ID: <20240301022007.344948-13-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240301022007.344948-1-stefanb@linux.ibm.com> References: <20240301022007.344948-1-stefanb@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: mRs7XMb-K63HGuk60utCdVeXCnhE_hbV X-Proofpoint-ORIG-GUID: bJt5Y1aNDD82emL5h9ejwVh6ZmBYPFfg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-29_08,2024-02-29_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 spamscore=0 phishscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=977 clxscore=1015 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403010018 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 Signed-off-by: Stefan Berger --- 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 487204d39426..99f809b7910b 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c @@ -538,6 +538,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; } diff --git a/include/linux/oid_registry.h b/include/linux/oid_registry.h index 3921fbed0b28..af16d96fbbf2 100644 --- a/include/linux/oid_registry.h +++ b/include/linux/oid_registry.h @@ -65,6 +65,7 @@ enum OID { OID_Scram, /* 1.3.6.1.5.5.14 */ OID_certAuthInfoAccess, /* 1.3.6.1.5.5.7.1.1 */ OID_id_ansip384r1, /* 1.3.132.0.34 */ + OID_id_ansip521r1, /* 1.3.132.0.35 */ 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.43.0