Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Feb 21, 2024
1 parent 98ea39a commit e7e7177
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/MCryptCompatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,28 @@ public function testMcryptGenericWithTwoParamsPHPPost71()
phpseclib_mcrypt_generic_init($td, 'xxx');
}

public function testOldMcryptNoIV()
{
$key = 'key';
$data = 'data';
$iv = null;

//$this->setExpectedException('PHPUnit_Framework_Error_Warning', 'mcrypt_encrypt(): Attempt to use an empty IV, which is NOT recommended');

phpseclib_mcrypt_helper_old('rijndael-128', $key, $data, 'cbc', $iv, 'encrypt');
}

public function testOldMcryptShortIV()
{
$key = 'key';
$data = 'data';
$iv = 'iv';

//$this->setExpectedException('PHPUnit_Framework_Error_Warning', 'mcrypt_encrypt(): The IV parameter must be as long as the blocksize');

phpseclib_mcrypt_helper_old('rijndael-128', $key, $data, 'cbc', $iv, 'encrypt');
}

public function providerForIVSizeChecks()
{
$tests = [
Expand Down

0 comments on commit e7e7177

Please sign in to comment.