diff --git a/.gitignore b/.gitignore index 6ee66ba..0b82550 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ scrypt-*.tgz # .deps +*.dep *.lo *.la .libs @@ -23,6 +24,7 @@ libtool configure* install-sh ltmain.sh +ltmain.sh.backup Makefile* missing mkinstalldirs diff --git a/crypto/crypto_scrypt-nosse.c b/crypto/crypto_scrypt-nosse.c index 114ce0a..c617880 100644 --- a/crypto/crypto_scrypt-nosse.c +++ b/crypto/crypto_scrypt-nosse.c @@ -231,24 +231,22 @@ crypto_scrypt(const uint8_t * passwd, size_t passwdlen, uint8_t * XY; uint32_t i; - TSRMLS_FETCH(); - /* Sanity-check parameters. */ #if SIZE_MAX > UINT32_MAX if (buflen > (((uint64_t)(1) << 32) - 1) * 32) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Parameters: $keyLength too big"); + php_error_docref(NULL, E_WARNING, "Invalid Parameters: $keyLength too big"); errno = EFBIG; goto err0; } #endif if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) { errno = EFBIG; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Parameters; $r * $p is >= 2^30"); + php_error_docref(NULL, E_WARNING, "Invalid Parameters; $r * $p is >= 2^30"); goto err0; } if (((N & (N - 1)) != 0) || (N == 0)) { errno = EINVAL; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Parameters; $N is not a power of two greater than 1"); + php_error_docref(NULL, E_WARNING, "Invalid Parameters; $N is not a power of two greater than 1"); goto err0; } if ((r > SIZE_MAX / 128 / p) || @@ -257,7 +255,7 @@ crypto_scrypt(const uint8_t * passwd, size_t passwdlen, #endif (N > SIZE_MAX / 128 / r)) { errno = ENOMEM; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Parameters"); + php_error_docref(NULL, E_WARNING, "Invalid Parameters"); goto err0; } diff --git a/crypto/crypto_scrypt-sse.c b/crypto/crypto_scrypt-sse.c index a41837d..003d632 100644 --- a/crypto/crypto_scrypt-sse.c +++ b/crypto/crypto_scrypt-sse.c @@ -273,24 +273,22 @@ crypto_scrypt(const uint8_t * passwd, size_t passwdlen, uint32_t * XY; uint32_t i; - TSRMLS_FETCH(); - /* Sanity-check parameters. */ #if SIZE_MAX > UINT32_MAX if (buflen > (((uint64_t)(1) << 32) - 1) * 32) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Parameters: $keyLength too big"); + php_error_docref(NULL, E_WARNING, "Invalid Parameters: $keyLength too big"); errno = EFBIG; goto err0; } #endif if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) { errno = EFBIG; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Parameters; $r * $p is >= 2^30"); + php_error_docref(NULL, E_WARNING, "Invalid Parameters; $r * $p is >= 2^30"); goto err0; } if (((N & (N - 1)) != 0) || (N == 0)) { errno = EINVAL; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Parameters; $N is not a power of two greater than 1"); + php_error_docref(NULL, E_WARNING, "Invalid Parameters; $N is not a power of two greater than 1"); goto err0; } if ((r > SIZE_MAX / 128 / p) || @@ -298,7 +296,7 @@ crypto_scrypt(const uint8_t * passwd, size_t passwdlen, (r > (SIZE_MAX - 64) / 256) || #endif (N > SIZE_MAX / 128 / r)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Parameters"); + php_error_docref(NULL, E_WARNING, "Invalid Parameters"); errno = ENOMEM; goto err0; } diff --git a/php_scrypt.c b/php_scrypt.c index 50df498..cad0cab 100644 --- a/php_scrypt.c +++ b/php_scrypt.c @@ -115,7 +115,6 @@ PHP_FUNCTION(scrypt) uint64_t cryptN; uint32_t cryptR; uint32_t cryptP; - int castError; /* Output variables */ char *hex; @@ -126,7 +125,7 @@ PHP_FUNCTION(scrypt) /* Get the parameters for this call */ raw_output = 0; if (zend_parse_parameters_throw( - ZEND_NUM_ARGS() TSRMLS_CC, "ssllll|b", + ZEND_NUM_ARGS(), "ssllll|b", &password, &password_len, &salt, &salt_len, &phpN, &phpR, &phpP, &keyLength, &raw_output ) == FAILURE) @@ -136,7 +135,6 @@ PHP_FUNCTION(scrypt) /* Checks on the parameters */ - castError = 0; cryptN = clampAndCast64(3, "N", phpN, 1); if (EG(exception)) { RETURN_THROWS(); @@ -231,7 +229,7 @@ PHP_FUNCTION(scrypt_pickparams) /* Get the parameters for this call */ if (zend_parse_parameters_throw( - ZEND_NUM_ARGS() TSRMLS_CC, "ldd", + ZEND_NUM_ARGS(), "ldd", &maxmem, &memfrac, &maxtime ) == FAILURE) { @@ -268,7 +266,7 @@ PHP_FUNCTION(scrypt_pickparams) rc = pickparams((size_t) maxmem, memfrac, maxtime, &cryptN, &cryptR, &cryptP); if (rc != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not determine scrypt parameters."); + php_error_docref(NULL, E_WARNING, "Could not determine scrypt parameters."); RETURN_FALSE; } diff --git a/php_scrypt.h b/php_scrypt.h index d0e6144..e4ff523 100644 --- a/php_scrypt.h +++ b/php_scrypt.h @@ -32,9 +32,4 @@ extern zend_module_entry scrypt_module_entry; #define phpext_scrypt_ptr &scrypt_module_entry -#ifndef TSRMLS_CC -#define TSRMLS_CC -#define TSRMLS_FETCH() -#endif - #endif diff --git a/php_scrypt_utils.c b/php_scrypt_utils.c index 1a50380..b6eba48 100644 --- a/php_scrypt_utils.c +++ b/php_scrypt_utils.c @@ -35,7 +35,6 @@ */ uint64_t clampAndCast64(uint32_t argNum, const char *argName, long value, long min) { - TSRMLS_FETCH(); if (value <= min) { #if PHP_VERSION_ID >= 80000 @@ -63,7 +62,6 @@ uint64_t clampAndCast64(uint32_t argNum, const char *argName, long value, long m */ uint32_t clampAndCast32(uint32_t argNum, const char *argName, long value, long min) { - TSRMLS_FETCH(); if (value <= min) { #if PHP_VERSION_ID >= 80000