2008-02-27 17:34:43 -08:00
|
|
|
/*
|
|
|
|
* wpa_supplicant - WPA definitions
|
2015-01-25 16:49:18 +02:00
|
|
|
* Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi>
|
2008-02-27 17:34:43 -08:00
|
|
|
*
|
2012-02-11 16:46:35 +02:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-02-27 17:34:43 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WPA_H
|
|
|
|
#define WPA_H
|
|
|
|
|
2009-11-29 17:51:55 +02:00
|
|
|
#include "common/defs.h"
|
|
|
|
#include "common/eapol_common.h"
|
|
|
|
#include "common/wpa_common.h"
|
2013-02-05 16:41:01 +02:00
|
|
|
#include "common/ieee802_11_defs.h"
|
2008-02-27 17:34:43 -08:00
|
|
|
|
|
|
|
struct wpa_sm;
|
|
|
|
struct eapol_sm;
|
|
|
|
struct wpa_config_blob;
|
2014-12-29 00:20:51 -05:00
|
|
|
struct hostapd_freq_params;
|
2018-08-06 15:46:20 -04:00
|
|
|
struct wpa_channel_info;
|
2022-11-20 19:27:51 +05:30
|
|
|
struct rsn_pmksa_cache_entry;
|
2022-05-07 00:38:35 +03:00
|
|
|
enum frame_encryption;
|
2008-02-27 17:34:43 -08:00
|
|
|
|
|
|
|
struct wpa_sm_ctx {
|
|
|
|
void *ctx; /* pointer to arbitrary upper level context */
|
2009-01-17 17:54:40 +02:00
|
|
|
void *msg_ctx; /* upper level context for wpa_msg() calls */
|
2008-02-27 17:34:43 -08:00
|
|
|
|
2009-12-26 10:35:08 +02:00
|
|
|
void (*set_state)(void *ctx, enum wpa_states state);
|
|
|
|
enum wpa_states (*get_state)(void *ctx);
|
2019-04-22 20:17:38 +03:00
|
|
|
void (*deauthenticate)(void * ctx, u16 reason_code);
|
2020-01-10 23:19:09 +01:00
|
|
|
void (*reconnect)(void *ctx);
|
2022-11-03 13:38:49 +05:30
|
|
|
int (*set_key)(void *ctx, int link_id, enum wpa_alg alg,
|
2008-02-27 17:34:43 -08:00
|
|
|
const u8 *addr, int key_idx, int set_tx,
|
|
|
|
const u8 *seq, size_t seq_len,
|
2020-01-04 23:10:04 +01:00
|
|
|
const u8 *key, size_t key_len, enum key_flag key_flag);
|
2008-02-27 17:34:43 -08:00
|
|
|
void * (*get_network_ctx)(void *ctx);
|
|
|
|
int (*get_bssid)(void *ctx, u8 *bssid);
|
|
|
|
int (*ether_send)(void *ctx, const u8 *dest, u16 proto, const u8 *buf,
|
|
|
|
size_t len);
|
|
|
|
int (*get_beacon_ie)(void *ctx);
|
|
|
|
void (*cancel_auth_timeout)(void *ctx);
|
|
|
|
u8 * (*alloc_eapol)(void *ctx, u8 type, const void *data, u16 data_len,
|
|
|
|
size_t *msg_len, void **data_pos);
|
2016-12-12 20:59:41 +02:00
|
|
|
int (*add_pmkid)(void *ctx, void *network_ctx, const u8 *bssid,
|
2017-03-30 19:27:15 +05:30
|
|
|
const u8 *pmkid, const u8 *fils_cache_id,
|
2020-03-23 19:11:24 +05:30
|
|
|
const u8 *pmk, size_t pmk_len, u32 pmk_lifetime,
|
2020-06-06 16:46:32 +03:00
|
|
|
u8 pmk_reauth_threshold, int akmp);
|
2016-12-12 20:59:41 +02:00
|
|
|
int (*remove_pmkid)(void *ctx, void *network_ctx, const u8 *bssid,
|
2017-03-30 19:27:15 +05:30
|
|
|
const u8 *pmkid, const u8 *fils_cache_id);
|
2008-02-27 17:34:43 -08:00
|
|
|
void (*set_config_blob)(void *ctx, struct wpa_config_blob *blob);
|
|
|
|
const struct wpa_config_blob * (*get_config_blob)(void *ctx,
|
|
|
|
const char *name);
|
|
|
|
int (*mlme_setprotection)(void *ctx, const u8 *addr,
|
|
|
|
int protection_type, int key_type);
|
|
|
|
int (*update_ft_ies)(void *ctx, const u8 *md, const u8 *ies,
|
|
|
|
size_t ies_len);
|
|
|
|
int (*send_ft_action)(void *ctx, u8 action, const u8 *target_ap,
|
|
|
|
const u8 *ies, size_t ies_len);
|
2010-03-13 18:28:15 +02:00
|
|
|
int (*mark_authenticated)(void *ctx, const u8 *target_ap);
|
2010-10-07 10:26:56 +03:00
|
|
|
#ifdef CONFIG_TDLS
|
2011-09-26 13:55:25 +03:00
|
|
|
int (*tdls_get_capa)(void *ctx, int *tdls_supported,
|
2014-12-28 22:44:37 -05:00
|
|
|
int *tdls_ext_setup, int *tdls_chan_switch);
|
2010-10-07 10:26:56 +03:00
|
|
|
int (*send_tdls_mgmt)(void *ctx, const u8 *dst,
|
|
|
|
u8 action_code, u8 dialog_token,
|
2014-03-26 21:34:50 +05:30
|
|
|
u16 status_code, u32 peer_capab,
|
2023-02-09 00:25:30 -08:00
|
|
|
int initiator, const u8 *buf, size_t len,
|
|
|
|
int link_id);
|
2010-10-07 10:26:56 +03:00
|
|
|
int (*tdls_oper)(void *ctx, int oper, const u8 *peer);
|
2013-05-06 15:47:44 +03:00
|
|
|
int (*tdls_peer_addset)(void *ctx, const u8 *addr, int add, u16 aid,
|
2011-10-23 14:02:57 +03:00
|
|
|
u16 capability, const u8 *supp_rates,
|
2013-02-05 16:41:01 +02:00
|
|
|
size_t supp_rates_len,
|
|
|
|
const struct ieee80211_ht_capabilities *ht_capab,
|
2013-02-25 10:31:50 +02:00
|
|
|
const struct ieee80211_vht_capabilities *vht_capab,
|
2021-01-06 12:38:25 +05:30
|
|
|
const struct ieee80211_he_capabilities *he_capab,
|
|
|
|
size_t he_capab_len,
|
2021-07-19 13:42:05 +05:30
|
|
|
const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
|
2014-09-29 20:47:53 +02:00
|
|
|
u8 qosinfo, int wmm, const u8 *ext_capab,
|
2014-01-06 18:36:13 +05:30
|
|
|
size_t ext_capab_len, const u8 *supp_channels,
|
|
|
|
size_t supp_channels_len,
|
|
|
|
const u8 *supp_oper_classes,
|
2023-02-09 00:25:30 -08:00
|
|
|
size_t supp_oper_classes_len,
|
|
|
|
const struct ieee80211_eht_capabilities *eht_capab,
|
|
|
|
size_t eht_capab_len, int mld_link_id);
|
2014-12-29 00:20:51 -05:00
|
|
|
int (*tdls_enable_channel_switch)(
|
|
|
|
void *ctx, const u8 *addr, u8 oper_class,
|
|
|
|
const struct hostapd_freq_params *params);
|
|
|
|
int (*tdls_disable_channel_switch)(void *ctx, const u8 *addr);
|
2010-10-07 10:26:56 +03:00
|
|
|
#endif /* CONFIG_TDLS */
|
2015-01-25 16:49:18 +02:00
|
|
|
void (*set_rekey_offload)(void *ctx, const u8 *kek, size_t kek_len,
|
|
|
|
const u8 *kck, size_t kck_len,
|
2011-07-12 21:22:51 +03:00
|
|
|
const u8 *replay_ctr);
|
2014-10-23 18:21:49 +03:00
|
|
|
int (*key_mgmt_set_pmk)(void *ctx, const u8 *pmk, size_t pmk_len);
|
2017-01-31 21:21:24 +02:00
|
|
|
void (*fils_hlp_rx)(void *ctx, const u8 *dst, const u8 *src,
|
|
|
|
const u8 *pkt, size_t pkt_len);
|
2018-08-06 15:46:20 -04:00
|
|
|
int (*channel_info)(void *ctx, struct wpa_channel_info *ci);
|
2020-03-26 00:10:16 +02:00
|
|
|
void (*transition_disable)(void *ctx, u8 bitmap);
|
2023-02-21 17:24:30 +02:00
|
|
|
void (*store_ptk)(void *ctx, const u8 *addr, int cipher,
|
2020-12-16 13:00:27 +02:00
|
|
|
u32 life_time, const struct wpa_ptk *ptk);
|
2022-07-08 02:47:08 +05:30
|
|
|
#ifdef CONFIG_PASN
|
|
|
|
int (*set_ltf_keyseed)(void *ctx, const u8 *own_addr,
|
|
|
|
const u8 *peer_addr, size_t ltf_keyseed_len,
|
|
|
|
const u8 *ltf_keyseed);
|
|
|
|
#endif /* CONFIG_PASN */
|
2022-11-20 19:27:51 +05:30
|
|
|
void (*notify_pmksa_cache_entry)(void *ctx,
|
|
|
|
struct rsn_pmksa_cache_entry *entry);
|
2024-07-11 22:44:46 +03:00
|
|
|
void (*ssid_verified)(void *ctx);
|
2008-02-27 17:34:43 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum wpa_sm_conf_params {
|
|
|
|
RSNA_PMK_LIFETIME /* dot11RSNAConfigPMKLifetime */,
|
|
|
|
RSNA_PMK_REAUTH_THRESHOLD /* dot11RSNAConfigPMKReauthThreshold */,
|
|
|
|
RSNA_SA_TIMEOUT /* dot11RSNAConfigSATimeout */,
|
|
|
|
WPA_PARAM_PROTO,
|
|
|
|
WPA_PARAM_PAIRWISE,
|
|
|
|
WPA_PARAM_GROUP,
|
|
|
|
WPA_PARAM_KEY_MGMT,
|
|
|
|
WPA_PARAM_MGMT_GROUP,
|
2010-03-29 10:48:01 -07:00
|
|
|
WPA_PARAM_RSN_ENABLED,
|
2018-08-06 15:46:25 -04:00
|
|
|
WPA_PARAM_MFP,
|
2019-10-17 16:54:05 +03:00
|
|
|
WPA_PARAM_OCV,
|
|
|
|
WPA_PARAM_SAE_PWE,
|
2020-06-10 12:22:59 +03:00
|
|
|
WPA_PARAM_SAE_PK,
|
2020-01-10 23:19:09 +01:00
|
|
|
WPA_PARAM_DENY_PTK0_REKEY,
|
2020-03-20 20:04:32 +01:00
|
|
|
WPA_PARAM_EXT_KEY_ID,
|
|
|
|
WPA_PARAM_USE_EXT_KEY_ID,
|
2020-04-14 13:48:43 +03:00
|
|
|
WPA_PARAM_FT_RSNXE_USED,
|
2020-05-01 19:53:07 +03:00
|
|
|
WPA_PARAM_DPP_PFS,
|
2023-04-12 18:46:53 +03:00
|
|
|
WPA_PARAM_WMM_ENABLED,
|
2020-05-08 23:29:04 +05:30
|
|
|
WPA_PARAM_OCI_FREQ_EAPOL,
|
2020-06-26 13:49:14 +05:30
|
|
|
WPA_PARAM_OCI_FREQ_EAPOL_G2,
|
|
|
|
WPA_PARAM_OCI_FREQ_FT_ASSOC,
|
|
|
|
WPA_PARAM_OCI_FREQ_FILS_ASSOC,
|
2022-02-28 16:57:37 +05:30
|
|
|
WPA_PARAM_DISABLE_EAPOL_G2_TX,
|
2024-01-16 21:11:23 +02:00
|
|
|
WPA_PARAM_ENCRYPT_EAPOL_M2,
|
|
|
|
WPA_PARAM_ENCRYPT_EAPOL_M4,
|
2024-02-03 20:13:46 +02:00
|
|
|
WPA_PARAM_FT_PREPEND_PMKID,
|
2024-06-19 01:07:36 +03:00
|
|
|
WPA_PARAM_SSID_PROTECTION,
|
2024-07-29 15:41:59 +03:00
|
|
|
WPA_PARAM_RSN_OVERRIDE,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum wpa_rsn_override {
|
|
|
|
RSN_OVERRIDE_NOT_USED,
|
|
|
|
RSN_OVERRIDE_RSNE,
|
|
|
|
RSN_OVERRIDE_RSNE_OVERRIDE,
|
|
|
|
RSN_OVERRIDE_RSNE_OVERRIDE_2,
|
2008-02-27 17:34:43 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct rsn_supp_config {
|
|
|
|
void *network_ctx;
|
|
|
|
int allowed_pairwise_cipher; /* bitfield of WPA_CIPHER_* */
|
|
|
|
int proactive_key_caching;
|
|
|
|
int eap_workaround;
|
|
|
|
void *eap_conf_ctx;
|
|
|
|
const u8 *ssid;
|
|
|
|
size_t ssid_len;
|
2008-11-06 19:57:21 +02:00
|
|
|
int wpa_ptk_rekey;
|
2020-01-10 23:19:09 +01:00
|
|
|
int wpa_deny_ptk0_rekey;
|
2013-03-16 19:13:31 +02:00
|
|
|
int p2p;
|
2015-10-14 12:26:33 +03:00
|
|
|
int wpa_rsc_relaxation;
|
2020-01-23 22:46:51 +02:00
|
|
|
int owe_ptk_workaround;
|
2017-02-21 12:22:19 +02:00
|
|
|
const u8 *fils_cache_id;
|
2020-02-18 00:16:55 +02:00
|
|
|
int beacon_prot;
|
2020-12-16 13:01:39 +02:00
|
|
|
bool force_kdk_derivation;
|
2008-02-27 17:34:43 -08:00
|
|
|
};
|
|
|
|
|
2022-11-03 13:38:45 +05:30
|
|
|
struct wpa_sm_link {
|
|
|
|
u8 addr[ETH_ALEN];
|
|
|
|
u8 bssid[ETH_ALEN];
|
2024-07-30 19:56:00 +03:00
|
|
|
u8 *ap_rsne, *ap_rsnxe, *ap_rsnoe, *ap_rsno2e, *ap_rsnxoe;
|
|
|
|
size_t ap_rsne_len, ap_rsnxe_len, ap_rsnoe_len, ap_rsno2e_len,
|
|
|
|
ap_rsnxoe_len;;
|
2022-11-03 13:38:50 +05:30
|
|
|
struct wpa_gtk gtk;
|
|
|
|
struct wpa_gtk gtk_wnm_sleep;
|
|
|
|
struct wpa_igtk igtk;
|
|
|
|
struct wpa_igtk igtk_wnm_sleep;
|
|
|
|
struct wpa_bigtk bigtk;
|
|
|
|
struct wpa_bigtk bigtk_wnm_sleep;
|
2022-11-03 13:38:45 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
struct wpa_sm_mlo {
|
|
|
|
u8 ap_mld_addr[ETH_ALEN];
|
|
|
|
u8 assoc_link_id;
|
|
|
|
u16 valid_links; /* bitmap of accepted links */
|
|
|
|
u16 req_links; /* bitmap of requested links */
|
|
|
|
struct wpa_sm_link links[MAX_NUM_MLD_LINKS];
|
|
|
|
};
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
#ifndef CONFIG_NO_WPA
|
|
|
|
|
|
|
|
struct wpa_sm * wpa_sm_init(struct wpa_sm_ctx *ctx);
|
|
|
|
void wpa_sm_deinit(struct wpa_sm *sm);
|
|
|
|
void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid);
|
|
|
|
void wpa_sm_notify_disassoc(struct wpa_sm *sm);
|
2014-10-18 13:02:02 +03:00
|
|
|
void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len,
|
2016-02-15 11:23:37 +09:00
|
|
|
const u8 *pmkid, const u8 *bssid);
|
2008-02-27 17:34:43 -08:00
|
|
|
void wpa_sm_set_pmk_from_pmksa(struct wpa_sm *sm);
|
|
|
|
void wpa_sm_set_fast_reauth(struct wpa_sm *sm, int fast_reauth);
|
|
|
|
void wpa_sm_set_scard_ctx(struct wpa_sm *sm, void *scard_ctx);
|
|
|
|
void wpa_sm_set_config(struct wpa_sm *sm, struct rsn_supp_config *config);
|
2024-06-19 01:07:36 +03:00
|
|
|
void wpa_sm_set_ssid(struct wpa_sm *sm, const u8 *ssid, size_t ssid_len);
|
2008-02-27 17:34:43 -08:00
|
|
|
void wpa_sm_set_own_addr(struct wpa_sm *sm, const u8 *addr);
|
|
|
|
void wpa_sm_set_ifname(struct wpa_sm *sm, const char *ifname,
|
|
|
|
const char *bridge_ifname);
|
|
|
|
void wpa_sm_set_eapol(struct wpa_sm *sm, struct eapol_sm *eapol);
|
|
|
|
int wpa_sm_set_assoc_wpa_ie(struct wpa_sm *sm, const u8 *ie, size_t len);
|
|
|
|
int wpa_sm_set_assoc_wpa_ie_default(struct wpa_sm *sm, u8 *wpa_ie,
|
|
|
|
size_t *wpa_ie_len);
|
2019-10-17 16:54:05 +03:00
|
|
|
int wpa_sm_set_assoc_rsnxe_default(struct wpa_sm *sm, u8 *rsnxe,
|
|
|
|
size_t *rsnxe_len);
|
|
|
|
int wpa_sm_set_assoc_rsnxe(struct wpa_sm *sm, const u8 *ie, size_t len);
|
2008-02-27 17:34:43 -08:00
|
|
|
int wpa_sm_set_ap_wpa_ie(struct wpa_sm *sm, const u8 *ie, size_t len);
|
|
|
|
int wpa_sm_set_ap_rsn_ie(struct wpa_sm *sm, const u8 *ie, size_t len);
|
2019-09-06 14:51:31 +03:00
|
|
|
int wpa_sm_set_ap_rsnxe(struct wpa_sm *sm, const u8 *ie, size_t len);
|
2024-07-29 17:20:22 +03:00
|
|
|
int wpa_sm_set_ap_rsne_override(struct wpa_sm *sm, const u8 *ie, size_t len);
|
|
|
|
int wpa_sm_set_ap_rsne_override_2(struct wpa_sm *sm, const u8 *ie, size_t len);
|
|
|
|
int wpa_sm_set_ap_rsnxe_override(struct wpa_sm *sm, const u8 *ie, size_t len);
|
2008-02-27 17:34:43 -08:00
|
|
|
int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen);
|
|
|
|
|
|
|
|
int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
|
|
|
|
unsigned int value);
|
|
|
|
|
|
|
|
int wpa_sm_get_status(struct wpa_sm *sm, char *buf, size_t buflen,
|
|
|
|
int verbose);
|
2013-04-20 16:48:10 -07:00
|
|
|
int wpa_sm_pmf_enabled(struct wpa_sm *sm);
|
2020-03-20 20:04:32 +01:00
|
|
|
int wpa_sm_ext_key_id(struct wpa_sm *sm);
|
|
|
|
int wpa_sm_ext_key_id_active(struct wpa_sm *sm);
|
2018-08-06 15:46:27 -04:00
|
|
|
int wpa_sm_ocv_enabled(struct wpa_sm *sm);
|
2008-02-27 17:34:43 -08:00
|
|
|
|
|
|
|
void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise);
|
|
|
|
|
|
|
|
int wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len,
|
|
|
|
struct wpa_ie_data *data);
|
|
|
|
|
|
|
|
void wpa_sm_aborted_cached(struct wpa_sm *sm);
|
2021-07-01 23:39:06 +05:30
|
|
|
void wpa_sm_aborted_external_cached(struct wpa_sm *sm);
|
2008-02-27 17:34:43 -08:00
|
|
|
int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
|
2022-05-07 00:38:35 +03:00
|
|
|
const u8 *buf, size_t len, enum frame_encryption encrypted);
|
2008-02-27 17:34:43 -08:00
|
|
|
int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data);
|
2009-01-13 20:22:42 +02:00
|
|
|
int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
|
2016-12-12 23:47:04 +02:00
|
|
|
struct rsn_pmksa_cache_entry * wpa_sm_pmksa_cache_head(struct wpa_sm *sm);
|
|
|
|
struct rsn_pmksa_cache_entry *
|
|
|
|
wpa_sm_pmksa_cache_add_entry(struct wpa_sm *sm,
|
|
|
|
struct rsn_pmksa_cache_entry * entry);
|
2017-03-22 16:10:05 +05:30
|
|
|
void wpa_sm_pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len,
|
|
|
|
const u8 *pmkid, const u8 *bssid,
|
|
|
|
const u8 *fils_cache_id);
|
2022-11-10 14:10:55 +02:00
|
|
|
int wpa_sm_pmksa_exists(struct wpa_sm *sm, const u8 *bssid, const u8 *own_addr,
|
2017-06-17 23:48:52 +03:00
|
|
|
const void *network_ctx);
|
2010-03-29 15:42:04 -07:00
|
|
|
void wpa_sm_drop_sa(struct wpa_sm *sm);
|
2020-12-16 13:00:25 +02:00
|
|
|
struct rsn_pmksa_cache_entry * wpa_sm_pmksa_cache_get(struct wpa_sm *sm,
|
|
|
|
const u8 *aa,
|
|
|
|
const u8 *pmkid,
|
|
|
|
const void *network_ctx,
|
|
|
|
int akmp);
|
2022-11-20 08:00:36 +02:00
|
|
|
void wpa_sm_pmksa_cache_remove(struct wpa_sm *sm,
|
|
|
|
struct rsn_pmksa_cache_entry *entry);
|
2022-11-08 23:43:43 +02:00
|
|
|
bool wpa_sm_has_ft_keys(struct wpa_sm *sm, const u8 *md);
|
2020-01-03 16:17:42 +01:00
|
|
|
int wpa_sm_has_ptk_installed(struct wpa_sm *sm);
|
2008-02-27 17:34:43 -08:00
|
|
|
|
2011-07-12 21:22:51 +03:00
|
|
|
void wpa_sm_update_replay_ctr(struct wpa_sm *sm, const u8 *replay_ctr);
|
|
|
|
|
2011-09-07 17:46:00 +03:00
|
|
|
void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx);
|
2021-07-01 23:39:06 +05:30
|
|
|
void wpa_sm_external_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx);
|
2011-09-07 17:46:00 +03:00
|
|
|
|
2013-03-16 19:13:31 +02:00
|
|
|
int wpa_sm_get_p2p_ip_addr(struct wpa_sm *sm, u8 *buf);
|
|
|
|
|
2014-10-23 18:21:49 +03:00
|
|
|
void wpa_sm_set_rx_replay_ctr(struct wpa_sm *sm, const u8 *rx_replay_counter);
|
2015-01-25 16:49:18 +02:00
|
|
|
void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm,
|
|
|
|
const u8 *ptk_kck, size_t ptk_kck_len,
|
|
|
|
const u8 *ptk_kek, size_t ptk_kek_len);
|
2017-06-08 11:18:00 +03:00
|
|
|
int wpa_fils_is_completed(struct wpa_sm *sm);
|
2021-10-07 19:46:04 +05:30
|
|
|
void wpa_sm_pmksa_cache_reconfig(struct wpa_sm *sm);
|
2022-11-03 13:38:45 +05:30
|
|
|
int wpa_sm_set_mlo_params(struct wpa_sm *sm, const struct wpa_sm_mlo *mlo);
|
2014-10-23 18:21:49 +03:00
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
#else /* CONFIG_NO_WPA */
|
|
|
|
|
|
|
|
static inline struct wpa_sm * wpa_sm_init(struct wpa_sm_ctx *ctx)
|
|
|
|
{
|
|
|
|
return (struct wpa_sm *) 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_deinit(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_notify_disassoc(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk,
|
2016-02-15 11:23:37 +09:00
|
|
|
size_t pmk_len, const u8 *pmkid,
|
|
|
|
const u8 *bssid)
|
2008-02-27 17:34:43 -08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_pmk_from_pmksa(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_fast_reauth(struct wpa_sm *sm, int fast_reauth)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_scard_ctx(struct wpa_sm *sm, void *scard_ctx)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_config(struct wpa_sm *sm,
|
|
|
|
struct rsn_supp_config *config)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_own_addr(struct wpa_sm *sm, const u8 *addr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_ifname(struct wpa_sm *sm, const char *ifname,
|
|
|
|
const char *bridge_ifname)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_eapol(struct wpa_sm *sm, struct eapol_sm *eapol)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_set_assoc_wpa_ie(struct wpa_sm *sm, const u8 *ie,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_set_assoc_wpa_ie_default(struct wpa_sm *sm,
|
|
|
|
u8 *wpa_ie,
|
|
|
|
size_t *wpa_ie_len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_set_ap_wpa_ie(struct wpa_sm *sm, const u8 *ie,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_set_ap_rsn_ie(struct wpa_sm *sm, const u8 *ie,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-09-06 14:51:31 +03:00
|
|
|
static inline int wpa_sm_set_ap_rsnxe(struct wpa_sm *sm, const u8 *ie,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2024-07-29 17:20:22 +03:00
|
|
|
static inline int wpa_sm_set_ap_rsne_override(struct wpa_sm *sm, const u8 *ie,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_set_ap_rsne_override_2(struct wpa_sm *sm, const u8 *ie,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_set_ap_rsnxe_override(struct wpa_sm *sm, const u8 *ie,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
static inline int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_set_param(struct wpa_sm *sm,
|
|
|
|
enum wpa_sm_conf_params param,
|
|
|
|
unsigned int value)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_get_status(struct wpa_sm *sm, char *buf,
|
|
|
|
size_t buflen, int verbose)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-06-07 20:02:50 +03:00
|
|
|
static inline int wpa_sm_pmf_enabled(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-03-20 20:04:32 +01:00
|
|
|
static inline int wpa_sm_ext_key_id(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_ext_key_id_active(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-08-06 15:46:27 -04:00
|
|
|
static inline int wpa_sm_ocv_enabled(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
static inline void wpa_sm_key_request(struct wpa_sm *sm, int error,
|
|
|
|
int pairwise)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len,
|
|
|
|
struct wpa_ie_data *data)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_aborted_cached(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-07-01 23:39:06 +05:30
|
|
|
static inline void wpa_sm_aborted_external_cached(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
static inline int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
|
2022-05-07 00:38:35 +03:00
|
|
|
const u8 *buf, size_t len,
|
|
|
|
enum frame_encryption encrypted)
|
2008-02-27 17:34:43 -08:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm,
|
|
|
|
struct wpa_ie_data *data)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-01-13 20:22:42 +02:00
|
|
|
static inline int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2010-03-29 15:42:04 -07:00
|
|
|
static inline void wpa_sm_drop_sa(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-12-16 13:00:25 +02:00
|
|
|
static inline struct rsn_pmksa_cache_entry *
|
|
|
|
wpa_sm_pmksa_cache_get(struct wpa_sm *sm, const u8 *aa, const u8 *pmkid,
|
|
|
|
const void *network_ctx, int akmp)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-04-11 11:39:14 +03:00
|
|
|
static inline int wpa_sm_has_ptk(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-12 21:22:51 +03:00
|
|
|
static inline void wpa_sm_update_replay_ctr(struct wpa_sm *sm,
|
|
|
|
const u8 *replay_ctr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-07-01 23:39:06 +05:30
|
|
|
static inline void wpa_sm_external_pmksa_cache_flush(struct wpa_sm *sm,
|
|
|
|
void *network_ctx)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-07 17:46:00 +03:00
|
|
|
static inline void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm,
|
|
|
|
void *network_ctx)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-10-23 18:21:49 +03:00
|
|
|
static inline void wpa_sm_set_rx_replay_ctr(struct wpa_sm *sm,
|
|
|
|
const u8 *rx_replay_counter)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, const u8 *ptk_kck,
|
2015-11-23 23:34:52 +02:00
|
|
|
size_t ptk_kck_len,
|
|
|
|
const u8 *ptk_kek, size_t ptk_kek_len)
|
2014-10-23 18:21:49 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-06-08 11:18:00 +03:00
|
|
|
static inline int wpa_fils_is_completed(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-07 19:46:04 +05:30
|
|
|
static inline void wpa_sm_pmksa_cache_reconfig(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-11-03 13:38:45 +05:30
|
|
|
static inline int wpa_sm_set_mlo_params(struct wpa_sm *sm,
|
|
|
|
const struct wpa_sm_mlo *mlo)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
#endif /* CONFIG_NO_WPA */
|
|
|
|
|
|
|
|
#ifdef CONFIG_IEEE80211R
|
|
|
|
|
2010-04-10 11:36:35 +03:00
|
|
|
int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len);
|
2010-04-09 16:26:20 +03:00
|
|
|
int wpa_ft_prepare_auth_request(struct wpa_sm *sm, const u8 *mdie);
|
2018-04-16 13:52:27 +03:00
|
|
|
int wpa_ft_add_mdie(struct wpa_sm *sm, u8 *ies, size_t ies_len,
|
|
|
|
const u8 *mdie);
|
|
|
|
const u8 * wpa_sm_get_ft_md(struct wpa_sm *sm);
|
2008-02-27 17:34:43 -08:00
|
|
|
int wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
|
2009-03-09 20:45:17 +02:00
|
|
|
int ft_action, const u8 *target_ap,
|
|
|
|
const u8 *ric_ies, size_t ric_ies_len);
|
2008-02-27 17:34:43 -08:00
|
|
|
int wpa_ft_is_completed(struct wpa_sm *sm);
|
2013-04-26 17:56:24 +03:00
|
|
|
void wpa_reset_ft_completed(struct wpa_sm *sm);
|
2008-02-27 17:34:43 -08:00
|
|
|
int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
|
2008-03-12 11:20:20 +02:00
|
|
|
size_t ies_len, const u8 *src_addr);
|
2010-04-09 16:26:20 +03:00
|
|
|
int wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap,
|
2022-11-08 23:43:43 +02:00
|
|
|
const u8 *mdie, bool force);
|
2008-02-27 17:34:43 -08:00
|
|
|
|
2020-12-16 13:01:03 +02:00
|
|
|
#ifdef CONFIG_PASN
|
|
|
|
|
|
|
|
int wpa_pasn_ft_derive_pmk_r1(struct wpa_sm *sm, int akmp, const u8 *r1kh_id,
|
|
|
|
u8 *pmk_r1, size_t *pmk_r1_len, u8 *pmk_r1_name);
|
|
|
|
|
|
|
|
#endif /* CONFIG_PASN */
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
#else /* CONFIG_IEEE80211R */
|
|
|
|
|
|
|
|
static inline int
|
2010-04-11 19:49:32 +03:00
|
|
|
wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len)
|
2008-02-27 17:34:43 -08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-04-09 16:26:20 +03:00
|
|
|
static inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm,
|
|
|
|
const u8 *mdie)
|
2008-02-27 17:34:43 -08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-16 13:52:27 +03:00
|
|
|
static inline int wpa_ft_add_mdie(struct wpa_sm *sm, u8 *ies, size_t ies_len,
|
|
|
|
const u8 *mdie)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
static inline int
|
|
|
|
wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
|
|
|
|
int ft_action, const u8 *target_ap)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpa_ft_is_completed(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-04-26 17:56:24 +03:00
|
|
|
static inline void wpa_reset_ft_completed(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
static inline int
|
2008-03-12 11:20:20 +02:00
|
|
|
wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
|
|
|
|
const u8 *src_addr)
|
2008-02-27 17:34:43 -08:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-12-16 13:01:03 +02:00
|
|
|
#ifdef CONFIG_PASN
|
|
|
|
|
2022-09-30 17:05:47 +03:00
|
|
|
static inline int
|
|
|
|
wpa_pasn_ft_derive_pmk_r1(struct wpa_sm *sm, int akmp, const u8 *r1kh_id,
|
|
|
|
u8 *pmk_r1, size_t *pmk_r1_len, u8 *pmk_r1_name)
|
2020-12-16 13:01:03 +02:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_PASN */
|
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
#endif /* CONFIG_IEEE80211R */
|
|
|
|
|
2010-10-07 10:26:56 +03:00
|
|
|
|
|
|
|
/* tdls.c */
|
2011-01-28 19:27:28 +02:00
|
|
|
void wpa_tdls_ap_ies(struct wpa_sm *sm, const u8 *ies, size_t len);
|
|
|
|
void wpa_tdls_assoc_resp_ies(struct wpa_sm *sm, const u8 *ies, size_t len);
|
2010-10-07 10:26:56 +03:00
|
|
|
int wpa_tdls_start(struct wpa_sm *sm, const u8 *addr);
|
2013-02-05 13:27:56 +02:00
|
|
|
void wpa_tdls_remove(struct wpa_sm *sm, const u8 *addr);
|
2011-09-26 13:55:28 +03:00
|
|
|
int wpa_tdls_teardown_link(struct wpa_sm *sm, const u8 *addr, u16 reason_code);
|
2011-09-26 13:55:29 +03:00
|
|
|
int wpa_tdls_send_discovery_request(struct wpa_sm *sm, const u8 *addr);
|
2010-10-07 10:26:56 +03:00
|
|
|
int wpa_tdls_init(struct wpa_sm *sm);
|
2013-02-12 23:25:21 +02:00
|
|
|
void wpa_tdls_teardown_peers(struct wpa_sm *sm);
|
2010-10-07 10:26:56 +03:00
|
|
|
void wpa_tdls_deinit(struct wpa_sm *sm);
|
2011-03-24 20:44:17 +02:00
|
|
|
void wpa_tdls_enable(struct wpa_sm *sm, int enabled);
|
2014-06-10 21:19:04 +03:00
|
|
|
void wpa_tdls_disable_unreachable_link(struct wpa_sm *sm, const u8 *addr);
|
2013-11-11 12:13:55 -08:00
|
|
|
const char * wpa_tdls_get_link_status(struct wpa_sm *sm, const u8 *addr);
|
2011-09-26 13:55:33 +03:00
|
|
|
int wpa_tdls_is_external_setup(struct wpa_sm *sm);
|
2014-12-29 00:20:51 -05:00
|
|
|
int wpa_tdls_enable_chan_switch(struct wpa_sm *sm, const u8 *addr,
|
|
|
|
u8 oper_class,
|
|
|
|
struct hostapd_freq_params *freq_params);
|
|
|
|
int wpa_tdls_disable_chan_switch(struct wpa_sm *sm, const u8 *addr);
|
2023-02-09 00:25:30 -08:00
|
|
|
int wpa_tdls_process_discovery_response(struct wpa_sm *sm, const u8 *addr,
|
|
|
|
const u8 *buf, size_t len);
|
2016-06-23 13:31:04 +03:00
|
|
|
#ifdef CONFIG_TDLS_TESTING
|
|
|
|
extern unsigned int tdls_testing;
|
|
|
|
#endif /* CONFIG_TDLS_TESTING */
|
|
|
|
|
2010-10-07 10:26:56 +03:00
|
|
|
|
2012-02-26 17:27:19 +02:00
|
|
|
int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf);
|
2015-12-06 19:30:59 +02:00
|
|
|
void wpa_sm_set_test_assoc_ie(struct wpa_sm *sm, struct wpabuf *buf);
|
2024-01-16 16:03:34 +02:00
|
|
|
void wpa_sm_set_test_eapol_m2_elems(struct wpa_sm *sm, struct wpabuf *buf);
|
|
|
|
void wpa_sm_set_test_eapol_m4_elems(struct wpa_sm *sm, struct wpabuf *buf);
|
2017-10-14 17:58:11 +03:00
|
|
|
const u8 * wpa_sm_get_anonce(struct wpa_sm *sm);
|
2018-04-16 13:52:27 +03:00
|
|
|
unsigned int wpa_sm_get_key_mgmt(struct wpa_sm *sm);
|
2012-02-26 17:27:19 +02:00
|
|
|
|
2017-04-02 13:22:52 +03:00
|
|
|
struct wpabuf * fils_build_auth(struct wpa_sm *sm, int dh_group, const u8 *md);
|
2017-02-21 12:25:02 +02:00
|
|
|
int fils_process_auth(struct wpa_sm *sm, const u8 *bssid, const u8 *data,
|
|
|
|
size_t len);
|
2015-09-08 20:58:53 +03:00
|
|
|
struct wpabuf * fils_build_assoc_req(struct wpa_sm *sm, const u8 **kek,
|
|
|
|
size_t *kek_len, const u8 **snonce,
|
2017-01-29 14:07:20 +02:00
|
|
|
const u8 **anonce,
|
|
|
|
const struct wpabuf **hlp,
|
|
|
|
unsigned int num_hlp);
|
2015-09-09 17:34:13 +03:00
|
|
|
int fils_process_assoc_resp(struct wpa_sm *sm, const u8 *resp, size_t len);
|
2015-09-04 15:32:07 +03:00
|
|
|
|
2017-10-08 16:39:08 +03:00
|
|
|
struct wpabuf * owe_build_assoc_req(struct wpa_sm *sm, u16 group);
|
2017-10-09 12:08:57 +03:00
|
|
|
int owe_process_assoc_resp(struct wpa_sm *sm, const u8 *bssid,
|
|
|
|
const u8 *resp_ies, size_t resp_ies_len);
|
2017-03-12 11:53:21 +02:00
|
|
|
|
2017-03-22 16:10:05 +05:30
|
|
|
void wpa_sm_set_reset_fils_completed(struct wpa_sm *sm, int set);
|
2017-03-22 16:10:05 +05:30
|
|
|
void wpa_sm_set_fils_cache_id(struct wpa_sm *sm, const u8 *fils_cache_id);
|
2019-03-17 23:51:53 +02:00
|
|
|
void wpa_sm_set_dpp_z(struct wpa_sm *sm, const struct wpabuf *z);
|
2022-03-20 19:26:02 +05:30
|
|
|
void wpa_pasn_sm_set_caps(struct wpa_sm *sm, unsigned int flags2);
|
2022-09-18 23:27:13 +05:30
|
|
|
struct rsn_pmksa_cache * wpa_sm_get_pmksa_cache(struct wpa_sm *sm);
|
|
|
|
|
|
|
|
void wpa_sm_set_cur_pmksa(struct wpa_sm *sm,
|
|
|
|
struct rsn_pmksa_cache_entry *entry);
|
2022-11-03 13:38:47 +05:30
|
|
|
const u8 * wpa_sm_get_auth_addr(struct wpa_sm *sm);
|
2023-09-27 11:27:13 +05:30
|
|
|
void wpa_sm_set_driver_bss_selection(struct wpa_sm *sm,
|
|
|
|
bool driver_bss_selection);
|
2017-03-22 16:10:05 +05:30
|
|
|
|
2008-02-27 17:34:43 -08:00
|
|
|
#endif /* WPA_H */
|