mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
mask passphrases in logs for PHP < 8.2
This commit is contained in:
parent
479452ad7b
commit
ec0d92bfac
|
@ -113,10 +113,10 @@ trait Pgp
|
|||
return $this->FalseResponse();
|
||||
}
|
||||
|
||||
$GPG->addDecryptKey(
|
||||
$this->GetActionParam('keyId', ''),
|
||||
$this->GetActionParam('passphrase', '')
|
||||
);
|
||||
$sPassphrase = $this->GetActionParam('passphrase', '');
|
||||
$this->logMask($sPassphrase);
|
||||
|
||||
$GPG->addDecryptKey($this->GetActionParam('keyId', ''), $sPassphrase);
|
||||
|
||||
$sData = $this->GetActionParam('data', '');
|
||||
$oPart = null;
|
||||
|
@ -160,10 +160,12 @@ trait Pgp
|
|||
|
||||
public function DoGnupgExportKey() : array
|
||||
{
|
||||
$sPassphrase = $this->GetActionParam('passphrase', '');
|
||||
$this->logMask($sPassphrase);
|
||||
$GPG = $this->GnuPG();
|
||||
return $this->DefaultResponse($GPG ? $GPG->export(
|
||||
$this->GetActionParam('keyId', ''),
|
||||
$this->GetActionParam('passphrase', '')
|
||||
$sPassphrase
|
||||
) : false);
|
||||
}
|
||||
|
||||
|
@ -174,9 +176,11 @@ trait Pgp
|
|||
if ($GPG) {
|
||||
$sName = $this->GetActionParam('name', '');
|
||||
$sEmail = $this->GetActionParam('email', '');
|
||||
$sPassphrase = $this->GetActionParam('passphrase', '');
|
||||
$this->logMask($sPassphrase);
|
||||
$fingerprint = $GPG->generateKey(
|
||||
$sName ? "{$sName} <{$sEmail}>" : $sEmail,
|
||||
$this->GetActionParam('passphrase', '')
|
||||
$sPassphrase
|
||||
);
|
||||
}
|
||||
return $this->DefaultResponse($fingerprint);
|
||||
|
|
|
@ -62,6 +62,7 @@ trait SMime
|
|||
$sName = $this->GetActionParam('name', '') ?: $oAccount->Name();
|
||||
$sEmail = $this->GetActionParam('email', '') ?: $oAccount->Email();
|
||||
$sPassphrase = $this->GetActionParam('passphrase', '');
|
||||
$this->logMask($sPassphrase);
|
||||
|
||||
$cert = new Certificate();
|
||||
$cert->distinguishedName['commonName'] = $sName;
|
||||
|
|
Loading…
Reference in a new issue