Skip to content
Draft
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 @@ -646,11 +646,12 @@ var (
// Chrome w/ New ALPS codepoint
HelloChrome_133 = ClientHelloID{helloChrome, "133", nil, nil}

HelloIOS_Auto = HelloIOS_14
HelloIOS_Auto = HelloIOS_27
HelloIOS_11_1 = ClientHelloID{helloIOS, "111", nil, nil} // legacy "111" means 11.1
HelloIOS_12_1 = ClientHelloID{helloIOS, "12.1", nil, nil}
HelloIOS_13 = ClientHelloID{helloIOS, "13", nil, nil}
HelloIOS_14 = ClientHelloID{helloIOS, "14", nil, nil}
HelloIOS_27 = ClientHelloID{helloIOS, "27", nil, nil}

HelloAndroid_11_OkHttp = ClientHelloID{helloAndroid, "11", nil, nil}

Expand Down
39 changes: 39 additions & 0 deletions u_ios_profile_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package tls

import (
"net"
"testing"
)

func TestIOSKeyShares(t *testing.T) {
for _, tc := range []struct {
id ClientHelloID
wantHybrid bool
}{
{HelloIOS_Auto, true},
{HelloIOS_14, false},
} {
conn := UClient(&net.TCPConn{}, &Config{ServerName: "example.com"}, tc.id)
if err := conn.BuildHandshakeState(); err != nil {
t.Fatal(err)
}
shares := conn.HandshakeState.Hello.KeyShares
var groups []CurveID
for _, share := range shares {
if !isGREASEUint16(uint16(share.Group)) {
groups = append(groups, share.Group)
}
}
if tc.wantHybrid {
if len(groups) < 2 || groups[0] != X25519MLKEM768 || groups[1] != X25519 {
t.Fatalf("%s: unexpected key shares %v", tc.id.Str(), groups)
}
} else {
for _, group := range groups {
if group == X25519MLKEM768 {
t.Fatalf("%s: legacy profile gained a hybrid key share", tc.id.Str())
}
}
}
}
}
2 changes: 1 addition & 1 deletion u_parrots.go
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,7 @@ func utlsIdToSpec(id ClientHelloID) (ClientHelloSpec, error) {
},
},
}, nil
case HelloSafari_26_3:
case HelloSafari_26_3, HelloIOS_27:
return ClientHelloSpec{
TLSVersMin: VersionTLS12,
TLSVersMax: VersionTLS13,
Expand Down