From aace0470e707248cc9a0fb0107cc3b7d94caaabb Mon Sep 17 00:00:00 2001 From: jasenk2 Date: Sun, 24 Jul 2022 15:35:24 +0000 Subject: [PATCH 1/3] Update HTTPConnection.hpp Fix header to existing mbedtls/sha1.h one --- src/HTTPConnection.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HTTPConnection.hpp b/src/HTTPConnection.hpp index fb15d7a..bab6150 100644 --- a/src/HTTPConnection.hpp +++ b/src/HTTPConnection.hpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include // Required for sockets From 7aec8fe9c0304a12686b54a3c9c6a2ce435cd822 Mon Sep 17 00:00:00 2001 From: jasenk2 Date: Sun, 24 Jul 2022 15:36:33 +0000 Subject: [PATCH 2/3] Update HTTPConnection.cpp --- src/HTTPConnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HTTPConnection.cpp b/src/HTTPConnection.cpp index 0ab739c..553a36c 100644 --- a/src/HTTPConnection.cpp +++ b/src/HTTPConnection.cpp @@ -664,7 +664,7 @@ void handleWebsocketHandshake(HTTPRequest * req, HTTPResponse * res) { std::string websocketKeyResponseHash(std::string const &key) { std::string newKey = key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; uint8_t shaData[HTTPS_SHA1_LENGTH]; - esp_sha(SHA1, (uint8_t*)newKey.data(), newKey.length(), shaData); + mbedtls_sha1_ret((uint8_t*)newKey.data(), newKey.length(), shaData); // Get output size required for base64 representation size_t b64BufferSize = 0; From 2780e9f4f4654434b90032f5ab51bbdba0479bf4 Mon Sep 17 00:00:00 2001 From: jkolev Date: Sun, 11 Dec 2022 12:07:46 +0200 Subject: [PATCH 3/3] fix tag --- src/WebsocketHandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/WebsocketHandler.cpp b/src/WebsocketHandler.cpp index 5e4c1d1..779f946 100644 --- a/src/WebsocketHandler.cpp +++ b/src/WebsocketHandler.cpp @@ -1,5 +1,7 @@ #include "WebsocketHandler.hpp" - +#ifndef TAG +#define TAG "ARDUINO" +#endif namespace httpsserver { /** @@ -17,7 +19,7 @@ static void dumpFrame(WebsocketFrame frame) { case WebsocketHandler::OPCODE_TEXT: opcode = std::string("TEXT"); break; } ESP_LOGI( - TAG, + "", "Fin: %d, OpCode: %d (%s), Mask: %d, Len: %d", (int)frame.fin, (int)frame.opCode,