diff options
author | Andrey Andreev <narf@devilix.net> | 2014-06-19 19:08:59 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-06-19 19:08:59 +0200 |
commit | 1e83d69a52a85a4f568bfa086d658556acd48980 (patch) | |
tree | a881d4573d226b09c0c8da800a72183319ac3f3d /tests/codeigniter/libraries/Encryption_test.php | |
parent | 62fad288482a02573d7c2f3463d97c7a0edbd533 (diff) |
Remove the custom IV option from CI_Encryption
It serves for no practical purpose and can only do harm.
Diffstat (limited to 'tests/codeigniter/libraries/Encryption_test.php')
-rw-r--r-- | tests/codeigniter/libraries/Encryption_test.php | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/codeigniter/libraries/Encryption_test.php b/tests/codeigniter/libraries/Encryption_test.php index 759d7cdac..f457fe325 100644 --- a/tests/codeigniter/libraries/Encryption_test.php +++ b/tests/codeigniter/libraries/Encryption_test.php @@ -141,7 +141,6 @@ class Encryption_test extends CI_TestCase { $this->assertTrue(is_array($this->encryption->__get_params($params))); - $params['iv'] = NULL; $params['base64'] = TRUE; $params['hmac_digest'] = 'sha512'; @@ -150,7 +149,6 @@ class Encryption_test extends CI_TestCase { 'cipher' => 'aes-128', 'mode' => 'cbc', 'key' => str_repeat("\x0", 16), - 'iv' => str_repeat("\x0", 16), 'raw_data' => TRUE, 'hmac_key' => str_repeat("\x0", 16), 'hmac_digest' => 'sha256' @@ -216,22 +214,17 @@ class Encryption_test extends CI_TestCase { $this->assertFalse($this->encryption->encrypt($message, array('foo'))); $this->assertFalse($this->encryption->decrypt($message, array('foo'))); - // Custom IV (we'll check it), no HMAC, binary output + // No HMAC, binary output $params = array( 'cipher' => 'tripledes', 'mode' => 'cfb', 'key' => str_repeat("\x1", 16), - 'iv' => str_repeat("\x2", 8), 'base64' => FALSE, 'hmac' => FALSE ); $ciphertext = $this->encryption->encrypt($message, $params); - $this->assertEquals(0, strncmp($params['iv'], $ciphertext, 8)); - // IV should be found in the cipher-text, no matter if it was supplied or not - $this->assertEquals($message, $this->encryption->decrypt($ciphertext, $params)); - unset($params['iv']); $this->assertEquals($message, $this->encryption->decrypt($ciphertext, $params)); } |