1
0
mirror of https://github.com/securego/gosec.git synced 2025-06-14 23:45:03 +02:00

Reset the state of TLS rule after each version check (#570)

Signed-off-by: Cosmin Cojocar <ccojocar@cloudbees.com>
This commit is contained in:
Cosmin Cojocar
2021-02-11 10:52:16 +01:00
committed by GitHub
parent 6c57ae1628
commit 897c203e62
3 changed files with 27 additions and 2 deletions

View File

@ -2057,7 +2057,24 @@ func main() {
if err != nil {
fmt.Println(err)
}
}`}, 0, gosec.NewConfig()}}
}`}, 0, gosec.NewConfig()}, {[]string{`
package p0
import "crypto/tls"
func TlsConfig0() *tls.Config {
var v uint16 = 0
return &tls.Config{MinVersion: v}
}
`, `
package p0
import "crypto/tls"
func TlsConfig1() *tls.Config {
return &tls.Config{MinVersion: 0x0304}
}
`}, 1, gosec.NewConfig()}}
// SampleCodeG403 - weak key strength
SampleCodeG403 = []CodeSample{