u_int type, subtype, len;
int count;
- ND_TCHECK_1(cp);
type = GET_U_1(cp);
- ND_TCHECK_2(cp + 2);
len = GET_BE_U_2(cp + 2);
if(len != length) {
goto trunc;
if (type == EAP_REQUEST || type == EAP_RESPONSE) {
/* RFC 3748 Section 4.1 */
- ND_TCHECK_1(cp + 4);
subtype = GET_U_1(cp + 4);
ND_PRINT("\n\t\t Type %s (%u)",
tok2str(eap_type_values, "unknown", subtype),
case EAP_TYPE_IDENTITY:
if (len - 5 > 0) {
ND_PRINT(", Identity: ");
- (void)nd_printzp(ndo, cp + 5, len - 5, NULL);
+ nd_printjnp(ndo, cp + 5, len - 5);
}
break;
case EAP_TYPE_NOTIFICATION:
if (len - 5 > 0) {
ND_PRINT(", Notification: ");
- (void)nd_printzp(ndo, cp + 5, len - 5, NULL);
+ nd_printjnp(ndo, cp + 5, len - 5);
}
break;
* type one octet per type
*/
while (count < (int)len) {
- ND_TCHECK_1(cp + count);
ND_PRINT(" %s (%u),",
tok2str(eap_type_values, "unknown", GET_U_1((cp + count))),
GET_U_1(cp + count));
case EAP_TYPE_TTLS:
case EAP_TYPE_TLS:
- ND_TCHECK_1(cp + 5);
if (subtype == EAP_TYPE_TTLS)
ND_PRINT(" TTLSv%u",
EAP_TTLS_VERSION(GET_U_1((cp + 5))));
GET_U_1(cp + 5));
if (EAP_TLS_EXTRACT_BIT_L(GET_U_1(cp + 5))) {
- ND_TCHECK_4(cp + 6);
ND_PRINT(" len %u", GET_BE_U_4(cp + 6));
}
break;
case EAP_TYPE_FAST:
- ND_TCHECK_1(cp + 5);
ND_PRINT(" FASTv%u",
EAP_TTLS_VERSION(GET_U_1((cp + 5))));
ND_PRINT(" flags [%s] 0x%02x,",
GET_U_1(cp + 5));
if (EAP_TLS_EXTRACT_BIT_L(GET_U_1(cp + 5))) {
- ND_TCHECK_4(cp + 6);
ND_PRINT(" len %u", GET_BE_U_4(cp + 6));
}
case EAP_TYPE_AKA:
case EAP_TYPE_SIM:
- ND_TCHECK_1(cp + 5);
ND_PRINT(" subtype [%s] 0x%02x,",
tok2str(eap_aka_subtype_values, "unknown", GET_U_1((cp + 5))),
GET_U_1(cp + 5));
return;
trunc:
nd_print_trunc(ndo);
- return;
}
void