From 6b0fce0b364b1b308ca7bf9e018db44fe51817d6 Mon Sep 17 00:00:00 2001 From: Reece Russell Date: Sun, 2 Jan 2022 10:53:28 +0000 Subject: [PATCH 1/3] :recycle: (hasher) removed debug logging line removed a debug logging line which must have been left in --- hasher.go | 1 - 1 file changed, 1 deletion(-) diff --git a/hasher.go b/hasher.go index 66d3eef..1e5bdc9 100644 --- a/hasher.go +++ b/hasher.go @@ -162,7 +162,6 @@ func (h *hasher) Verify(pwd, hash []byte) (ok bool) { } hashFunc, iterCnt, saltLen := scanHeader(hash) - fmt.Printf("%d < %d\n", saltLen, h.saltSize) if saltLen < h.saltSize { // saltLen must be >= to the hasher's salt size. return false From 4693108803a0384482bbab0e4dd3f147b2a68985 Mon Sep 17 00:00:00 2001 From: Reece Russell Date: Sun, 2 Jan 2022 10:54:10 +0000 Subject: [PATCH 2/3] :art: (hasher) removed redundant break clauses --- hasher.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/hasher.go b/hasher.go index 1e5bdc9..3d09571 100644 --- a/hasher.go +++ b/hasher.go @@ -191,13 +191,10 @@ func scanHeader(buf []byte) (hashAlg func() hash.Hash, iterCnt, saltSize int) { switch i { case 1: hashAlg = alg(v) - break case 5: iterCnt = v - break case 9: saltSize = v - break } } From 609bfc32b1e3d46dd907109cf3774ff35b368174 Mon Sep 17 00:00:00 2001 From: Reece Russell Date: Sun, 2 Jan 2022 10:55:03 +0000 Subject: [PATCH 3/3] :arrow_up: (mod) reference github.com/golang/mock directly --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2efd14d..9b4f052 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/reecerussell/adaptive-password-hasher go 1.14 require ( - github.com/golang/mock v1.4.4 // indirect + github.com/golang/mock v1.4.4 golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 )