QR2: Fix wrong mutex used

This commit is contained in:
mkwcat 2024-02-01 20:51:21 -05:00
parent 0cbf5e431c
commit 0edfa96b92
No known key found for this signature in database
GPG Key ID: 7A505679CE9E7AA9

View File

@ -120,9 +120,6 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) {
case ClientMessageAckRequest:
logging.Info(moduleName, "Command:", aurora.Yellow("CLIENT_MESSAGE_ACK"))
mutex.Lock()
defer mutex.Unlock()
// In case ClientExploitReply is lost, this can be checked as well
// This would be sent either after the payload is downloaded, or the client is already patched
session.ExploitReceived = true
@ -130,16 +127,15 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) {
login.NeedsExploit = false
}
session.MessageMutex.Lock()
session.MessageAckWaker.Assert()
session.MessageMutex.Unlock()
return
case KeepAliveRequest:
logging.Info(moduleName, "Command:", aurora.Yellow("KEEPALIVE"))
conn.WriteTo(createResponseHeader(KeepAliveRequest, 0), addr)
mutex.Lock()
defer mutex.Unlock()
session.LastKeepAlive = time.Now().Unix()
return
@ -155,9 +151,6 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) {
case ClientExploitReply:
logging.Info(moduleName, "Command:", aurora.Yellow("CLIENT_EXPLOIT_ACK"))
mutex.Lock()
defer mutex.Unlock()
session.ExploitReceived = true
if login := session.Login; login != nil {
login.NeedsExploit = false