]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-isakmp.c
IPX: Add a length check
[tcpdump] / print-isakmp.c
index d407e81049e076a48730386662325556b234d417..17e7ede99aa2325193aa7b144a0d7d0214d121fb 100644 (file)
@@ -1175,7 +1175,7 @@ static const struct attrmap ipsec_t_map[] = {
 };
 
 static const struct attrmap encr_t_map[] = {
-       { NULL, 0, { NULL } },  { NULL, 0, { NULL } },  /* 0, 1 */
+       { NULL, 0, { NULL } },  { NULL, 0, { NULL } },  /* 0, 1 */
        { NULL, 0, { NULL } },  { NULL, 0, { NULL } },  /* 2, 3 */
        { NULL, 0, { NULL } },  { NULL, 0, { NULL } },  /* 4, 5 */
        { NULL, 0, { NULL } },  { NULL, 0, { NULL } },  /* 6, 7 */
@@ -1188,7 +1188,7 @@ static const struct attrmap encr_t_map[] = {
 static const struct attrmap oakley_t_map[] = {
        { NULL, 0, { NULL } },
        { "enc", 8,     { NULL, "1des", "idea", "blowfish", "rc5",
-                         "3des", "cast", "aes", }, },
+                         "3des", "cast", "aes", }, },
        { "hash", 7,    { NULL, "md5", "sha1", "tiger",
                          "sha2-256", "sha2-384", "sha2-512", }, },
        { "auth", 6,    { NULL, "preshared", "dss", "rsa sig", "rsa enc",
@@ -1398,7 +1398,7 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_,
                        u_int i;
                        ND_PRINT(" len=%u ", len);
                        for (i = 0; i < len; i++)
-                               safeputchar(ndo, EXTRACT_U_1(data + i));
+                               fn_print_char(ndo, EXTRACT_U_1(data + i));
                        len = 0;
                        break;
                    }
@@ -2752,7 +2752,7 @@ ike_sub0_print(netdissect_options *ndo,
 
        return cp;
 trunc:
-       ND_PRINT(" [|isakmp]");
+       nd_print_trunc(ndo);
        return NULL;
 }
 
@@ -2920,7 +2920,7 @@ ikev2_sub0_print(netdissect_options *ndo, const struct isakmp *base,
 
        return cp;
 trunc:
-       ND_PRINT(" [|isakmp]");
+       nd_print_trunc(ndo);
        return NULL;
 }
 
@@ -3045,7 +3045,7 @@ isakmp_print(netdissect_options *ndo,
        ep = ndo->ndo_snapend;
 
        if ((const struct isakmp *)ep < p + 1) {
-               ND_PRINT("[|isakmp]");
+               nd_print_trunc(ndo);
                return;
        }
 
@@ -3103,8 +3103,7 @@ isakmp_rfc3948_print(netdissect_options *ndo,
        /*
         * see if this is an IKE packet
         */
-       if (EXTRACT_U_1(bp) == 0 && EXTRACT_U_1(bp + 1) == 0 &&
-           EXTRACT_U_1(bp + 2) == 0 && EXTRACT_U_1(bp + 3) == 0) {
+       if (EXTRACT_BE_U_4(bp) == 0) {
                ND_PRINT("NONESP-encap: ");
                isakmp_print(ndo, bp+4, length-4, bp2);
                return;
@@ -3130,13 +3129,6 @@ isakmp_rfc3948_print(netdissect_options *ndo,
        }
 
 trunc:
-       ND_PRINT("[|isakmp]");
+       nd_print_trunc(ndo);
        return;
 }
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 8
- * End:
- */