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