diff options
| author | Ben Fuhrmannek | 2016-02-24 00:36:35 +0100 |
|---|---|---|
| committer | Ben Fuhrmannek | 2016-02-24 00:36:35 +0100 |
| commit | 346455c6b5716c8ce095235428614e15c0adf13e (patch) | |
| tree | aaa648869e88287ed34c6d36cc06474d062b4b32 /php_suhosin7.h | |
| parent | 35b7c9a0e3f8a0daf1718a8ba9889a2aec24dc84 (diff) | |
cookie encryption
Diffstat (limited to 'php_suhosin7.h')
| -rw-r--r-- | php_suhosin7.h | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/php_suhosin7.h b/php_suhosin7.h index 0a40316..eaf2f87 100644 --- a/php_suhosin7.h +++ b/php_suhosin7.h | |||
| @@ -122,8 +122,6 @@ protected_varname: | |||
| 122 | 122 | ||
| 123 | 123 | ||
| 124 | ZEND_BEGIN_MODULE_GLOBALS(suhosin7) | 124 | ZEND_BEGIN_MODULE_GLOBALS(suhosin7) |
| 125 | // zend_long global_value; | ||
| 126 | // char *global_string; | ||
| 127 | zend_bool protectkey; | 125 | zend_bool protectkey; |
| 128 | 126 | ||
| 129 | zend_bool simulation; | 127 | zend_bool simulation; |
| @@ -307,7 +305,7 @@ ZEND_BEGIN_MODULE_GLOBALS(suhosin7) | |||
| 307 | zend_bool log_file_time; | 305 | zend_bool log_file_time; |
| 308 | 306 | ||
| 309 | /* header handler */ | 307 | /* header handler */ |
| 310 | // zend_bool allow_multiheader; | 308 | zend_bool allow_multiheader; |
| 311 | 309 | ||
| 312 | /* mailprotect */ | 310 | /* mailprotect */ |
| 313 | // long mailprotect; | 311 | // long mailprotect; |
| @@ -362,18 +360,43 @@ ZEND_EXTERN_MODULE_GLOBALS(suhosin7) | |||
| 362 | 360 | ||
| 363 | /* functions */ | 361 | /* functions */ |
| 364 | 362 | ||
| 365 | unsigned int suhosin_input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | 363 | // unsigned int suhosin_input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); |
| 366 | unsigned int suhosin_input_filter_wrapper(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | 364 | // unsigned int suhosin_input_filter_wrapper(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); |
| 367 | SUHOSIN7_API void suhosin_log(int loglevel, char *fmt, ...); | 365 | SUHOSIN7_API void suhosin_log(int loglevel, char *fmt, ...); |
| 368 | extern unsigned int (*old_input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | 366 | // extern unsigned int (*orig_input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); |
| 369 | char *suhosin_getenv(char *name, size_t name_len); | 367 | char *suhosin_getenv(char *name, size_t name_len); |
| 370 | 368 | ||
| 369 | // hooks | ||
| 371 | void suhosin_hook_memory_limit(); | 370 | void suhosin_hook_memory_limit(); |
| 372 | void suhosin_hook_treat_data(); | 371 | void suhosin_hook_treat_data(); |
| 373 | void suhosin_hook_execute(); | 372 | void suhosin_hook_input_filter(); |
| 374 | void suhosin_hook_register_server_variables(); | 373 | void suhosin_hook_register_server_variables(); |
| 374 | void suhosin_hook_header_handler(); | ||
| 375 | void suhosin_unhook_header_handler(); | ||
| 376 | void suhosin_hook_execute(); | ||
| 375 | // void suhosin_hook_sha256(); | 377 | // void suhosin_hook_sha256(); |
| 376 | 378 | ||
| 379 | // ifilter.c | ||
| 380 | void suhosin_normalize_varname(char *varname); | ||
| 381 | |||
| 382 | // cookiecrypt.c | ||
| 383 | char *suhosin_cookie_decryptor(char *raw_cookie); | ||
| 384 | zend_string *suhosin_encrypt_single_cookie(char *name, int name_len, char *value, int value_len, char *key); | ||
| 385 | char *suhosin_decrypt_single_cookie(char *name, int name_len, char *value, int value_len, char *key, char **out); | ||
| 386 | |||
| 387 | // crypt.c | ||
| 388 | zend_string *suhosin_encrypt_string(char *str, int len, char *var, int vlen, char *key); | ||
| 389 | zend_string *suhosin_decrypt_string(char *str, int padded_len, char *var, int vlen, char *key, int check_ra); | ||
| 390 | char *suhosin_generate_key(char *key, zend_bool ua, zend_bool dr, long raddr, char *cryptkey); | ||
| 391 | |||
| 392 | // aes.c | ||
| 393 | void suhosin_aes_gentables(); | ||
| 394 | void suhosin_aes_gkey(int nb,int nk,char *key); | ||
| 395 | void suhosin_aes_encrypt(char *buff); | ||
| 396 | void suhosin_aes_decrypt(char *buff); | ||
| 397 | |||
| 398 | // | ||
| 399 | |||
| 377 | static inline void suhosin_bailout() | 400 | static inline void suhosin_bailout() |
| 378 | { | 401 | { |
| 379 | if (!SUHOSIN7_G(simulation)) { | 402 | if (!SUHOSIN7_G(simulation)) { |
| @@ -381,6 +404,13 @@ static inline void suhosin_bailout() | |||
| 381 | } | 404 | } |
| 382 | } | 405 | } |
| 383 | 406 | ||
| 407 | static inline char *suhosin_get_active_function_name() { | ||
| 408 | char *fn = (char *)get_active_function_name(); | ||
| 409 | if (fn == NULL) { | ||
| 410 | return "unknown"; | ||
| 411 | } | ||
| 412 | return fn; | ||
| 413 | } | ||
| 384 | 414 | ||
| 385 | #endif /* PHP_SUHOSIN7_H */ | 415 | #endif /* PHP_SUHOSIN7_H */ |
| 386 | 416 | ||
