Bug #50776 [Com]: openssl_pkcs7_verify
| From: | gufophp at gmail dot com | Date: | Tue, 21 Feb 2012 22:05:04 +0000 |
| Subject: | Bug #50776 [Com]: openssl_pkcs7_verify | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-167717@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50776&edit=1
ID: 50776
Comment by: gufophp at gmail dot com
Reported by: gufophp at gmail dot com
Summary: openssl_pkcs7_verify
Status: No Feedback
Type: Bug
Package: OpenSSL related
Operating System: win32 apache
PHP Version: 5.3.1
Block user comment: N
Private report: N
New Comment:
please CHECK all certificate in filesysem (pubblic key):
auto signed certificate "root ca"(H0)
-->create and sign certifichate used H0, this certificate is H1
---->create a new certificate used H1 to sign, this certificate is H2
to check certificate(H2) authority ALL certificate is necessary (H0, H1, and H2)
if not have ALL publik key of all cert, cerificate check fail "certificate verify error"
You have all certificate ?
please update documentation (no bug)
Previous Comments:
------------------------------------------------------------------------
[2010-04-25 20:25:17] felipe@php.net
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=50776&edit=1