fix sm3 code error

This commit is contained in:
jinlun 2024-04-18 18:29:53 +08:00
parent 2eb681be8c
commit 5e0a87c1be
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,50 @@
From d71c36d1c218a7bba38a7aaa7d31917d3551e7d5 Mon Sep 17 00:00:00 2001
From: jinlun <jinlun@huawei.com>
Date: Thu, 18 Apr 2024 18:22:39 +0800
Subject: [PATCH] fix sm3 code error
---
nss/lib/cryptohi/sechash.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/nss/lib/cryptohi/sechash.c b/nss/lib/cryptohi/sechash.c
index b288145..8d60fbc 100644
--- a/lib/cryptohi/sechash.c
+++ b/lib/cryptohi/sechash.c
@@ -196,16 +196,6 @@ const SECHashObject SECHashObjects[] = {
PK11_DigestFinal,
SHA224_BLOCK_LENGTH,
HASH_AlgSHA224 },
- { SM3_LENGTH,
- (void *(*)(void))sm3_NewContext,
- (void *(*)(void *))PK11_CloneContext,
- (void (*)(void *, PRBool))PK11_DestroyContext,
- (void (*)(void *))PK11_DigestBegin,
- (void (*)(void *, const unsigned char *, unsigned int))PK11_DigestOp,
- (void (*)(void *, unsigned char *, unsigned int *, unsigned int))
- PK11_DigestFinal,
- SM3_BLOCK_LENGTH,
- HASH_AlgSM3 },
{ SHA3_224_LENGTH,
(void *(*)(void))sha3_224_NewContext,
(void *(*)(void *))PK11_CloneContext,
@@ -246,6 +236,16 @@ const SECHashObject SECHashObjects[] = {
PK11_DigestFinal,
SHA3_512_BLOCK_LENGTH,
HASH_AlgSHA3_512 },
+ { SM3_LENGTH,
+ (void *(*)(void))sm3_NewContext,
+ (void *(*)(void *))PK11_CloneContext,
+ (void (*)(void *, PRBool))PK11_DestroyContext,
+ (void (*)(void *))PK11_DigestBegin,
+ (void (*)(void *, const unsigned char *, unsigned int))PK11_DigestOp,
+ (void (*)(void *, unsigned char *, unsigned int *, unsigned int))
+ PK11_DigestFinal,
+ SM3_BLOCK_LENGTH,
+ HASH_AlgSM3 },
};
const SECHashObject *
--
2.33.0

View File

@ -15,7 +15,7 @@
Summary: Network Security Services
Name: nss
Version: %{nss_version}
Release: 4
Release: 5
License: MPLv2.0
URL: http://www.mozilla.org/projects/security/pki/nss/
Provides: nss-system-init
@ -48,6 +48,7 @@ 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
Patch9005: Feature-fix-sm2-sm3-code-error.patch
Patch9006: Feature-fix-sm3-code-error.patch
%description
Network Security Services (NSS) is a set of libraries designed to
@ -137,6 +138,7 @@ pushd nss
%patch9003 -p1
%patch9004 -p1
%patch9005 -p1
%patch9006 -p1
popd
%build
@ -559,6 +561,9 @@ update-crypto-policies &>/dev/null||:
%doc %{_mandir}/man*
%changelog
* Thu Apr 18 2024 jinlun <jinlun@huawei.com> - 3.94.0-5
- fix sm3 code error
* Mon Jan 22 2024 jinlun <jinlun@huawei.com> - 3.94.0-4
- fix sm2 sm3 code error