From 92a5c34a61066b47ba2d342f3f3b965033a501b6 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 17 May 2021 12:17:20 +0530 Subject: [PATCH] secure_element: Update esp-cryptoauthlib submodule latest version. *This updates the cryptoauthlib version in the esp-cryptoauthlib to cryptoauthlib-v3.3.1 --- components/esp-tls/esp_tls_mbedtls.c | 10 ++++++---- .../atecc608_ecdsa/components/esp-cryptoauthlib | 2 +- .../atecc608_ecdsa/main/ecdsa_example_main.c | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/esp-tls/esp_tls_mbedtls.c b/components/esp-tls/esp_tls_mbedtls.c index 53f10d7de1..10db36338a 100644 --- a/components/esp-tls/esp_tls_mbedtls.c +++ b/components/esp-tls/esp_tls_mbedtls.c @@ -39,7 +39,7 @@ #include "mbedtls/atca_mbedtls_wrap.h" #include "tng_atca.h" #include "cryptoauthlib.h" -static const atcacert_def_t* cert_def = NULL; +static const atcacert_def_t *cert_def = NULL; /* Prototypes for functions */ static esp_err_t esp_set_atecc608a_pki_context(esp_tls_t *tls, esp_tls_cfg_t *cfg); #endif /* CONFIG_ESP_TLS_USE_SECURE_ELEMENT */ @@ -669,9 +669,9 @@ void esp_mbedtls_free_global_ca_store(void) } #ifdef CONFIG_ESP_TLS_USE_SECURE_ELEMENT -static esp_err_t esp_init_atecc608a(uint8_t slave_addr) +static esp_err_t esp_init_atecc608a(uint8_t i2c_addr) { - cfg_ateccx08a_i2c_default.atcai2c.slave_address = slave_addr; + cfg_ateccx08a_i2c_default.atcai2c.address = i2c_addr; int ret = atcab_init(&cfg_ateccx08a_i2c_default); if(ret != 0) { ESP_LOGE(TAG, "Failed\n !atcab_init returned %02x", ret); @@ -683,8 +683,10 @@ static esp_err_t esp_init_atecc608a(uint8_t slave_addr) static esp_err_t esp_set_atecc608a_pki_context(esp_tls_t *tls, esp_tls_cfg_t *cfg) { int ret = 0; - int esp_ret = ESP_FAIL; + esp_err_t esp_ret = ESP_FAIL; ESP_LOGI(TAG, "Initialize the ATECC interface..."); + (void)esp_ret; + (void)cert_def; #if defined(CONFIG_ATECC608A_TNG) || defined(CONFIG_ATECC608A_TFLEX) #ifdef CONFIG_ATECC608A_TNG esp_ret = esp_init_atecc608a(ATECC608A_TNG_SLAVE_ADDR); diff --git a/examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib b/examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib index c3d3a69021..bb672b0437 160000 --- a/examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib +++ b/examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib @@ -1 +1 @@ -Subproject commit c3d3a69021cfec3236ca2c0b63be4048ec6643a4 +Subproject commit bb672b0437485fc7420add178299631692b15ac3 diff --git a/examples/peripherals/secure_element/atecc608_ecdsa/main/ecdsa_example_main.c b/examples/peripherals/secure_element/atecc608_ecdsa/main/ecdsa_example_main.c index eb8d2ce4a6..be379ff3cc 100644 --- a/examples/peripherals/secure_element/atecc608_ecdsa/main/ecdsa_example_main.c +++ b/examples/peripherals/secure_element/atecc608_ecdsa/main/ecdsa_example_main.c @@ -179,10 +179,10 @@ void app_main(void) ret = configure_mbedtls_rng(); #ifdef CONFIG_ATECC608A_TNG ESP_LOGI(TAG, " . Initialize the ATECC interface for Trust & GO ..."); - cfg_ateccx08a_i2c_default.atcai2c.slave_address = 0x6A; + cfg_ateccx08a_i2c_default.atcai2c.address = 0x6A; #elif CONFIG_ATECC608A_TFLEX /* CONFIG_ATECC608A_TNGO */ ESP_LOGI(TAG, " . Initialize the ATECC interface for TrustFlex ..."); - cfg_ateccx08a_i2c_default.atcai2c.slave_address = 0x6C; + cfg_ateccx08a_i2c_default.atcai2c.address = 0x6C; #elif CONFIG_ATECC608A_TCUSTOM /* CONFIG_ATECC608A_TFLEX */ ESP_LOGI(TAG, " . Initialize the ATECC interface for TrustCustom ..."); /* Default slave address is same as that of TCUSTOM ATECC608A chips */