diff --git a/plugin/openssl_plugin/common/src/openssl_common.c b/plugin/openssl_plugin/common/src/openssl_common.c index a80d789cab2681dd443a57b62dd4f5312480c2f0..512219eb663893790545a60da039543dc874dda4 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 c3405fde5864fb1c6c9b40bf6cfa387abea165e3..94d70a89d2c663c2fa38094c5f15604aa2ea1a66 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();