aboutsummaryrefslogtreecommitdiffstats
path: root/modules/websocket.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2025-04-05 13:16:24 +0100
committerGravatar Sadie Powell2025-04-06 00:35:36 +0100
commite276c7084d4d330370454adfea40679e9c3cd874 (patch)
treed346b73752c858a060a8cb20cf0b8fdaa4f69c87 /modules/websocket.cpp
parentRequire an exact server name in <sasl:target>. (diff)
Add the new hashing interface, port consumer modules to use it.
Diffstat (limited to 'modules/websocket.cpp')
-rw-r--r--modules/websocket.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/websocket.cpp b/modules/websocket.cpp
index e84e7c237..c3ce269fb 100644
--- a/modules/websocket.cpp
+++ b/modules/websocket.cpp
@@ -23,7 +23,7 @@
#include "inspircd.h"
#include "extension.h"
#include "iohook.h"
-#include "modules/hash.h"
+#include "modules/newhash.h"
#include "modules/isupport.h"
#include "modules/whois.h"
#include "utility/string.h"
@@ -47,13 +47,13 @@ struct SharedData final
StringExtItem realip;
// A reference to the SHA-1 provider.
- dynamic_reference_nocheck<HashProvider> sha1;
+ Hash::ProviderRef sha1;
SharedData(Module* mod)
: origin(mod, "websocket-origin", ExtensionType::USER, true)
, realhost(mod, "websocket-realhost", ExtensionType::USER, true)
, realip(mod, "websocket-realip", ExtensionType::USER, true)
- , sha1(mod, "hash/sha1")
+ , sha1(mod, "sha1")
{
}
};
@@ -553,7 +553,7 @@ class WebSocketHook final
key.append(MagicGUID);
std::string reply = "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: ";
- reply.append(Base64::Encode((*g_data->sha1)->GenerateRaw(key), nullptr, '=')).append(newline);
+ reply.append(Base64::Encode((*g_data->sha1)->Hash(key), nullptr, '=')).append(newline);
if (!selectedproto.empty())
reply.append("Sec-WebSocket-Protocol: ").append(selectedproto).append(newline);
reply.append(newline);