Skip to content

Commit 18caddb

Browse files
committed
gosec: justify SHA1 usage with #nosec annotations
1 parent b61829b commit 18caddb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/icingadb-migrate/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"context"
5-
"crypto/sha1"
5+
"crypto/sha1" // #nosec G505 -- used as a non-cryptographic hash function to hash IDs
66
"database/sql"
77
_ "embed"
88
"encoding/hex"

cmd/icingadb-migrate/misc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"context"
5-
"crypto/sha1"
5+
"crypto/sha1" // #nosec G505 -- used as a non-cryptographic hash function to hash IDs
66
"github.com/icinga/icinga-go-library/database"
77
"github.com/icinga/icinga-go-library/objectpacker"
88
"github.com/icinga/icinga-go-library/types"
@@ -54,7 +54,7 @@ var objectTypes = map[uint8]string{1: "host", 2: "service"}
5454

5555
// hashAny combines objectpacker.PackAny and SHA1 hashing.
5656
func hashAny(in interface{}) []byte {
57-
hash := sha1.New()
57+
hash := sha1.New() // #nosec G401 -- used as a non-cryptographic hash function to hash IDs
5858
if err := objectpacker.PackAny(in, hash); err != nil {
5959
panic(err)
6060
}

0 commit comments

Comments
 (0)