summaryrefslogtreecommitdiff
path: root/crypt.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypt.go')
-rw-r--r--crypt.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypt.go b/crypt.go
index c579a10..8a783a9 100644
--- a/crypt.go
+++ b/crypt.go
@@ -629,7 +629,7 @@ func genISOPasswdHash(passwd, hashAlgorithm, salt string, spinCount int) (hashVa
err = ErrPasswordLengthInvalid
return
}
- hash, ok := map[string]string{
+ algorithmName, ok := map[string]string{
"MD4": "md4",
"MD5": "md5",
"SHA-1": "sha1",
@@ -653,11 +653,11 @@ func genISOPasswdHash(passwd, hashAlgorithm, salt string, spinCount int) (hashVa
passwordBuffer, _ := encoder.Bytes([]byte(passwd))
b.Write(passwordBuffer)
// Generate the initial hash.
- key := hashing(hash, b.Bytes())
+ key := hashing(algorithmName, b.Bytes())
// Now regenerate until spin count.
for i := 0; i < spinCount; i++ {
iterator := createUInt32LEBuffer(i, 4)
- key = hashing(hash, key, iterator)
+ key = hashing(algorithmName, key, iterator)
}
hashValue, saltValue = base64.StdEncoding.EncodeToString(key), base64.StdEncoding.EncodeToString(s)
return