]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-isakmp.c
CVE-2016-7925/Add more bounds checks.
[tcpdump] / print-isakmp.c
index dcf2ea44705dbaae99df0703cb7694c6a97dc2a8..b11e22d46983c84117cf70816bd4b5e0b8f4bd5b 100644 (file)
@@ -28,6 +28,8 @@
  *
  */
 
+/* \summary: Internet Security Association and Key Management Protocol (ISAKMP) printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -642,12 +644,12 @@ ikev1_print(netdissect_options *ndo,
            const u_char *bp2, struct isakmp *base);
 
 #define MAXINITIATORS  20
-int ninitiator = 0;
+static int ninitiator = 0;
 union inaddr_u {
        struct in_addr in4;
        struct in6_addr in6;
 };
-struct {
+static struct {
        cookie_t initiator;
        u_int version;
        union inaddr_u iaddr;
@@ -1463,7 +1465,7 @@ trunc:
 
 static const u_char *
 ikev1_cert_print(netdissect_options *ndo, u_char tpay _U_,
-                const struct isakmp_gen *ext, u_int item_len _U_,
+                const struct isakmp_gen *ext, u_int item_len,
                 const u_char *ep _U_, uint32_t phase _U_,
                 uint32_t doi0 _U_,
                 uint32_t proto0 _U_, int depth _U_)
@@ -1496,7 +1498,7 @@ trunc:
 
 static const u_char *
 ikev1_cr_print(netdissect_options *ndo, u_char tpay _U_,
-              const struct isakmp_gen *ext, u_int item_len _U_,
+              const struct isakmp_gen *ext, u_int item_len,
               const u_char *ep _U_, uint32_t phase _U_, uint32_t doi0 _U_,
               uint32_t proto0 _U_, int depth _U_)
 {
@@ -1578,7 +1580,7 @@ static const u_char *
 ikev1_nonce_print(netdissect_options *ndo, u_char tpay _U_,
                  const struct isakmp_gen *ext,
                  u_int item_len _U_,
-                 const u_char *ep _U_,
+                 const u_char *ep,
                  uint32_t phase _U_, uint32_t doi _U_,
                  uint32_t proto _U_, int depth _U_)
 {
@@ -1966,9 +1968,9 @@ trunc:
 static const u_char *
 ikev2_sa_print(netdissect_options *ndo, u_char tpay,
                const struct isakmp_gen *ext1,
-               u_int item_len _U_, const u_char *ep _U_,
+               u_int item_len _U_, const u_char *ep,
                uint32_t phase _U_, uint32_t doi _U_,
-               uint32_t proto _U_, int depth _U_)
+               uint32_t proto _U_, int depth)
 {
        struct isakmp_gen e;
        int    osa_length, sa_length;
@@ -2125,7 +2127,7 @@ ikev2_cr_print(netdissect_options *ndo, u_char tpay,
 static const u_char *
 ikev2_auth_print(netdissect_options *ndo, u_char tpay,
                const struct isakmp_gen *ext,
-               u_int item_len _U_, const u_char *ep _U_,
+               u_int item_len _U_, const u_char *ep,
                uint32_t phase _U_, uint32_t doi _U_,
                uint32_t proto _U_, int depth _U_)
 {
@@ -2161,7 +2163,7 @@ trunc:
 static const u_char *
 ikev2_nonce_print(netdissect_options *ndo, u_char tpay,
                const struct isakmp_gen *ext,
-               u_int item_len _U_, const u_char *ep _U_,
+               u_int item_len _U_, const u_char *ep,
                uint32_t phase _U_, uint32_t doi _U_,
                uint32_t proto _U_, int depth _U_)
 {
@@ -2191,7 +2193,7 @@ trunc:
 static const u_char *
 ikev2_n_print(netdissect_options *ndo, u_char tpay _U_,
                const struct isakmp_gen *ext,
-               u_int item_len _U_, const u_char *ep _U_,
+               u_int item_len, const u_char *ep,
                uint32_t phase _U_, uint32_t doi _U_,
                uint32_t proto _U_, int depth _U_)
 {