[Pkg-owncloud-commits] [owncloud] 19/44: close encryption session after decryption was finished

David Prévot taffit at moszumanska.debian.org
Fri Mar 7 13:27:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 9a0c78b8315908646f7786d57eaafa0951e53f2f
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Wed Feb 26 17:18:38 2014 +0100

    close encryption session after decryption was finished
---
 apps/files_encryption/lib/session.php | 8 ++++++++
 apps/files_encryption/lib/util.php    | 8 ++++++++
 settings/ajax/decryptall.php          | 2 ++
 3 files changed, 18 insertions(+)

diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 25f2198..284c2fd 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -132,6 +132,14 @@ class Session {
 
 	}
 
+	/**
+	 * @brief remove encryption keys and init status from session
+	 */
+	public function closeSession() {
+		\OC::$session->remove('encryptionInitialized');
+		\OC::$session->remove('privateKey');
+	}
+
 
 	/**
 	 * @brief Gets status if we already tried to initialize the encryption app
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index bb5a20b..4a04220 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1783,4 +1783,12 @@ class Util {
 		return $session;
 	}
 
+	/*
+	 * @brief remove encryption related keys from the session
+	 */
+	public function closeEncryptionSession() {
+		$session = new \OCA\Encryption\Session($this->view);
+		$session->closeSession();
+	}
+
 }
diff --git a/settings/ajax/decryptall.php b/settings/ajax/decryptall.php
index d7c104a..4782a4c 100644
--- a/settings/ajax/decryptall.php
+++ b/settings/ajax/decryptall.php
@@ -24,6 +24,8 @@ if ($result !== false) {
 		$successful = false;
 	}
 
+	$util->closeEncryptionSession();
+
 	if ($successful === true) {
 		\OCP\JSON::success(array('data' => array('message' => 'Files decrypted successfully')));
 	} else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list