From:             josef dot andrysek at icewarp dot com
Operating system: independent
PHP version:      5.2.9
PHP Bug Type:     OpenSSL related
Bug description:  openssl_pkcs7_sign ignores new openssl flags

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 bug report at http://bugs.php.net/?id=47728&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47728&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47728&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47728&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47728&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47728&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47728&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47728&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47728&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47728&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47728&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47728&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47728&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47728&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47728&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47728&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47728&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47728&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47728&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47728&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47728&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47728&r=mysqlcfg

Reply via email to