Addressed review comments

This commit is contained in:
Hideki Miyazaki 2019-01-17 12:25:28 +09:00
parent 2753d2d548
commit 4a5c380f32
7 changed files with 27 additions and 43 deletions

View File

@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfcrypt/benchmark/benchmark.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
@ -36,15 +37,8 @@
/* proto-type */
extern void wolf_benchmark_task();
extern int benchmark_init();
extern int benchmark_test(void *args);
#ifdef WOLFSSL_ESPWROOM32SE
const static char* TAG = "wolfbenchmark";
#else
const char* TAG = "wolfbenchmark";
#endif
static const char* const TAG = "wolfbenchmark";
char* __argv[22];
@ -53,17 +47,12 @@ char* __argv[22];
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
int atcatls_set_callbacks(struct WOLFSSL_CTX* ctx);
/* when you need to use a custom slot allocation, */
/* enable the definition CUSTOM_SLOT_ALLOCAION. */
#if defined(CUSTOM_SLOT_ALLOCATION)
static byte mSlotList[ATECC_MAX_SLOT];
int atmel_set_slot_allocator(atmel_slot_alloc_cb alloc, atmel_slot_dealloc_cb dealloc);
/* initialize slot array */
void my_atmel_slotInit()
{

View File

@ -40,15 +40,13 @@
#include <wolfssl/wolfcrypt/mem_track.h>
#endif
#ifdef WOLFSSL_ESPWROOM32SE
static const char* TAG = "tls_client";
#else
const char* TAG = "tls_client";
#endif
static const char* const TAG = "tls_client";
#if defined(DEBUG_WOLFSSL)
static void ShowCiphers(void)
{
static char ciphers[4096];
char ciphers[4096];
int ret = wolfSSL_get_ciphers(ciphers, (int)sizeof(ciphers));
@ -56,13 +54,13 @@ static void ShowCiphers(void)
printf("%s\n", ciphers);
}
#endif
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
int atcatls_set_callbacks(struct WOLFSSL_CTX* ctx);
/* when you want to use custome slot allocation */
/* enable the definition CUSTOM_SLOT_ALLOCATION.*/
@ -147,8 +145,6 @@ void tls_smp_client_task()
WOLFSSL_MSG("Debug ON");
wolfSSL_Debugging_ON();
ShowCiphers();
#else
(void)ShowCiphers;
#endif
/* Initialize wolfSSL */
wolfSSL_Init();

View File

@ -1,6 +1,6 @@
/* server-tls-callback.c
*
* Copyright (C) 2006-2018 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
@ -42,11 +42,9 @@
#include <wolfssl/wolfcrypt/mem_track.h>
#endif
#if defined(WOLFSSL_ESPWROOM32SE)
static const char* TAG = "tls_server";
#else
const char* TAG = "tls_server";
#endif
static const char* const TAG = "tls_server";
#if defined(DEBUG_WOLFSSL)
static void ShowCiphers(void)
{
@ -58,6 +56,8 @@ static void ShowCiphers(void)
printf("%s\n", ciphers);
}
#endif
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
@ -146,8 +146,6 @@ void tls_smp_server_task()
WOLFSSL_MSG("Debug ON");
wolfSSL_Debugging_ON();
ShowCiphers();
#else
(void)ShowCiphers;
#endif
/* Initialize wolfSSL */

View File

@ -11,6 +11,7 @@ set(INCLUDE_PATH ${WOLFSSL_ROOT})
set(COMPONENT_SRCDIRS "./src/"
"./wolfcrypt/src/"
"./wolfcrypt/src/port/Espressif/"
"./wolfcrypt/src/port/atmel/"
)
set(COMPONENT_REQUIRES lwip)

View File

@ -44,10 +44,16 @@
#define CURVE25519_SMALL
#define HAVE_ED25519
/* when you want to use a custom slot allocation for ATECC608A */
/* unless your configuration is unusual, you can use default */
/* implementation. */
/* #define CUSTOM_SLOT_ALLOCATION */
/* esp32-wroom-32se specific definition */
#if defined(WOLFSSL_ESPWROOM32SE)
#define WOLFSSL_ATECC508A
#define HAVE_PK_CALLBACKS
/* when you want to use a custom slot allocation for ATECC608A */
/* unless your configuration is unusual, you can use default */
/* implementation. */
/* #define CUSTOM_SLOT_ALLOCATION */
#endif
/* debug options */
/* #define DEBUG_WOLFSSL */

View File

@ -1,6 +1,6 @@
/* logging.c
*
* Copyright (C) 2006-2017 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -255,8 +255,7 @@ static void wolfssl_log(const int logLevel, const char *const logMessage)
#elif defined(WOLFSSL_APACHE_MYNEWT)
LOG_DEBUG(&mynewt_log, LOG_MODULE_DEFAULT, "%s\n", logMessage);
#elif defined(WOLFSSL_ESPIDF)
extern char* TAG;
ESP_LOGI(TAG, "%s", logMessage);
ESP_LOGI("wolfssl", "%s", logMessage);
#else
fprintf(stderr, "%s\n", logMessage);
#endif

View File

@ -241,11 +241,6 @@
#define WOLFSSL_ESP32WROOM32_CRYPT
#endif
#endif
#if defined(WOLFSSL_ESPWROOM32SE)
/* esp32-wroom-32se specific definition */
#define WOLFSSL_ATECC508A
#define HAVE_PK_CALLBACKS
#endif
#if !defined(WOLFSSL_USER_SETTINGS)
#define HAVE_ECC
#endif /* !WOLFSSL_USER_SETTINGS */