Skip to content

Commit

Permalink
Mark parameter in ext/ldap as sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWolla committed Jun 13, 2022
1 parent 176a484 commit 788b7a0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions ext/ldap/ldap.c
Expand Up @@ -28,6 +28,7 @@

#include "php.h"
#include "php_ini.h"
#include "Zend/zend_attributes.h"

#include <stddef.h>

Expand Down
14 changes: 14 additions & 0 deletions ext/ldap/ldap.stub.php
Expand Up @@ -610,6 +610,9 @@
#endif

#ifdef HAVE_ORALDAP
/**
* @sensitive-param $password
*/
function ldap_connect(?string $uri = null, int $port = 389, string $wallet = UNKNOWN, string $password = UNKNOWN, int $auth_mode = GSLC_SSL_NO_AUTH): LDAP\Connection|false {}
#else
function ldap_connect(?string $uri = null, int $port = 389): LDAP\Connection|false {}
Expand All @@ -620,11 +623,20 @@ function ldap_unbind(LDAP\Connection $ldap): bool {}
/** @alias ldap_unbind */
function ldap_close(LDAP\Connection $ldap): bool {}

/**
* @sensitive-param $password
*/
function ldap_bind(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null): bool {}

/**
* @sensitive-param $password
*/
function ldap_bind_ext(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null, ?array $controls = null): LDAP\Result|false {}

#ifdef HAVE_LDAP_SASL
/**
* @sensitive-param $password
*/
function ldap_sasl_bind(LDAP\Connection $ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): bool {}
#endif

Expand Down Expand Up @@ -779,6 +791,8 @@ function ldap_exop(LDAP\Connection $ldap, string $request_oid, ?string $request_
#ifdef HAVE_LDAP_PASSWD
/**
* @param array $controls
* @sensitive-param $old_password
* @sensitive-param $new_password
*/
function ldap_exop_passwd(LDAP\Connection $ldap, string $user = "", string $old_password = "", string $new_password = "", &$controls = null): string|bool {}
#endif
Expand Down
15 changes: 14 additions & 1 deletion ext/ldap/ldap_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 788b7a0

Please sign in to comment.