From:             ivan at mishanin dot ru
Operating system: Windows XP, Windows 2000 Server
PHP version:      5.0.4
PHP Bug Type:     OpenSSL related
Bug description:  error under openssl_private_encrypt and openssl_public_decrypt

Description:
------------
When i try to encrypt big string it return null. If i try to use big key
to encrypt - it help my, but if i use a big sting (300 000 signs) - it
isn't work. 
i try encrypt big string by part, it's ok, but then i try to decrypt it -
openssl_public_decrypt make a null decrypt text...

certificate is OK - under MS BizTolk server it's work right.


Reproduce code:
---------------
prkeyid = openssl_pkey_get_private("file://c:/cert/CAkey.pem", '1234');
$pubkeyid = openssl_pkey_get_public("file://c:/cert/CAcert.pem");

openssl_private_encrypt($res,$crypttext,$prkeyid);
$fp = fopen ("c:/file.xml", "w+");
// for test
fwrite ($fp, $crypttext);
fclose ($fp);

openssl_public_decrypt($crypttext, $ext_data, $pubkeyid);
$fp = fopen ("c:/file2.xml", "w+");
fwrite ($fp, $ext_data);
fclose ($fp);

Actual result:
--------------
null

-- 
Edit bug report at http://bugs.php.net/?id=32772&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32772&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32772&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32772&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32772&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32772&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32772&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32772&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32772&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32772&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32772&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32772&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32772&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32772&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32772&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32772&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32772&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32772&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32772&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32772&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32772&r=mysqlcfg

Reply via email to