From 185181ca437af302aa80f4a49b81de7931d80f7f Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 7 Apr 2017 17:46:38 +0200 Subject: [PATCH] Extract content out of signed message when does the signature verification --- framework/Crypt/lib/Horde/Crypt/Smime.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/Crypt/lib/Horde/Crypt/Smime.php b/framework/Crypt/lib/Horde/Crypt/Smime.php index 58e477d1eee..18a9de5dad6 100644 --- a/framework/Crypt/lib/Horde/Crypt/Smime.php +++ b/framework/Crypt/lib/Horde/Crypt/Smime.php @@ -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); @@ -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);