EAP-SIM/AKA: Pass EAP type as argument to eap_sim_msg_finish()
This makes it easier for static analyzers to figure out which code paths are possible within eap_sim_msg_finish() for EAP-SIM. This will hopefully avoid some false warnings (CID 68110, CID 68113, CID 68114). Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
f107d00cf6
commit
b2b8a4cb10
6 changed files with 29 additions and 27 deletions
|
@ -449,7 +449,7 @@ static struct wpabuf * eap_sim_client_error(struct eap_sim_data *data, u8 id,
|
|||
msg = eap_sim_msg_init(EAP_CODE_RESPONSE, id, EAP_TYPE_SIM,
|
||||
EAP_SIM_SUBTYPE_CLIENT_ERROR);
|
||||
eap_sim_msg_add(msg, EAP_SIM_AT_CLIENT_ERROR_CODE, err, NULL, 0);
|
||||
return eap_sim_msg_finish(msg, NULL, NULL, 0);
|
||||
return eap_sim_msg_finish(msg, EAP_TYPE_SIM, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -502,7 +502,7 @@ static struct wpabuf * eap_sim_response_start(struct eap_sm *sm,
|
|||
identity, identity_len);
|
||||
}
|
||||
|
||||
return eap_sim_msg_finish(msg, NULL, NULL, 0);
|
||||
return eap_sim_msg_finish(msg, EAP_TYPE_SIM, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -520,7 +520,8 @@ static struct wpabuf * eap_sim_response_challenge(struct eap_sim_data *data,
|
|||
}
|
||||
wpa_printf(MSG_DEBUG, " AT_MAC");
|
||||
eap_sim_msg_add_mac(msg, EAP_SIM_AT_MAC);
|
||||
return eap_sim_msg_finish(msg, data->k_aut, (u8 *) data->sres,
|
||||
return eap_sim_msg_finish(msg, EAP_TYPE_SIM, data->k_aut,
|
||||
(u8 *) data->sres,
|
||||
data->num_chal * EAP_SIM_SRES_LEN);
|
||||
}
|
||||
|
||||
|
@ -562,7 +563,7 @@ static struct wpabuf * eap_sim_response_reauth(struct eap_sim_data *data,
|
|||
}
|
||||
wpa_printf(MSG_DEBUG, " AT_MAC");
|
||||
eap_sim_msg_add_mac(msg, EAP_SIM_AT_MAC);
|
||||
return eap_sim_msg_finish(msg, data->k_aut, nonce_s,
|
||||
return eap_sim_msg_finish(msg, EAP_TYPE_SIM, data->k_aut, nonce_s,
|
||||
EAP_SIM_NONCE_S_LEN);
|
||||
}
|
||||
|
||||
|
@ -596,7 +597,7 @@ static struct wpabuf * eap_sim_response_notification(struct eap_sim_data *data,
|
|||
wpa_printf(MSG_DEBUG, " AT_MAC");
|
||||
eap_sim_msg_add_mac(msg, EAP_SIM_AT_MAC);
|
||||
}
|
||||
return eap_sim_msg_finish(msg, k_aut, (u8 *) "", 0);
|
||||
return eap_sim_msg_finish(msg, EAP_TYPE_SIM, k_aut, (u8 *) "", 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue