Skip to content

Commit c6d2648

Browse files
committed
Mark parameter in ext/oci8 as sensitive
1 parent c2bee22 commit c6d2648

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

ext/oci8/oci8.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "php.h"
3232
#include "ext/standard/info.h"
3333
#include "php_ini.h"
34+
#include "zend_attributes.h"
3435
#include "zend_smart_str.h"
3536

3637
#ifdef HAVE_OCI8
@@ -385,6 +386,8 @@ PHP_MINIT_FUNCTION(oci)
385386

386387
REGISTER_LONG_CONSTANT("OCI_FO_RETRY", OCI_FO_RETRY, CONST_CS | CONST_PERSISTENT);
387388

389+
register_oci8_symbols(module_number);
390+
388391
return SUCCESS;
389392
}
390393

ext/oci8/oci8.stub.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,32 +294,42 @@ function oci_close($connection): ?bool {}
294294
*/
295295
function ocilogoff($connection): ?bool {}
296296

297-
/** @return resource|false */
297+
/**
298+
* @sensitive-param $password
299+
* @return resource|false
300+
*/
298301
function oci_new_connect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {}
299302

300303
/**
304+
* @sensitive-param $password
301305
* @return resource|false
302306
* @alias oci_new_connect
303307
* @deprecated
304308
*/
305309
function ocinlogon(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {}
306310

307311
/**
312+
* @sensitive-param $password
308313
* @return resource|false
309314
*/
310315
function oci_connect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {}
311316

312317
/**
318+
* @sensitive-param $password
313319
* @return resource|false
314320
* @alias oci_connect
315321
* @deprecated
316322
*/
317323
function ocilogon(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {}
318324

319-
/** @return resource|false */
325+
/**
326+
* @sensitive-param $password
327+
* @return resource|false
328+
*/
320329
function oci_pconnect(string $username, string $password, ?string $connection_string = null, string $encoding = "", int $session_mode = OCI_DEFAULT) {}
321330

322331
/**
332+
* @sensitive-param $password
323333
* @return resource|false
324334
* @alias oci_pconnect
325335
* @deprecated

ext/oci8/oci8_arginfo.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 9db587b5d431b9dfe7178fd843ae8907db737a04 */
2+
* Stub hash: db170b61403c53d4d420d0095031944f3d036508 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0)
55
ZEND_ARG_INFO(0, statement)
@@ -799,6 +799,16 @@ static const zend_function_entry class_OCICollection_methods[] = {
799799
ZEND_FE_END
800800
};
801801

802+
static void register_oci8_symbols(int module_number)
803+
{
804+
zend_mark_function_parameter_as_sensitive(CG(function_table), "oci_new_connect", 1);
805+
zend_mark_function_parameter_as_sensitive(CG(function_table), "ocinlogon", 1);
806+
zend_mark_function_parameter_as_sensitive(CG(function_table), "oci_connect", 1);
807+
zend_mark_function_parameter_as_sensitive(CG(function_table), "ocilogon", 1);
808+
zend_mark_function_parameter_as_sensitive(CG(function_table), "oci_pconnect", 1);
809+
zend_mark_function_parameter_as_sensitive(CG(function_table), "ociplogon", 1);
810+
}
811+
802812
static zend_class_entry *register_class_OCILob(void)
803813
{
804814
zend_class_entry ce, *class_entry;

0 commit comments

Comments
 (0)