summaryrefslogtreecommitdiff
path: root/print-isakmp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-10 16:22:37 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-09-05 14:59:21 +0200
commit929e4be621ebdcede37865a5767a175f083f9138 (patch)
treebf6ecbc038696e66176b2d50e04e015767f23b3d /print-isakmp.c
parent54b5db3dde658894be730b15480f9b6e27b717a0 (diff)
downloadtcpdump-test-rc.tar.gz
Remove many (761) redundant ND_TCHECK_n() callstest-rc
ND_TCHECK_n(e), n in { 1, 2, 3, 4, 8 }. They are redundant because they are followed by a GET_.*_n(e) call, same n, same e, which do the bounds check. Remove unused 'trunc' labels and most associated codes. Update the outputs of some tests accordingly.
Diffstat (limited to 'print-isakmp.c')
-rw-r--r--print-isakmp.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/print-isakmp.c b/print-isakmp.c
index b3854d15..9a662748 100644
--- a/print-isakmp.c
+++ b/print-isakmp.c
@@ -914,11 +914,9 @@ ikev1_attrmap_print(netdissect_options *ndo,
u_int totlen;
uint32_t t, v;
- ND_TCHECK_1(p);
if (GET_U_1(p) & 0x80)
totlen = 4;
else {
- ND_TCHECK_2(p + 2);
totlen = 4 + GET_BE_U_2(p + 2);
}
if (ep2 < p + totlen) {
@@ -926,7 +924,6 @@ ikev1_attrmap_print(netdissect_options *ndo,
return ep2 + 1;
}
- ND_TCHECK_2(p);
ND_PRINT("(");
t = GET_BE_U_2(p) & 0x7fff;
if (map && t < nmap && map[t].type)
@@ -935,7 +932,6 @@ ikev1_attrmap_print(netdissect_options *ndo,
ND_PRINT("type=#%u ", t);
if (GET_U_1(p) & 0x80) {
ND_PRINT("value=");
- ND_TCHECK_2(p + 2);
v = GET_BE_U_2(p + 2);
if (map && t < nmap && v < map[t].nvalue && map[t].value[v])
ND_PRINT("%s", map[t].value[v]);
@@ -965,11 +961,9 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2)
u_int totlen;
uint32_t t;
- ND_TCHECK_1(p);
if (GET_U_1(p) & 0x80)
totlen = 4;
else {
- ND_TCHECK_2(p + 2);
totlen = 4 + GET_BE_U_2(p + 2);
}
if (ep2 < p + totlen) {
@@ -977,7 +971,6 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2)
return ep2 + 1;
}
- ND_TCHECK_2(p);
ND_PRINT("(");
t = GET_BE_U_2(p) & 0x7fff;
ND_PRINT("type=#%u ", t);
@@ -1042,7 +1035,6 @@ ikev1_sa_print(netdissect_options *ndo, u_char tpay _U_,
np = (const u_char *)ext + sizeof(struct ikev1_pl_sa);
if (sit != 0x01) {
- ND_TCHECK_4(ext + 1);
ident = GET_BE_U_4(ext + 1);
ND_PRINT(" ident=%u", ident);
np += sizeof(ident);
@@ -3111,7 +3103,6 @@ isakmp_rfc3948_print(netdissect_options *ndo,
const u_char *bp2, int ver, int fragmented, u_int ttl_hl)
{
ndo->ndo_protocol = "isakmp_rfc3948";
- ND_TCHECK_1(bp);
if(length == 1 && GET_U_1(bp)==0xff) {
ND_PRINT("isakmp-nat-keep-alive");
return;