close encryption session after decryption was finished
This commit is contained in:
parent
b7385986ae
commit
86b3cdc132
3 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue