changes done as per review comments

This commit is contained in:
Rahul Somasundaram
2022-10-05 00:12:53 +05:30
parent 24eb3476db
commit 15b19ff726
5 changed files with 41 additions and 22 deletions

View File

@@ -34,11 +34,14 @@ func SaferCipherSuites() (safe []uint16) {
return safe
}
func UserPreferredCipherSuites(ciphers []string) (userCiphers []uint16) {
// ParseCipherIDs returns a set of cipher suites with the cipher names provided
func ParseCipherIDs(ciphers []string) (userCiphers []uint16) {
for _, s := range tls.CipherSuites() {
if slices.Contains(ciphers, s.Name) {
userCiphers = append(userCiphers, s.ID)
log.Debug("user specified cipher : %s, ID : %d", s.Name, s.ID)
} else {
log.Error("unknown cipher : %s ", s)
}
}