Skip to content

Remove obsolete BSSL debug print routines #5368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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++;
}
}
};

};