ERP: Avoid mixing of enum types

Use explicit typecasting to avoid implicit conversion warnings in cases
where enum eap_erp_type is used in functions taking an EapType argument.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-07-07 12:09:09 +03:00
parent 96e8c13da7
commit 597e8afeb4
2 changed files with 6 additions and 5 deletions

View File

@ -584,7 +584,7 @@ static int eap_peer_erp_reauth_start(struct eap_sm *sm,
wpa_printf(MSG_DEBUG, "EAP: Valid ERP key found %s (SEQ=%u)", wpa_printf(MSG_DEBUG, "EAP: Valid ERP key found %s (SEQ=%u)",
erp->keyname_nai, erp->next_seq); erp->keyname_nai, erp->next_seq);
msg = eap_msg_alloc(EAP_VENDOR_IETF, EAP_ERP_TYPE_REAUTH, msg = eap_msg_alloc(EAP_VENDOR_IETF, (EapType) EAP_ERP_TYPE_REAUTH,
1 + 2 + 2 + os_strlen(erp->keyname_nai) + 1 + 16, 1 + 2 + 2 + os_strlen(erp->keyname_nai) + 1 + 16,
EAP_CODE_INITIATE, hdr->identifier); EAP_CODE_INITIATE, hdr->identifier);
if (msg == NULL) if (msg == NULL)

View File

@ -96,7 +96,8 @@ static struct wpabuf * eap_sm_buildInitiateReauthStart(struct eap_sm *sm,
plen += 2 + domain_len; plen += 2 + domain_len;
} }
msg = eap_msg_alloc(EAP_VENDOR_IETF, EAP_ERP_TYPE_REAUTH_START, plen, msg = eap_msg_alloc(EAP_VENDOR_IETF,
(EapType) EAP_ERP_TYPE_REAUTH_START, plen,
EAP_CODE_INITIATE, id); EAP_CODE_INITIATE, id);
if (msg == NULL) if (msg == NULL)
return NULL; return NULL;
@ -714,8 +715,8 @@ static void erp_send_finish_reauth(struct eap_sm *sm,
plen = 1 + 2 + 2 + os_strlen(nai); plen = 1 + 2 + 2 + os_strlen(nai);
if (hash_len) if (hash_len)
plen += 1 + hash_len; plen += 1 + hash_len;
msg = eap_msg_alloc(EAP_VENDOR_IETF, EAP_ERP_TYPE_REAUTH, plen, msg = eap_msg_alloc(EAP_VENDOR_IETF, (EapType) EAP_ERP_TYPE_REAUTH,
EAP_CODE_FINISH, id); plen, EAP_CODE_FINISH, id);
if (msg == NULL) if (msg == NULL)
return; return;
wpabuf_put_u8(msg, flags); wpabuf_put_u8(msg, flags);
@ -799,7 +800,7 @@ SM_STATE(EAP, INITIATE_RECEIVED)
sm->rxInitiate = FALSE; sm->rxInitiate = FALSE;
pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_ERP_TYPE_REAUTH, pos = eap_hdr_validate(EAP_VENDOR_IETF, (EapType) EAP_ERP_TYPE_REAUTH,
sm->eap_if.eapRespData, &len); sm->eap_if.eapRespData, &len);
if (pos == NULL) { if (pos == NULL) {
wpa_printf(MSG_INFO, "EAP-Initiate: Invalid frame"); wpa_printf(MSG_INFO, "EAP-Initiate: Invalid frame");