X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/8534f3b7bfbb81a76fc110a79bbbfedf35cc4f30..refs/heads/master:/print-krb.c diff --git a/print-krb.c b/print-krb.c index 41a6126a..69a0c115 100644 --- a/print-krb.c +++ b/print-krb.c @@ -23,9 +23,7 @@ /* \summary: Kerberos printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -168,8 +166,6 @@ krb4_print(netdissect_options *ndo, kp = (const struct krb *)cp; - ND_TCHECK_1(kp->type); - type = GET_U_1(kp->type) & (0xFF << 1); ND_PRINT(" %s %s: ", @@ -181,7 +177,6 @@ krb4_print(netdissect_options *ndo, if ((cp = krb4_print_hdr(ndo, cp)) == NULL) return; cp += 4; /* ctime */ - ND_TCHECK_1(cp); ND_PRINT(" %umin ", GET_U_1(cp) * 5); cp++; PRINT; @@ -191,14 +186,11 @@ krb4_print(netdissect_options *ndo, case AUTH_MSG_APPL_REQUEST: cp += 2; - ND_TCHECK_1(cp); ND_PRINT("v%u ", GET_U_1(cp)); cp++; PRINT; - ND_TCHECK_1(cp); ND_PRINT(" (%u)", GET_U_1(cp)); cp++; - ND_TCHECK_1(cp); ND_PRINT(" (%u)", GET_U_1(cp)); break; @@ -206,7 +198,6 @@ krb4_print(netdissect_options *ndo, if ((cp = krb4_print_hdr(ndo, cp)) == NULL) return; cp += 10; /* timestamp + n + exp + kvno */ - ND_TCHECK_LEN(cp, sizeof(short)); len = KTOHSP(kp, cp); ND_PRINT(" (%u)", len); break; @@ -214,8 +205,7 @@ krb4_print(netdissect_options *ndo, case AUTH_MSG_ERR_REPLY: if ((cp = krb4_print_hdr(ndo, cp)) == NULL) return; - cp += 4; /* timestamp */ - ND_TCHECK_LEN(cp, sizeof(short)); + cp += 4; /* timestamp */ ND_PRINT(" %s ", tok2str(kerr2str, NULL, KTOHSP(kp, cp))); cp += 4; PRINT; @@ -237,13 +227,10 @@ krb_print(netdissect_options *ndo, { const struct krb *kp; - ndo->ndo_protocol = "krb"; - kp = (const struct krb *)dat; + ndo->ndo_protocol = "kerberos"; + nd_print_protocol(ndo); - if (dat >= ndo->ndo_snapend) { - nd_print_trunc(ndo); - return; - } + kp = (const struct krb *)dat; switch (GET_U_1(kp->pvno)) { @@ -264,5 +251,4 @@ krb_print(netdissect_options *ndo, /* Decode ASN.1 here "someday" */ break; } - return; }