ID: 32772
User updated by: ivan at mishanin dot ru
Reported By: ivan at mishanin dot ru
Status: Bogus
Bug Type: OpenSSL related
Operating System: Windows XP, Windows 2000 Server
PHP Version: 5.0.4
New Comment:
after openssl_private_encrypt($res,$crypttext,$prkeyid);
openssl_error_string(); return null.
but sometimes it openssl_error_string(); return error:0406C06E:rsa
routines:RSA_padding_add_PKCS1_type_1:data too large for key size
i use just one key and use just one text, i don't understand why it
sometime return error:0406C06E:rsa
routines:RSA_padding_add_PKCS1_type_1:data too large for key size and
sometime return null, null is return more often.
Previous Comments:
------------------------------------------------------------------------
[2005-04-19 23:59:41] [EMAIL PROTECTED]
Try using openssl_error_string(); after those functions and you'll get
more detailed information WHY they fail.
------------------------------------------------------------------------
[2005-04-19 17:38:33] ivan at mishanin dot ru
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 this bug report at http://bugs.php.net/?id=32772&edit=1