New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support atecc608a on 32se #2034
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Hideki. Excellent work on this. Just a few minor cleanups.
/* proto-type */ | ||
extern void wolf_benchmark_task(); | ||
extern int benchmark_init(); | ||
extern int benchmark_test(void *args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you include wolfcrypt/benchmark/benchmark.h
instead for benchmark_init
and benchmark_test
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included wolfcrypt/benchmark/benchmark.h
Removed benchmark_init() and benchmark_test() proto-type
extern int benchmark_test(void *args); | ||
|
||
#ifdef WOLFSSL_ESPWROOM32SE | ||
const static char* TAG = "wolfbenchmark"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these "TAG", can you just standardize on static const char*
? The static just makes it "private" and it should work for either build type (WOLFSSL_ESPWROOM32SE). Same applies for the other example "TAG" variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for suggestion.
Done.
|
||
#include "wolfssl/wolfcrypt/port/atmel/atmel.h" | ||
|
||
int atcatls_set_callbacks(struct WOLFSSL_CTX* ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function prototype is inwolfssl/wolfcrypt/port/atmel/atmel.h
, so you should not need this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks. Removed.
|
||
#include "wolfssl/wolfcrypt/port/atmel/atmel.h" | ||
|
||
int atcatls_set_callbacks(struct WOLFSSL_CTX* ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function prototype is inwolfssl/wolfcrypt/port/atmel/atmel.h, so you should not need this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
|
||
static void ShowCiphers(void) | ||
{ | ||
static char ciphers[4096]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be static. If its static the compiler will reserve 4096 bytes globally all the time for this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed. And only enabled the function when DEBUG_WOLFSSL is enabled.
|
||
static void ShowCiphers(void) | ||
{ | ||
static char ciphers[4096]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be static. If its static the compiler will reserve 4096 bytes globally all the time for this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. And only enabled the function when DEBUG_WOLFSSL is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server-tls.c:51 still has static and should be removed.
@@ -42,25 +40,115 @@ | |||
#include <wolfssl/wolfcrypt/mem_track.h> | |||
#endif | |||
|
|||
const char *TAG = "tls_client"; | |||
#ifdef WOLFSSL_ESPWROOM32SE | |||
static const char* TAG = "tls_client"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please standardize on static const char*
for either build type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -42,7 +42,87 @@ | |||
#include <wolfssl/wolfcrypt/mem_track.h> | |||
#endif | |||
|
|||
const char *TAG = "tls_server"; | |||
#if defined(WOLFSSL_ESPWROOM32SE) | |||
static const char* TAG = "tls_server"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please standardize on static const char*
for either build type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks.
wolfssl/wolfcrypt/settings.h
Outdated
#ifndef NO_ESP32WROOM32_CRYPT | ||
#define WOLFSSL_ESP32WROOM32_CRYPT | ||
#endif | ||
#endif | ||
#if defined(WOLFSSL_ESPWROOM32SE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps these would be better to have in the example user_settings.h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you. Moved these into user_settings.h
6334000
to
7db485d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Hideki, just a few minor cleanup still remaining and this will be ready.
|
||
static void ShowCiphers(void) | ||
{ | ||
static char ciphers[4096]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server-tls.c:51 still has static and should be removed.
|
||
#include "wolfssl/wolfcrypt/port/atmel/atmel.h" | ||
|
||
int atcatls_set_callbacks(struct WOLFSSL_CTX* ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not need this as its defined in wolfssl/wolfssl/wolfcrypt/port/atmel/atmel.h
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks!
|
||
|
||
ESP_LOGI(TAG, "Start benchmark.."); | ||
wolf_benchmark_task( ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to cleanup this and remove the wolf_benchmark_task
call here and in the benchmark.c and just use benchmark_test(NULL);
below? Also these calls should be wrapped in #ifndef NO_CRYPT_BENCHMARK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to call wolf_benchmark_task() rather than benchmark_test(NULL) here because I'd like to pass arguments. This is nicer for me and user when we want to only see a part of benchmark.
Removed #ifndef WOLFSSL_ESPIDF in wolf_benchmark_task().
Surrounded NO_CRYPT_BENCHARK.
7db485d
to
9879425
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved! Thanks Hideki San. Passing over to Todd for final review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
This PR is a checkpoint to support atecc608a on esp-wroom-32se.