diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-03-16 11:11:15 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-03-16 11:11:15 +0100 |
commit | d4dca43453a7a9e798c208cbb89ee09616381dde (patch) | |
tree | 9e27d608b2f04f45347537f7cf8cab7a7f376962 | |
parent | 7883d066bc903bdea41cfdb920c949ec1ebdf206 (diff) | |
download | rpg-d4dca43453a7a9e798c208cbb89ee09616381dde.tar.gz rpg-d4dca43453a7a9e798c208cbb89ee09616381dde.tar.bz2 |
fixed error in bcrypt password method
-rw-r--r-- | _test/cases/inc/auth_password.test.php | 4 | ||||
-rw-r--r-- | inc/PassHash.class.php | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/_test/cases/inc/auth_password.test.php b/_test/cases/inc/auth_password.test.php index 394f0b2f5..d4a4d2bdb 100644 --- a/_test/cases/inc/auth_password.test.php +++ b/_test/cases/inc/auth_password.test.php @@ -54,6 +54,10 @@ class auth_password_test extends UnitTestCase { $this->assertTrue(auth_verifyPassword('foobcrypt',$hash)); } + function test_verifyPassword_fixedbcrypt(){ + $this->assertTrue(auth_verifyPassword('foobcrypt','$2a$12$uTWercxbq4sjp2xAzv3we.ZOxk51m5V/Bv5bp2H27oVFJl5neFQoC')); + } + function test_verifyPassword_nohash(){ $this->assertTrue(auth_verifyPassword('foo','$1$$n1rTiFE0nRifwV/43bVon/')); } diff --git a/inc/PassHash.class.php b/inc/PassHash.class.php index 2558f37c6..0521ee305 100644 --- a/inc/PassHash.class.php +++ b/inc/PassHash.class.php @@ -427,7 +427,7 @@ class PassHash { $this->gen_salt(22); } - return crypt($password, $salt); + return crypt($clear, $salt); } } |