#37595 [Csd->Bgs]: last part of the string is lost at decoding
ID: 37595
Updated by: derick@php.net
Reported By: coditza at cluj dot astral dot ro
-Status: Closed
+Status: Bogus
Bug Type: mcrypt related
Operating System: windows
PHP Version: 4.4.2
New Comment:
There was nothing wrong here, so I reverted the patch. Openssl is
behaving badly. Try the test vectors from
http://www.schneier.com/code/vectors.txt and
you will see. I also
updated our testcases with this.
Previous Comments:
------------------------------------------------------------------------
[2006-05-31 12:08:22] tony2001@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Thank you for your resistance.
------------------------------------------------------------------------
[2006-05-31 08:43:58] tony2001@php.net
Please, fix your code, there is nothing wrong neither with mcrypt
library nor with PHP.
------------------------------------------------------------------------
[2006-05-31 07:44:46] coditza at cluj dot astral dot ro
Indeed, your sugestion fixed the thing, but that's just a work around.
I added some debuing bits and here are 2 outputs:
string: 12345678qwertyui12345678g
0) Encoding: 12345678 - 7e0dc5b2ff23aca1
1) Encoding: qwertyui - eb3b6b54025c6347
2) Encoding: 12345678 - f258e8a6ab3003af
3) Encoding: g - 20d274568051c4e6
4) Encoding: - 43f92ddf945e42fc
string lenght is 25, ceil(25/8) = 4, the for loop you sugested is
"processing" an aditional empty part of the string.
Again, this is a workaround, not a fix/user error. Please fix the
library or point out in the docs that for a succesfull crypt you need
to use this thinghy.
Thanks
------------------------------------------------------------------------
[2006-05-30 23:35:29] tony2001@php.net
Change
for($i=0;$i<$max;$i++) {
to
for($i=0;$i<=$max;$i++) {
Not PHP problem, just a user error.
------------------------------------------------------------------------
[2006-05-29 13:07:08] coditza at cluj dot astral dot ro
The example is for freebsd 6.0 actually, but the beavior is the same
both on windows (with php4) and on freebsd (with php5)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/37595
--
Edit this bug report at http://bugs.php.net/?id=37595&edit=1
Thread (7 messages)