-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request: all: imp tls cipher selection
Closes #2993. Squashed commit of the following: commit 6c521e5 Author: Ainar Garipov <[email protected]> Date: Tue Jan 25 21:39:48 2022 +0300 all: imp tls cipher selection
- Loading branch information
Showing
7 changed files
with
52 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// 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) { | ||
suites := tls.CipherSuites() | ||
for _, s := range suites { | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters