mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 10:18:21 -05:00
3ce48c440e
The previous implementation did not check that we are associated with the sender of the GAS response before checking for PMF status. This could have accepted Venue URL when not in associated state. Fix this by explicitly checking for association with the responder first. This fixes an issue that was detected, e.g., with these hwsim test case sequences: gas_anqp_venue_url_pmf gas_anqp_venue_url gas_prot_vs_not_prot gas_anqp_venue_url Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
61 lines
1.5 KiB
C
61 lines
1.5 KiB
C
/*
|
|
* Generic advertisement service (GAS) query
|
|
* Copyright (c) 2009, Atheros Communications
|
|
* Copyright (c) 2011, Qualcomm Atheros
|
|
*
|
|
* This software may be distributed under the terms of the BSD license.
|
|
* See README for more details.
|
|
*/
|
|
|
|
#ifndef GAS_QUERY_H
|
|
#define GAS_QUERY_H
|
|
|
|
struct gas_query;
|
|
|
|
#ifdef CONFIG_GAS
|
|
|
|
struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s);
|
|
void gas_query_deinit(struct gas_query *gas);
|
|
int gas_query_rx(struct gas_query *gas, const u8 *da, const u8 *sa,
|
|
const u8 *bssid, u8 categ, const u8 *data, size_t len,
|
|
int freq);
|
|
int pmf_in_use(struct wpa_supplicant *wpa_s, const u8 *addr);
|
|
|
|
/**
|
|
* enum gas_query_result - GAS query result
|
|
*/
|
|
enum gas_query_result {
|
|
GAS_QUERY_SUCCESS,
|
|
GAS_QUERY_FAILURE,
|
|
GAS_QUERY_TIMEOUT,
|
|
GAS_QUERY_PEER_ERROR,
|
|
GAS_QUERY_INTERNAL_ERROR,
|
|
GAS_QUERY_STOPPED,
|
|
GAS_QUERY_DELETED_AT_DEINIT
|
|
};
|
|
|
|
int gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
|
|
int wildcard_bssid, struct wpabuf *req,
|
|
void (*cb)(void *ctx, const u8 *dst, u8 dialog_token,
|
|
enum gas_query_result result,
|
|
const struct wpabuf *adv_proto,
|
|
const struct wpabuf *resp, u16 status_code),
|
|
void *ctx);
|
|
int gas_query_stop(struct gas_query *gas, u8 dialog_token);
|
|
|
|
#else /* CONFIG_GAS */
|
|
|
|
static inline struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s)
|
|
{
|
|
return (void *) 1;
|
|
}
|
|
|
|
static inline void gas_query_deinit(struct gas_query *gas)
|
|
{
|
|
}
|
|
|
|
#endif /* CONFIG_GAS */
|
|
|
|
|
|
#endif /* GAS_QUERY_H */
|