We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fbcf10 commit 2fad8a4Copy full SHA for 2fad8a4
rules/tls.go
@@ -87,8 +87,17 @@ func (t *insecureConfigTLS) processTLSConfVal(n *ast.KeyValueExpr, c *gosec.Cont
87
}
88
89
case "MinVersion":
90
- if d, ok := n.Value.(*ast.Ident); ok && d.Obj != nil {
91
- if vs, ok := d.Obj.Decl.(*ast.ValueSpec); ok && len(vs.Values) > 0 {
+ if d, ok := n.Value.(*ast.Ident); ok {
+ obj := d.Obj
92
+ if obj == nil {
93
+ for _, f := range c.PkgFiles {
94
+ obj = f.Scope.Lookup(d.Name)
95
+ if obj != nil {
96
+ break
97
+ }
98
99
100
+ if vs, ok := obj.Decl.(*ast.ValueSpec); ok && len(vs.Values) > 0 {
101
if s, ok := vs.Values[0].(*ast.SelectorExpr); ok {
102
x := s.X.(*ast.Ident).Name
103
sel := s.Sel.Name
0 commit comments