summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-01-11 19:59:15 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-01-11 19:59:15 +0100
commit98c4951f458f398c022bf928ff17b106a7901428 (patch)
tree637a9189abdccda6d4cf3a594d9be462dad32384
parent373776b8d84bece3df4a06b157bbe41f51ef511d (diff)
downloadnextcloud-server-98c4951f458f398c022bf928ff17b106a7901428.tar.gz
nextcloud-server-98c4951f458f398c022bf928ff17b106a7901428.zip
getLowStrengthGenerator does not do anything anymore
-rw-r--r--apps/files_sharing/tests/controller/sharecontroller.php2
-rw-r--r--lib/private/appframework/http/request.php2
-rw-r--r--lib/private/cache/file.php2
-rw-r--r--lib/private/security/crypto.php2
-rw-r--r--lib/private/setup.php4
-rw-r--r--lib/private/util.php2
-rw-r--r--tests/lib/security/securerandom.php2
-rw-r--r--tests/lib/testcase.php2
8 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/controller/sharecontroller.php
index 398538f0943..87b9e2839d7 100644
--- a/apps/files_sharing/tests/controller/sharecontroller.php
+++ b/apps/files_sharing/tests/controller/sharecontroller.php
@@ -76,7 +76,7 @@ class ShareControllerTest extends \Test\TestCase {
$this->oldUser = \OC_User::getUser();
// Create a dummy user
- $this->user = \OC::$server->getSecureRandom()->getLowStrengthGenerator()->generate(12, ISecureRandom::CHAR_LOWER);
+ $this->user = \OC::$server->getSecureRandom()->generate(12, ISecureRandom::CHAR_LOWER);
\OC::$server->getUserManager()->createUser($this->user, $this->user);
\OC_Util::tearDownFS();
diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php
index 6ba1d8f644d..94e58cfc679 100644
--- a/lib/private/appframework/http/request.php
+++ b/lib/private/appframework/http/request.php
@@ -465,7 +465,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
}
if(empty($this->requestId)) {
- $this->requestId = $this->secureRandom->getLowStrengthGenerator()->generate(20);
+ $this->requestId = $this->secureRandom->generate(20);
}
return $this->requestId;
diff --git a/lib/private/cache/file.php b/lib/private/cache/file.php
index 31d4718d18a..c531f8c610b 100644
--- a/lib/private/cache/file.php
+++ b/lib/private/cache/file.php
@@ -99,7 +99,7 @@ class File implements ICache {
$storage = $this->getStorage();
$result = false;
// unique id to avoid chunk collision, just in case
- $uniqueId = \OC::$server->getSecureRandom()->getLowStrengthGenerator()->generate(
+ $uniqueId = \OC::$server->getSecureRandom()->generate(
16,
ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER
);
diff --git a/lib/private/security/crypto.php b/lib/private/security/crypto.php
index 46d0c750b2f..6737902640f 100644
--- a/lib/private/security/crypto.php
+++ b/lib/private/security/crypto.php
@@ -90,7 +90,7 @@ class Crypto implements ICrypto {
}
$this->cipher->setPassword($password);
- $iv = $this->random->getLowStrengthGenerator()->generate($this->ivLength);
+ $iv = $this->random->generate($this->ivLength);
$this->cipher->setIV($iv);
$ciphertext = bin2hex($this->cipher->encrypt($plaintext));
diff --git a/lib/private/setup.php b/lib/private/setup.php
index 770f5cdab52..d318e5f0575 100644
--- a/lib/private/setup.php
+++ b/lib/private/setup.php
@@ -310,9 +310,9 @@ class Setup {
}
//generate a random salt that is used to salt the local user passwords
- $salt = $this->random->getLowStrengthGenerator()->generate(30);
+ $salt = $this->random->generate(30);
// generate a secret
- $secret = $this->random->getMediumStrengthGenerator()->generate(48);
+ $secret = $this->random->generate(48);
//write the config file
$this->config->setSystemValues([
diff --git a/lib/private/util.php b/lib/private/util.php
index 4bcde68c355..5a7a4d8ae5d 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -1097,7 +1097,7 @@ class OC_Util {
$id = \OC::$server->getSystemConfig()->getValue('instanceid', null);
if (is_null($id)) {
// We need to guarantee at least one letter in instanceid so it can be used as the session_name
- $id = 'oc' . \OC::$server->getSecureRandom()->getLowStrengthGenerator()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
+ $id = 'oc' . \OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
\OC::$server->getSystemConfig()->setValue('instanceid', $id);
}
return $id;
diff --git a/tests/lib/security/securerandom.php b/tests/lib/security/securerandom.php
index af437640805..5eede9a30fb 100644
--- a/tests/lib/security/securerandom.php
+++ b/tests/lib/security/securerandom.php
@@ -42,7 +42,7 @@ class SecureRandomTest extends \Test\TestCase {
* @dataProvider stringGenerationProvider
*/
function testGetLowStrengthGeneratorLength($length, $expectedLength) {
- $generator = $this->rng->getLowStrengthGenerator();
+ $generator = $this->rng;
$this->assertEquals($expectedLength, strlen($generator->generate($length)));
}
diff --git a/tests/lib/testcase.php b/tests/lib/testcase.php
index 93b354863a9..38d5cf49320 100644
--- a/tests/lib/testcase.php
+++ b/tests/lib/testcase.php
@@ -150,7 +150,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
* @return string
*/
protected static function getUniqueID($prefix = '', $length = 13) {
- return $prefix . \OC::$server->getSecureRandom()->getLowStrengthGenerator()->generate(
+ return $prefix . \OC::$server->getSecureRandom()->generate(
$length,
// Do not use dots and slashes as we use the value for file names
ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER