From e6aec88899f7d3e3098237ca5382e69bd4a96800 Mon Sep 17 00:00:00 2001 From: hhhFun Date: Sat, 14 Sep 2024 19:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=86=85=E5=AD=98=E6=B3=84?= =?UTF-8?q?=E6=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hhhFun --- plugin/openssl_plugin/common/src/openssl_common.c | 4 ++-- .../cipher/src/cipher_sm2_crypto_util_openssl.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin/openssl_plugin/common/src/openssl_common.c b/plugin/openssl_plugin/common/src/openssl_common.c index a80d789..512219e 100644 --- a/plugin/openssl_plugin/common/src/openssl_common.c +++ b/plugin/openssl_plugin/common/src/openssl_common.c @@ -432,9 +432,9 @@ HcfResult BigIntegerToBigNum(const HcfBigInteger *src, BIGNUM **dest) } if (IsBigEndian()) { - *dest = OpensslBin2Bn((src->data), (src->len), NULL); + *dest = OpensslBin2Bn((src->data), (src->len), *dest); } else { - *dest = OpensslLeBin2Bn((src->data), (src->len), NULL); + *dest = OpensslLeBin2Bn((src->data), (src->len), *dest); } if (*dest == NULL) { diff --git a/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_sm2_crypto_util_openssl.c b/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_sm2_crypto_util_openssl.c index c3405fd..94d70a8 100644 --- a/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_sm2_crypto_util_openssl.c +++ b/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_sm2_crypto_util_openssl.c @@ -33,8 +33,6 @@ static HcfResult BuildSm2Ciphertext(const Sm2CipherTextSpec *spec, struct Sm2Cip LOGE("Build y failed."); return HCF_ERR_CRYPTO_OPERATION; } - sm2Text->c3 = OpensslAsn1OctetStringNew(); - sm2Text->c2 = OpensslAsn1OctetStringNew(); if (sm2Text->c3 == NULL || sm2Text->c2 == NULL) { LOGE("SM2 openssl [ASN1_OCTET_STRING_new] c3 c2 fail"); HcfPrintOpensslError(); -- Gitee