From 5e77253577e1a23b14f57be2a4bf5e90e9500604 Mon Sep 17 00:00:00 2001 From: Hideki Miyazaki Date: Wed, 23 Jul 2025 07:44:30 +0900 Subject: [PATCH] Addressed code review comments --- .../e2studio/RA6M4/test/src/wolfssl_sce_unit_test.c | 2 +- wolfcrypt/src/port/Renesas/renesas_fspsm_util.c | 9 +++++---- wolfssl/wolfcrypt/port/Renesas/renesas_fspsm_internal.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/IDE/Renesas/e2studio/RA6M4/test/src/wolfssl_sce_unit_test.c b/IDE/Renesas/e2studio/RA6M4/test/src/wolfssl_sce_unit_test.c index be48717d7..ac359efb9 100644 --- a/IDE/Renesas/e2studio/RA6M4/test/src/wolfssl_sce_unit_test.c +++ b/IDE/Renesas/e2studio/RA6M4/test/src/wolfssl_sce_unit_test.c @@ -808,7 +808,7 @@ int sce_crypt_test() gCbInfo.wrapped_key_rsapri2048 = &g_wrapped_pair_2048key.priv_key; gCbInfo.wrapped_key_rsapub2048 = - &g_wrapped_pair_2048key.pub_key;; + &g_wrapped_pair_2048key.pub_key; } /* Key generation for multi testing */ diff --git a/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c b/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c index 2dfd81946..ca7051263 100644 --- a/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c +++ b/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c @@ -192,7 +192,7 @@ int wc_fspsm_GenerateRandBlock(byte* output, word32 sz) { /* Generate PRNG based on NIST SP800-90A AES CTR-DRBG */ int ret = 0; - word32 fspbuf[RANDGEN_WORDS]; + uint32_t fspbuf[RANDGEN_WORDS]; while (sz > 0) { word32 len = sizeof(buffer); @@ -201,8 +201,8 @@ int wc_fspsm_GenerateRandBlock(byte* output, word32 sz) len = sz; } /* return 4 words random number*/ - ret = R_RANDOM_GEN((uint32_t*)fspbuf); - if(ret == FSP_SUCCESS) { + ret = R_RANDOM_GEN(fspbuf); + if (ret == FSP_SUCCESS) { XMEMCPY(output, &fspbuf, len); output += len; sz -= len; @@ -404,7 +404,7 @@ int fspsm_EccSharedSecret(WOLFSSL* ssl, ecc_key* otherKey, /* sanity check */ if (ssl == NULL || pubKeyDer == NULL || pubKeySz == NULL || - out == NULL || outlen == NULL || cbInfo == NULL|| + out == NULL || outlen == NULL || cbInfo == NULL || cbInfo->internal == NULL) return WOLFSSL_FAILURE; @@ -1251,6 +1251,7 @@ int wc_fspsm_TlsCleanup(WOLFSSL* ssl) /* zero clear */ ForceZero(tuc, sizeof(FSPSM_ST)); ssl->RenesasUserCtx = NULL; + return ret; } /* Set callback contexts needed for sce TLS api handling */ diff --git a/wolfssl/wolfcrypt/port/Renesas/renesas_fspsm_internal.h b/wolfssl/wolfcrypt/port/Renesas/renesas_fspsm_internal.h index ff7b6407c..cf44e2ace 100644 --- a/wolfssl/wolfcrypt/port/Renesas/renesas_fspsm_internal.h +++ b/wolfssl/wolfcrypt/port/Renesas/renesas_fspsm_internal.h @@ -25,7 +25,7 @@ #include #include -/* flsgas related to TLS */ +/* Wrapped TLS FSP Key Set Flags */ struct FSPSM_tls_flg_ST { uint8_t pk_key_set:1; uint8_t session_key_set:1;