From: [EMAIL PROTECTED]
Operating system: FreeBSD 4.7
PHP version: 4.3.0RC3
PHP Bug Type: mcrypt related
Bug description: crash when IV is not set
I'm running FreeBSD 4.7 with libmcrypt 2.5.3.
There seems to be a bug in libmcrypt, the crash occurs if you call
mcrypt_generic(), but without valid IV. Here's a short script:
$td = mcrypt_module_open ('des', '', 'cbc', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
mcrypt_generic_init ($td, substr($nthash, 0, 7));
$res = mcrypt_generic ($td, $challenge);
changing:
mcrypt_generic_init ($td, substr($nthash, 0, 7));
to:
mcrypt_generic_init ($td, substr($nthash, 0, 7), $iv);
solves the problem :-)
--
Edit bug report at http://bugs.php.net/?id=21039&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21039&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21039&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21039&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21039&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21039&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21039&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21039&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21039&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21039&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21039&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21039&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21039&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21039&r=isapi