mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:04:02 +03:00
Rework antireplay
This commit is contained in:
@@ -80,10 +80,10 @@ func (c *ClientProtocol) Handshake(socket conntypes.StreamReadWriteCloser) (conn
|
||||
}
|
||||
|
||||
antiReplayKey := decryptedFrame.Unique()
|
||||
if antireplay.Has(antiReplayKey) {
|
||||
if antireplay.Cache.Has(antiReplayKey) {
|
||||
return nil, errors.New("Replay attack is detected")
|
||||
}
|
||||
antireplay.Add(antiReplayKey)
|
||||
antireplay.Cache.Add(antiReplayKey)
|
||||
|
||||
return wrappers.NewObfuscated2(socket, encryptor, decryptor), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user