Merge pull request #12609 from owncloud/remove-53-fixme

Remove workaround for 5.3
This commit is contained in:
Thomas Müller 2014-12-04 14:25:47 +01:00
commit e9f0b30023
1 changed files with 2 additions and 18 deletions

View File

@ -42,22 +42,6 @@ class Crypto implements ICrypto {
$this->random = $random;
}
/**
* Custom implementation of hex2bin since the function is only available starting
* with PHP 5.4
*
* @TODO Remove this once 5.3 support for ownCloud is dropped
* @param $message
* @return string
*/
protected static function hexToBin($message) {
if (function_exists('hex2bin')) {
return hex2bin($message);
}
return pack("H*", $message);
}
/**
* @param string $message The message to authenticate
* @param string $password Password to use (defaults to `secret` in config.php)
@ -115,9 +99,9 @@ class Crypto implements ICrypto {
throw new \Exception('Authenticated ciphertext could not be decoded.');
}
$ciphertext = self::hexToBin($parts[0]);
$ciphertext = hex2bin($parts[0]);
$iv = $parts[1];
$hmac = self::hexToBin($parts[2]);
$hmac = hex2bin($parts[2]);
$this->cipher->setIV($iv);