summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2017-10-02 13:57:19 +0200
committerjvoisin2017-10-02 15:21:20 +0200
commit3552ac0647966ea8bd6ddf0df6ac899421503e8e (patch)
tree4f1efa4a12fcf353f89bbca230ae86e08b03d0e5
parentcd760451559aa2b9a8a242349fa8aefd83d4515d (diff)
Add a warning if the env var is NULL
-rw-r--r--src/sp_cookie_encryption.c4
1 files changed, 4 insertions, 0 deletions
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) {
25 25
26 if (env_var) { 26 if (env_var) {
27 PHP_SHA256Update(&ctx, (unsigned char*)env_var, strlen(env_var)); 27 PHP_SHA256Update(&ctx, (unsigned char*)env_var, strlen(env_var));
28 } else {
29 sp_log_err("cookie_encryption", "The environment variable '%s'"
30 "is empty, cookies are weakly encrypted.",
31 SNUFFLEUPAGUS_G(config).config_snuffleupagus->cookies_env_var);
28 } 32 }
29 33
30 if (encryption_key) { 34 if (encryption_key) {