|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesopenssl_pkcs7_verify.patch (last revision 2012-05-23 13:06 UTC by f-roth at megaera dot de)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-05-23 13:09 UTC] f-roth at megaera dot de
[2016-12-14 11:58 UTC] tony2001@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: bukka
[2016-12-14 11:58 UTC] tony2001@php.net
[2016-12-14 19:02 UTC] bukka@php.net
[2017-04-28 15:29 UTC] bukka@php.net
-Status: Assigned
+Status: Not a bug
[2017-04-28 15:29 UTC] bukka@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 10:00:01 2025 UTC |
Description: ------------ I found the function openssl_pkcs7_verify not working correctly with the PKCS7_BINARY flag and an ASN1 encoded input file. I traced the error message returned by openssl_error_string() and found the error hidden in ext/openssl/openssl.c. When using libopenssl and ASN1 input you have to use the d2i_PKCS7_bio function instead of SMIME_read_PKCS7 because of a known bug in the later one("The parser assumes that the PKCS7 structure is always base64 encoded and will not handle the case where it is in binary format or uses quoted printable format." [from man 3 SMIME_read_PKCS7]). I changed the code in ext/openssl/openssl.c similar to the one from openssl-1.0.0/apps/smime.c (the openssl command line tool). I tested my patch successfully on Test script: --------------- echo(openssl_pkcs7_verify("input", PKCS7_BINARY|PKCS7_NOVERIFY); echo(openssl_error_string()); with ASN1 encoded "input" file. Expected result: ---------------- output of: "1" and no error message (this expected result actually occurs with my patch applied) Actual result: -------------- output of "-1error:0D0D40D1:asn1 encoding routines:SMIME_read_ASN1:no content type"