From aeda81d15a542279f2cc1983ec13b4228117c9db Mon Sep 17 00:00:00 2001 From: lanlanlan Date: Wed, 12 Apr 2023 09:03:55 +0000 Subject: [PATCH] update plugin/openssl_plugin/rand/src/rand_openssl.c. Signed-off-by: lanlanlan --- plugin/openssl_plugin/rand/src/rand_openssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/openssl_plugin/rand/src/rand_openssl.c b/plugin/openssl_plugin/rand/src/rand_openssl.c index 573639e..91c0a3b 100644 --- a/plugin/openssl_plugin/rand/src/rand_openssl.c +++ b/plugin/openssl_plugin/rand/src/rand_openssl.c @@ -34,8 +34,8 @@ static const char *GetRandOpenSSLClass(void) static HcfResult OpensslGenerateRandom(HcfRandSpi *self, int32_t numBytes, HcfBlob *random) { - unsigned char rand_buf[numBytes]; - int32_t ret = RAND_priv_bytes(rand_buf, numBytes); + unsigned char randBuf[numBytes]; + int32_t ret = RAND_priv_bytes(randBuf, numBytes); if (ret != HCF_OPENSSL_SUCCESS) { LOGE("RAND_bytes return error!"); HcfPrintOpensslError(); @@ -46,7 +46,7 @@ static HcfResult OpensslGenerateRandom(HcfRandSpi *self, int32_t numBytes, HcfBl LOGE("Failed to allocate random->data memory!"); return HCF_ERR_MALLOC; } - (void)memcpy_s(random->data, numBytes, rand_buf, numBytes); + (void)memcpy_s(random->data, numBytes, randBuf, numBytes); random->len = numBytes; return HCF_SUCCESS; } -- Gitee