From 8f27aaa323f649290a7ebed57647c1af3394f787 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 13 Dec 2014 15:10:47 -0600 Subject: [PATCH] Tests (DES): i didn't realize last commit included all the changes that it did not all of them were ready to go out. i just meant for it to include a one-line change. meh. --- tests/Unit/Crypt/DES.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/Unit/Crypt/DES.php b/tests/Unit/Crypt/DES.php index 56810bbe..9ae77c03 100644 --- a/tests/Unit/Crypt/DES.php +++ b/tests/Unit/Crypt/DES.php @@ -22,9 +22,7 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase $result = pack('H*', '3e7613642049af1e'); $internal = $des->encrypt('d'); - if (!$this->assertEquals($result, $internal)) { - $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result'); - } + $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result'); $des->setPreferredEngine(CRYPT_ENGINE_MCRYPT); if ($des->getEngine() == CRYPT_ENGINE_MCRYPT) { @@ -57,10 +55,13 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase $des->setPreferredEngine(CRYPT_ENGINE_INTERNAL); $internal = $des->decrypt('d'); + $result = pack('H*', '36a86ebd0f9e048f'); + $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result'); + $des->setPreferredEngine(CRYPT_ENGINE_MCRYPT); if ($des->getEngine() == CRYPT_ENGINE_MCRYPT) { $mcrypt = $des->decrypt('d'); - $this->assertEquals($internal, $mcrypt, 'Failed asserting that the internal and mcrypt engines produce identical results'); + $this->assertEquals($result, $mcrypt, 'Failed asserting that the mcrypt engine produced the correct result'); } else { self::markTestSkipped('Unable to initialize mcrypt engine'); } @@ -68,7 +69,7 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase $des->setPreferredEngine(CRYPT_ENGINE_OPENSSL); if ($des->getEngine() == CRYPT_ENGINE_OPENSSL) { $openssl = $des->decrypt('d'); - $this->assertEquals($internal, $openssl, 'Failed asserting that the internal and OpenSSL engines produce identical results'); + $this->assertEquals($result, $openssl, 'Failed asserting that the OpenSSL engine produced the correct result'); } else { self::markTestSkipped('Unable to initialize OpenSSL engine'); }