gosec: G505, G401 - crypto/sha1 module
Disabling G505 and G401 gosec rules on specific lines on internal/storage/storage.go to be able to use sha1 algorithm.
This commit is contained in:
parent
eb3fa3e5d4
commit
b9f1ccbdf1
1 changed files with 4 additions and 0 deletions
|
|
@ -4,6 +4,8 @@ package store
|
|||
|
||||
import (
|
||||
"crypto/rand"
|
||||
// The use of SHA1 is valid here
|
||||
/* #nosec G505 */
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
|
|
@ -90,6 +92,8 @@ func New(stateDir *string, arch distro.Arch, log *log.Logger) *Store {
|
|||
}
|
||||
|
||||
func randomSHA1String() (string, error) {
|
||||
// The use of SHA1 is accepted here
|
||||
/* #nosec G401 */
|
||||
hash := sha1.New()
|
||||
data := make([]byte, 20)
|
||||
n, err := rand.Read(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue