!112 修复国密证书导入失败的问题

From: @jinlun123123 
Reviewed-by: @zcfsite, @HuaxinLuGitee 
Signed-off-by: @zcfsite
This commit is contained in:
openeuler-ci-bot 2023-09-12 12:31:36 +00:00 committed by Gitee
commit 328d72d6e6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From 5ad87d10b76fe5d4646d1f0a795580df20f0cd02 Mon Sep 17 00:00:00 2001
From: jinlun <jinlun@huawei.com>
Date: Tue, 12 Sep 2023 17:40:03 +0800
Subject: [PATCH] fix the certificate resolution in sm2
---
lib/cryptohi/seckey.c | 1 +
lib/softoken/pkcs11c.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/lib/cryptohi/seckey.c b/lib/cryptohi/seckey.c
index 6a230e1..11a936e 100644
--- a/lib/cryptohi/seckey.c
+++ b/lib/cryptohi/seckey.c
@@ -639,6 +639,7 @@ seckey_ExtractPublicKey(const CERTSubjectPublicKeyInfo *spki)
return pubk;
break;
case SEC_OID_ANSIX962_EC_PUBLIC_KEY:
+ case SEC_OID_SM2:
/* A basic sanity check on inputs. */
if (spki->algorithm.parameters.len == 0 || newOs.len == 0) {
PORT_SetError(SEC_ERROR_INPUT_LEN);
diff --git a/lib/softoken/pkcs11c.c b/lib/softoken/pkcs11c.c
index 2105cb5..5261a92 100644
--- a/lib/softoken/pkcs11c.c
+++ b/lib/softoken/pkcs11c.c
@@ -6199,6 +6199,7 @@ sftk_unwrapPrivateKey(SFTKObject *key, SECItem *bpki)
prepare_low_pqg_params_for_asn1(&lpk->u.dsa.params);
break;
/* case NSSLOWKEYDHKey: */
+ case SEC_OID_SM2:
case SEC_OID_ANSIX962_EC_PUBLIC_KEY:
keyTemplate = nsslowkey_ECPrivateKeyTemplate;
paramTemplate = NULL;
--
2.27.0

View File

@ -14,7 +14,7 @@
Summary: Network Security Services
Name: nss
Version: %{nss_version}
Release: 1
Release: 2
License: MPLv2.0
URL: http://www.mozilla.org/projects/security/pki/nss/
Provides: nss-system-init
@ -45,6 +45,7 @@ Patch9000: Feature-nss-add-implement-of-SM3-digest-algorithm.patch
Patch9001: Feature-nss-add-implement-of-SM2-signature-algorithm.patch
Patch9002: Feature-nss-support-SM3-digest-algorithm.patch
Patch9003: Feature-nss-support-SM2-signature-algorithm.patch
Patch9004: Feature-nss-fix-the-certificate-resolution-in-sm2.patch
%description
Network Security Services (NSS) is a set of libraries designed to
@ -132,6 +133,7 @@ pushd nss
%patch9001 -p1
%patch9002 -p1
%patch9003 -p1
%patch9004 -p1
popd
%build
@ -554,6 +556,9 @@ update-crypto-policies &>/dev/null||:
%doc %{_mandir}/man*
%changelog
* Tue Sep 12 2023 jinlun <jinlun@huawei.com> - 3.89.0-2
- fix the certificate resolution in sm2
* Tue Jul 18 2023 jinlun <jinlun@huawei.com> - 3.89.0-1
- update version to 3.89