From 6af93cd2bd89d38ade8d9384fe3798aed1a38a65 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sat, 4 Feb 2023 20:48:57 -0500 Subject: Remove uses of pkg/errors Signed-off-by: Dave Henderson --- crypto/pbkdf2.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crypto') 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 } -- cgit v1.2.3