mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-05 05:34:41 +02:00
addressed review comments 5
This commit is contained in:
@@ -369,19 +369,19 @@ static void Tls_client(void *pvParam)
|
|||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
#ifdef WOLFSSL_RENESAS_TSIP_TLS
|
#ifdef WOLFSSL_RENESAS_TSIP_TLS
|
||||||
#if !defined(TLS_MULTITHREAD_TEST)
|
#if !defined(TLS_MULTITHREAD_TEST)
|
||||||
memset(&userContext, 0, sizeof(TsipUserCtx));
|
memset(&userContext, 0, sizeof(TsipUserCtx));
|
||||||
tsip_set_callback_ctx(ssl, &userContext);
|
tsip_set_callback_ctx(ssl, &userContext);
|
||||||
#else
|
#else
|
||||||
if (p->port - TLSSERVER_PORT == 0) {
|
if (p->port - TLSSERVER_PORT == 0) {
|
||||||
memset(&userContext_taskA, 0, sizeof(TsipUserCtx));
|
memset(&userContext_taskA, 0, sizeof(TsipUserCtx));
|
||||||
tsip_set_callback_ctx(ssl, (void*)&userContext_taskA);
|
tsip_set_callback_ctx(ssl, (void*)&userContext_taskA);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
memset(&userContext_taskB, 0, sizeof(TsipUserCtx));
|
memset(&userContext_taskB, 0, sizeof(TsipUserCtx));
|
||||||
tsip_set_callback_ctx(ssl, (void*)&userContext_taskB);
|
tsip_set_callback_ctx(ssl, (void*)&userContext_taskB);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,7 +60,8 @@
|
|||||||
/* use multi-thread example */
|
/* use multi-thread example */
|
||||||
/* #define TLS_MULTITHREAD_TEST */
|
/* #define TLS_MULTITHREAD_TEST */
|
||||||
#if defined(TLS_MULTITHREAD_TEST) && defined(WOLFSSL_TLS13)
|
#if defined(TLS_MULTITHREAD_TEST) && defined(WOLFSSL_TLS13)
|
||||||
#error "MULTITHREAD_TEST is only available when not set WOLFSSL_TLS13"
|
#error "MULTITHREAD_TEST is only available when not set WOLFSSL_TLS13 \
|
||||||
|
because it is not verified yet."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TLS_MULTITHREAD_TEST)
|
#if defined(TLS_MULTITHREAD_TEST)
|
||||||
|
@@ -133,7 +133,8 @@ static int tsip_aes_cbc_test(int prnt, tsip_aes_key_index_t* aes_key)
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
#ifdef HAVE_AES_DECRYPT
|
#ifdef HAVE_AES_DECRYPT
|
||||||
ret = wc_AesInit(aes, NULL, INVALID_DEVID);
|
if (ret == 0)
|
||||||
|
ret = wc_AesInit(aes, NULL, INVALID_DEVID);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = wc_AesSetKey(aes, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION);
|
ret = wc_AesSetKey(aes, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION);
|
||||||
XMEMCPY(&aes->ctx.tsip_keyIdx, aes_key,
|
XMEMCPY(&aes->ctx.tsip_keyIdx, aes_key,
|
||||||
|
@@ -360,7 +360,7 @@ int wc_CryptoCb_CryptInitRenesasCmn(WOLFSSL* ssl, void* ctx)
|
|||||||
{
|
{
|
||||||
(void)ssl;
|
(void)ssl;
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
|
|
||||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
|
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||||
TsipUserCtx* cbInfo = (TsipUserCtx*)ctx;
|
TsipUserCtx* cbInfo = (TsipUserCtx*)ctx;
|
||||||
#elif defined(WOLFSSL_RENESAS_SCEPROTECT)
|
#elif defined(WOLFSSL_RENESAS_SCEPROTECT)
|
||||||
|
@@ -719,8 +719,9 @@ int wc_tsip_AesGcmEncrypt(
|
|||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
|
||||||
/* since generated session key is coupled to iv, no need to pass
|
/* Since generated session key is coupled to iv, no need to pass
|
||||||
* iv init func.
|
* iv init func.
|
||||||
|
* It expects to pass iv when users create their own key.
|
||||||
*/
|
*/
|
||||||
err = initFn(&hdl, &key_client_aes, iv_l, ivSz_l);
|
err = initFn(&hdl, &key_client_aes, iv_l, ivSz_l);
|
||||||
|
|
||||||
@@ -913,6 +914,8 @@ int wc_tsip_AesGcmDecrypt(
|
|||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
/* since key_index has iv and ivSz in it, no need to pass them init
|
/* since key_index has iv and ivSz in it, no need to pass them init
|
||||||
* func. Pass NULL and 0 as 3rd and 4th parameter respectively.
|
* func. Pass NULL and 0 as 3rd and 4th parameter respectively.
|
||||||
|
*
|
||||||
|
* It expects to pass iv when users create their own key.
|
||||||
*/
|
*/
|
||||||
err = initFn(&hdl, &key_server_aes, iv_l, ivSz_l);
|
err = initFn(&hdl, &key_server_aes, iv_l, ivSz_l);
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
/* renesas-tsip-crypt-types.h
|
/* renesas_tsip_types.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __RENESAS_TSIP_CRYPT_TYPES_H__
|
#ifndef __RENESAS_TSIP_TYPES_H__
|
||||||
#define __RENESAS_TSIP_CRYPT_TYPES_H__
|
#define __RENESAS_TSIP_TYPES_H__
|
||||||
|
|
||||||
|
|
||||||
#include <wolfssl/wolfcrypt/settings.h>
|
#include <wolfssl/wolfcrypt/settings.h>
|
||||||
@@ -74,4 +74,4 @@ typedef struct {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __RENESAS_TSIP_CRYPT_TYPES_H__ */
|
#endif /* __RENESAS_TSIP_TYPES_H__ */
|
||||||
|
Reference in New Issue
Block a user