From 86b3cdc132a2ae19caf327985d5613a58804d1b5 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 26 Feb 2014 17:18:38 +0100 Subject: close encryption session after decryption was finished --- apps/files_encryption/lib/session.php | 8 ++++++++ apps/files_encryption/lib/util.php | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'apps/files_encryption/lib') diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php index aa58e33e9d2..3daaa06425f 100644 --- a/apps/files_encryption/lib/session.php +++ b/apps/files_encryption/lib/session.php @@ -134,6 +134,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 ec06bd52f5e..6bf69cd8ee1 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -1772,4 +1772,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(); + } + } -- cgit v1.2.3