From 4fafa8ae5a7bcd700f368bbe6016e0b0fb2cc892 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 27 Dec 2017 15:43:33 +0100 Subject: Implement simulation mode for cookies (de/en)cryption This should close #102 This commit can be useful for two use-cases: 1. When deploying Snuffleupagus on big CMS like Magento, and not knowing what cookies are modified via javascript. 2. When deploying Snuffleupagus on big websites: you don't want to disconnect every single user at once. When simulation is enabled, if the decryption fails, a log message is now issued, and the cookie value taken as it (since odds are that it's non-encrypted). --- src/sp_config_keywords.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sp_config_keywords.c') diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 2d294ee..32363b8 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c @@ -111,6 +111,7 @@ int parse_cookie(char *line) { sp_config_functions sp_config_funcs_cookie_encryption[] = { {parse_str, SP_TOKEN_NAME, &name}, {parse_str, SP_TOKEN_SAMESITE, &samesite}, + {parse_empty, SP_TOKEN_SIMULATION, &cookie->simulation}, {parse_empty, SP_TOKEN_ENCRYPT, &cookie->encrypt}, {0}}; -- cgit v1.3