diff options
| author | xXx-caillou-xXx | 2018-08-27 13:56:44 +0200 |
|---|---|---|
| committer | jvoisin | 2018-08-27 11:56:44 +0000 |
| commit | 096e7faa6a5e21e5416a7c8c484e27acd4636a66 (patch) | |
| tree | 3dd11a05c4406280238459be917b8f47d22400f7 /src/sp_config.h | |
| parent | 6abdd9abca50c92390b94fbebb3e7065d5d532da (diff) | |
Add whitelist support for php's wrappers
Diffstat (limited to 'src/sp_config.h')
| -rw-r--r-- | src/sp_config.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sp_config.h b/src/sp_config.h index d2fa64f..9d58359 100644 --- a/src/sp_config.h +++ b/src/sp_config.h | |||
| @@ -78,6 +78,12 @@ typedef struct { | |||
| 78 | } sp_cookie; | 78 | } sp_cookie; |
| 79 | 79 | ||
| 80 | typedef struct { | 80 | typedef struct { |
| 81 | sp_list_node *whitelist; | ||
| 82 | bool enabled; | ||
| 83 | size_t num_wrapper; // Used to verify if wrappers were added. | ||
| 84 | } sp_config_wrapper; | ||
| 85 | |||
| 86 | typedef struct { | ||
| 81 | bool encrypt; | 87 | bool encrypt; |
| 82 | bool simulation; | 88 | bool simulation; |
| 83 | } sp_config_session; | 89 | } sp_config_session; |
| @@ -166,6 +172,7 @@ typedef struct { | |||
| 166 | sp_config_global_strict *config_global_strict; | 172 | sp_config_global_strict *config_global_strict; |
| 167 | sp_config_disable_xxe *config_disable_xxe; | 173 | sp_config_disable_xxe *config_disable_xxe; |
| 168 | sp_config_eval *config_eval; | 174 | sp_config_eval *config_eval; |
| 175 | sp_config_wrapper *config_wrapper; | ||
| 169 | sp_config_session *config_session; | 176 | sp_config_session *config_session; |
| 170 | bool hook_execute; | 177 | bool hook_execute; |
| 171 | 178 | ||
| @@ -204,6 +211,7 @@ typedef struct { | |||
| 204 | #define SP_TOKEN_EVAL_BLACKLIST ".eval_blacklist" | 211 | #define SP_TOKEN_EVAL_BLACKLIST ".eval_blacklist" |
| 205 | #define SP_TOKEN_EVAL_WHITELIST ".eval_whitelist" | 212 | #define SP_TOKEN_EVAL_WHITELIST ".eval_whitelist" |
| 206 | #define SP_TOKEN_SLOPPY_COMPARISON ".sloppy_comparison" | 213 | #define SP_TOKEN_SLOPPY_COMPARISON ".sloppy_comparison" |
| 214 | #define SP_TOKEN_ALLOW_WRAPPERS ".wrappers_whitelist" | ||
| 207 | 215 | ||
| 208 | // common tokens | 216 | // common tokens |
| 209 | #define SP_TOKEN_ENABLE ".enable(" | 217 | #define SP_TOKEN_ENABLE ".enable(" |
| @@ -256,8 +264,7 @@ typedef struct { | |||
| 256 | // upload_validator | 264 | // upload_validator |
| 257 | #define SP_TOKEN_UPLOAD_SCRIPT ".script(" | 265 | #define SP_TOKEN_UPLOAD_SCRIPT ".script(" |
| 258 | 266 | ||
| 259 | // eval blacklist | 267 | #define SP_TOKEN_LIST ".list(" |
| 260 | #define SP_TOKEN_EVAL_LIST ".list(" | ||
| 261 | 268 | ||
| 262 | int sp_parse_config(const char *); | 269 | int sp_parse_config(const char *); |
| 263 | int parse_array(sp_disabled_function *); | 270 | int parse_array(sp_disabled_function *); |
| @@ -267,6 +274,7 @@ int parse_regexp(char *restrict, char *restrict, void *); | |||
| 267 | int parse_empty(char *restrict, char *restrict, void *); | 274 | int parse_empty(char *restrict, char *restrict, void *); |
| 268 | int parse_cidr(char *restrict, char *restrict, void *); | 275 | int parse_cidr(char *restrict, char *restrict, void *); |
| 269 | int parse_php_type(char *restrict, char *restrict, void *); | 276 | int parse_php_type(char *restrict, char *restrict, void *); |
| 277 | int parse_list(char *restrict, char *restrict, void *); | ||
| 270 | 278 | ||
| 271 | // cleanup | 279 | // cleanup |
| 272 | void sp_disabled_function_list_free(sp_list_node *); | 280 | void sp_disabled_function_list_free(sp_list_node *); |
