mirror of https://github.com/MISP/MISP
fix: [S/MIME] don't sign e-mails if no signing key is set
- fixes e-mails not going out on instances where no signing key was providedpull/6858/head
parent
68596db5be
commit
f5157ddba3
|
@ -320,7 +320,7 @@ class SendEmail
|
||||||
if (!$this->gpg) {
|
if (!$this->gpg) {
|
||||||
throw new SendEmailException("GPG encryption is enabled, but GPG is not configured.");
|
throw new SendEmailException("GPG encryption is enabled, but GPG is not configured.");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$fingerprint = $this->importAndValidateGpgPublicKey($params['gpgkey']);
|
$fingerprint = $this->importAndValidateGpgPublicKey($params['gpgkey']);
|
||||||
} catch (Crypt_GPG_NoDataException $e) {
|
} catch (Crypt_GPG_NoDataException $e) {
|
||||||
|
@ -415,7 +415,7 @@ class SendEmail
|
||||||
if (!$this->gpg) {
|
if (!$this->gpg) {
|
||||||
throw new SendEmailException("GPG signing is enabled, but GPG is not initialized. Check debug log why GPG could not be initialized.");
|
throw new SendEmailException("GPG signing is enabled, but GPG is not initialized. Check debug log why GPG could not be initialized.");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$fingerprint = $this->importAndValidateGpgPublicKey($user['User']['gpgkey']);
|
$fingerprint = $this->importAndValidateGpgPublicKey($user['User']['gpgkey']);
|
||||||
} catch (Crypt_GPG_NoDataException $e) {
|
} catch (Crypt_GPG_NoDataException $e) {
|
||||||
|
@ -446,7 +446,9 @@ class SendEmail
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$canEncryptGpg && $canEncryptSmime) {
|
if (!$canEncryptGpg && $canEncryptSmime) {
|
||||||
$this->signBySmime($email);
|
if (!empty(Configure::read('SMIME.cert_public_sign')) && !empty(Configure::read('SMIME.key_sign'))) {
|
||||||
|
$this->signBySmime($email);
|
||||||
|
}
|
||||||
$this->encryptBySmime($email, $user['User']['certif_public']);
|
$this->encryptBySmime($email, $user['User']['certif_public']);
|
||||||
$encrypted = true;
|
$encrypted = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue