From 4be40bc5fa84f5d8e821562cc248a19c09380b0e Mon Sep 17 00:00:00 2001 From: asez73 Date: Tue, 15 Dec 2015 11:41:29 +0100 Subject: [PATCH] Skip ':' inside SHA1 signatures in WiFiClientSecure.cpp . Improves the convenience of the verification of fingerprints. As ':' are commonly inserted by web browser inside the SHA1 of https web sites, this created false problems with signatures "not matching". Now, copied and pasted signature from Firefox simply because the verify function will skipped them... --- libraries/ESP8266WiFi/src/WiFiClientSecure.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp index f141a0909..a35a25ad0 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp @@ -327,7 +327,7 @@ bool WiFiClientSecure::verify(const char* fp, const char* url) { int len = strlen(fp); int pos = 0; for (size_t i = 0; i < sizeof(sha1); ++i) { - while (pos < len && fp[pos] == ' ') { + while (pos < len && ((fp[pos] == ' ') || (fp[pos] == ':'))) { ++pos; } if (pos > len - 2) {