Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/benchmark/clu_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ int wolfCLU_benchmark(int timer, int* option)

byte* digest; /* message digest */

XMEMSET(&rng, 0, sizeof(rng));

if (wc_InitRng(&rng) != 0) {
return WOLFCLU_FATAL_ERROR;
}
Expand Down
1 change: 0 additions & 1 deletion src/genkey/clu_genkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,6 @@ int wolfCLU_genKey_XMSS(WC_RNG* rng, char* fName,

/* init the xmss key */
if (ret == 0) {
XMEMSET(key, 0, sizeof(XmssKey));
ret = wc_XmssKey_Init(key, HEAP_HINT, 0);
if (ret != 0) {
wolfCLU_LogError("Failed to initialize XMSS Key."
Expand Down
2 changes: 0 additions & 2 deletions src/pkey/clu_pkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ static int wolfCLU_DerToEncryptedPEM(WOLFSSL_BIO* bio, byte* key, word32 keySz,
int itt = WC_PKCS12_ITT_DEFAULT;
void* heap = NULL;

XMEMSET(&rng, 0, sizeof(rng));

if (wc_InitRng(&rng) != 0) {
ret = WOLFCLU_FATAL_ERROR;
}
Expand Down
1 change: 0 additions & 1 deletion src/sign-verify/clu_dgst_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ static int wolfCLU_dgstSignVerify(WOLFSSL_BIO* dataBio, WOLFSSL_BIO* pubKeyBio,
/* create the signature if requested */
if (ret == WOLFCLU_SUCCESS && signing == 1) {
WC_RNG rng;
XMEMSET(&rng, 0, sizeof(rng));

if (wc_InitRng(&rng) != 0) {
wolfCLU_LogError("Error initializing RNG");
Expand Down
8 changes: 2 additions & 6 deletions src/sign-verify/clu_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ int wolfCLU_sign_data_rsa(byte* data, char* out, word32 dataSz, char* privKey,
int outBufSz = 0;

XMEMSET(&rng, 0, sizeof(rng));
XMEMSET(&key, 0, sizeof(key));

/* initialize the RSA key */
ret = wc_InitRsaKey(&key, NULL);
Expand Down Expand Up @@ -749,7 +748,6 @@ int wolfCLU_sign_data_dilithium (byte* data, char* out, word32 dataSz, char* pri
#endif

XMEMSET(&rng, 0, sizeof(rng));
XMEMSET(key, 0, sizeof(dilithium_key));

/* init the dilithium key */
ret = wc_dilithium_init(key);
Expand Down Expand Up @@ -885,8 +883,8 @@ int wolfCLU_sign_data_dilithium (byte* data, char* out, word32 dataSz, char* pri
}

wc_dilithium_free(key);
/* rng zeroed via XMEMSET before wc_InitRng, so even if wc_InitRng failed:
* wolfSSL checks rng->drbg internally before freeing. */
/* rng zeroed via XMEMSET before wc_InitRng, because wc_InitRsaKey can
* fail leaving rng un inited and not zeroed. */
wc_FreeRng(&rng);
#ifdef WOLFSSL_SMALL_STACK
XFREE(key, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
Expand Down Expand Up @@ -929,7 +927,6 @@ int wolfCLU_sign_data_xmss(byte* data, char* out, int fSz, char* privKey)
#endif

/* init the XMSS key */
XMEMSET(key, 0, sizeof(XmssKey));
Comment thread
dgarske marked this conversation as resolved.
ret = wc_XmssKey_Init(key, HEAP_HINT, 0);
if (ret != 0) {
wolfCLU_LogError("Failed to initialize XMSS Key."
Expand Down Expand Up @@ -1109,7 +1106,6 @@ int wolfCLU_sign_data_xmssmt(byte* data, char* out, int fSz, char* privKey)
#endif

/* init the xmss key */
XMEMSET(key, 0, sizeof(XmssKey));
ret = wc_XmssKey_Init(key, HEAP_HINT, 0);
if (ret != 0) {
wolfCLU_LogError("Failed to initialize XMSS Key.\nRET: %d", ret);
Expand Down
4 changes: 0 additions & 4 deletions src/sign-verify/clu_verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ int wolfCLU_verify_signature_rsa(byte* sig, char* out, int sigSz, char* keyPath,
byte* outBuf = NULL;
int outBufSz = 0;

XMEMSET(&key, 0, sizeof(key));

/* initialize RSA key */
ret = wc_InitRsaKey(&key, NULL);
if (ret != 0) {
Expand Down Expand Up @@ -1030,7 +1028,6 @@ int wolfCLU_verify_signature_xmss(byte* sig, int sigSz,
#endif

/* init the xmss key */
XMEMSET(key, 0, sizeof(XmssKey));
ret = wc_XmssKey_Init(key, HEAP_HINT, 0);
if (ret != 0) {
wolfCLU_LogError("Failed to initialize XMSS Key.\nRET: %d", ret);
Expand Down Expand Up @@ -1198,7 +1195,6 @@ int wolfCLU_verify_signature_xmssmt(byte* sig, int sigSz,
#endif

/* init the xmss key */
XMEMSET(key, 0, sizeof(XmssKey));
ret = wc_XmssKey_Init(key, HEAP_HINT, 0);
if (ret != 0) {
wolfCLU_LogError("Failed to initialize XMSS Key.\nRET: %d", ret);
Expand Down
Loading