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:
the-djmaze 2024-03-17 14:53:45 +01:00
parent 8c033f53fa
commit 9ccd616132
3 changed files with 20 additions and 32 deletions

View file

@ -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));

View file

@ -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'))
*/
}
}