make legacyDecrypt() private als always call legacyBlockDecrypt() from other classes

This commit is contained in:
Björn Schießle 2013-05-27 12:21:39 +02:00
parent 8b35578833
commit df22a7c495
4 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ class Hooks {
&& $encLegacyKey = $userView->file_get_contents( 'encryption.key' )
) {
$plainLegacyKey = Crypt::legacyDecrypt( $encLegacyKey, $params['password'] );
$plainLegacyKey = Crypt::legacyBlockDecrypt( $encLegacyKey, $params['password'] );
$session->setLegacyKey( $plainLegacyKey );

View File

@ -607,7 +607,7 @@ class Crypt
*
* This function decrypts an content
*/
public static function legacyDecrypt( $content, $passphrase = '' ) {
private static function legacyDecrypt( $content, $passphrase = '' ) {
$bf = self::getBlowfish( $passphrase );

View File

@ -223,7 +223,7 @@ class Proxy extends \OC_FileProxy
&& isset( $_SESSION['legacyenckey'] )
&& Crypt::isEncryptedMeta( $path )
) {
$plainData = Crypt::legacyDecrypt( $data, $session->getLegacyKey() );
$plainData = Crypt::legacyBlockDecrypt( $data, $session->getLegacyKey() );
}
\OC_FileProxy::$enabled = $proxyStatus;

View File

@ -515,7 +515,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
*/
function testLegacyDecryptShort($crypted) {
$decrypted = Encryption\Crypt::legacyDecrypt($crypted, $this->pass);
$decrypted = Encryption\Crypt::legacyBlockDecrypt($crypted, $this->pass);
$this->assertEquals($this->dataShort, $decrypted);
@ -543,7 +543,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
*/
function testLegacyDecryptLong($crypted) {
$decrypted = Encryption\Crypt::legacyDecrypt($crypted, $this->pass);
$decrypted = Encryption\Crypt::legacyBlockDecrypt($crypted, $this->pass);
$this->assertEquals($this->dataLong, $decrypted);
@ -560,7 +560,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$encKey = Encryption\Crypt::legacyCreateKey($this->pass);
// Decrypt key
$key = Encryption\Crypt::legacyDecrypt($encKey, $this->pass);
$key = Encryption\Crypt::legacyBlockDecrypt($encKey, $this->pass);
$this->assertTrue(is_numeric($key));