summaryrefslogtreecommitdiff
path: root/internal/configfile
diff options
context:
space:
mode:
Diffstat (limited to 'internal/configfile')
-rw-r--r--internal/configfile/kdf.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/configfile/kdf.go b/internal/configfile/kdf.go
index f1a7a40..e77a743 100644
--- a/internal/configfile/kdf.go
+++ b/internal/configfile/kdf.go
@@ -1,13 +1,14 @@
package configfile
import (
- "fmt"
+ "log"
"math"
"os"
"golang.org/x/crypto/scrypt"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
+ "github.com/rfjakob/gocryptfs/internal/toggledlog"
)
const (
@@ -31,7 +32,7 @@ func NewScryptKdf(logN int) scryptKdf {
s.N = 1 << ScryptDefaultLogN
} else {
if logN < 10 {
- fmt.Println("Error: scryptn below 10 is too low to make sense. Aborting.")
+ toggledlog.Fatal.Println("Error: scryptn below 10 is too low to make sense. Aborting.")
os.Exit(1)
}
s.N = 1 << uint32(logN)
@@ -45,7 +46,7 @@ func NewScryptKdf(logN int) scryptKdf {
func (s *scryptKdf) DeriveKey(pw string) []byte {
k, err := scrypt.Key([]byte(pw), s.Salt, s.N, s.R, s.P, s.KeyLen)
if err != nil {
- panic(fmt.Sprintf("DeriveKey failed: %s", err.Error()))
+ log.Panicf("DeriveKey failed: %v", err)
}
return k
}