summaryrefslogtreecommitdiffstats
path: root/lib/private/Security/CSRF
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Security/CSRF')
-rw-r--r--lib/private/Security/CSRF/CsrfToken.php2
-rw-r--r--lib/private/Security/CSRF/CsrfTokenManager.php6
-rw-r--r--lib/private/Security/CSRF/TokenStorage/SessionStorage.php2
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/private/Security/CSRF/CsrfToken.php b/lib/private/Security/CSRF/CsrfToken.php
index 9b6b249e20f..a0ecdbd1008 100644
--- a/lib/private/Security/CSRF/CsrfToken.php
+++ b/lib/private/Security/CSRF/CsrfToken.php
@@ -55,7 +55,7 @@ class CsrfToken {
* @return string
*/
public function getEncryptedValue(): string {
- if($this->encryptedValue === '') {
+ if ($this->encryptedValue === '') {
$sharedSecret = random_bytes(\strlen($this->value));
$this->encryptedValue = base64_encode($this->value ^ $sharedSecret) . ':' . base64_encode($sharedSecret);
}
diff --git a/lib/private/Security/CSRF/CsrfTokenManager.php b/lib/private/Security/CSRF/CsrfTokenManager.php
index 8314639e8ef..2f64aeb24f4 100644
--- a/lib/private/Security/CSRF/CsrfTokenManager.php
+++ b/lib/private/Security/CSRF/CsrfTokenManager.php
@@ -57,11 +57,11 @@ class CsrfTokenManager {
* @return CsrfToken
*/
public function getToken(): CsrfToken {
- if(!\is_null($this->csrfToken)) {
+ if (!\is_null($this->csrfToken)) {
return $this->csrfToken;
}
- if($this->sessionStorage->hasToken()) {
+ if ($this->sessionStorage->hasToken()) {
$value = $this->sessionStorage->getToken();
} else {
$value = $this->tokenGenerator->generateToken();
@@ -99,7 +99,7 @@ class CsrfTokenManager {
* @return bool
*/
public function isTokenValid(CsrfToken $token): bool {
- if(!$this->sessionStorage->hasToken()) {
+ if (!$this->sessionStorage->hasToken()) {
return false;
}
diff --git a/lib/private/Security/CSRF/TokenStorage/SessionStorage.php b/lib/private/Security/CSRF/TokenStorage/SessionStorage.php
index d73c8d94206..34adc566bf7 100644
--- a/lib/private/Security/CSRF/TokenStorage/SessionStorage.php
+++ b/lib/private/Security/CSRF/TokenStorage/SessionStorage.php
@@ -60,7 +60,7 @@ class SessionStorage {
*/
public function getToken(): string {
$token = $this->session->get('requesttoken');
- if(empty($token)) {
+ if (empty($token)) {
throw new \Exception('Session does not contain a requesttoken');
}