From 730cd84662ad20da6e0b54e325619c40d3c3d223 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 16 Apr 2025 11:38:18 +0200 Subject: [PATCH 1/2] BearSSLClient: fix ctor initialization --- src/BearSSLClient.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/BearSSLClient.cpp b/src/BearSSLClient.cpp index 3653d90..77a005b 100644 --- a/src/BearSSLClient.cpp +++ b/src/BearSSLClient.cpp @@ -42,18 +42,9 @@ BearSSLClient::BearSSLClient(Client& client) : } #endif -BearSSLClient::BearSSLClient() : - _noSNI(false) +BearSSLClient::BearSSLClient() +: BearSSLClient(nullptr, nullptr, 0) { - _ecKey.curve = 0; - _ecKey.x = NULL; - _ecKey.xlen = 0; - - for (size_t i = 0; i < BEAR_SSL_CLIENT_CHAIN_SIZE; i++) { - _ecCert[i].data = NULL; - _ecCert[i].data_len = 0; - } - _ecCertDynamic = false; } BearSSLClient::BearSSLClient(Client& client, const br_x509_trust_anchor* myTAs, int myNumTAs) From a891ad3cb15bca3d080adc8188a63277f92fa81c Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 16 Apr 2025 11:39:02 +0200 Subject: [PATCH 2/2] BearSSLClient: use internal verify and sign callbacks by default callbacks are switched to ECC when setECCSlot is called --- src/BearSSLClient.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/BearSSLClient.cpp b/src/BearSSLClient.cpp index 77a005b..23cb8a5 100644 --- a/src/BearSSLClient.cpp +++ b/src/BearSSLClient.cpp @@ -67,13 +67,8 @@ BearSSLClient::BearSSLClient(Client* client, const br_x509_trust_anchor* myTAs, _br_ssl_client_init_function(NULL) #endif { -#ifndef ARDUINO_DISABLE_ECCX08 - _ecVrfy = eccX08_vrfy_asn1; - _ecSign = eccX08_sign_asn1; -#else _ecVrfy = br_ecdsa_vrfy_asn1_get_default(); _ecSign = br_ecdsa_sign_asn1_get_default(); -#endif _ecKey.curve = 0; _ecKey.x = NULL;