summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2023-02-04 20:48:57 -0500
committerDave Henderson <dhenderson@gmail.com>2023-02-04 21:16:18 -0500
commit6af93cd2bd89d38ade8d9384fe3798aed1a38a65 (patch)
tree5a505a798217963cd8aa89e54767cd1a8d38feea /crypto
parent08d70cf321ffede08205594ae4e7633f944647da (diff)
Remove uses of pkg/errors
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/pbkdf2.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/pbkdf2.go b/crypto/pbkdf2.go
index 683194ba..d5217429 100644
--- a/crypto/pbkdf2.go
+++ b/crypto/pbkdf2.go
@@ -5,10 +5,9 @@ import (
"crypto/sha1" //nolint: gosec
"crypto/sha256"
"crypto/sha512"
+ "fmt"
"hash"
- "github.com/pkg/errors"
-
"golang.org/x/crypto/pbkdf2"
)
@@ -43,7 +42,7 @@ func StrToHash(hash string) (crypto.Hash, error) {
case "SHA512_256", "SHA512/256", "SHA-512_256", "SHA-512/256":
return crypto.SHA512_256, nil
}
- return 0, errors.Errorf("no such hash %s", hash)
+ return 0, fmt.Errorf("no such hash %s", hash)
}
// PBKDF2 - Run the Password-Based Key Derivation Function #2 as defined in
@@ -51,7 +50,7 @@ func StrToHash(hash string) (crypto.Hash, error) {
func PBKDF2(password, salt []byte, iter, keylen int, hashFunc crypto.Hash) ([]byte, error) {
h, ok := hashFuncs[hashFunc]
if !ok {
- return nil, errors.Errorf("hashFunc not supported: %v", hashFunc)
+ return nil, fmt.Errorf("hashFunc not supported: %v", hashFunc)
}
return pbkdf2.Key(password, salt, iter, keylen, h), nil
}