From 47f6f41cced85303d8cb3854204fd2f40b147093 Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Mon, 22 Jun 2015 12:47:41 +0200 Subject: [PATCH] Use always the private methods to test AES encryption/decryption. --- tests/lib/SimpleSAML/Utils/CryptoTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/lib/SimpleSAML/Utils/CryptoTest.php b/tests/lib/SimpleSAML/Utils/CryptoTest.php index abd090c17..bd395d589 100644 --- a/tests/lib/SimpleSAML/Utils/CryptoTest.php +++ b/tests/lib/SimpleSAML/Utils/CryptoTest.php @@ -14,7 +14,10 @@ class CryptoTest extends PHPUnit_Framework_TestCase */ public function testAesDecryptBadInput() { - \SimpleSAML\Utils\Crypto::aesDecrypt(array()); + $m = new ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesDecrypt'); + $m->setAccessible(true); + + $m->invokeArgs(null, array(array(), 'SECRET')); } @@ -25,7 +28,10 @@ class CryptoTest extends PHPUnit_Framework_TestCase */ public function testAesEncryptBadInput() { - \SimpleSAML\Utils\Crypto::aesEncrypt(array()); + $m = new ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesEncrypt'); + $m->setAccessible(true); + + $m->invokeArgs(null, array(array(), 'SECRET')); } -- GitLab