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/sp_config.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/sp_config.h') diff --git a/src/sp_config.h b/src/sp_config.h index 3a7a79c..aca9ff6 100644 --- a/src/sp_config.h +++ b/src/sp_config.h @@ -58,7 +58,9 @@ typedef struct { bool enable; } sp_config_disable_xxe; typedef struct { enum samesite_type {strict=1, lax=2} samesite; bool encrypt; - bool simulation; + char *name; + pcre *name_r; + bool simulation; } sp_cookie; typedef struct { @@ -114,7 +116,7 @@ typedef struct { } sp_config_disabled_functions; typedef struct { - HashTable *cookies; // HashTable of sp_cookie + sp_list_node *cookies; //list of sp_cookie for regexp/names } sp_config_cookie; typedef struct { @@ -204,6 +206,7 @@ typedef struct { // cookies encryption #define SP_TOKEN_NAME ".name(" +#define SP_TOKEN_NAME_REGEXP ".name_r(" // cookies samesite #define SP_TOKEN_SAMESITE ".samesite(" -- cgit v1.3