mirror of
https://github.com/securego/gosec.git
synced 2024-12-27 04:55:53 +00:00
9a4a741e6b
* 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`
23 lines
375 B
Go
23 lines
375 B
Go
package testutils
|
|
|
|
import "github.com/securego/gosec/v2"
|
|
|
|
// SampleCodeG507 - Blocklisted import RIPEMD160
|
|
var SampleCodeG507 = []CodeSample{
|
|
{[]string{`
|
|
package main
|
|
|
|
import (
|
|
"encoding/hex"
|
|
"fmt"
|
|
|
|
"golang.org/x/crypto/ripemd160"
|
|
)
|
|
|
|
func main() {
|
|
h := ripemd160.New()
|
|
h.Write([]byte("test"))
|
|
fmt.Println(hex.EncodeToString(h.Sum(nil)))
|
|
}
|
|
`}, 1, gosec.NewConfig()},
|
|
}
|