ID:               47728
 Updated by:       [email protected]
 Reported By:      josef dot andrysek at icewarp dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         OpenSSL related
 Operating System: independent
 PHP Version:      5.2.9
-Assigned To:      
+Assigned To:      pajoye
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[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 http://bugs.php.net/?id=47728&edit=1

Reply via email to