#50776 [Opn->Fbk]: openssl_pkcs7_verify

From: Date: Sat, 16 Jan 2010 19:53:10 +0000
Subject: #50776 [Opn->Fbk]: openssl_pkcs7_verify
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-146732@lists.php.net to get a copy of this message
ID: 50776 Updated by: jani@php.net Reported By: gufophp at gmail dot com -Status: Open +Status: Feedback Bug Type: OpenSSL related Operating System: win32 apache PHP Version: 5.3.1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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/?id=50776&edit=1

« previous php.bugs (#146732) next »