aboutsummaryrefslogtreecommitdiff
path: root/internal/configfile/scrypt.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-02-18 14:26:54 +0100
committerJakob Unterwurzacher2018-02-18 14:26:54 +0100
commit3b8f5cbb17c964224456bb36b096feafb0e24f44 (patch)
tree1caae8dbf736510b971790b94c1975b325dfe377 /internal/configfile/scrypt.go
parent14c063428dcded6a1060395bb45bf7bd5d185738 (diff)
readpassword: convert from string to []byte
This will allows us to overwrite the password with zeros once we are done with it. https://github.com/rfjakob/gocryptfs/issues/211
Diffstat (limited to 'internal/configfile/scrypt.go')
-rw-r--r--internal/configfile/scrypt.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/configfile/scrypt.go b/internal/configfile/scrypt.go
index b5a3edb..a1caf06 100644
--- a/internal/configfile/scrypt.go
+++ b/internal/configfile/scrypt.go
@@ -61,10 +61,10 @@ func NewScryptKDF(logN int) ScryptKDF {
}
// DeriveKey returns a new key from a supplied password.
-func (s *ScryptKDF) DeriveKey(pw string) []byte {
+func (s *ScryptKDF) DeriveKey(pw []byte) []byte {
s.validateParams()
- k, err := scrypt.Key([]byte(pw), s.Salt, s.N, s.R, s.P, s.KeyLen)
+ k, err := scrypt.Key(pw, s.Salt, s.N, s.R, s.P, s.KeyLen)
if err != nil {
log.Panicf("DeriveKey failed: %v", err)
}