mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-22 21:15:35 +03:00
5ff7cdbac8
Merge in DNS/adguard-home from fix-chlog to master Squashed commit of the following: commit e69da2f574923b95ac3d0fa9057fffe2a716b5be Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Jan 26 14:41:04 2022 +0300 all: fix chlog, imp
30 lines
883 B
Go
30 lines
883 B
Go
// Package aghtls contains utilities for work with TLS.
|
|
package aghtls
|
|
|
|
import "crypto/tls"
|
|
|
|
// SaferCipherSuites returns a set of default cipher suites with vulnerable and
|
|
// weak cipher suites removed.
|
|
func SaferCipherSuites() (safe []uint16) {
|
|
for _, s := range tls.CipherSuites() {
|
|
switch s.ID {
|
|
case
|
|
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
|
|
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
|
|
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
|
|
tls.TLS_RSA_WITH_AES_128_CBC_SHA256,
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
|
|
tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
|
|
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
|
|
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
|
|
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:
|
|
// Less safe 3DES and CBC suites, go on.
|
|
default:
|
|
safe = append(safe, s.ID)
|
|
}
|
|
}
|
|
|
|
return safe
|
|
}
|