* Mail: take certificate SAN email into account when verifying SMIME signed message

This commit is contained in:
Hadi Nategh 2018-08-30 14:06:26 +02:00
parent be6903b074
commit e5bd217a77

View File

@ -7504,20 +7504,20 @@ class Mail
'certDetails' => $this->smime->parseCert($cert->cert),
'msg' => $cert->msg,
'certHtml' => $this->smime->certToHTML($cert->cert),
'email' => $cert->email,
'email' => $this->smime->getEmailFromKey($cert->cert),
'signed' => true
));
// check for email address if both signer email address and
// email address of sender are the same.
if (is_array($from) && strcasecmp($from[0], $cert->email) != 0)
if (is_array($from) && strcasecmp($from[0], $metadata['email']) != 0)
{
$metadata['unknownemail'] = true;
$metadata['msg'] .= ' '.lang('Email address of signer is different from the email address of sender!');
}
$AB_bo = new \addressbook_bo();
$certkey = $AB_bo->get_smime_keys($cert->email);
if (!is_array($certkey) || strcasecmp($certkey[$cert->email], $cert->cert) != 0) $metadata['addtocontact'] = true;
$certkey = $AB_bo->get_smime_keys($metadata['email']);
if (!is_array($certkey) || strcasecmp($certkey[$metadata['email']], $cert->cert) != 0) $metadata['addtocontact'] = true;
}
else // only encrypted message
{