Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
ee1f8b02
Commit
ee1f8b02
authored
Dec 04, 2014
by
Lukas Reschke
Browse files
Remove workaround for 5.3
Function is natively available with 5.4
parent
5aad9025
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/private/security/crypto.php
View file @
ee1f8b02
...
@@ -42,22 +42,6 @@ class Crypto implements ICrypto {
...
@@ -42,22 +42,6 @@ class Crypto implements ICrypto {
$this
->
random
=
$random
;
$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 $message The message to authenticate
* @param string $password Password to use (defaults to `secret` in config.php)
* @param string $password Password to use (defaults to `secret` in config.php)
...
@@ -115,9 +99,9 @@ class Crypto implements ICrypto {
...
@@ -115,9 +99,9 @@ class Crypto implements ICrypto {
throw
new
\
Exception
(
'Authenticated ciphertext could not be decoded.'
);
throw
new
\
Exception
(
'Authenticated ciphertext could not be decoded.'
);
}
}
$ciphertext
=
self
::
hexToB
in
(
$parts
[
0
]);
$ciphertext
=
hex2b
in
(
$parts
[
0
]);
$iv
=
$parts
[
1
];
$iv
=
$parts
[
1
];
$hmac
=
self
::
hexToB
in
(
$parts
[
2
]);
$hmac
=
hex2b
in
(
$parts
[
2
]);
$this
->
cipher
->
setIV
(
$iv
);
$this
->
cipher
->
setIV
(
$iv
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment