Generates a key using hash functions */
PHP_FUNCTION(mhash_keygen_s2k)
{
- long algorithm, bytes;
+ long algorithm, l_bytes;
+ int bytes;
char *password, *salt;
int 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, &bytes) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lssl", &algorithm, &password, &password_len, &salt, &salt_len, &l_bytes) == FAILURE) {
return;
}
+ bytes = (int)l_bytes;
if (bytes <= 0){
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the byte parameter must be greater than 0");
RETURN_FALSE;