]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: add linkname comments dropped from CL 587220
authorRuss Cox <rsc@golang.org>
Thu, 23 May 2024 02:01:35 +0000 (22:01 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 29 May 2024 16:25:28 +0000 (16:25 +0000)
A bad merge syncing before the submit of CL 587220 dropped these.
(I forgot to write the file out.)

For #67401.

Change-Id: I6f2ba69f388907f3d24eeef55c80cbb2cf51f580
Reviewed-on: https://go-review.googlesource.com/c/go/+/587755
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Marten Seemann <martenseemann@gmail.com>
src/crypto/tls/defaults.go

index df64def63d10cec5508953fc95b954e3e0eca38c..ef1a6137da32b1c4d9ff55582d42074c69a06924 100644 (file)
@@ -7,6 +7,7 @@ package tls
 import (
        "internal/godebug"
        "slices"
+       _ "unsafe" // for linkname
 )
 
 // Defaults are collected in this file to allow distributions to more easily patch
@@ -56,12 +57,31 @@ func defaultCipherSuites() []uint16 {
 // defaultCipherSuitesTLS13 is also the preference order, since there are no
 // disabled by default TLS 1.3 cipher suites. The same AES vs ChaCha20 logic as
 // cipherSuitesPreferenceOrder applies.
+//
+// defaultCipherSuitesTLS13 should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+//   - github.com/quic-go/quic-go
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname defaultCipherSuitesTLS13
 var defaultCipherSuitesTLS13 = []uint16{
        TLS_AES_128_GCM_SHA256,
        TLS_AES_256_GCM_SHA384,
        TLS_CHACHA20_POLY1305_SHA256,
 }
 
+// defaultCipherSuitesTLS13NoAES should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+//   - github.com/quic-go/quic-go
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname defaultCipherSuitesTLS13NoAES
 var defaultCipherSuitesTLS13NoAES = []uint16{
        TLS_CHACHA20_POLY1305_SHA256,
        TLS_AES_128_GCM_SHA256,