From 30648e84ce9c2515994b95b9d1e2e870283ed214 Mon Sep 17 00:00:00 2001 From: Matt Schatz Date: Mon, 20 Jul 2020 20:37:20 -0600 Subject: Fix secure websocket users not being seen as secure. Since a TLS (SSL) module will always be the last IOHook attached to a socket, IsSSL() needs to ignore any Middle IOHooks that may also be attached. --- src/inspsocket.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/inspsocket.cpp') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 6cf3e3008..6172aebe2 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -510,6 +510,18 @@ IOHook* StreamSocket::GetModHook(Module* mod) const return NULL; } +IOHook* StreamSocket::GetLastHook() const +{ + IOHook* curr = GetIOHook(); + IOHook* last = curr; + + for (; curr; curr = GetNextHook(curr)) + last = curr; + + return last; +} + + void StreamSocket::AddIOHook(IOHook* newhook) { IOHook* curr = GetIOHook(); -- cgit v1.3.1-10-gc9f91