summaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/pwhash/pwhash.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/pwhash/pwhash.go b/internal/pwhash/pwhash.go
index a17ed2e..7bc62d4 100644
--- a/internal/pwhash/pwhash.go
+++ b/internal/pwhash/pwhash.go
@@ -12,11 +12,11 @@ func HashIter(password string, salt []byte, iter int) ([]byte, error) {
return pbkdf2.Key(sha256.New, password, salt, iter, 32)
}
-func Hash(password string, salt []byte) ([]byte, error) {
+func Hash(password string, salt []byte) (key, pwhash []byte, err error) {
hashed, err := HashIter(password, salt, defaultIterations)
if err != nil {
- return nil, err
+ return nil, nil, err
}
sha := sha512.Sum512(hashed)
- return sha[:], nil
+ return hashed, sha[:], nil
}