diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2023-10-11 19:59:18 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-02-09 11:10:28 +0100 |
commit | db8252e82c4efbd37195a264654b4246f79ca62d (patch) | |
tree | 20c937d6c9420fb8354b9703116ebbbe881e9655 | |
parent | 436759f317b253a4a30230509109d2f565edb959 (diff) | |
download | nextcloud-server-db8252e82c4efbd37195a264654b4246f79ca62d.tar.gz nextcloud-server-db8252e82c4efbd37195a264654b4246f79ca62d.zip |
fix(session): Log when crypto session data is lost
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r-- | lib/private/Session/CryptoSessionData.php | 8 |
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); } |