static void eap_sake_process(struct eap_sm *sm, void *priv, u8 *respData, size_t respDataLen) { struct eap_sake_data *data = priv; struct eap_sake_hdr *resp; u8 subtype, *pos, *end; resp = (struct eap_sake_hdr *) respData; subtype = resp->subtype; pos = (u8 *) (resp + 1); end = respData + ntohs(resp->length); wpa_hexdump(MSG_DEBUG, "EAP-SAKE: Received attributes", pos, end - pos); switch (subtype) { case EAP_SAKE_SUBTYPE_IDENTITY: eap_sake_process_identity(sm, data, respData, respDataLen, pos, end - pos); break; case EAP_SAKE_SUBTYPE_CHALLENGE: eap_sake_process_challenge(sm, data, respData, respDataLen, pos, end - pos); break; case EAP_SAKE_SUBTYPE_CONFIRM: eap_sake_process_confirm(sm, data, respData, respDataLen, pos, end - pos); break; case EAP_SAKE_SUBTYPE_AUTH_REJECT: eap_sake_process_auth_reject(sm, data, respData, respDataLen, pos, end - pos); break; } }
static void eap_sake_process(struct eap_sm *sm, void *priv, struct wpabuf *respData) { struct eap_sake_data *data = priv; struct eap_sake_hdr *resp; u8 subtype; size_t len; const u8 *pos, *end; pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_SAKE, respData, &len); if (pos == NULL || len < sizeof(struct eap_sake_hdr)) return; resp = (struct eap_sake_hdr *) pos; end = pos + len; subtype = resp->subtype; pos = (u8 *) (resp + 1); wpa_hexdump(MSG_DEBUG, "EAP-SAKE: Received attributes", pos, end - pos); switch (subtype) { case EAP_SAKE_SUBTYPE_IDENTITY: eap_sake_process_identity(sm, data, respData, pos, end - pos); break; case EAP_SAKE_SUBTYPE_CHALLENGE: eap_sake_process_challenge(sm, data, respData, pos, end - pos); break; case EAP_SAKE_SUBTYPE_CONFIRM: eap_sake_process_confirm(sm, data, respData, pos, end - pos); break; case EAP_SAKE_SUBTYPE_AUTH_REJECT: eap_sake_process_auth_reject(sm, data, respData, pos, end - pos); break; } }