mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-09 23:31:00 +00:00
Fixed #632 Fatal error: Cannot access self:: when no class scope is active
This commit is contained in:
parent
3cbb9516ef
commit
47c419545a
@ -1357,8 +1357,8 @@ class DES extends Base
|
||||
$k[self::ENCRYPT][$i] = '$ke[' . $i . ']';
|
||||
$k[self::DECRYPT][$i] = '$kd[' . $i . ']';
|
||||
}
|
||||
$init_encrypt = '$ke = $self->keys[self::ENCRYPT];';
|
||||
$init_decrypt = '$kd = $self->keys[self::DECRYPT];';
|
||||
$init_encrypt = '$ke = $self->keys[$self::ENCRYPT];';
|
||||
$init_decrypt = '$kd = $self->keys[$self::DECRYPT];';
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -186,4 +186,15 @@ class Unit_Crypt_TripleDESTest extends PhpseclibTestCase
|
||||
$this->assertEquals($result, $expected, "Failed asserting inner chainin worked correctly in $engineName engine");
|
||||
}
|
||||
}
|
||||
|
||||
// test special case lambda function error
|
||||
public function testCorrectSelfUseInLambda()
|
||||
{
|
||||
$td = new TripleDES( TripleDES::MODE_ECB );
|
||||
$td->setPreferredEngine( TripleDES::ENGINE_INTERNAL );
|
||||
for ( $i = 0; $i < 20; $i++ ) {
|
||||
$td->setKey( str_repeat( 'a', 20 ) . pack( 'V', mt_rand() ) );
|
||||
$td->encrypt( str_repeat( 'a', 32 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user