save-keys: Add warning message to log if keys are being saved
authorTobias Brunner <tobias@strongswan.org>
Thu, 15 Feb 2018 09:04:47 +0000 (10:04 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 15 Feb 2018 22:03:29 +0000 (23:03 +0100)
src/libcharon/plugins/save_keys/save_keys_listener.c

index 72e3dad..fc16f20 100644 (file)
@@ -415,5 +415,21 @@ save_keys_listener_t *save_keys_listener_create()
                                                                           FALSE, lib->ns),
        );
 
+       if (this->path && (this->ike || this->esp))
+       {
+               char *keys = "IKE";
+
+               if (this->ike && this->esp)
+               {
+                       keys = "IKE AND ESP";
+               }
+               else if (this->esp)
+               {
+                       keys = "ESP";
+               }
+               DBG0(DBG_DMN, "!!", keys, this->path);
+               DBG0(DBG_DMN, "!! WARNING: SAVING %s KEYS TO '%s'", keys, this->path);
+               DBG0(DBG_DMN, "!!", keys, this->path);
+       }
        return &this->public;
 }