pkg/util: Replace custom pbkdf2 implementation by maintained version (#19941)

This commit is contained in:
Stephan Eicher
2019-11-06 10:03:10 +02:00
committed by Sofia Papagiannaki
parent 31e7e35bff
commit 8cf75b4e75
3 changed files with 5 additions and 54 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"crypto/rand"
"crypto/sha256"
"errors"
"golang.org/x/crypto/pbkdf2"
"io"
)
@@ -73,5 +74,5 @@ func Encrypt(payload []byte, secret string) ([]byte, error) {
// Key needs to be 32bytes
func encryptionKeyToBytes(secret, salt string) ([]byte, error) {
return PBKDF2([]byte(secret), []byte(salt), 10000, 32, sha256.New)
return pbkdf2.Key([]byte(secret), []byte(salt), 10000, 32, sha256.New), nil
}