loginsrv

Unnamed repository; edit this file 'description' to name the repository.
git clone git@jamesshield.xyz:repos/loginsrv.git
Log | Files | Refs | README | LICENSE

commit 7c244ebe949ad51a7be455479d7853a551bf98fc
parent e482109fc416fb8678befb27336ab5d08ff10252
Author: Sebastian Mancke <sebastian.mancke@snabble.io>
Date:   Fri, 20 Jul 2018 14:01:54 +0200

Merge pull request #86 from nicolaspernoud/master

Allow Bcrypt $2a$ prefix
Diffstat:
Mhtpasswd/auth.go | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htpasswd/auth.go b/htpasswd/auth.go @@ -97,7 +97,7 @@ func (a *Auth) Authenticate(username, password string) (bool, error) { if hash, exist := a.userHash[username]; exist { h := []byte(hash) p := []byte(password) - if strings.HasPrefix(hash, "$2y$") || strings.HasPrefix(hash, "$2b$") { + if strings.HasPrefix(hash, "$2y$") || strings.HasPrefix(hash, "$2b$") || strings.HasPrefix(hash, "$2a$") { matchErr := bcrypt.CompareHashAndPassword(h, p) return (matchErr == nil), nil }