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

Add a test for tls min version defined in a different file

This commit is contained in:
Cosmin Cojocar
2022-01-26 18:13:53 +01:00
parent b12c0f6e4e
commit 1fbcf10e18
2 changed files with 22 additions and 1 deletions

View File

@ -2838,6 +2838,27 @@ func TlsConfig1() *tls.Config {
return &tls.Config{MinVersion: 0x0304}
}
`}, 1, gosec.NewConfig()},
{[]string{`
package main
import (
"crypto/tls"
"fmt"
)
func main() {
cfg := tls.Config{
MinVersion: MinVer,
}
fmt.Println("tls min version", cfg.MinVersion)
}
`, `
package main
import "crypto/tls"
const MinVer = tls.VersionTLS13
`}, 0, gosec.NewConfig()},
}
// SampleCodeG403 - weak key strength