mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-06 22:24:42 +02:00
fix long line and trailing whitespaces
This commit is contained in:
@@ -244,7 +244,8 @@ WOLFSSL_LOCAL int wc_fspsm_AesGcmEncrypt(struct Aes* aes, byte* out,
|
|||||||
(void) key_server_aes;
|
(void) key_server_aes;
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (aes == NULL || authTagSz > WC_AES_BLOCK_SIZE || ivSz == 0 || info == NULL) {
|
if (aes == NULL || authTagSz > WC_AES_BLOCK_SIZE || ivSz == 0 ||
|
||||||
|
info == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,7 +454,8 @@ WOLFSSL_LOCAL int wc_fspsm_AesGcmDecrypt(struct Aes* aes, byte* out,
|
|||||||
FSPSM_AES_PWKEY key_server_aes = NULL;
|
FSPSM_AES_PWKEY key_server_aes = NULL;
|
||||||
(void) key_client_aes;
|
(void) key_client_aes;
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (aes == NULL || authTagSz > WC_AES_BLOCK_SIZE || ivSz == 0 || info == NULL) {
|
if (aes == NULL || authTagSz > WC_AES_BLOCK_SIZE || ivSz == 0 ||
|
||||||
|
info == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -812,14 +814,15 @@ int wc_AesSetKey(Aes* aes, const byte* userKey, word32 keylen,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WOLFSSL_LOCAL int wc_fspsm_AesCipher(int devIdArg, wc_CryptoInfo* info, void* ctx)
|
WOLFSSL_LOCAL int wc_fspsm_AesCipher(int devIdArg, wc_CryptoInfo* info,
|
||||||
|
void* ctx)
|
||||||
{
|
{
|
||||||
int ret = WC_NO_ERR_TRACE(NOT_COMPILED_IN);
|
int ret = WC_NO_ERR_TRACE(NOT_COMPILED_IN);
|
||||||
FSPSM_ST* cbInfo = (FSPSM_ST*)ctx;
|
FSPSM_ST* cbInfo = (FSPSM_ST*)ctx;
|
||||||
(void)devIdArg;
|
(void)devIdArg;
|
||||||
|
|
||||||
WOLFSSL_ENTER("wc_fspsm_AesCipher");
|
WOLFSSL_ENTER("wc_fspsm_AesCipher");
|
||||||
|
|
||||||
if (info == NULL || ctx == NULL) {
|
if (info == NULL || ctx == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
@@ -67,10 +67,6 @@ static fspsm_key_data g_user_key_info;
|
|||||||
|
|
||||||
static uint32_t g_encrypted_publicCA_key[HW_SCE_SINST_WORD_SIZE];
|
static uint32_t g_encrypted_publicCA_key[HW_SCE_SINST_WORD_SIZE];
|
||||||
extern uint32_t g_CAscm_Idx; /* index of CM table */
|
extern uint32_t g_CAscm_Idx; /* index of CM table */
|
||||||
//#define USE_GLOBAL_INTERNAL
|
|
||||||
#if !defined(USE_GLOBAL_INTERNAL)
|
|
||||||
FSPSM_ST_Internal g_internal;
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* WOLFSSL_RENESAS_FSPSM*/
|
#endif /* WOLFSSL_RENESAS_FSPSM*/
|
||||||
@@ -445,7 +441,7 @@ int fspsm_EccSharedSecret(WOLFSSL* ssl, ecc_key* otherKey,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* set master secret generation callback for use */
|
/* set master secret generation callback for use */
|
||||||
wolfSSL_CTX_SetGenMasterSecretCb(ssl->ctx,
|
wolfSSL_CTX_SetGenMasterSecretCb(ssl->ctx,
|
||||||
Renesas_cmn_genMasterSecret);
|
Renesas_cmn_genMasterSecret);
|
||||||
wolfSSL_SetGenMasterSecretCtx(ssl, cbInfo);
|
wolfSSL_SetGenMasterSecretCtx(ssl, cbInfo);
|
||||||
}
|
}
|
||||||
@@ -458,7 +454,7 @@ int fspsm_EccSharedSecret(WOLFSSL* ssl, ecc_key* otherKey,
|
|||||||
wc_fspsm_hw_unlock();
|
wc_fspsm_hw_unlock();
|
||||||
|
|
||||||
*outlen = 64;
|
*outlen = 64;
|
||||||
WOLFSSL_PKMSG("PK ECC PMS: ret %d, PubKeySz %d, OutLen %d\n",
|
WOLFSSL_PKMSG("PK ECC PMS: ret %d, PubKeySz %d, OutLen %d\n",
|
||||||
ret, *pubKeySz, *outlen);
|
ret, *pubKeySz, *outlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -852,9 +848,9 @@ int wc_fspsm_generateSessionKey(WOLFSSL *ssl,
|
|||||||
/* ready-for-use flag will be set when SetKeySide() is called */
|
/* ready-for-use flag will be set when SetKeySide() is called */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cbInfo->internal->cipher ==
|
if (cbInfo->internal->cipher ==
|
||||||
SCE_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ||
|
SCE_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ||
|
||||||
cbInfo->internal->cipher ==
|
cbInfo->internal->cipher ==
|
||||||
SCE_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256) {
|
SCE_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256) {
|
||||||
enc->aes->nonceSz = AEAD_MAX_IMP_SZ;
|
enc->aes->nonceSz = AEAD_MAX_IMP_SZ;
|
||||||
dec->aes->nonceSz = AEAD_MAX_IMP_SZ;
|
dec->aes->nonceSz = AEAD_MAX_IMP_SZ;
|
||||||
@@ -1151,12 +1147,12 @@ int wc_fspsm_storeKeyCtx(WOLFSSL* ssl, FSPSM_ST* info)
|
|||||||
ret = BAD_FUNC_ARG;
|
ret = BAD_FUNC_ARG;
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
XMEMCPY(info->internal->masterSecret,
|
XMEMCPY(info->internal->masterSecret,
|
||||||
ssl->arrays->fspsm_masterSecret,
|
ssl->arrays->fspsm_masterSecret,
|
||||||
FSPSM_TLS_MASTERSECRET_SIZE);
|
FSPSM_TLS_MASTERSECRET_SIZE);
|
||||||
XMEMCPY(info->internal->clientRandom,
|
XMEMCPY(info->internal->clientRandom,
|
||||||
ssl->arrays->clientRandom, 32);
|
ssl->arrays->clientRandom, 32);
|
||||||
XMEMCPY(info->internal->serverRandom,
|
XMEMCPY(info->internal->serverRandom,
|
||||||
ssl->arrays->serverRandom, 32);
|
ssl->arrays->serverRandom, 32);
|
||||||
|
|
||||||
info->internal->cipher = (uint8_t)GetSceCipherSuite(
|
info->internal->cipher = (uint8_t)GetSceCipherSuite(
|
||||||
@@ -1246,12 +1242,8 @@ void wc_fspsm_TlsCleanup(WOLFSSL* ssl)
|
|||||||
return;
|
return;
|
||||||
/* free internal structure */
|
/* free internal structure */
|
||||||
if (tuc->internal) {
|
if (tuc->internal) {
|
||||||
#if !defined(USE_GLOBAL_INTERNAL)
|
|
||||||
XFREE(tuc->internal, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(tuc->internal, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
tuc->internal = NULL;
|
tuc->internal = NULL;
|
||||||
#else
|
|
||||||
ForceZero(tuc->internal, sizeof(FSPSM_ST_Internal));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* zero clear */
|
/* zero clear */
|
||||||
@@ -1272,14 +1264,9 @@ WOLFSSL_API int wc_fspsm_set_callback_ctx(WOLFSSL* ssl, void* user_ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ForceZero(uCtx, sizeof(FSPSM_ST));
|
ForceZero(uCtx, sizeof(FSPSM_ST));
|
||||||
#if !defined(USE_GLOBAL_INTERNAL)
|
|
||||||
uCtx->internal = (FSPSM_ST_Internal*)XMALLOC(sizeof(FSPSM_ST_Internal),
|
uCtx->internal = (FSPSM_ST_Internal*)XMALLOC(sizeof(FSPSM_ST_Internal),
|
||||||
ssl->heap,
|
ssl->heap,
|
||||||
DYNAMIC_TYPE_TMP_BUFFER);
|
DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
#else
|
|
||||||
printf("sizeof (FSPSM_ST_Internal) = %d\n", sizeof(FSPSM_ST_Internal));
|
|
||||||
uCtx->internal = &g_internal;
|
|
||||||
#endif
|
|
||||||
if (!uCtx->internal) {
|
if (!uCtx->internal) {
|
||||||
WOLFSSL_MSG("Failed to allocate memory for user ctx internal");
|
WOLFSSL_MSG("Failed to allocate memory for user ctx internal");
|
||||||
return MEMORY_E;
|
return MEMORY_E;
|
||||||
|
@@ -46,7 +46,7 @@ typedef struct FSPSM_ST_Internal FSPSM_ST_Internal;
|
|||||||
typedef struct FSPSM_tag_ST {
|
typedef struct FSPSM_tag_ST {
|
||||||
/* unique number for each session */
|
/* unique number for each session */
|
||||||
int devId;
|
int devId;
|
||||||
|
|
||||||
/* installed key handling */
|
/* installed key handling */
|
||||||
/* aes */
|
/* aes */
|
||||||
FSPSM_W_KEYVAR wrapped_key_aes256;
|
FSPSM_W_KEYVAR wrapped_key_aes256;
|
||||||
|
@@ -180,7 +180,7 @@ WOLFSSL_LOCAL int wc_fspsm_AesGcmDecrypt(struct Aes* aes, byte* out,
|
|||||||
const byte* authTag, word32 authTagSz,
|
const byte* authTag, word32 authTagSz,
|
||||||
const byte* authIn, word32 authInSz,
|
const byte* authIn, word32 authInSz,
|
||||||
void* ctx);
|
void* ctx);
|
||||||
|
|
||||||
WOLFSSL_LOCAL int wc_fspsm_AesCipher(int devIdArg, struct wc_CryptoInfo* info,
|
WOLFSSL_LOCAL int wc_fspsm_AesCipher(int devIdArg, struct wc_CryptoInfo* info,
|
||||||
void* ctx);
|
void* ctx);
|
||||||
WOLFSSL_LOCAL int wc_fspsm_tls_RootCertVerify(
|
WOLFSSL_LOCAL int wc_fspsm_tls_RootCertVerify(
|
||||||
|
Reference in New Issue
Block a user