package tls
import (
"internal/godebug"
"slices"
_ "unsafe"
)
var tlsmlkem = godebug .New ("tlsmlkem" )
func defaultCurvePreferences() []CurveID {
if tlsmlkem .Value () == "0" {
return []CurveID {X25519 , CurveP256 , CurveP384 , CurveP521 }
}
return []CurveID {X25519MLKEM768 , X25519 , CurveP256 , CurveP384 , CurveP521 }
}
func defaultSupportedSignatureAlgorithms() []SignatureScheme {
return []SignatureScheme {
PSSWithSHA256 ,
ECDSAWithP256AndSHA256 ,
Ed25519 ,
PSSWithSHA384 ,
PSSWithSHA512 ,
PKCS1WithSHA256 ,
PKCS1WithSHA384 ,
PKCS1WithSHA512 ,
ECDSAWithP384AndSHA384 ,
ECDSAWithP521AndSHA512 ,
PKCS1WithSHA1 ,
ECDSAWithSHA1 ,
}
}
var tlsrsakex = godebug .New ("tlsrsakex" )
var tls3des = godebug .New ("tls3des" )
func supportedCipherSuites(aesGCMPreferred bool ) []uint16 {
if aesGCMPreferred {
return slices .Clone (cipherSuitesPreferenceOrder )
} else {
return slices .Clone (cipherSuitesPreferenceOrderNoAES )
}
}
func defaultCipherSuites(aesGCMPreferred bool ) []uint16 {
cipherSuites := supportedCipherSuites (aesGCMPreferred )
return slices .DeleteFunc (cipherSuites , func (c uint16 ) bool {
return disabledCipherSuites [c ] ||
tlsrsakex .Value () != "1" && rsaKexCiphers [c ] ||
tls3des .Value () != "1" && tdesCiphers [c ]
})
}
var defaultCipherSuitesTLS13 = []uint16 {
TLS_AES_128_GCM_SHA256 ,
TLS_AES_256_GCM_SHA384 ,
TLS_CHACHA20_POLY1305_SHA256 ,
}
var defaultCipherSuitesTLS13NoAES = []uint16 {
TLS_CHACHA20_POLY1305_SHA256 ,
TLS_AES_128_GCM_SHA256 ,
TLS_AES_256_GCM_SHA384 ,
}
The pages are generated with Golds v0.7.7-preview . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .