Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/HTTPConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/HTTPConnection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <string>
#include <mbedtls/base64.h>
#include <hwcrypto/sha.h>
#include <mbedtls/sha1.h>
#include <functional>

// Required for sockets
Expand Down
6 changes: 4 additions & 2 deletions src/WebsocketHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "WebsocketHandler.hpp"

#ifndef TAG
#define TAG "ARDUINO"
#endif
namespace httpsserver {

/**
Expand All @@ -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,
Expand Down