~ubuntu-branches/ubuntu/trusty/php-mcrypt/trusty

« back to all changes in this revision

Viewing changes to mcrypt.c

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2012-09-21 20:29:33 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120921202933-m0m9hfp70wa1swdz
Tags: 5.4.6-0ubuntu1
* New upstream release in sync with php5
* Document orig source origin in README.source
* enable hardening flags

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
   +----------------------------------------------------------------------+
3
3
   | PHP Version 5                                                        |
4
4
   +----------------------------------------------------------------------+
5
 
   | Copyright (c) 1997-2010 The PHP Group                                |
 
5
   | Copyright (c) 1997-2012 The PHP Group                                |
6
6
   +----------------------------------------------------------------------+
7
7
   | This source file is subject to version 3.01 of the PHP license,      |
8
8
   | that is bundled with this package in the file LICENSE, and is        |
16
16
   |          Derick Rethans <derick@derickrethans.nl>                    |
17
17
   +----------------------------------------------------------------------+
18
18
 */
19
 
/* $Id: mcrypt.c 300289 2010-06-08 18:27:23Z pajoye $ */
 
19
/* $Id$ */
20
20
 
21
21
#ifdef HAVE_CONFIG_H
22
22
#include "config.h"
280
280
        PHP_FE(mcrypt_module_get_supported_key_sizes,   arginfo_mcrypt_module_get_supported_key_sizes)
281
281
 
282
282
        PHP_FE(mcrypt_module_close,                                     arginfo_mcrypt_module_close)
283
 
        {NULL, NULL, NULL}
 
283
        PHP_FE_END
284
284
};
285
285
/* }}} */
286
286
 
1387
1387
        }
1388
1388
        
1389
1389
        iv = ecalloc(size + 1, 1);
1390
 
        
 
1390
 
1391
1391
        if (source == RANDOM || source == URANDOM) {
1392
1392
#if PHP_WIN32
1393
1393
                /* random/urandom equivalent on Windows */
1394
1394
                BYTE *iv_b = (BYTE *) iv;
1395
1395
                if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){
1396
1396
                        efree(iv);
1397
 
                        php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not gather sufficient random data");
 
1397
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data");
1398
1398
                        RETURN_FALSE;
1399
1399
                }
1400
1400
                n = size;