fix: eliminate stale verdict poisoning, memory leaks, data races, and per-packet allocations in engine
This commit is contained in:
+4
-2
@@ -6,6 +6,8 @@ import (
|
||||
"git.difuse.io/Difuse/Mellaris/analyzer/utils"
|
||||
)
|
||||
|
||||
const maxHandshakeLen = 65536
|
||||
|
||||
var _ analyzer.TCPAnalyzer = (*TLSAnalyzer)(nil)
|
||||
|
||||
type TLSAnalyzer struct{}
|
||||
@@ -123,7 +125,7 @@ func (s *tlsStream) tlsClientHelloPreprocess() utils.LSMAction {
|
||||
}
|
||||
|
||||
s.clientHelloLen = int(header[6])<<16 | int(header[7])<<8 | int(header[8])
|
||||
if s.clientHelloLen < minDataSize {
|
||||
if s.clientHelloLen < minDataSize || s.clientHelloLen > maxHandshakeLen {
|
||||
return utils.LSMActionCancel
|
||||
}
|
||||
|
||||
@@ -167,7 +169,7 @@ func (s *tlsStream) tlsServerHelloPreprocess() utils.LSMAction {
|
||||
}
|
||||
|
||||
s.serverHelloLen = int(header[6])<<16 | int(header[7])<<8 | int(header[8])
|
||||
if s.serverHelloLen < minDataSize {
|
||||
if s.serverHelloLen < minDataSize || s.serverHelloLen > maxHandshakeLen {
|
||||
return utils.LSMActionCancel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user