diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2023-10-12 10:37:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-12 10:37:15 +0200 |
commit | 03c7ee4e41c6714874a43d0c1b62a780afd700b7 (patch) | |
tree | cf85495cce161697b58adb323a3e26e8616dc068 /lib | |
parent | 37f21cf94ddbbbf0f5b3c52f24b279f4e3e5e0b9 (diff) | |
parent | ca33d6b01caceae4d553aae1b65d7b7dde3d4324 (diff) | |
download | nextcloud-server-03c7ee4e41c6714874a43d0c1b62a780afd700b7.tar.gz nextcloud-server-03c7ee4e41c6714874a43d0c1b62a780afd700b7.zip |
Merge pull request #40879 from nextcloud/fix/session/log-lost-crypto-session
fix(session): Log when crypto session data is lost
Diffstat (limited to 'lib')
-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); } |