Skip to content

Commit

Permalink
REALITY protocol: Set the fourth byte as reserved
Browse files Browse the repository at this point in the history
  • Loading branch information
RPRX authored Mar 31, 2023
1 parent d3d3761 commit 176a943
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,8 @@ func Server(ctx context.Context, conn net.Conn, config *Config) (*Conn, error) {
}
copy(hs.clientHello.sessionId, ciphertext)
copy(hs.c.ClientVer[:], plainText)
hs.c.ClientTime = time.Unix(int64(binary.BigEndian.Uint32(plainText[4:])), 0)
copy(hs.c.ClientShortId[:], plainText[8:])
plainText[0] = 0
plainText[1] = 0
plainText[2] = 0
hs.c.ClientTime = time.Unix(int64(binary.BigEndian.Uint64(plainText)), 0)
if config.Show {
fmt.Printf("REALITY remoteAddr: %v\ths.c.ClientVer: %v\n", remoteAddr, hs.c.ClientVer)
fmt.Printf("REALITY remoteAddr: %v\ths.c.ClientTime: %v\n", remoteAddr, hs.c.ClientTime)
Expand Down

0 comments on commit 176a943

Please sign in to comment.