From caaff53f9bcead633bfc27d6b4c140d87deec3fc Mon Sep 17 00:00:00 2001 From: wywywywycloud <100153948+wywywywycloud@users.noreply.github.com> Date: Thu, 26 Nov 2026 15:06:32 +0300 Subject: [PATCH] Add the iOS 27 Safari ClientHello and update HelloIOS_Auto --- u_common.go | 3 ++- u_ios_profile_test.go | 39 +++++++++++++++++++++++++++++++++++++++ u_parrots.go | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 u_ios_profile_test.go diff --git a/u_common.go b/u_common.go index 770507c6a1..7df5420cb8 100644 --- a/u_common.go +++ b/u_common.go @@ -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} diff --git a/u_ios_profile_test.go b/u_ios_profile_test.go new file mode 100644 index 0000000000..b361695f09 --- /dev/null +++ b/u_ios_profile_test.go @@ -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()) + } + } + } + } +} diff --git a/u_parrots.go b/u_parrots.go index 425ab6ddda..82b19bb584 100644 --- a/u_parrots.go +++ b/u_parrots.go @@ -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,