Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP support for chrome 119 #3

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tls/u_tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tls
import (
"bytes"
"compress/zlib"
//"encoding/hex"
"fmt"
"io"

Expand All @@ -16,6 +17,7 @@ const (
extensionEMS uint16 = 23
extensionCompressCertificate uint16 = 27
extensionApplicationSetting uint16 = 0x4469
extensionECH uint16 = 0xfe0d // Unknown type 65037
)

const (
Expand Down Expand Up @@ -299,6 +301,21 @@ func transformClientHello(mRaw []byte, noGreaseKeyshare bool) []byte {
b.AddUint16(BoringGrease(random, ssl_grease_extension1))
b.AddUint16(0x0000)

b.AddUint16(extensionStatusRequest)
b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
b.AddUint8(1) // status_type = ocsp
b.AddUint16(0) // empty responder_id_list
b.AddUint16(0) // empty request_extensions
})

/*
b.AddUint16(extensionECH)
b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
h, _ := hex.DecodeString("0000010001630020c4e7a7065a0b30728687f639a13136972e642bf192277508e88c3c2ea1a9824f00b0ddea441241f9211290af1bf57d17e327bf97842f074145b558f0f41afd8b60a0ea52fda19aaeb60a0254633577a2ca7ae68421b4c664038c31af05e7af14dadcddc53b9b0c7b9ceeb4ed8eafdcbd9657c94e0e9821c2690cf81a3d906e3b0f27ab525aaf59d94a3aac0ec9812c4b09ff8be446ef182f45ee92e37578ef60bef71e44cd10055d0310a5b51c59a8370decbcadc5095a9fc665460804f71a552a2514ba6d8ea71dccbf01de2d0e552d871b")
b.AddBytes(h)
})
*/

if len(sniExtensionData) > 0 {
b.AddUint16(extensionServerName)
b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
Expand Down Expand Up @@ -368,6 +385,7 @@ func transformClientHello(mRaw []byte, noGreaseKeyshare bool) []byte {
if !noGreaseKeyshare {
b.AddUint16(BoringGrease(random, ssl_grease_group))
b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
b.AddUint16(1)
b.AddUint8(0)
})
}
Expand Down