REALITY practice: Support X25519MLKEM768 for TLS' communication

https://github.com/XTLS/Xray-core/pull/3813#issuecomment-2873889724
This commit is contained in:
RPRX 2025-05-16 04:08:38 +00:00 committed by GitHub
parent 882975ce5a
commit 7ddc4a2525
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

2
go.mod
View file

@ -20,7 +20,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e
github.com/vishvananda/netlink v1.3.1
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d
github.com/xtls/reality v0.0.0-20250513125209-514f8647eac0
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
golang.org/x/crypto v0.38.0
golang.org/x/net v0.40.0

2
go.sum
View file

@ -78,6 +78,8 @@ github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zd
github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d h1:+B97uD9uHLgAAulhigmys4BVwZZypzK7gPN3WtpgRJg=
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE=
github.com/xtls/reality v0.0.0-20250513125209-514f8647eac0 h1:ou6jXqJ9Ogs0BaEIzuszo1HMBokiKpf7XpNdsVYcvfA=
github.com/xtls/reality v0.0.0-20250513125209-514f8647eac0/go.mod h1:bJdU3ExzfUlY40Xxfibq3THW9IHiE8mHu/tEzud5JWM=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=

View file

@ -163,7 +163,7 @@ func init() {
func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
if name == "" {
return &utls.HelloChrome_120
return &utls.HelloChrome_Auto
}
if fingerprint = PresetFingerprints[name]; fingerprint != nil {
return
@ -179,7 +179,7 @@ func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
var PresetFingerprints = map[string]*utls.ClientHelloID{
// Recommended preset options in GUI clients
"chrome": &utls.HelloChrome_120,
"chrome": &utls.HelloChrome_Auto,
"firefox": &utls.HelloFirefox_Auto,
"safari": &utls.HelloSafari_Auto,
"ios": &utls.HelloIOS_Auto,
@ -206,6 +206,7 @@ var ModernFingerprints = map[string]*utls.ClientHelloID{
"hellochrome_102": &utls.HelloChrome_102,
"hellochrome_106_shuffle": &utls.HelloChrome_106_Shuffle,
"hellochrome_120": &utls.HelloChrome_120,
"hellochrome_131": &utls.HelloChrome_131,
"helloios_13": &utls.HelloIOS_13,
"helloios_14": &utls.HelloIOS_14,
"helloedge_85": &utls.HelloEdge_85,
@ -241,12 +242,11 @@ var OtherFingerprints = map[string]*utls.ClientHelloID{
"hello360_7_5": &utls.Hello360_7_5,
"helloqq_auto": &utls.HelloQQ_Auto,
// reality currently does not support these new fingerprints
// Chrome betas'
"hellochrome_100_psk": &utls.HelloChrome_100_PSK,
"hellochrome_112_psk_shuf": &utls.HelloChrome_112_PSK_Shuf,
"hellochrome_114_padding_psk_shuf": &utls.HelloChrome_114_Padding_PSK_Shuf,
"hellochrome_115_pq": &utls.HelloChrome_115_PQ,
"hellochrome_115_pq_psk": &utls.HelloChrome_115_PQ_PSK,
"hellochrome_120_pq": &utls.HelloChrome_120_PQ,
"hellochrome_131": &utls.HelloChrome_131,
}