diff options
author | J0WI <J0WI@users.noreply.github.com> | 2021-07-07 17:52:46 +0200 |
---|---|---|
committer | J0WI <J0WI@users.noreply.github.com> | 2021-07-08 15:11:31 +0200 |
commit | 3b656446afcac16b53aeb5906cb0d2dd57a23d7e (patch) | |
tree | 05ef4885ca0010e1253acf718cb1567e1d82fc03 /apps/oauth2/lib/Controller/OauthApiController.php | |
parent | 040bc04287dd955194aaa9ec53d69e95d5bb5385 (diff) | |
download | nextcloud-server-3b656446afcac16b53aeb5906cb0d2dd57a23d7e.tar.gz nextcloud-server-3b656446afcac16b53aeb5906cb0d2dd57a23d7e.zip |
Introduce ISecureRandom::CHAR_ALPHANUMERIC
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
Diffstat (limited to 'apps/oauth2/lib/Controller/OauthApiController.php')
-rw-r--r-- | apps/oauth2/lib/Controller/OauthApiController.php | 4 |
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); |