Tests/AES: add unit test for encrypting without a key

This commit is contained in:
terrafrost 2018-12-02 11:58:07 -06:00
parent 479fa4ce3d
commit 50f9e1a71a

View File

@ -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));
}
} }