Skip to content

Commit 8dd030c

Browse files
committed
Mark password_hash()'s password parameter as sensitive
1 parent 5b02f32 commit 8dd030c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/standard/password.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "php_rand.h"
2525
#include "php_crypt.h"
2626
#include "base64.h"
27+
#include "zend_attributes.h"
2728
#include "zend_interfaces.h"
2829
#include "info.h"
2930
#include "php_random.h"
@@ -448,6 +449,13 @@ PHP_MINIT_FUNCTION(password) /* {{{ */
448449
REGISTER_STRING_CONSTANT("PASSWORD_ARGON2_PROVIDER", "standard", CONST_CS | CONST_PERSISTENT);
449450
#endif
450451

452+
zend_add_parameter_attribute(
453+
zend_hash_str_find_ptr(CG(function_table), "password_hash", sizeof("password_hash") - 1),
454+
0,
455+
zend_ce_sensitive_parameter->name,
456+
0
457+
);
458+
451459
return SUCCESS;
452460
}
453461
/* }}} */

0 commit comments

Comments
 (0)