Repository: shiro
Updated Branches:
  refs/heads/1.3.x cfc9b57f1 -> ca29664d8


Fix the calculation for the hash iterations

We really need to subtract 1 here, not DEFAULT_ITERATIONS (which could
change, breaking the calculation then)

Fixes #14, SHIRO-568


Project: http://git-wip-us.apache.org/repos/asf/shiro/repo
Commit: http://git-wip-us.apache.org/repos/asf/shiro/commit/ca29664d
Tree: http://git-wip-us.apache.org/repos/asf/shiro/tree/ca29664d
Diff: http://git-wip-us.apache.org/repos/asf/shiro/diff/ca29664d

Branch: refs/heads/1.3.x
Commit: ca29664d8e4552a70a06bd958062d589b5468450
Parents: dff6cc6
Author: Andreas Kohn <[email protected]>
Authored: Thu Apr 21 10:26:44 2016 +0200
Committer: Brian Demers <[email protected]>
Committed: Wed Jun 29 14:59:59 2016 -0700

----------------------------------------------------------------------
 core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/ca29664d/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java 
b/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java
index 7ee3c40..b3c8a33 100644
--- a/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java
+++ b/core/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java
@@ -346,7 +346,7 @@ public class SimpleHash extends AbstractHash {
             digest.update(salt);
         }
         byte[] hashed = digest.digest(bytes);
-        int iterations = hashIterations - DEFAULT_ITERATIONS; //already hashed 
once above
+        int iterations = hashIterations - 1; //already hashed once above
         //iterate remaining number:
         for (int i = 0; i < iterations; i++) {
             digest.reset();

Reply via email to