Skip to content

Commit

Permalink
Merge branch 'contrib/github_pr_11923' into 'master'
Browse files Browse the repository at this point in the history
fix(esp-tls): fix pointer cast and condition for CONFIG_ATECC608A_TCUSTOM (GitHub PR)

Closes IDFGH-10697

See merge request espressif/esp-idf!25348
  • Loading branch information
mahavirj committed Aug 16, 2023
2 parents ef24dd3 + 6704566 commit 29a4b05
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/esp-tls/esp_tls_mbedtls.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -973,8 +973,9 @@ static esp_err_t esp_set_atecc608a_pki_context(esp_tls_t *tls, const void *pki)
}
mbedtls_x509_crt_init(&tls->clientcert);

if(cfg->clientcert_buf != NULL) {
ret = mbedtls_x509_crt_parse(&tls->clientcert, (const unsigned char*)((esp_tls_pki_t *)pki->publiccert_pem_buf), (esp_tls_pki_t *)pki->publiccert_pem_bytes);
esp_tls_pki_t *pki_l = (esp_tls_pki_t *) pki;
if (pki_l->publiccert_pem_buf != NULL) {
ret = mbedtls_x509_crt_parse(&tls->clientcert, pki_l->publiccert_pem_buf, pki_l->publiccert_pem_bytes);
if (ret < 0) {
ESP_LOGE(TAG, "mbedtls_x509_crt_parse of client cert returned -0x%04X", -ret);
mbedtls_print_error_msg(ret);
Expand Down

0 comments on commit 29a4b05

Please sign in to comment.