Req #47728 [Asn->Opn]: openssl_pkcs7_sign ignores new openssl flags

From: Date: Tue, 24 Oct 2017 07:33:39 +0000
Subject: Req #47728 [Asn->Opn]: openssl_pkcs7_sign ignores new openssl flags
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212104@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=47728&edit=1

 ID:                 47728
 Updated by:         kalle@php.net
 Reported by:        josef dot andrysek at icewarp dot com
 Summary:            openssl_pkcs7_sign ignores new openssl flags
-Status:             Assigned
+Status:             Open
 Type:               Feature/Change Request
 Package:            OpenSSL related
 Operating System:   *
 PHP Version:        5.2.9
-Assigned To:        pajoye
+Assigned To:        
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2009-03-20 11:23:52] pajoye@php.net

Right, and need one a couple of small changes+tests as well.

------------------------------------------------------------------------
[2009-03-20 10:06:33] 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));
			}



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=47728&edit=1


Thread (5 messages)

« previous php.bugs (#212104) next »