From 3552ac0647966ea8bd6ddf0df6ac899421503e8e Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 2 Oct 2017 13:57:19 +0200 Subject: Add a warning if the env var is NULL --- src/sp_cookie_encryption.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c index 69c438d..a65a748 100644 --- a/src/sp_cookie_encryption.c +++ b/src/sp_cookie_encryption.c @@ -25,6 +25,10 @@ static inline void generate_key(unsigned char *key) { if (env_var) { PHP_SHA256Update(&ctx, (unsigned char*)env_var, strlen(env_var)); + } else { + sp_log_err("cookie_encryption", "The environment variable '%s'" + "is empty, cookies are weakly encrypted.", + SNUFFLEUPAGUS_G(config).config_snuffleupagus->cookies_env_var); } if (encryption_key) { -- cgit v1.3