Skip to content

Commit

Permalink
Remove obsolete BSSL debug print routines (#5368)
Browse files Browse the repository at this point in the history
Fixes #5356
  • Loading branch information
earlephilhower authored Nov 23, 2018
1 parent 016f3b8 commit 19a0a0b
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,68 +1373,4 @@ bool WiFiClientSecure::loadPrivateKey(Stream& stream, size_t size) {
return ret;
}




// Debug printout helpers for BearSSL library when libbearssl.a is compiled in debug mode
// This is really only for debugging the core BearSSL library itself, and not the IDE
// SSL debugging which should focus on the WiFiClientBearSSL objects.

extern "C" {

#if CORE_MOCK

void br_esp8266_stack_proxy_init(uint8_t *space, uint16_t size) {
(void)space;
(void)size;
}
void _BearSSLCheckStack(const char *fcn, const char *file, int line) {
(void)fcn;
(void)file;
(void)line;
}

#else // !CORE_MOCK

extern size_t br_esp8266_stack_proxy_usage();

void _BearSSLCheckStack(const char *fcn, const char *file, int line) {
static int cnt = 0;
register uint32_t *sp asm("a1");
int freestack = 4 * (sp - g_pcont->stack);
int freeheap = ESP.getFreeHeap();
static int laststack, lastheap, laststack2;
if ((laststack != freestack) || (lastheap != freeheap) || (laststack2 != (int)br_esp8266_stack_proxy_usage())) {
Serial.printf("%s:%s(%d): FREESTACK=%d, STACK2USAGE=%zd, FREEHEAP=%d\n", file, fcn, line, freestack, br_esp8266_stack_proxy_usage(), freeheap);
if (freestack < 256) {
Serial.printf("!!! Out of main stack space\n");
}
if (freeheap < 1024) {
Serial.printf("!!! Out of heap space\n");
}
Serial.flush();
laststack = freestack;
lastheap = freeheap;
laststack2 = (int)br_esp8266_stack_proxy_usage();
}
// BearSSL debug can get very chatty, add yields to avoid WDT
if (cnt == 100) {
yield();
cnt++;
}
}

#endif // !CORE_MOCK

void _BearSSLSerialPrint(const char *str) {
static int cnt = 0;
Serial.printf("%s", str);
// BearSSL debug can get very chatty, add yields to avoid WDT
if (cnt == 100) {
yield();
cnt++;
}
}
};

};

0 comments on commit 19a0a0b

Please sign in to comment.