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

Commit

Permalink
Fix bug handling UDP OTA.
Browse files Browse the repository at this point in the history
  • Loading branch information
lixin9311 committed Jan 21, 2017
1 parent 789556a commit 0e4e35a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions shadowsocks/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func (c *SecurePacketConn) WriteTo(b []byte, dst net.Addr) (n int, err error) {
packetLen := len(b) + len(iv)

if c.ota {
b[idType] |= OneTimeAuthMask
packetLen += lenHmacSha1
key := cipher.key
actualHmacSha1Buf := HmacSha1(append(iv, key...), b)
Expand Down
1 change: 1 addition & 0 deletions shadowsocks/udprelay.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func handleUDPConnection(handle *SecurePacketConn, n int, src net.Addr, receive
if addrType&OneTimeAuthMask > 0 {
ota = true
}
receive[idType] &= ^OneTimeAuthMask
compatiblemode := !handle.IsOta() && ota

switch addrType & AddrMask {
Expand Down

0 comments on commit 0e4e35a

Please sign in to comment.