addressed review comments 5

This commit is contained in:
Hideki Miyazaki 2022-07-15 13:46:30 +09:00
parent fd885d89eb
commit 15725400a7
No known key found for this signature in database
GPG Key ID: 7EB19ED9B9D5AC28
6 changed files with 26 additions and 21 deletions

View File

@ -369,19 +369,19 @@ static void Tls_client(void *pvParam)
if (ret == 0) {
#ifdef WOLFSSL_RENESAS_TSIP_TLS
#if !defined(TLS_MULTITHREAD_TEST)
memset(&userContext, 0, sizeof(TsipUserCtx));
tsip_set_callback_ctx(ssl, &userContext);
#else
if (p->port - TLSSERVER_PORT == 0) {
memset(&userContext_taskA, 0, sizeof(TsipUserCtx));
tsip_set_callback_ctx(ssl, (void*)&userContext_taskA);
}
else {
memset(&userContext_taskB, 0, sizeof(TsipUserCtx));
tsip_set_callback_ctx(ssl, (void*)&userContext_taskB);
}
#endif
#if !defined(TLS_MULTITHREAD_TEST)
memset(&userContext, 0, sizeof(TsipUserCtx));
tsip_set_callback_ctx(ssl, &userContext);
#else
if (p->port - TLSSERVER_PORT == 0) {
memset(&userContext_taskA, 0, sizeof(TsipUserCtx));
tsip_set_callback_ctx(ssl, (void*)&userContext_taskA);
}
else {
memset(&userContext_taskB, 0, sizeof(TsipUserCtx));
tsip_set_callback_ctx(ssl, (void*)&userContext_taskB);
}
#endif
#endif
}

View File

@ -60,7 +60,8 @@
/* use multi-thread example */
/* #define TLS_MULTITHREAD_TEST */
#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
#if defined(TLS_MULTITHREAD_TEST)

View File

@ -133,7 +133,8 @@ static int tsip_aes_cbc_test(int prnt, tsip_aes_key_index_t* aes_key)
ret = -1;
#ifdef HAVE_AES_DECRYPT
ret = wc_AesInit(aes, NULL, INVALID_DEVID);
if (ret == 0)
ret = wc_AesInit(aes, NULL, INVALID_DEVID);
if (ret == 0) {
ret = wc_AesSetKey(aes, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION);
XMEMCPY(&aes->ctx.tsip_keyIdx, aes_key,

View File

@ -719,8 +719,9 @@ int wc_tsip_AesGcmEncrypt(
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.
* It expects to pass iv when users create their own key.
*/
err = initFn(&hdl, &key_client_aes, iv_l, ivSz_l);
@ -913,6 +914,8 @@ int wc_tsip_AesGcmDecrypt(
if (ret == 0) {
/* 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.
*
* It expects to pass iv when users create their own key.
*/
err = initFn(&hdl, &key_server_aes, iv_l, ivSz_l);

View File

@ -1,5 +1,5 @@
/* renesas-tsip-crypt-types.h
/* renesas_tsip_types.h
*
* Copyright (C) 2006-2022 wolfSSL Inc.
*
@ -20,8 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef __RENESAS_TSIP_CRYPT_TYPES_H__
#define __RENESAS_TSIP_CRYPT_TYPES_H__
#ifndef __RENESAS_TSIP_TYPES_H__
#define __RENESAS_TSIP_TYPES_H__
#include <wolfssl/wolfcrypt/settings.h>
@ -74,4 +74,4 @@ typedef struct {
#endif
#endif /* __RENESAS_TSIP_CRYPT_TYPES_H__ */
#endif /* __RENESAS_TSIP_TYPES_H__ */