Skip to content

Fix hash_pbkdf2 options parameter #11731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ PHP_FUNCTION(hash_pbkdf2)
bool raw_output = 0;
const php_hash_ops *ops;
void *context;
HashTable *args;
HashTable *args = NULL;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|lbh", &algo, &pass, &pass_len, &salt, &salt_len, &iterations, &length, &raw_output, &args) == FAILURE) {
RETURN_THROWS();
Expand Down
2 changes: 1 addition & 1 deletion ext/hash/hash.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function hash_algos(): array {}
function hash_hmac_algos(): array {}

/** @refcount 1 */
function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $binary = false): string {}
function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $binary = false, array $options = []): string {}

function hash_equals(string $known_string, string $user_string): bool {}

Expand Down
3 changes: 2 additions & 1 deletion ext/hash/hash_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 8b5131fd7bd88d1ec0211bcfcb5a4854418aa3c8 */
* Stub hash: 66d99527cf6d7b37ff652bb78fa57d5e3d5c78d9 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash, 0, 2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
Expand Down Expand Up @@ -74,6 +74,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_pbkdf2, 0, 4, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_equals, 0, 2, _IS_BOOL, 0)
Expand Down