summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-11 11:40:51 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-11 11:40:51 +0100
commit6317ba8cb4fef328bf828eab5197cc58f7057221 (patch)
treec54316e17a23a2a29f5a61391fb433c1436a8cf8 /lib/public
parent86bd95ea1b19a42b2a41f8851f7451d38c92957b (diff)
parent2f3b10f980db9a54fc0022c69387ae5d7d9c0914 (diff)
downloadnextcloud-server-6317ba8cb4fef328bf828eab5197cc58f7057221.tar.gz
nextcloud-server-6317ba8cb4fef328bf828eab5197cc58f7057221.zip
Merge pull request #21135 from owncloud/add-polyfill
Add polyfills for PHP55, PHP56 and PHP70 functionalities
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/security/isecurerandom.php11
-rw-r--r--lib/public/security/stringutils.php3
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/public/security/isecurerandom.php b/lib/public/security/isecurerandom.php
index 1b72e4f4377..8315d0f971a 100644
--- a/lib/public/security/isecurerandom.php
+++ b/lib/public/security/isecurerandom.php
@@ -23,12 +23,12 @@
namespace OCP\Security;
/**
- * Class SecureRandom provides a layer around RandomLib to generate
- * secure random strings. For PHP 7 the native CSPRNG is used.
+ * Class SecureRandom provides a wrapper around the random_int function to generate
+ * secure random strings. For PHP 7 the native CSPRNG is used, older versions do
+ * use a fallback.
*
* Usage:
- * $rng = new \OC\Security\SecureRandom();
- * $randomString = $rng->getMediumStrengthGenerator()->generateString(30);
+ * \OC::$server->getSecureRandom()->generate(10);
*
* @package OCP\Security
* @since 8.0.0
@@ -52,6 +52,7 @@ interface ISecureRandom {
*
* @return $this
* @since 8.0.0
+ * @deprecated 9.0.0 Use \OC\Security\SecureRandom::generate directly or random_bytes() / random_int()
*/
public function getLowStrengthGenerator();
@@ -64,6 +65,7 @@ interface ISecureRandom {
*
* @return $this
* @since 8.0.0
+ * @deprecated 9.0.0 Use \OC\Security\SecureRandom::generate directly or random_bytes() / random_int()
*/
public function getMediumStrengthGenerator();
@@ -73,7 +75,6 @@ interface ISecureRandom {
* @param string $characters An optional list of characters to use if no character list is
* specified all valid base64 characters are used.
* @return string
- * @throws \Exception If the generator is not initialized.
* @since 8.0.0
*/
public function generate($length,
diff --git a/lib/public/security/stringutils.php b/lib/public/security/stringutils.php
index 4f41fcf8262..7cf12ea2702 100644
--- a/lib/public/security/stringutils.php
+++ b/lib/public/security/stringutils.php
@@ -39,8 +39,9 @@ class StringUtils {
* @param string $input The input to compare against
* @return bool True if the two strings are equal, otherwise false.
* @since 8.0.0
+ * @deprecated 9.0.0 Use hash_equals
*/
public static function equals($expected, $input) {
- return \OC\Security\StringUtils::equals($expected, $input);
+ return hash_equals($expected, $input);
}
}