From b0495cda4f58e6cfc16fe97ac464bdb4ba745b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=81ojewski?= Date: Sat, 29 Sep 2018 17:52:35 +0200 Subject: [PATCH] Fix: Encoding of iteration for 'Extended DES (Crypt)' --- CHANGELOG.md | 3 ++- lib/Crypto/CryptExtendedDES.php | 2 +- tests/Crypto/CryptExtendedDESTest.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e2cdf..e499412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Fixed - Error when 'Display name' not set +- Encoding of iteration for 'Extended DES (Crypt)' -## [4.0.1] - 2018-08-11 +## [4.0.1] - 2018-08-16 ### Fixed - Leftover lines break the admin page diff --git a/lib/Crypto/CryptExtendedDES.php b/lib/Crypto/CryptExtendedDES.php index d6654c4..c91e04c 100644 --- a/lib/Crypto/CryptExtendedDES.php +++ b/lib/Crypto/CryptExtendedDES.php @@ -76,7 +76,7 @@ class CryptExtendedDES extends AbstractCrypt while ($number) { $rem = $number % $base; $number = (int)($number / $base); - $arr[] = $alphabet[$rem]; + $chars[] = $alphabet[$rem]; } return str_pad(implode($chars), 4, ".", STR_PAD_RIGHT); diff --git a/tests/Crypto/CryptExtendedDESTest.php b/tests/Crypto/CryptExtendedDESTest.php index c5627e0..5f820b6 100644 --- a/tests/Crypto/CryptExtendedDESTest.php +++ b/tests/Crypto/CryptExtendedDESTest.php @@ -41,7 +41,7 @@ class CryptExtendedDESTest extends TestCase public function testCheckPassword() { $this->assertTrue( - $this->crypto->checkPassword("password", "..UZoIyj/Hy/c") + $this->crypto->checkPassword("password", "cDRpdxPmHpzS.") ); }