From 176a94313edafd2484d50fabc37f50d255a74b82 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Fri, 31 Mar 2023 22:31:27 +0000 Subject: [PATCH] REALITY protocol: Set the fourth byte as reserved --- tls.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tls.go b/tls.go index afb99eb..aecb5a0 100644 --- a/tls.go +++ b/tls.go @@ -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)