addressed review comments 5

This commit is contained in:
Hideki Miyazaki
2022-07-15 13:46:30 +09:00
parent fd885d89eb
commit 15725400a7
6 changed files with 26 additions and 21 deletions

View File

@@ -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)

View File

@@ -133,6 +133,7 @@ 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
if (ret == 0)
ret = wc_AesInit(aes, NULL, INVALID_DEVID); 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);

View File

@@ -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);

View File

@@ -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__ */