bazel: patch Go SDK to increase tls maxHandshake size (#3009)

This commit is contained in:
Malte Poll 2024-04-03 14:08:45 +02:00 committed by GitHub
parent 638a94c7c6
commit 24c346c657
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

1
3rdparty/bazel/org_golang/BUILD.bazel vendored Normal file
View File

@ -0,0 +1 @@
exports_files(["go_tls_max_handshake_size.patch"])

View File

@ -0,0 +1,11 @@
--- src/crypto/tls/common.go
+++ src/crypto/tls/common.go
@@ -62,7 +62,7 @@
maxCiphertext = 16384 + 2048 // maximum ciphertext payload length
maxCiphertextTLS13 = 16384 + 256 // maximum ciphertext length in TLS 1.3
recordHeaderLen = 5 // record header length
- maxHandshake = 65536 // maximum handshake we support (protocol max is 16 MB)
+ maxHandshake = 262144 // maximum handshake we support (protocol max is 16 MB)
maxUselessRecords = 16 // maximum number of consecutive non-advancing records
)

View File

@ -165,11 +165,17 @@ load("//bazel/toolchains:go_module_deps.bzl", "go_dependencies")
# gazelle:repository_macro bazel/toolchains/go_module_deps.bzl%go_dependencies
go_dependencies()
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies")
go_download_sdk(
name = "go_sdk",
patches = ["//3rdparty/bazel/org_golang:go_tls_max_handshake_size.patch"],
version = "1.22.1",
)
go_rules_dependencies()
go_register_toolchains(version = "1.22.1")
go_register_toolchains()
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")