From bc4d0e014e9fb1edd05e6f9c91cbf97b6c5546b4 Mon Sep 17 00:00:00 2001 From: Thibault "bui" Koechlin Date: Thu, 28 Dec 2017 13:37:10 +0100 Subject: Implement regexp support for cookies encryption It's now possible to encrypt cookies matching a specific regexp. This should close #106 --- src/snuffleupagus.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/snuffleupagus.c') 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) { snuffleupagus_globals->config.config_disabled_constructs->construct_eval = sp_list_new(); snuffleupagus_globals->config.config_disabled_functions->disabled_functions = sp_list_new(); snuffleupagus_globals->config.config_disabled_functions_ret->disabled_functions = sp_list_new(); - SP_INIT_HT(snuffleupagus_globals->config.config_cookie->cookies); + snuffleupagus_globals->config.config_cookie->cookies = sp_list_new(); #undef SP_INIT #undef SP_INIT_HT @@ -96,7 +96,6 @@ PHP_MSHUTDOWN_FUNCTION(snuffleupagus) { pefree(SNUFFLEUPAGUS_G(F), 1); FREE_HT(disabled_functions_hook); - FREE_HT(config.config_cookie->cookies); #undef FREE_HT @@ -109,19 +108,20 @@ PHP_MSHUTDOWN_FUNCTION(snuffleupagus) { pefree(SNUFFLEUPAGUS_G(config.config_disable_xxe), 1); pefree(SNUFFLEUPAGUS_G(config.config_upload_validation), 1); -#define FREE_LST(L) \ +#define FREE_LST_DISABLE(L) \ do { \ sp_list_node* _n = SNUFFLEUPAGUS_G(L); \ sp_disabled_function_list_free(_n); \ sp_list_free(_n); \ } while(0) - FREE_LST(config.config_disabled_functions->disabled_functions); - FREE_LST(config.config_disabled_functions_ret->disabled_functions); - FREE_LST(config.config_disabled_constructs->construct_include); - FREE_LST(config.config_disabled_constructs->construct_eval); + FREE_LST_DISABLE(config.config_disabled_functions->disabled_functions); + FREE_LST_DISABLE(config.config_disabled_functions_ret->disabled_functions); + FREE_LST_DISABLE(config.config_disabled_constructs->construct_include); + FREE_LST_DISABLE(config.config_disabled_constructs->construct_eval); + sp_list_free(SNUFFLEUPAGUS_G(config).config_cookie->cookies); -#undef FREE_LST +#undef FREE_LST_DISABLE pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions), 1); pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions_ret), 1); -- cgit v1.3