aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2023-10-11 19:59:18 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2023-10-11 19:59:18 +0200
commitca33d6b01caceae4d553aae1b65d7b7dde3d4324 (patch)
treead77aeac1966484ca94157c7911bde6fc70c3f20 /lib
parent827515d9601e5fe4c4592a3279155e2a403436fa (diff)
downloadnextcloud-server-ca33d6b01caceae4d553aae1b65d7b7dde3d4324.tar.gz
nextcloud-server-ca33d6b01caceae4d553aae1b65d7b7dde3d4324.zip
fix(session): Log when crypto session data is lost
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Session/CryptoSessionData.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Session/CryptoSessionData.php b/lib/private/Session/CryptoSessionData.php
index 1eb6987fc18..76a214584a6 100644
--- a/lib/private/Session/CryptoSessionData.php
+++ b/lib/private/Session/CryptoSessionData.php
@@ -32,6 +32,7 @@ namespace OC\Session;
use OCP\ISession;
use OCP\Security\ICrypto;
use OCP\Session\Exceptions\SessionNotAvailableException;
+use function OCP\Log\logger;
/**
* Class CryptoSessionData
@@ -82,9 +83,14 @@ class CryptoSessionData implements \ArrayAccess, ISession {
try {
$this->sessionValues = json_decode(
$this->crypto->decrypt($encryptedSessionData, $this->passphrase),
- true
+ true,
+ 512,
+ JSON_THROW_ON_ERROR,
);
} catch (\Exception $e) {
+ logger('core')->critical('Could not decrypt or decode encrypted session data', [
+ 'exception' => $e,
+ ]);
$this->sessionValues = [];
$this->regenerateId(true, false);
}