diff options
Diffstat (limited to 'ext/hash/hash.c')
-rw-r--r-- | ext/hash/hash.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/hash/hash.c b/ext/hash/hash.c index b78f979130..4bf5fa6f7e 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -86,7 +86,7 @@ static struct mhash_bc_entry mhash_to_hash[MHASH_NUM_ALGOS] = { /* Hash Registry Access */ -PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, int algo_len) /* {{{ */ +PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, size_t algo_len) /* {{{ */ { char *lower = zend_str_tolower_dup(algo, algo_len); php_hash_ops *ops = zend_hash_str_find_ptr(&php_hash_hashtable, lower, algo_len); @@ -211,7 +211,7 @@ static inline void php_hash_string_xor(unsigned char *out, const unsigned char * } } -static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops *ops, void *context, const unsigned char *key, const int key_len) { +static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops *ops, void *context, const unsigned char *key, const size_t key_len) { memset(K, 0, ops->block_size); if (key_len > ops->block_size) { /* Reduce the key first */ @@ -396,7 +396,7 @@ PHP_FUNCTION(hash_update) zval *zhash; php_hash_data *hash; char *data; - int data_len; + size_t data_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zhash, &data, &data_len) == FAILURE) { return; @@ -456,7 +456,7 @@ PHP_FUNCTION(hash_update_file) php_stream_context *context; php_stream *stream; char *filename, buf[1024]; - int filename_len, n; + size_t filename_len, n; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) { return; @@ -602,8 +602,9 @@ PHP_FUNCTION(hash_pbkdf2) zend_string *returnval; char *algo, *salt, *pass = NULL; unsigned char *computed_salt, *digest, *temp, *result, *K1, *K2 = NULL; - zend_long loops, i, j, algo_len, pass_len, iterations, length = 0, digest_length = 0; - int salt_len = 0; + zend_long loops, i, j, iterations, digest_length = 0; + size_t algo_len, pass_len, length = 0; + size_t salt_len = 0; zend_bool raw_output = 0; const php_hash_ops *ops; void *context; @@ -920,7 +921,7 @@ PHP_FUNCTION(mhash_keygen_s2k) zend_long algorithm, l_bytes; int bytes; char *password, *salt; - int password_len, salt_len; + size_t password_len, salt_len; char padded_salt[SALT_SIZE]; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lssl", &algorithm, &password, &password_len, &salt, &salt_len, &l_bytes) == FAILURE) { |