aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-07-16 12:46:20 +0200
committerGitHub <noreply@github.com>2021-07-16 12:46:20 +0200
commitf86f594a3a867018a3354e7d26a9932bb0eb11a1 (patch)
tree422922d5ed4c719568a339f508958d0a59f08338 /apps/dav
parent23df99dbe080f113c6f8af091e8664979fb59358 (diff)
parent91051d92073f19908947cf05560de7e78ad80b86 (diff)
downloadnextcloud-server-f86f594a3a867018a3354e7d26a9932bb0eb11a1.tar.gz
nextcloud-server-f86f594a3a867018a3354e7d26a9932bb0eb11a1.zip
Merge pull request #27860 from J0WI/alphanumeric-rnd
Introduce ISecureRandom::CHAR_ALPHANUMERIC
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipPlugin.php2
-rw-r--r--apps/dav/lib/Controller/DirectController.php2
-rw-r--r--apps/dav/tests/unit/Controller/DirectControllerTest.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
index 555b38e0efb..fa87db45797 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -692,7 +692,7 @@ class IMipPlugin extends SabreIMipPlugin {
* @return string
*/
private function createInvitationToken(Message $iTipMessage, $lastOccurrence):string {
- $token = $this->random->generate(60, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
+ $token = $this->random->generate(60, ISecureRandom::CHAR_ALPHANUMERIC);
/** @var VEvent $vevent */
$vevent = $iTipMessage->message->VEVENT;
diff --git a/apps/dav/lib/Controller/DirectController.php b/apps/dav/lib/Controller/DirectController.php
index bd77cef4872..955400998cf 100644
--- a/apps/dav/lib/Controller/DirectController.php
+++ b/apps/dav/lib/Controller/DirectController.php
@@ -104,7 +104,7 @@ class DirectController extends OCSController {
$direct->setUserId($this->userId);
$direct->setFileId($fileId);
- $token = $this->random->generate(60, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
+ $token = $this->random->generate(60, ISecureRandom::CHAR_ALPHANUMERIC);
$direct->setToken($token);
$direct->setExpiration($this->timeFactory->getTime() + $expirationTime);
diff --git a/apps/dav/tests/unit/Controller/DirectControllerTest.php b/apps/dav/tests/unit/Controller/DirectControllerTest.php
index b85610f94d8..00771e7f7a6 100644
--- a/apps/dav/tests/unit/Controller/DirectControllerTest.php
+++ b/apps/dav/tests/unit/Controller/DirectControllerTest.php
@@ -131,7 +131,7 @@ class DirectControllerTest extends TestCase {
$this->random->method('generate')
->with(
60,
- ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS
+ ISecureRandom::CHAR_ALPHANUMERIC
)->willReturn('superduperlongtoken');
$this->directMapper->expects($this->once())