[PHP4BETA] CVS update: php4/ext/mcrypt

From: Date: Sat, 01 May 1999 11:14:22 +0000
Subject: [PHP4BETA] CVS update: php4/ext/mcrypt
Groups: php.version4 
Request: Send a blank email to php-version4+get-615@lists.php.net to get a copy of this message
Date: Saturday May 1, 1999 @ 7:14 Author: sas Update of /repository/php4/ext/mcrypt In directory php:/tmp/cvs-serv22652/ext/mcrypt Modified Files: config.m4 mcrypt.c php_mcrypt.h Log Message: mcrypt 2.1.18 support, better autoconf checking Index: php4/ext/mcrypt/config.m4 diff -u php4/ext/mcrypt/config.m4:1.1 php4/ext/mcrypt/config.m4:1.2 --- php4/ext/mcrypt/config.m4:1.1 Sun Apr 25 12:50:40 1999 +++ php4/ext/mcrypt/config.m4 Sat May 1 07:14:22 1999 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.1 1999/04/25 16:50:40 sas Exp $ +dnl $Id: config.m4,v 1.2 1999/05/01 11:14:22 sas Exp $ dnl config.m4 for extension mcrypt dnl don't forget to call PHP_EXTENSION(mcrypt) @@ -9,10 +9,14 @@ [ if test "$withval" != "no"; then for i in /usr/local /usr $withval; do - if test -f $i/include/lcrypt.h; then + if test -f $i/include/mcrypt.h; then MCRYPT_DIR=$i fi done + if test "$MCRYPT_DIR" = ""; then + AC_MSG_ERROR(Please install mcrypt.h and libmcrypt.a accordingly to the do +cumentation - I cannot find mcrypt.h) + fi INCLUDES="$INCLUDES -I$MCRYPT_DIR/include" EXTRA_LIBS="$EXTRA_LIBS -L$MCRYPT_DIR/lib -lmcrypt" Index: php4/ext/mcrypt/mcrypt.c diff -u php4/ext/mcrypt/mcrypt.c:1.12 php4/ext/mcrypt/mcrypt.c:1.13 --- php4/ext/mcrypt/mcrypt.c:1.12 Sun Apr 25 18:22:13 1999 +++ php4/ext/mcrypt/mcrypt.c Sat May 1 07:14:22 1999 @@ -31,17 +31,12 @@ #if HAVE_LIBMCRYPT -#if PHP_API_VERSION < 19990421 -#define zend_module_entry php3_module_entry -#include "modules.h" -#include "internal_functions.h" -#endif - -#include "fcntl.h" - #include "php_mcrypt.h" +#include "fcntl.h" -#include "lcrypt.h" +/* we should find a way to figure out whether RC6/IDEA are available */ +#define NON_FREE +#include "mcrypt.h" function_entry mcrypt_functions[] = { PHP_FE(mcrypt_ecb, NULL) @@ -143,15 +138,29 @@ MCRYPT_ENTRY(TripleDES); MCRYPT_ENTRY(ThreeWAY); MCRYPT_ENTRY(GOST); +#ifdef MCRYPT2 + MCRYPT_ENTRY(CRYPT); + MCRYPT_ENTRY(DES_COMPAT); +#endif MCRYPT_ENTRY(SAFER64); MCRYPT_ENTRY(SAFER128); MCRYPT_ENTRY(CAST128); MCRYPT_ENTRY(TEAN); - MCRYPT_ENTRY(TWOFISH); MCRYPT_ENTRY(RC2); -#ifdef CRYPT - MCRYPT_ENTRY(CRYPT); +#ifdef TWOFISH + MCRYPT_ENTRY(TWOFISH); +#elif defined(TWOFISH128) + MCRYPT_ENTRY(TWOFISH128); + MCRYPT_ENTRY(TWOFISH192); + MCRYPT_ENTRY(TWOFISH256); +#endif +#ifdef RC6 + MCRYPT_ENTRY(RC6); +#endif +#ifdef IDEA + MCRYPT_ENTRY(IDEA); #endif + return SUCCESS; } @@ -179,6 +188,11 @@ source = psource->value.lval; i = size->value.lval; + if(i <= 0) { + php3_error(E_WARNING, "illegal size input parameter"); + RETURN_FALSE; + } + iv = ecalloc(i, 1); if(source == RANDOM || source == URANDOM) { Index: php4/ext/mcrypt/php_mcrypt.h diff -u php4/ext/mcrypt/php_mcrypt.h:1.7 php4/ext/mcrypt/php_mcrypt.h:1.8 --- php4/ext/mcrypt/php_mcrypt.h:1.7 Sun Apr 25 17:49:01 1999 +++ php4/ext/mcrypt/php_mcrypt.h Sat May 1 07:14:22 1999 @@ -3,6 +3,12 @@ #if HAVE_LIBMCRYPT +#if PHP_API_VERSION < 19990421 +#define zend_module_entry php3_module_entry +#include "modules.h" +#include "internal_functions.h" +#endif + extern zend_module_entry mcrypt_module_entry; #define mcrypt_module_ptr &mcrypt_module_entry -- PHP 4 Beta

« previous php.version4 (#615) next »