diff options
author | Gregor Harlan <mail@gh01.de> | 2015-03-31 01:07:44 +0200 |
---|---|---|
committer | Gregor Harlan <mail@gh01.de> | 2015-04-07 19:54:22 +0200 |
commit | 9278dfa5dd6dfbcda01e947459b34fdd0e2e68bb (patch) | |
tree | ae8ba47324c97246c25fb640329f10c6ccbe5c1b /Core | |
parent | 197fd5c73c06c2b7032abe313a49a7b8d804fc38 (diff) | |
download | symfony-security-9278dfa5dd6dfbcda01e947459b34fdd0e2e68bb.zip symfony-security-9278dfa5dd6dfbcda01e947459b34fdd0e2e68bb.tar.gz symfony-security-9278dfa5dd6dfbcda01e947459b34fdd0e2e68bb.tar.bz2 |
CS: Pre incrementation/decrementation should be used if possible
Diffstat (limited to 'Core')
-rw-r--r-- | Core/Encoder/MessageDigestPasswordEncoder.php | 2 | ||||
-rw-r--r-- | Core/Encoder/Pbkdf2PasswordEncoder.php | 4 | ||||
-rw-r--r-- | Core/Util/StringUtils.php | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Core/Encoder/MessageDigestPasswordEncoder.php b/Core/Encoder/MessageDigestPasswordEncoder.php index 03de228..1706fc8 100644 --- a/Core/Encoder/MessageDigestPasswordEncoder.php +++ b/Core/Encoder/MessageDigestPasswordEncoder.php @@ -55,7 +55,7 @@ class MessageDigestPasswordEncoder extends BasePasswordEncoder $digest = hash($this->algorithm, $salted, true); // "stretch" hash - for ($i = 1; $i < $this->iterations; $i++) { + for ($i = 1; $i < $this->iterations; ++$i) { $digest = hash($this->algorithm, $digest.$salted, true); } diff --git a/Core/Encoder/Pbkdf2PasswordEncoder.php b/Core/Encoder/Pbkdf2PasswordEncoder.php index dac1cad..6f24c4f 100644 --- a/Core/Encoder/Pbkdf2PasswordEncoder.php +++ b/Core/Encoder/Pbkdf2PasswordEncoder.php @@ -87,11 +87,11 @@ class Pbkdf2PasswordEncoder extends BasePasswordEncoder $blocks = ceil($length / strlen(hash($algorithm, null, true))); $digest = ''; - for ($i = 1; $i <= $blocks; $i++) { + for ($i = 1; $i <= $blocks; ++$i) { $ib = $block = hash_hmac($algorithm, $salt.pack('N', $i), $password, true); // Iterations - for ($j = 1; $j < $iterations; $j++) { + for ($j = 1; $j < $iterations; ++$j) { $ib ^= ($block = hash_hmac($algorithm, $block, $password, true)); } diff --git a/Core/Util/StringUtils.php b/Core/Util/StringUtils.php index e68347f..343585c 100644 --- a/Core/Util/StringUtils.php +++ b/Core/Util/StringUtils.php @@ -60,7 +60,7 @@ class StringUtils $result = 0; - for ($i = 0; $i < $knownLen; $i++) { + for ($i = 0; $i < $knownLen; ++$i) { $result |= (ord($knownString[$i]) ^ ord($userInput[$i])); } |