mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 12:44:45 +02:00
Addressed code review comments
This commit is contained in:
@@ -808,7 +808,7 @@ int sce_crypt_test()
|
|||||||
gCbInfo.wrapped_key_rsapri2048 =
|
gCbInfo.wrapped_key_rsapri2048 =
|
||||||
&g_wrapped_pair_2048key.priv_key;
|
&g_wrapped_pair_2048key.priv_key;
|
||||||
gCbInfo.wrapped_key_rsapub2048 =
|
gCbInfo.wrapped_key_rsapub2048 =
|
||||||
&g_wrapped_pair_2048key.pub_key;;
|
&g_wrapped_pair_2048key.pub_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Key generation for multi testing */
|
/* Key generation for multi testing */
|
||||||
|
@@ -192,7 +192,7 @@ int wc_fspsm_GenerateRandBlock(byte* output, word32 sz)
|
|||||||
{
|
{
|
||||||
/* Generate PRNG based on NIST SP800-90A AES CTR-DRBG */
|
/* Generate PRNG based on NIST SP800-90A AES CTR-DRBG */
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
word32 fspbuf[RANDGEN_WORDS];
|
uint32_t fspbuf[RANDGEN_WORDS];
|
||||||
|
|
||||||
while (sz > 0) {
|
while (sz > 0) {
|
||||||
word32 len = sizeof(buffer);
|
word32 len = sizeof(buffer);
|
||||||
@@ -201,8 +201,8 @@ int wc_fspsm_GenerateRandBlock(byte* output, word32 sz)
|
|||||||
len = sz;
|
len = sz;
|
||||||
}
|
}
|
||||||
/* return 4 words random number*/
|
/* return 4 words random number*/
|
||||||
ret = R_RANDOM_GEN((uint32_t*)fspbuf);
|
ret = R_RANDOM_GEN(fspbuf);
|
||||||
if(ret == FSP_SUCCESS) {
|
if (ret == FSP_SUCCESS) {
|
||||||
XMEMCPY(output, &fspbuf, len);
|
XMEMCPY(output, &fspbuf, len);
|
||||||
output += len;
|
output += len;
|
||||||
sz -= len;
|
sz -= len;
|
||||||
@@ -404,7 +404,7 @@ int fspsm_EccSharedSecret(WOLFSSL* ssl, ecc_key* otherKey,
|
|||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (ssl == NULL || pubKeyDer == NULL || pubKeySz == NULL ||
|
if (ssl == NULL || pubKeyDer == NULL || pubKeySz == NULL ||
|
||||||
out == NULL || outlen == NULL || cbInfo == NULL||
|
out == NULL || outlen == NULL || cbInfo == NULL ||
|
||||||
cbInfo->internal == NULL)
|
cbInfo->internal == NULL)
|
||||||
return WOLFSSL_FAILURE;
|
return WOLFSSL_FAILURE;
|
||||||
|
|
||||||
@@ -1251,6 +1251,7 @@ int wc_fspsm_TlsCleanup(WOLFSSL* ssl)
|
|||||||
/* zero clear */
|
/* zero clear */
|
||||||
ForceZero(tuc, sizeof(FSPSM_ST));
|
ForceZero(tuc, sizeof(FSPSM_ST));
|
||||||
ssl->RenesasUserCtx = NULL;
|
ssl->RenesasUserCtx = NULL;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
/* Set callback contexts needed for sce TLS api handling */
|
/* Set callback contexts needed for sce TLS api handling */
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
#include <wolfssl/wolfcrypt/port/Renesas/renesas-fspsm-types.h>
|
#include <wolfssl/wolfcrypt/port/Renesas/renesas-fspsm-types.h>
|
||||||
#include <wolfssl/wolfcrypt/port/Renesas/renesas-fspsm-crypt.h>
|
#include <wolfssl/wolfcrypt/port/Renesas/renesas-fspsm-crypt.h>
|
||||||
|
|
||||||
/* flsgas related to TLS */
|
/* Wrapped TLS FSP Key Set Flags */
|
||||||
struct FSPSM_tls_flg_ST {
|
struct FSPSM_tls_flg_ST {
|
||||||
uint8_t pk_key_set:1;
|
uint8_t pk_key_set:1;
|
||||||
uint8_t session_key_set:1;
|
uint8_t session_key_set:1;
|
||||||
|
Reference in New Issue
Block a user