Skip to content

Commit

Permalink
Mark parameter in ext/zip as sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWolla committed Jun 13, 2022
1 parent 8f82433 commit 1a4401d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ext/zip/php_zip.c
Expand Up @@ -26,6 +26,7 @@
#include "ext/standard/php_string.h"
#include "ext/pcre/php_pcre.h"
#include "ext/standard/php_filestat.h"
#include "zend_attributes.h"
#include "zend_interfaces.h"
#include "php_zip.h"
#include "php_zip_arginfo.h"
Expand Down Expand Up @@ -3255,6 +3256,8 @@ static PHP_MINIT_FUNCTION(zip)
le_zip_dir = zend_register_list_destructors_ex(php_zip_free_dir, NULL, le_zip_dir_name, module_number);
le_zip_entry = zend_register_list_destructors_ex(php_zip_free_entry, NULL, le_zip_entry_name, module_number);

register_php_zip_symbols(module_number, zip_class_entry);

return SUCCESS;
}
/* }}} */
Expand Down
15 changes: 12 additions & 3 deletions ext/zip/php_zip.stub.php
Expand Up @@ -82,7 +82,10 @@ class ZipArchive implements Countable
/** @tentative-return-type */
public function open(string $filename, int $flags = 0): bool|int {}

/** @tentative-return-type */
/**
* @sensitive-param $password
* @tentative-return-type
*/
public function setPassword(string $password): bool {}

/** @tentative-return-type */
Expand Down Expand Up @@ -223,10 +226,16 @@ public function setCompressionName(string $name, int $method, int $compflags = 0
public function setCompressionIndex(int $index, int $method, int $compflags = 0): bool {}

#ifdef HAVE_ENCRYPTION
/** @tentative-return-type */
/**
* @sensitive-param $password
* @tentative-return-type
*/
public function setEncryptionName(string $name, int $method, ?string $password = null): bool {}

/** @tentative-return-type */
/**
* @sensitive-param $password
* @tentative-return-type
*/
public function setEncryptionIndex(int $index, int $method, ?string $password = null): bool {}
#endif

Expand Down
13 changes: 12 additions & 1 deletion ext/zip/php_zip_arginfo.h

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

0 comments on commit 1a4401d

Please sign in to comment.