parent
8932666701
commit
e40eefae10
87
xray-core/patches/010-compatible-with-go-1.18+.patch
Normal file
87
xray-core/patches/010-compatible-with-go-1.18+.patch
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
diff --git a/common/protocol/quic/qtls_go118.go b/common/protocol/quic/qtls_go118.go
|
||||||
|
index e701adf..429037d 100644
|
||||||
|
--- a/common/protocol/quic/qtls_go118.go
|
||||||
|
+++ b/common/protocol/quic/qtls_go118.go
|
||||||
|
@@ -1,9 +1,11 @@
|
||||||
|
+//go:build go1.18 && !go1.19
|
||||||
|
+
|
||||||
|
package quic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/cipher"
|
||||||
|
|
||||||
|
- "github.com/quic-go/qtls-go1-20"
|
||||||
|
+ "github.com/quic-go/qtls-go1-18"
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
diff --git a/common/protocol/quic/qtls_go119.go b/common/protocol/quic/qtls_go119.go
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..4ab25af
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/common/protocol/quic/qtls_go119.go
|
||||||
|
@@ -0,0 +1,18 @@
|
||||||
|
+//go:build go1.19 && !go1.20
|
||||||
|
+
|
||||||
|
+package quic
|
||||||
|
+
|
||||||
|
+import (
|
||||||
|
+ "crypto/cipher"
|
||||||
|
+
|
||||||
|
+ "github.com/quic-go/qtls-go1-19"
|
||||||
|
+)
|
||||||
|
+
|
||||||
|
+type (
|
||||||
|
+ // A CipherSuiteTLS13 is a cipher suite for TLS 1.3
|
||||||
|
+ CipherSuiteTLS13 = qtls.CipherSuiteTLS13
|
||||||
|
+)
|
||||||
|
+
|
||||||
|
+func AEADAESGCMTLS13(key, fixedNonce []byte) cipher.AEAD {
|
||||||
|
+ return qtls.AEADAESGCMTLS13(key, fixedNonce)
|
||||||
|
+}
|
||||||
|
diff --git a/common/protocol/quic/qtls_go120.go b/common/protocol/quic/qtls_go120.go
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..e182c75
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/common/protocol/quic/qtls_go120.go
|
||||||
|
@@ -0,0 +1,18 @@
|
||||||
|
+//go:build go1.20
|
||||||
|
+
|
||||||
|
+package quic
|
||||||
|
+
|
||||||
|
+import (
|
||||||
|
+ "crypto/cipher"
|
||||||
|
+
|
||||||
|
+ "github.com/quic-go/qtls-go1-20"
|
||||||
|
+)
|
||||||
|
+
|
||||||
|
+type (
|
||||||
|
+ // A CipherSuiteTLS13 is a cipher suite for TLS 1.3
|
||||||
|
+ CipherSuiteTLS13 = qtls.CipherSuiteTLS13
|
||||||
|
+)
|
||||||
|
+
|
||||||
|
+func AEADAESGCMTLS13(key, fixedNonce []byte) cipher.AEAD {
|
||||||
|
+ return qtls.AEADAESGCMTLS13(key, fixedNonce)
|
||||||
|
+}
|
||||||
|
diff --git a/go.mod b/go.mod
|
||||||
|
index 49d8a74..7277794 100644
|
||||||
|
--- a/go.mod
|
||||||
|
+++ b/go.mod
|
||||||
|
@@ -11,6 +11,8 @@ require (
|
||||||
|
github.com/miekg/dns v1.1.50
|
||||||
|
github.com/pelletier/go-toml v1.9.5
|
||||||
|
github.com/pires/go-proxyproto v0.6.2
|
||||||
|
+ github.com/quic-go/qtls-go1-18 v0.2.0
|
||||||
|
+ github.com/quic-go/qtls-go1-19 v0.2.0
|
||||||
|
github.com/quic-go/qtls-go1-20 v0.1.0
|
||||||
|
github.com/quic-go/quic-go v0.32.0
|
||||||
|
github.com/refraction-networking/utls v1.2.0
|
||||||
|
@@ -44,8 +46,6 @@ require (
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
|
||||||
|
github.com/onsi/ginkgo/v2 v2.8.0 // indirect
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
|
- github.com/quic-go/qtls-go1-18 v0.2.0 // indirect
|
||||||
|
- github.com/quic-go/qtls-go1-19 v0.2.0 // indirect
|
||||||
|
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
|
||||||
|
go.uber.org/atomic v1.10.0 // indirect
|
||||||
|
golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect
|
Loading…
Reference in New Issue
Block a user