summaryrefslogtreecommitdiff
path: root/src/snuffleupagus.c
diff options
context:
space:
mode:
authorThibault "bui" Koechlin2017-12-28 13:37:10 +0100
committerjvoisin2017-12-28 13:37:10 +0100
commitbc4d0e014e9fb1edd05e6f9c91cbf97b6c5546b4 (patch)
treecad37642d9c1e5ef786f29c18a030c4a8a288af2 /src/snuffleupagus.c
parentfe057bba5baaef8fe428b971604194ef9c9119c0 (diff)
Implement regexp support for cookies encryption
It's now possible to encrypt cookies matching a specific regexp. This should close #106
Diffstat (limited to 'src/snuffleupagus.c')
-rw-r--r--src/snuffleupagus.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c
index ae1a864..afbd725 100644
--- a/src/snuffleupagus.c
+++ b/src/snuffleupagus.c
@@ -78,7 +78,7 @@ PHP_GINIT_FUNCTION(snuffleupagus) {
78 snuffleupagus_globals->config.config_disabled_constructs->construct_eval = sp_list_new(); 78 snuffleupagus_globals->config.config_disabled_constructs->construct_eval = sp_list_new();
79 snuffleupagus_globals->config.config_disabled_functions->disabled_functions = sp_list_new(); 79 snuffleupagus_globals->config.config_disabled_functions->disabled_functions = sp_list_new();
80 snuffleupagus_globals->config.config_disabled_functions_ret->disabled_functions = sp_list_new(); 80 snuffleupagus_globals->config.config_disabled_functions_ret->disabled_functions = sp_list_new();
81 SP_INIT_HT(snuffleupagus_globals->config.config_cookie->cookies); 81 snuffleupagus_globals->config.config_cookie->cookies = sp_list_new();
82 82
83#undef SP_INIT 83#undef SP_INIT
84#undef SP_INIT_HT 84#undef SP_INIT_HT
@@ -96,7 +96,6 @@ PHP_MSHUTDOWN_FUNCTION(snuffleupagus) {
96 pefree(SNUFFLEUPAGUS_G(F), 1); 96 pefree(SNUFFLEUPAGUS_G(F), 1);
97 97
98 FREE_HT(disabled_functions_hook); 98 FREE_HT(disabled_functions_hook);
99 FREE_HT(config.config_cookie->cookies);
100 99
101#undef FREE_HT 100#undef FREE_HT
102 101
@@ -109,19 +108,20 @@ PHP_MSHUTDOWN_FUNCTION(snuffleupagus) {
109 pefree(SNUFFLEUPAGUS_G(config.config_disable_xxe), 1); 108 pefree(SNUFFLEUPAGUS_G(config.config_disable_xxe), 1);
110 pefree(SNUFFLEUPAGUS_G(config.config_upload_validation), 1); 109 pefree(SNUFFLEUPAGUS_G(config.config_upload_validation), 1);
111 110
112#define FREE_LST(L) \ 111#define FREE_LST_DISABLE(L) \
113 do { \ 112 do { \
114 sp_list_node* _n = SNUFFLEUPAGUS_G(L); \ 113 sp_list_node* _n = SNUFFLEUPAGUS_G(L); \
115 sp_disabled_function_list_free(_n); \ 114 sp_disabled_function_list_free(_n); \
116 sp_list_free(_n); \ 115 sp_list_free(_n); \
117 } while(0) 116 } while(0)
118 117
119 FREE_LST(config.config_disabled_functions->disabled_functions); 118 FREE_LST_DISABLE(config.config_disabled_functions->disabled_functions);
120 FREE_LST(config.config_disabled_functions_ret->disabled_functions); 119 FREE_LST_DISABLE(config.config_disabled_functions_ret->disabled_functions);
121 FREE_LST(config.config_disabled_constructs->construct_include); 120 FREE_LST_DISABLE(config.config_disabled_constructs->construct_include);
122 FREE_LST(config.config_disabled_constructs->construct_eval); 121 FREE_LST_DISABLE(config.config_disabled_constructs->construct_eval);
122 sp_list_free(SNUFFLEUPAGUS_G(config).config_cookie->cookies);
123 123
124#undef FREE_LST 124#undef FREE_LST_DISABLE
125 125
126 pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions), 1); 126 pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions), 1);
127 pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions_ret), 1); 127 pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions_ret), 1);