php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #47728 openssl_pkcs7_sign ignores new openssl flags
Submitted: 2009-03-20 10:06 UTC Modified: 2017-10-24 07:33 UTC
From: josef dot andrysek at icewarp dot com Assigned:
Status: Open Package: OpenSSL related
PHP Version: 5.2.9 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
2 + 2 = ?
Subscribe to this entry?

 
 [2009-03-20 10:06 UTC] josef dot andrysek at icewarp dot com
Description:
------------
openssl_pkcs7_sign supports several new flags:
e.g. PKCS7_CRLFEOL,PKCS7_NOSMIMECAP...

1. openssl extension should define these constants
2. openssl extension should check the PKCS7_CRLFEOL and use appropriate line delimiter in call to BIO_printf()



Reproduce code:
---------------
look at ext\openssl\openssl.c



Expected result:
----------------
1) also new constants should be registered here
REGISTER_LONG_CONSTANT("PKCS7_NOSMIMECAP", PKCS7_NOSMIMECAP, CONST_CS|CONST_PERSISTENT);
	REGISTER_LONG_CONSTANT("PKCS7_NOOLDMIMETYPE", PKCS7_NOOLDMIMETYPE, CONST_CS|CONST_PERSISTENT);
	REGISTER_LONG_CONSTANT("PKCS7_CRLFEOL", PKCS7_CRLFEOL, CONST_CS|CONST_PERSISTENT);
	REGISTER_LONG_CONSTANT("PKCS7_STREAM", PKCS7_STREAM, CONST_CS|CONST_PERSISTENT);
	REGISTER_LONG_CONSTANT("PKCS7_NOCRL", PKCS7_NOCRL, CONST_CS|CONST_PERSISTENT);

2) newline symbol should depend on PKCS7_CRLFEOL flag
   (this style of coding is taken from openssl project itself)
	if (flags & PKCS7_CRLFEOL)
		mime_eol = "\r\n";
	else
		mime_eol = "\n"; 


if (strindex) {
				BIO_printf(outfile, "%s: %s%s", strindex, Z_STRVAL_PP(hval),mime_eol);
			} else {
				BIO_printf(outfile, "%s%s", Z_STRVAL_PP(hval),mime_eol);
			}


Actual result:
--------------
look at ext\openssl\openssl.c


1)
Line 701:
/* flags for S/MIME */
-  only old flags are defined here	


2)
if (strindex) {
				BIO_printf(outfile, "%s: %s\n", strindex, Z_STRVAL_PP(hval));
			} else {
				BIO_printf(outfile, "%s\n", Z_STRVAL_PP(hval));
			}


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-20 11:23 UTC] pajoye@php.net
Right, and need one a couple of small changes+tests as well.
 [2010-12-20 14:26 UTC] jani@php.net
-Package: Feature/Change Request +Package: OpenSSL related
 [2017-10-24 07:33 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: pajoye +Assigned To:
 [2024-01-19 00:39 UTC] info at gomarketes dot exchange
The following pull request has been associated:

Patch Name: Extract functions to classes
On GitHub:  https://github.com/php/web-master/pull/12
Patch:      https://github.com/php/web-master/pull/12.patch
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 20:01:29 2024 UTC