message: Log message if unknown/disallowed payload received
authorTobias Brunner <tobias@strongswan.org>
Fri, 15 May 2015 10:19:27 +0000 (12:19 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 1 Jun 2015 07:42:11 +0000 (09:42 +0200)
src/libcharon/encoding/message.c

index 925a5b2..3303024 100644 (file)
@@ -2286,9 +2286,16 @@ static status_t parse_payloads(private_message_t *this)
                        payload->destroy(payload);
                        return VERIFY_ERROR;
                }
-
-               DBG2(DBG_ENC, "%N payload verified, adding to payload list",
-                        payload_type_names, type);
+               if (payload->get_type(payload) == PL_UNKNOWN)
+               {
+                       DBG2(DBG_ENC, "%N payload unknown or not allowed",
+                                payload_type_names, type);
+               }
+               else
+               {
+                       DBG2(DBG_ENC, "%N payload verified, adding to payload list",
+                                payload_type_names, type);
+               }
                this->payloads->insert_last(this->payloads, payload);
 
                /* an encrypted (fragment) payload MUST be the last one, so STOP here.