Skip to content

Commit

Permalink
Extract content out of signed message when does the signature verific…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
hnategh committed Apr 7, 2017
1 parent d01524c commit 185181c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion framework/Crypt/lib/Horde/Crypt/Smime.php
Expand Up @@ -128,6 +128,7 @@ public function verify($text, $certs)
/* Create temp files for input/output. */
$input = $this->_createTempFile('horde-smime');
$output = $this->_createTempFile('horde-smime');
$content = $this->_createTempFile('horde-smime');

/* Write text to file */
file_put_contents($input, $text);
Expand Down Expand Up @@ -163,7 +164,9 @@ public function verify($text, $certs)
$ob->msg = Horde_Crypt_Translation::t("Message verified successfully but the signer's certificate could not be verified.");
$ob->verify = false;
}

if (openssl_pkcs7_verify($input, PKCS7_NOVERIFY, $output, array(), $output, $content)) {
$ob->content = file_get_contents($content);
}
$ob->cert = file_get_contents($output);
$ob->email = $this->getEmailFromKey($ob->cert);

Expand Down

0 comments on commit 185181c

Please sign in to comment.