From 68f83866bd7269eaaa198188b9ad988ccf2d6019 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 9 Oct 2020 15:11:02 -0700 Subject: [PATCH] Fix error when debug enabled but no port chosen When the debug level for the device includes SSL but the debug port is chosen as "None," don't attempt to write debug messages. Fixes #7638 --- libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp | 2 +- libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp b/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp index 9f3e0ac808..faa34e7a34 100644 --- a/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp @@ -21,7 +21,7 @@ #include -#ifdef DEBUG_ESP_SSL +#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT) #define DEBUG_BSSL(fmt, ...) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__) #else #define DEBUG_BSSL(...) diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp index d482b9cd60..a38909cc01 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp @@ -59,7 +59,7 @@ extern "C" { #endif -#ifdef DEBUG_ESP_SSL +#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT) #define DEBUG_BSSL(fmt, ...) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__) #else #define DEBUG_BSSL(...) @@ -664,7 +664,7 @@ extern "C" { if (!xc->done_cert) { br_sha1_update(&xc->sha1_cert, buf, len); br_x509_decoder_push(&xc->ctx, (const void*)buf, len); -#ifdef DEBUG_ESP_SSL +#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT) DEBUG_BSSL("CERT: "); for (size_t i=0; i