tony2001                Sun Apr  8 08:04:31 2007 UTC

  Modified files:              
    /php-src/ext/mcrypt mcrypt.c 
  Log:
  MFB: fix #40999 (mcrypt_create_iv() not using random seed)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mcrypt/mcrypt.c?r1=1.103&r2=1.104&diff_format=u
Index: php-src/ext/mcrypt/mcrypt.c
diff -u php-src/ext/mcrypt/mcrypt.c:1.103 php-src/ext/mcrypt/mcrypt.c:1.104
--- php-src/ext/mcrypt/mcrypt.c:1.103   Mon Jan  1 09:29:25 2007
+++ php-src/ext/mcrypt/mcrypt.c Sun Apr  8 08:04:30 2007
@@ -16,7 +16,7 @@
    |          Derick Rethans <[EMAIL PROTECTED]>                    |
    +----------------------------------------------------------------------+
  */
-/* $Id: mcrypt.c,v 1.103 2007/01/01 09:29:25 sebastian Exp $ */
+/* $Id: mcrypt.c,v 1.104 2007/04/08 08:04:30 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -35,6 +35,7 @@
 #include "php_ini.h"
 #include "php_globals.h"
 #include "ext/standard/info.h"
+#include "ext/standard/php_rand.h"
 
 static int le_mcrypt;
 
@@ -1039,8 +1040,7 @@
                case PHP_MCRYPT_IV_SOURCE_RAND:
                                *iv_len = size;
                                while (size) {
-                                       unsigned int ctx;
-                                       (*iv_str)[--size] = 255.0 * 
php_rand_r(&ctx) / RAND_MAX;
+                                       (*iv_str)[--size] = 255.0 * 
php_rand(TSRMLS_C) / RAND_MAX;
                                }
                        break;
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to