Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion u_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,9 @@ var (
Hello360_7_5 = ClientHelloID{hello360, "7.5", nil, nil}
Hello360_11_0 = ClientHelloID{hello360, "11.0", nil, nil}

HelloQQ_Auto = HelloQQ_11_1
HelloQQ_Auto = HelloQQ_22_5
HelloQQ_11_1 = ClientHelloID{helloQQ, "11.1", nil, nil}
HelloQQ_22_5 = ClientHelloID{helloQQ, "22.5", nil, nil}
)

type Weights struct {
Expand Down
2 changes: 2 additions & 0 deletions u_parrots.go
Original file line number Diff line number Diff line change
Expand Up @@ -2530,6 +2530,8 @@ func utlsIdToSpec(id ClientHelloID) (ClientHelloSpec, error) {
},
},
}, nil
case HelloQQ_22_5:
return utlsIdToSpec(HelloChrome_133)
case HelloQQ_11_1:
return ClientHelloSpec{
TLSVersMin: VersionTLS10,
Expand Down
32 changes: 32 additions & 0 deletions u_qq_profile_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package tls

import (
"net"
"reflect"
"testing"
)

func TestQQ225ClientHello(t *testing.T) {
conn := UClient(&net.TCPConn{}, &Config{ServerName: "example.com"}, HelloQQ_Auto)
if err := conn.BuildHandshakeState(); err != nil {
t.Fatal(err)
}
hello := conn.HandshakeState.Hello
shares := hello.KeyShares
if len(shares) != 3 || !isGREASEUint16(uint16(shares[0].Group)) ||
shares[1].Group != X25519MLKEM768 || len(shares[1].Data) != 1216 ||
shares[2].Group != X25519 || len(shares[2].Data) != 32 {
t.Fatal("unexpected key shares")
}
wantVersions := []uint16{VersionTLS13, VersionTLS12}
if len(hello.SupportedVersions) != len(wantVersions)+1 ||
!isGREASEUint16(hello.SupportedVersions[0]) || !reflect.DeepEqual(hello.SupportedVersions[1:], wantVersions) {
t.Fatalf("unexpected supported versions: %x", hello.SupportedVersions)
}
for _, ext := range conn.Extensions {
if alps, ok := ext.(*ApplicationSettingsExtensionNew); ok && reflect.DeepEqual(alps.SupportedProtocols, []string{"h2"}) {
return
}
}
t.Fatal("missing new ALPS codepoint for h2")
}