gosec/testutils/g506_samples.go
Dimitar Banchev 9a4a741e6b Added more rules
* Rule G406 responsible for the usage of deprecated MD4 and RIPEMD160 added.
* Rules G506, G507 responsible for tracking the usage of the already mentioned libraries added.
* Slight changes in the Makefile(`make clean` wasn't removing all expected files)
* Added license to `analyzer_test.go`
2024-06-25 13:18:27 +02:00

23 lines
357 B
Go

package testutils
import "github.com/securego/gosec/v2"
// SampleCodeG506 - Blocklisted import MD4
var SampleCodeG506 = []CodeSample{
{[]string{`
package main
import (
"encoding/hex"
"fmt"
"golang.org/x/crypto/md4"
)
func main() {
h := md4.New()
h.Write([]byte("test"))
fmt.Println(hex.EncodeToString(h.Sum(nil)))
}
`}, 1, gosec.NewConfig()},
}