mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-18 03:05:11 +00:00
Tests/AES: add unit test for encrypting without a key
This commit is contained in:
parent
479fa4ce3d
commit
50f9e1a71a
@ -407,4 +407,16 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
|
|||||||
|
|
||||||
$this->assertEquals($plaintext, $actual);
|
$this->assertEquals($plaintext, $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \UnexpectedValueException
|
||||||
|
*/
|
||||||
|
public function testNoKey()
|
||||||
|
{
|
||||||
|
$aes = new AES('cbc');
|
||||||
|
$aes->setPreferredEngine($this->engine);
|
||||||
|
$aes->setIV(str_repeat('x', 16));
|
||||||
|
|
||||||
|
$aes->encrypt(str_repeat('a', 16));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user