summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/caddyauth/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/caddyauth/command.go')
-rw-r--r--modules/caddyhttp/caddyauth/command.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/caddyhttp/caddyauth/command.go b/modules/caddyhttp/caddyauth/command.go
index a0e971e..f445f67 100644
--- a/modules/caddyhttp/caddyauth/command.go
+++ b/modules/caddyhttp/caddyauth/command.go
@@ -25,8 +25,6 @@ import (
"github.com/caddyserver/caddy/v2"
caddycmd "github.com/caddyserver/caddy/v2/cmd"
- "golang.org/x/crypto/bcrypt"
- "golang.org/x/crypto/scrypt"
"golang.org/x/crypto/ssh/terminal"
)
@@ -116,11 +114,11 @@ func cmdHashPassword(fs caddycmd.Flags) (int, error) {
var hash []byte
switch algorithm {
case "bcrypt":
- hash, err = bcrypt.GenerateFromPassword(plaintext, 14)
+ hash, err = BcryptHash{}.Hash(plaintext, nil)
case "scrypt":
def := ScryptHash{}
def.SetDefaults()
- hash, err = scrypt.Key(plaintext, salt, def.N, def.R, def.P, def.KeyLength)
+ hash, err = def.Hash(plaintext, salt)
default:
return caddy.ExitCodeFailedStartup, fmt.Errorf("unrecognized hash algorithm: %s", algorithm)
}