mirror of
https://github.com/danog/phpseclib.git
synced 2024-11-27 04:46:26 +01:00
- AES should try to auto-predict the size of keys when the size isn't specified; last update interfered with that
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@137 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
parent
4d4cc0e0f5
commit
354a0965e8
@ -457,7 +457,7 @@ class Crypt_AES extends Crypt_Rijndael {
|
||||
$this->key_size = 32;
|
||||
}
|
||||
|
||||
$this->key = substr($this->key, 0, $this->key_size);
|
||||
$this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));
|
||||
$this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, 16), 16, chr(0));
|
||||
|
||||
if (!isset($this->enmcrypt)) {
|
||||
|
@ -532,7 +532,7 @@ class Crypt_Rijndael {
|
||||
*/
|
||||
function setKey($key)
|
||||
{
|
||||
$this->key = str_pad(substr($key, 0, $this->key_size), $this->key_size, chr(0));
|
||||
$this->key = $key;
|
||||
$this->changed = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user