Bug #50776 [NoF->Fbk]: openssl_pkcs7_verify
| From: | felipe@php.net | Date: | Sun, 25 Apr 2010 18:25:17 +0000 |
| Subject: | Bug #50776 [NoF->Fbk]: openssl_pkcs7_verify | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149888@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50776&edit=1
ID: 50776
Updated by: felipe@php.net
Reported by: gufophp at gmail dot com
Summary: openssl_pkcs7_verify
-Status: No Feedback
+Status: Feedback
Type: Bug
Package: OpenSSL related
Operating System: win32 apache
PHP Version: 5.3.1
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2010-01-24 01:00:01] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2010-01-16 19:53:10] jani@php.net
Try Google for the error:
"Likewise, if the senderâs certificate isnât recognized by your
OpenSSL infrastructure, youâll get a similar error"
Looks like your script is buggy.
------------------------------------------------------------------------
[2010-01-16 06:06:14] gufophp at gmail dot com
Description:
------------
PKCS7_verify:certificate verify error
Reproduce code:
---------------
<?php
$body = <<<EOD
You have my authorization to spend $10,000 on dinner expenses.
The CEO
EOD;
$key = file_get_contents("test.key");
$crt = file_get_contents("test.crt");
$file = tempnam('', 'mail');
file_put_contents($file, $body);
$signed = tempnam("", "signed"); // view 1
echo openssl_x509_check_private_key($crt,
array($key,"gufogufogufogufogufogufo")) ;
while ($msg = openssl_error_string())
echo $msg . "<br />\n";
echo "<hr />"; // view 1
$arr = array("To" => "joes@example.com", // keyed syntax
"From: HQ <ceo@example.com>", // indexed syntax
"Subject" => "Eyes only");
echo openssl_pkcs7_sign($file, $signed, $crt, array($key,
"gufogufogufogufogufogufo"),$arr);
while ($msg = openssl_error_string())
echo $msg . "<br />\n";
echo "<hr />";
$body = file_get_contents($signed);
file_put_contents("signed.txt",$body);
$pa = "C:\\Programmi\\Apache Software
Foundation\\Apache2.2\\htdocs\sign\\";
// error here
echo openssl_pkcs7_verify(
$pa."signed.txt",
PKCS7_BINARY,
$pa.'test3.crt',
array($pa.'test.crt'),
$pa.'test.crt',
$pa.'content.eml'
);
// error:21075075:PKCS7 routines:PKCS7_verify:certificate verify error
while ($msg = openssl_error_string())
echo $msg . "<br />\n";
?>
Expected result:
----------------
1
Actual result:
--------------
error:21075075:PKCS7 routines:PKCS7_verify:certificate verify error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=50776&edit=1