OCV: Move "OCV failed" prefix to callers

Make reporting of OCV validation failure reasons more flexible by
removing the fixed prefix from ocv_verify_tx_params() output in
ocv_errorstr so that the caller can use whatever prefix or encapsulation
that is most appropriate for each case.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-05-25 18:33:00 +03:00 committed by Jouni Malinen
parent 2d118f557a
commit 52579be860
11 changed files with 26 additions and 22 deletions

View file

@ -1717,7 +1717,7 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
if (ocv_verify_tx_params(ie.oci, ie.oci_len, &ci,
channel_width_to_int(ci.chanwidth),
ci.seg1_idx) != 0) {
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "%s",
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "OCV failed: %s",
ocv_errorstr);
return;
}
@ -1864,7 +1864,7 @@ static int wpa_supplicant_process_1_of_2_rsn(struct wpa_sm *sm,
if (ocv_verify_tx_params(ie.oci, ie.oci_len, &ci,
channel_width_to_int(ci.chanwidth),
ci.seg1_idx) != 0) {
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "%s",
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "OCV failed: %s",
ocv_errorstr);
return -1;
}
@ -4764,7 +4764,8 @@ int fils_process_assoc_resp(struct wpa_sm *sm, const u8 *resp, size_t len)
if (ocv_verify_tx_params(elems.oci, elems.oci_len, &ci,
channel_width_to_int(ci.chanwidth),
ci.seg1_idx) != 0) {
wpa_printf(MSG_WARNING, "FILS: %s", ocv_errorstr);
wpa_printf(MSG_WARNING, "FILS: OCV failed: %s",
ocv_errorstr);
goto fail;
}
}

View file

@ -1159,7 +1159,7 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
if (ocv_verify_tx_params(parse.oci, parse.oci_len, &ci,
channel_width_to_int(ci.chanwidth),
ci.seg1_idx) != 0) {
wpa_printf(MSG_WARNING, "%s", ocv_errorstr);
wpa_printf(MSG_WARNING, "OCV failed: %s", ocv_errorstr);
return -1;
}
}