Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Commit 0e4e35a

Browse files
committed
Fix bug handling UDP OTA.
1 parent 789556a commit 0e4e35a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

shadowsocks/udp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ func (c *SecurePacketConn) WriteTo(b []byte, dst net.Addr) (n int, err error) {
9292
packetLen := len(b) + len(iv)
9393

9494
if c.ota {
95+
b[idType] |= OneTimeAuthMask
9596
packetLen += lenHmacSha1
9697
key := cipher.key
9798
actualHmacSha1Buf := HmacSha1(append(iv, key...), b)

shadowsocks/udprelay.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ func handleUDPConnection(handle *SecurePacketConn, n int, src net.Addr, receive
168168
if addrType&OneTimeAuthMask > 0 {
169169
ota = true
170170
}
171+
receive[idType] &= ^OneTimeAuthMask
171172
compatiblemode := !handle.IsOta() && ota
172173

173174
switch addrType & AddrMask {

0 commit comments

Comments
 (0)