Skip to content

Commit a608c5a

Browse files
committed
uTLS: Add new fingerprints
PSK extension, Post-Quantum Key Agreement, ML-KEM
1 parent 0dd74cf commit a608c5a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

transport/internet/reality/reality.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati
137137
if err != nil {
138138
return nil, errors.New("REALITY: publicKey == nil")
139139
}
140-
if uConn.HandshakeState.State13.EcdheKey == nil {
140+
if uConn.HandshakeState.State13.KeyShareKeys.Ecdhe == nil {
141141
return nil, errors.New("Current fingerprint ", uConn.ClientHelloID.Client, uConn.ClientHelloID.Version, " does not support TLS 1.3, REALITY handshake cannot establish.")
142142
}
143-
uConn.AuthKey, _ = uConn.HandshakeState.State13.EcdheKey.ECDH(publicKey)
143+
uConn.AuthKey, _ = uConn.HandshakeState.State13.KeyShareKeys.Ecdhe.ECDH(publicKey)
144144
if uConn.AuthKey == nil {
145145
return nil, errors.New("REALITY: SharedKey == nil")
146146
}

transport/internet/tls/tls.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func init() {
163163

164164
func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
165165
if name == "" {
166-
return &utls.HelloChrome_Auto
166+
return &utls.HelloChrome_120
167167
}
168168
if fingerprint = PresetFingerprints[name]; fingerprint != nil {
169169
return
@@ -179,7 +179,7 @@ func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
179179

180180
var PresetFingerprints = map[string]*utls.ClientHelloID{
181181
// Recommended preset options in GUI clients
182-
"chrome": &utls.HelloChrome_Auto,
182+
"chrome": &utls.HelloChrome_120,
183183
"firefox": &utls.HelloFirefox_Auto,
184184
"safari": &utls.HelloSafari_Auto,
185185
"ios": &utls.HelloIOS_Auto,
@@ -240,4 +240,13 @@ var OtherFingerprints = map[string]*utls.ClientHelloID{
240240
"hello360_auto": &utls.Hello360_Auto,
241241
"hello360_7_5": &utls.Hello360_7_5,
242242
"helloqq_auto": &utls.HelloQQ_Auto,
243+
244+
// reality currently does not support these new fingerprints
245+
"hellochrome_100_psk": &utls.HelloChrome_100_PSK,
246+
"hellochrome_112_psk_shuf": &utls.HelloChrome_112_PSK_Shuf,
247+
"hellochrome_114_padding_psk_shuf": &utls.HelloChrome_114_Padding_PSK_Shuf,
248+
"hellochrome_115_pq": &utls.HelloChrome_115_PQ,
249+
"hellochrome_115_pq_psk": &utls.HelloChrome_115_PQ_PSK,
250+
"hellochrome_120_pq": &utls.HelloChrome_120_PQ,
251+
"hellochrome_131": &utls.HelloChrome_131,
243252
}

0 commit comments

Comments
 (0)