summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-08-24 12:10:15 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-08-24 12:10:15 +0200
commitb3495a1dc9ca339e839a3fda169bf9ce8656484d (patch)
tree4bc396b37d231011474638cd93104c5feb51b350 /lib/base.php
parentcca35f0c3e94ce5270e3f2fa3619d08a976ab650 (diff)
parent6a3fb0d3b36dce7a6583d58ded1b133f086e2a95 (diff)
downloadnextcloud-server-b3495a1dc9ca339e839a3fda169bf9ce8656484d.tar.gz
nextcloud-server-b3495a1dc9ca339e839a3fda169bf9ce8656484d.zip
Merge pull request #18482 from owncloud/encrypt-session-data
Add a session wrapper to encrypt the data before storing it on disk
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/base.php b/lib/base.php
index 1f921b13e67..2435661dfa6 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -452,13 +452,15 @@ class OC {
$useCustomSession = false;
$session = self::$server->getSession();
OC_Hook::emit('OC', 'initSession', array('session' => &$session, 'sessionName' => &$sessionName, 'useCustomSession' => &$useCustomSession));
- if($useCustomSession) {
- // use the session reference as the new Session
- self::$server->setSession($session);
- } else {
+ if (!$useCustomSession) {
// set the session name to the instance id - which is unique
- self::$server->setSession(new \OC\Session\Internal($sessionName));
+ $session = new \OC\Session\Internal($sessionName);
}
+
+ $cryptoWrapper = \OC::$server->getSessionCryptoWrapper();
+ $session = $cryptoWrapper->wrapSession($session);
+ self::$server->setSession($session);
+
// if session cant be started break with http 500 error
} catch (Exception $e) {
\OCP\Util::logException('base', $e);