Exemplo n.º 1
0
static struct wpabuf * eap_aka_process_notification(
    struct eap_sm *sm, struct eap_aka_data *data, u8 id,
    const struct wpabuf *reqData, struct eap_sim_attrs *attr)
{
    wpa_printf(MSG_DEBUG, "EAP-AKA: subtype Notification");
    if (data->num_notification > 0) {
        wpa_printf(MSG_INFO, "EAP-AKA: too many notification "
                   "rounds (only one allowed)");
        return eap_aka_client_error(data, id,
                                    EAP_AKA_UNABLE_TO_PROCESS_PACKET);
    }
    data->num_notification++;
    if (attr->notification == -1) {
        wpa_printf(MSG_INFO, "EAP-AKA: no AT_NOTIFICATION in "
                   "Notification message");
        return eap_aka_client_error(data, id,
                                    EAP_AKA_UNABLE_TO_PROCESS_PACKET);
    }

    if ((attr->notification & 0x4000) == 0 &&
            eap_aka_process_notification_auth(data, reqData, attr)) {
        return eap_aka_client_error(data, id,
                                    EAP_AKA_UNABLE_TO_PROCESS_PACKET);
    }

    eap_sim_report_notification(sm->msg_ctx, attr->notification, 1);
    if (attr->notification >= 0 && attr->notification < 32768) {
        eap_aka_state(data, FAILURE);
    } else if (attr->notification == EAP_SIM_SUCCESS &&
               data->state == RESULT_SUCCESS)
        eap_aka_state(data, SUCCESS);
    return eap_aka_response_notification(data, id, attr->notification);
}
Exemplo n.º 2
0
static u8 * eap_aka_process_notification(struct eap_sm *sm,
					 struct eap_aka_data *data,
					 const struct eap_hdr *req,
					 size_t reqDataLen,
					 size_t *respDataLen,
					 struct eap_sim_attrs *attr)
{
	wpa_printf(MSG_DEBUG, "EAP-AKA: subtype Notification");
	if (data->num_notification > 0) {
		wpa_printf(MSG_INFO, "EAP-AKA: too many notification "
			   "rounds (only one allowed)");
		return eap_aka_client_error(data, req, respDataLen,
					    EAP_AKA_UNABLE_TO_PROCESS_PACKET);
	}
	data->num_notification++;
	if (attr->notification == -1) {
		wpa_printf(MSG_INFO, "EAP-AKA: no AT_NOTIFICATION in "
			   "Notification message");
		return eap_aka_client_error(data, req, respDataLen,
					    EAP_AKA_UNABLE_TO_PROCESS_PACKET);
	}

	if ((attr->notification & 0x4000) == 0 &&
	    eap_aka_process_notification_auth(data, req, reqDataLen, attr)) {
		return eap_aka_client_error(data, req, respDataLen,
					    EAP_AKA_UNABLE_TO_PROCESS_PACKET);
	}

	eap_sim_report_notification(sm->msg_ctx, attr->notification, 1);
	if (attr->notification >= 0 && attr->notification < 32768) {
		data->state = FAILURE;
	}
	return eap_aka_response_notification(data, req, respDataLen,
					     attr->notification);
}