From 4bc3e1464c646c9db13614d23ce364648977e954 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sun, 14 Nov 2021 20:50:41 +0000 Subject: [PATCH] make sure php_crypt:BLOWFISH works --- tests/PacryptTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/PacryptTest.php b/tests/PacryptTest.php index cf92417d..2a30571e 100644 --- a/tests/PacryptTest.php +++ b/tests/PacryptTest.php @@ -304,7 +304,7 @@ class PaCryptTest extends \PHPUnit\Framework\TestCase } } - public function testObviousMechs() + public function testObviousMechanisms() { global $CONF; @@ -318,9 +318,12 @@ class PaCryptTest extends \PHPUnit\Framework\TestCase 'php_crypt:DES' => 'VXAXutUnpVYg6', 'php_crypt:MD5' => '$1$rGTbP.KE$wimpECWs/wQa7rnSwCmHU.', 'php_crypt:SHA256' => '$5$UaZs6ZuaLkVPx3bM$4JwAqdphXVutFYw7COgAkp/vj09S1DfjIftxtjqDrr/', + 'php_crypt:BLOWFISH' => '$2y$10$4gbwQMAoJPcg.mWnENYNg.syH9mZNsbQu6KN7skK92g3tlPnvvBDW', 'sha512.b64' => '{SHA512-CRYPT.B64}JDYkMDBpOFJXQ0JwMlFMMDlobCRFMVFWLzJjbENPbEo4OTg0SjJyY1oxeXNTaFJIYVhJeVdFTDdHRGl3aHliYkhQUHBUQjZTM0lFMlYya2ZXczZWbHY0aDVNa3N0anpud0xuRTBWZVRELw==', ]; + + foreach ($mechs as $mech => $example_hash) { if ($mech == 'mysql_encrypt' && Config::read_string('database_type') != 'mysql') { continue; @@ -329,6 +332,7 @@ class PaCryptTest extends \PHPUnit\Framework\TestCase Config::write('encrypt', $mech); $CONF['encrypt'] = $mech; + $x = pacrypt('test123'); $this->assertNotEmpty($x);