mirror of
https://github.com/securego/gosec.git
synced 2026-01-15 01:33:41 +08:00
Enable Go 1.18 in the ci and release workflows
* Enable Go 1.18 in the ci and release workflows * Fix lint warning * Add golangci as a make target
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
//go:build go1.14 || !go1.11
|
||||
// +build go1.14 !go1.11
|
||||
|
||||
// main
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -1,34 +0,0 @@
|
||||
//go:build go1.12 && !go1.14
|
||||
// +build go1.12,!go1.14
|
||||
|
||||
// This file can be removed once go1.13 is no longer supported
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"sort"
|
||||
)
|
||||
|
||||
func mapTLSVersions(tlsVersions []string) []int {
|
||||
var versions []int
|
||||
for _, tlsVersion := range tlsVersions {
|
||||
switch tlsVersion {
|
||||
case "TLSv1.3":
|
||||
versions = append(versions, tls.VersionTLS13)
|
||||
case "TLSv1.2":
|
||||
versions = append(versions, tls.VersionTLS12)
|
||||
case "TLSv1.1":
|
||||
versions = append(versions, tls.VersionTLS11)
|
||||
case "TLSv1":
|
||||
versions = append(versions, tls.VersionTLS10)
|
||||
case "SSLv3":
|
||||
// unsupported from go1.14
|
||||
versions = append(versions, tls.VersionSSL30)
|
||||
default:
|
||||
continue
|
||||
}
|
||||
}
|
||||
sort.Ints(versions)
|
||||
return versions
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build go1.12
|
||||
// +build go1.12
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -14,9 +11,10 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/mozilla/tls-observatory/constants"
|
||||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -82,7 +80,8 @@ func getTLSConfFromURL(url string) (*ServerSideTLSJson, error) {
|
||||
}
|
||||
|
||||
func getGoCipherConfig(name string, sstls ServerSideTLSJson) (goCipherConfiguration, error) {
|
||||
cipherConf := goCipherConfiguration{Name: strings.Title(name)}
|
||||
caser := cases.Title(language.English)
|
||||
cipherConf := goCipherConfiguration{Name: caser.String(name)}
|
||||
conf, ok := sstls.Configurations[name]
|
||||
if !ok {
|
||||
return cipherConf, fmt.Errorf("TLS configuration '%s' not found", name)
|
||||
|
||||
Reference in New Issue
Block a user