From a0367559a725dec1cc57407585d0d7818f8b7a62 Mon Sep 17 00:00:00 2001 From: cosmincojocar Date: Mon, 12 Mar 2018 09:17:32 +0100 Subject: [PATCH] Fix TLS config template (#191) * Fix TLS config template * Update the log message for unavailable ciphers --- cmd/tlsconfig/rule_template.go | 3 ++- cmd/tlsconfig/tlsconfig.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/tlsconfig/rule_template.go b/cmd/tlsconfig/rule_template.go index 05ed831..bea9c39 100644 --- a/cmd/tlsconfig/rule_template.go +++ b/cmd/tlsconfig/rule_template.go @@ -5,8 +5,9 @@ import "text/template" var generatedRuleTmpl = template.Must(template.New("generated").Parse(` // New{{.Name}}TLSCheck creates a check for {{.Name}} TLS ciphers // DO NOT EDIT - generated by tlsconfig tool -func New{{.Name}}TLSCheck(conf gas.Config) (gas.Rule, []ast.Node) { +func New{{.Name}}TLSCheck(id string, conf gas.Config) (gas.Rule, []ast.Node) { return &insecureConfigTLS{ + MetaData: gas.MetaData{ID: id}, requiredType: "crypto/tls.Config", MinVersion: {{ .MinVersion }}, MaxVersion: {{ .MaxVersion }}, diff --git a/cmd/tlsconfig/tlsconfig.go b/cmd/tlsconfig/tlsconfig.go index 90a324a..94bc387 100644 --- a/cmd/tlsconfig/tlsconfig.go +++ b/cmd/tlsconfig/tlsconfig.go @@ -87,7 +87,7 @@ func getGoCipherConfig(name string, sstls ServerSideTLSJson) (goCipherConfigurat for _, cipherName := range conf.Ciphersuites { cipherSuite, ok := constants.CipherSuites[cipherName] if !ok { - log.Printf("Warning: cannot map cipher '%s'\n", cipherName) + log.Printf("'%s' cipher is not available in crypto/tls package\n", cipherName) } if len(cipherSuite.IANAName) > 0 { cipherConf.Ciphers = append(cipherConf.Ciphers, cipherSuite.IANAName)