mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Now the MainAccount CryptKey is sealed.
This way change-password extension, Oauth2 and others can easily change the cryptkey seal withoug loosing decrypt functionality
This commit is contained in:
parent
8c033f53fa
commit
9ccd616132
3 changed files with 20 additions and 32 deletions
|
|
@ -201,6 +201,7 @@ class ChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
$oAccount->SetPassword($oNewPassword);
|
||||
if ($oAccount instanceof \RainLoop\Model\MainAccount) {
|
||||
$oActions->SetAuthToken($oAccount);
|
||||
$oAccount->resealCryptKey($oPrevPassword);
|
||||
}
|
||||
|
||||
return $this->jsonResponse(__FUNCTION__, $oActions->AppData(false));
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ class LoginOAuth2Plugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
* So we need to securely save a cryptkey.
|
||||
* Encrypted using the old/new refresh token is an option:
|
||||
* 1. decrypt cryptkey with the old refresh token
|
||||
* 2. $oAccount->SetCryptKey('cryptkey')
|
||||
* 3. encrypt cryptkey with the new refresh token
|
||||
* 2. encrypt cryptkey with the new refresh token
|
||||
* = $oAccount->resealCryptKey(new \SnappyMail\SensitiveString('old refresh token'))
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue