mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-05 07:50:24 +08:00
fix(listen): preshard key decode
This commit is contained in:
@@ -62,11 +62,6 @@ func (m *Me) listenthread(conn *net.UDPConn, mu *sync.Mutex) {
|
||||
switch {
|
||||
case p.IsToMe(packet.Dst):
|
||||
packet.Data = p.Decode(uint8(packet.TeaTypeDataSZ>>28), packet.Data)
|
||||
if !packet.IsVaildHash() {
|
||||
logrus.Debugln("[listen] drop invalid hash packet")
|
||||
packet.Put()
|
||||
continue
|
||||
}
|
||||
if p.aead != nil {
|
||||
packet.Data = p.DecodePreshared(packet.AdditionalData(), packet.Data)
|
||||
if packet.Data == nil {
|
||||
@@ -75,6 +70,11 @@ func (m *Me) listenthread(conn *net.UDPConn, mu *sync.Mutex) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if !packet.IsVaildHash() {
|
||||
logrus.Debugln("[listen] drop invalid hash packet")
|
||||
packet.Put()
|
||||
continue
|
||||
}
|
||||
switch packet.Proto {
|
||||
case head.ProtoHello:
|
||||
switch p.status {
|
||||
|
||||
Reference in New Issue
Block a user