From ba72b1a84b6e1d4b9571c84601f318e8e1d67d9a Mon Sep 17 00:00:00 2001 From: Huaxin Lu Date: Wed, 26 Oct 2022 17:20:46 +0800 Subject: [PATCH] fix cms testcase --- ...ign-and-verify-support-SM2-algorithm.patch | 19 +++++++------------ openssl.spec | 5 ++++- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Feature-PKCS7-sign-and-verify-support-SM2-algorithm.patch b/Feature-PKCS7-sign-and-verify-support-SM2-algorithm.patch index 73de050..fc588ad 100644 --- a/Feature-PKCS7-sign-and-verify-support-SM2-algorithm.patch +++ b/Feature-PKCS7-sign-and-verify-support-SM2-algorithm.patch @@ -1,15 +1,16 @@ -From 95ae0cd988b4a556c1719f84af3fe3a116352fd7 Mon Sep 17 00:00:00 2001 +From fa3d5b8af929c296f4d684345dedf1e2b4b390e2 Mon Sep 17 00:00:00 2001 From: gaoyusong Date: Fri, 30 Sep 2022 12:10:15 +0800 Subject: [PATCH] PKCS7 sign and verify support SM2 algorithm +Signed-off-by: Huaxin Lu --- - crypto/pkcs7/pk7_doit.c | 28 +++++++++++++++++++++------- + crypto/pkcs7/pk7_doit.c | 23 +++++++++++++++++++++-- crypto/sm2/sm2_pmeth.c | 1 + - 2 files changed, 22 insertions(+), 7 deletions(-) + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c -index f63fbc5..2e86cce 100644 +index f63fbc5..916a35a 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -946,6 +946,9 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, @@ -43,16 +44,10 @@ index f63fbc5..2e86cce 100644 goto err; alen = ASN1_item_i2d((ASN1_VALUE *)sk, &abuf, -@@ -1030,13 +1045,12 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, +@@ -1036,7 +1051,11 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, + goto err; } - os = si->enc_digest; -- pkey = X509_get0_pubkey(x509); -- if (!pkey) { -- ret = -1; -- goto err; -- } - - i = EVP_VerifyFinal(mdc_tmp, os->data, os->length, pkey); + i = +#ifndef OPENSSL_NO_SM2 diff --git a/openssl.spec b/openssl.spec index 81c72ee..c5be8f8 100644 --- a/openssl.spec +++ b/openssl.spec @@ -2,7 +2,7 @@ Name: openssl Epoch: 1 Version: 1.1.1m -Release: 11 +Release: 12 Summary: Cryptography and SSL/TLS Toolkit License: OpenSSL and SSLeay URL: https://www.openssl.org/ @@ -238,6 +238,9 @@ make test || : %ldconfig_scriptlets libs %changelog +* Wed Oct 26 2022 luhuaxin - 1:1.1.1m-12 +- fix cms testcase + * Fri Oct 21 2022 luhuaxin - 1:1.1.1m-11 - add support for SM2 PKCS7 -- Gitee