Skip to content

Commit

Permalink
v2.9.1a forgot to encrypt sProxyAuthPassword
Browse files Browse the repository at this point in the history
  • Loading branch information
djmaze committed Nov 12, 2021
1 parent f2c6900 commit f14ebc6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public function asTokenArray(MainAccount $oMainAccount) : array
{
$sHash = $oMainAccount->CryptKey();
$aData = $this->jsonSerialize();
$aData[3] = \SnappyMail\Crypt::EncryptUrlSafe($aData[3], $sHash);
$aData[3] = \SnappyMail\Crypt::EncryptUrlSafe($aData[3], $sHash); // sPassword
$aData[6] = \SnappyMail\Crypt::EncryptUrlSafe($aData[6], $sHash); // sProxyAuthPassword
$aData[] = \hash_hmac('sha1', $aData[3], $sHash);
return $aData;
}
Expand All @@ -55,6 +56,7 @@ public static function NewInstanceFromTokenArray(
$sParentEmail = \array_pop($aAccountHash);
if ($sPasswordHMAC && $sPasswordHMAC === \hash_hmac('sha1', $aAccountHash[3], $sHash)) {
$aAccountHash[3] = \SnappyMail\Crypt::DecryptUrlSafe($aAccountHash[3], $sHash);
$aAccountHash[6] = \SnappyMail\Crypt::DecryptUrlSafe($aAccountHash[6], $sHash);
}
$oAccount = parent::NewInstanceFromTokenArray($oActions, $aAccountHash, $bThrowExceptionOnFalse);
if ($oAccount) {
Expand Down

0 comments on commit f14ebc6

Please sign in to comment.