Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ0WI <J0WI@users.noreply.github.com>2021-07-07 18:52:46 +0300
committerJ0WI <J0WI@users.noreply.github.com>2021-07-08 16:11:31 +0300
commit3b656446afcac16b53aeb5906cb0d2dd57a23d7e (patch)
tree05ef4885ca0010e1253acf718cb1567e1d82fc03 /apps/oauth2
parent040bc04287dd955194aaa9ec53d69e95d5bb5385 (diff)
Introduce ISecureRandom::CHAR_ALPHANUMERIC
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
Diffstat (limited to 'apps/oauth2')
-rw-r--r--apps/oauth2/lib/Controller/OauthApiController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php
index d6e090565ca..392eb09e89e 100644
--- a/apps/oauth2/lib/Controller/OauthApiController.php
+++ b/apps/oauth2/lib/Controller/OauthApiController.php
@@ -147,7 +147,7 @@ class OauthApiController extends Controller {
}
// Rotate the apptoken (so the old one becomes invalid basically)
- $newToken = $this->secureRandom->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
+ $newToken = $this->secureRandom->generate(72, ISecureRandom::CHAR_ALPHANUMERIC);
$appToken = $this->tokenProvider->rotate(
$appToken,
@@ -160,7 +160,7 @@ class OauthApiController extends Controller {
$this->tokenProvider->updateToken($appToken);
// Generate a new refresh token and encrypt the new apptoken in the DB
- $newCode = $this->secureRandom->generate(128, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
+ $newCode = $this->secureRandom->generate(128, ISecureRandom::CHAR_ALPHANUMERIC);
$accessToken->setHashedCode(hash('sha512', $newCode));
$accessToken->setEncryptedToken($this->crypto->encrypt($newToken, $newCode));
$this->accessTokenMapper->update($accessToken);