Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * hostapd - IEEE 802.11i-2004 / WPA Authenticator |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 3 | * Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 4 | * |
Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef WPA_AUTH_H |
| 10 | #define WPA_AUTH_H |
| 11 | |
| 12 | #include "common/defs.h" |
| 13 | #include "common/eapol_common.h" |
| 14 | #include "common/wpa_common.h" |
Dmitry Shmidt | 9d9e602 | 2015-04-23 10:34:55 -0700 | [diff] [blame] | 15 | #include "common/ieee802_11_defs.h" |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 16 | |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 17 | #define MAX_OWN_IE_OVERRIDE 256 |
| 18 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 19 | #ifdef _MSC_VER |
| 20 | #pragma pack(push, 1) |
| 21 | #endif /* _MSC_VER */ |
| 22 | |
| 23 | /* IEEE Std 802.11r-2008, 11A.10.3 - Remote request/response frame definition |
| 24 | */ |
| 25 | struct ft_rrb_frame { |
| 26 | u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ |
| 27 | u8 packet_type; /* FT_PACKET_REQUEST/FT_PACKET_RESPONSE */ |
| 28 | le16 action_length; /* little endian length of action_frame */ |
| 29 | u8 ap_address[ETH_ALEN]; |
| 30 | /* |
| 31 | * Followed by action_length bytes of FT Action frame (from Category |
| 32 | * field to the end of Action Frame body. |
| 33 | */ |
| 34 | } STRUCT_PACKED; |
| 35 | |
| 36 | #define RSN_REMOTE_FRAME_TYPE_FT_RRB 1 |
| 37 | |
| 38 | #define FT_PACKET_REQUEST 0 |
| 39 | #define FT_PACKET_RESPONSE 1 |
| 40 | /* Vendor-specific types for R0KH-R1KH protocol; not defined in 802.11r */ |
| 41 | #define FT_PACKET_R0KH_R1KH_PULL 200 |
| 42 | #define FT_PACKET_R0KH_R1KH_RESP 201 |
| 43 | #define FT_PACKET_R0KH_R1KH_PUSH 202 |
| 44 | |
Dmitry Shmidt | d11f019 | 2014-03-24 12:09:47 -0700 | [diff] [blame] | 45 | #define FT_R0KH_R1KH_PULL_NONCE_LEN 16 |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 46 | #define FT_R0KH_R1KH_PULL_DATA_LEN (FT_R0KH_R1KH_PULL_NONCE_LEN + \ |
| 47 | WPA_PMK_NAME_LEN + FT_R1KH_ID_LEN + \ |
| 48 | ETH_ALEN) |
| 49 | #define FT_R0KH_R1KH_PULL_PAD_LEN ((8 - FT_R0KH_R1KH_PULL_DATA_LEN % 8) % 8) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 50 | |
| 51 | struct ft_r0kh_r1kh_pull_frame { |
| 52 | u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ |
| 53 | u8 packet_type; /* FT_PACKET_R0KH_R1KH_PULL */ |
| 54 | le16 data_length; /* little endian length of data (44) */ |
| 55 | u8 ap_address[ETH_ALEN]; |
| 56 | |
Dmitry Shmidt | d11f019 | 2014-03-24 12:09:47 -0700 | [diff] [blame] | 57 | u8 nonce[FT_R0KH_R1KH_PULL_NONCE_LEN]; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 58 | u8 pmk_r0_name[WPA_PMK_NAME_LEN]; |
| 59 | u8 r1kh_id[FT_R1KH_ID_LEN]; |
| 60 | u8 s1kh_id[ETH_ALEN]; |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 61 | u8 pad[FT_R0KH_R1KH_PULL_PAD_LEN]; /* 8-octet boundary for AES block */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 62 | u8 key_wrap_extra[8]; |
| 63 | } STRUCT_PACKED; |
| 64 | |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 65 | #define FT_R0KH_R1KH_RESP_DATA_LEN (FT_R0KH_R1KH_PULL_NONCE_LEN + \ |
| 66 | FT_R1KH_ID_LEN + ETH_ALEN + PMK_LEN + \ |
| 67 | WPA_PMK_NAME_LEN + 2) |
| 68 | #define FT_R0KH_R1KH_RESP_PAD_LEN ((8 - FT_R0KH_R1KH_RESP_DATA_LEN % 8) % 8) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 69 | struct ft_r0kh_r1kh_resp_frame { |
| 70 | u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ |
| 71 | u8 packet_type; /* FT_PACKET_R0KH_R1KH_RESP */ |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 72 | le16 data_length; /* little endian length of data (78) */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 73 | u8 ap_address[ETH_ALEN]; |
| 74 | |
Dmitry Shmidt | d11f019 | 2014-03-24 12:09:47 -0700 | [diff] [blame] | 75 | u8 nonce[FT_R0KH_R1KH_PULL_NONCE_LEN]; /* copied from pull */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 76 | u8 r1kh_id[FT_R1KH_ID_LEN]; /* copied from pull */ |
| 77 | u8 s1kh_id[ETH_ALEN]; /* copied from pull */ |
| 78 | u8 pmk_r1[PMK_LEN]; |
| 79 | u8 pmk_r1_name[WPA_PMK_NAME_LEN]; |
| 80 | le16 pairwise; |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 81 | u8 pad[FT_R0KH_R1KH_RESP_PAD_LEN]; /* 8-octet boundary for AES block */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 82 | u8 key_wrap_extra[8]; |
| 83 | } STRUCT_PACKED; |
| 84 | |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 85 | #define FT_R0KH_R1KH_PUSH_DATA_LEN (4 + FT_R1KH_ID_LEN + ETH_ALEN + \ |
| 86 | WPA_PMK_NAME_LEN + PMK_LEN + \ |
| 87 | WPA_PMK_NAME_LEN + 2) |
| 88 | #define FT_R0KH_R1KH_PUSH_PAD_LEN ((8 - FT_R0KH_R1KH_PUSH_DATA_LEN % 8) % 8) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 89 | struct ft_r0kh_r1kh_push_frame { |
| 90 | u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ |
| 91 | u8 packet_type; /* FT_PACKET_R0KH_R1KH_PUSH */ |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 92 | le16 data_length; /* little endian length of data (82) */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 93 | u8 ap_address[ETH_ALEN]; |
| 94 | |
| 95 | /* Encrypted with AES key-wrap */ |
| 96 | u8 timestamp[4]; /* current time in seconds since unix epoch, little |
| 97 | * endian */ |
| 98 | u8 r1kh_id[FT_R1KH_ID_LEN]; |
| 99 | u8 s1kh_id[ETH_ALEN]; |
| 100 | u8 pmk_r0_name[WPA_PMK_NAME_LEN]; |
| 101 | u8 pmk_r1[PMK_LEN]; |
| 102 | u8 pmk_r1_name[WPA_PMK_NAME_LEN]; |
| 103 | le16 pairwise; |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 104 | u8 pad[FT_R0KH_R1KH_PUSH_PAD_LEN]; /* 8-octet boundary for AES block */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 105 | u8 key_wrap_extra[8]; |
| 106 | } STRUCT_PACKED; |
| 107 | |
| 108 | #ifdef _MSC_VER |
| 109 | #pragma pack(pop) |
| 110 | #endif /* _MSC_VER */ |
| 111 | |
| 112 | |
| 113 | /* per STA state machine data */ |
| 114 | |
| 115 | struct wpa_authenticator; |
| 116 | struct wpa_state_machine; |
| 117 | struct rsn_pmksa_cache_entry; |
| 118 | struct eapol_state_machine; |
| 119 | |
| 120 | |
| 121 | struct ft_remote_r0kh { |
| 122 | struct ft_remote_r0kh *next; |
| 123 | u8 addr[ETH_ALEN]; |
| 124 | u8 id[FT_R0KH_ID_MAX_LEN]; |
| 125 | size_t id_len; |
| 126 | u8 key[16]; |
| 127 | }; |
| 128 | |
| 129 | |
| 130 | struct ft_remote_r1kh { |
| 131 | struct ft_remote_r1kh *next; |
| 132 | u8 addr[ETH_ALEN]; |
| 133 | u8 id[FT_R1KH_ID_LEN]; |
| 134 | u8 key[16]; |
| 135 | }; |
| 136 | |
| 137 | |
| 138 | struct wpa_auth_config { |
| 139 | int wpa; |
| 140 | int wpa_key_mgmt; |
| 141 | int wpa_pairwise; |
| 142 | int wpa_group; |
| 143 | int wpa_group_rekey; |
| 144 | int wpa_strict_rekey; |
| 145 | int wpa_gmk_rekey; |
| 146 | int wpa_ptk_rekey; |
| 147 | int rsn_pairwise; |
| 148 | int rsn_preauth; |
| 149 | int eapol_version; |
| 150 | int peerkey; |
| 151 | int wmm_enabled; |
| 152 | int wmm_uapsd; |
Dmitry Shmidt | c55524a | 2011-07-07 11:18:38 -0700 | [diff] [blame] | 153 | int disable_pmksa_caching; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 154 | int okc; |
| 155 | int tx_status; |
| 156 | #ifdef CONFIG_IEEE80211W |
| 157 | enum mfp_options ieee80211w; |
Dmitry Shmidt | b36ed7c | 2014-03-17 10:57:26 -0700 | [diff] [blame] | 158 | int group_mgmt_cipher; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 159 | #endif /* CONFIG_IEEE80211W */ |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame^] | 160 | #ifdef CONFIG_IEEE80211R_AP |
Dmitry Shmidt | 9d9e602 | 2015-04-23 10:34:55 -0700 | [diff] [blame] | 161 | u8 ssid[SSID_MAX_LEN]; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 162 | size_t ssid_len; |
| 163 | u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN]; |
| 164 | u8 r0_key_holder[FT_R0KH_ID_MAX_LEN]; |
| 165 | size_t r0_key_holder_len; |
| 166 | u8 r1_key_holder[FT_R1KH_ID_LEN]; |
| 167 | u32 r0_key_lifetime; |
| 168 | u32 reassociation_deadline; |
| 169 | struct ft_remote_r0kh *r0kh_list; |
| 170 | struct ft_remote_r1kh *r1kh_list; |
| 171 | int pmk_r1_push; |
| 172 | int ft_over_ds; |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame^] | 173 | int ft_psk_generate_local; |
| 174 | #endif /* CONFIG_IEEE80211R_AP */ |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 175 | int disable_gtk; |
| 176 | int ap_mlme; |
Dmitry Shmidt | 51b6ea8 | 2013-05-08 10:42:09 -0700 | [diff] [blame] | 177 | #ifdef CONFIG_TESTING_OPTIONS |
| 178 | double corrupt_gtk_rekey_mic_probability; |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 179 | u8 own_ie_override[MAX_OWN_IE_OVERRIDE]; |
| 180 | size_t own_ie_override_len; |
Dmitry Shmidt | 51b6ea8 | 2013-05-08 10:42:09 -0700 | [diff] [blame] | 181 | #endif /* CONFIG_TESTING_OPTIONS */ |
Dmitry Shmidt | cf32e60 | 2014-01-28 10:57:39 -0800 | [diff] [blame] | 182 | #ifdef CONFIG_P2P |
| 183 | u8 ip_addr_go[4]; |
| 184 | u8 ip_addr_mask[4]; |
| 185 | u8 ip_addr_start[4]; |
| 186 | u8 ip_addr_end[4]; |
| 187 | #endif /* CONFIG_P2P */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 188 | }; |
| 189 | |
| 190 | typedef enum { |
| 191 | LOGGER_DEBUG, LOGGER_INFO, LOGGER_WARNING |
| 192 | } logger_level; |
| 193 | |
| 194 | typedef enum { |
| 195 | WPA_EAPOL_portEnabled, WPA_EAPOL_portValid, WPA_EAPOL_authorized, |
| 196 | WPA_EAPOL_portControl_Auto, WPA_EAPOL_keyRun, WPA_EAPOL_keyAvailable, |
| 197 | WPA_EAPOL_keyDone, WPA_EAPOL_inc_EapolFramesTx |
| 198 | } wpa_eapol_variable; |
| 199 | |
| 200 | struct wpa_auth_callbacks { |
| 201 | void *ctx; |
| 202 | void (*logger)(void *ctx, const u8 *addr, logger_level level, |
| 203 | const char *txt); |
| 204 | void (*disconnect)(void *ctx, const u8 *addr, u16 reason); |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 205 | int (*mic_failure_report)(void *ctx, const u8 *addr); |
Dmitry Shmidt | dda10c2 | 2015-03-24 16:05:01 -0700 | [diff] [blame] | 206 | void (*psk_failure_report)(void *ctx, const u8 *addr); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 207 | void (*set_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var, |
| 208 | int value); |
| 209 | int (*get_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var); |
Dmitry Shmidt | 391c59f | 2013-09-03 12:16:28 -0700 | [diff] [blame] | 210 | const u8 * (*get_psk)(void *ctx, const u8 *addr, const u8 *p2p_dev_addr, |
| 211 | const u8 *prev_psk); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 212 | int (*get_msk)(void *ctx, const u8 *addr, u8 *msk, size_t *len); |
| 213 | int (*set_key)(void *ctx, int vlan_id, enum wpa_alg alg, |
| 214 | const u8 *addr, int idx, u8 *key, size_t key_len); |
| 215 | int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq); |
| 216 | int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data, |
| 217 | size_t data_len, int encrypt); |
| 218 | int (*for_each_sta)(void *ctx, int (*cb)(struct wpa_state_machine *sm, |
| 219 | void *ctx), void *cb_ctx); |
| 220 | int (*for_each_auth)(void *ctx, int (*cb)(struct wpa_authenticator *a, |
| 221 | void *ctx), void *cb_ctx); |
| 222 | int (*send_ether)(void *ctx, const u8 *dst, u16 proto, const u8 *data, |
| 223 | size_t data_len); |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame^] | 224 | #ifdef CONFIG_IEEE80211R_AP |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 225 | struct wpa_state_machine * (*add_sta)(void *ctx, const u8 *sta_addr); |
| 226 | int (*send_ft_action)(void *ctx, const u8 *dst, |
| 227 | const u8 *data, size_t data_len); |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 228 | int (*add_tspec)(void *ctx, const u8 *sta_addr, u8 *tspec_ie, |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 229 | size_t tspec_ielen); |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame^] | 230 | #endif /* CONFIG_IEEE80211R_AP */ |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 231 | #ifdef CONFIG_MESH |
| 232 | int (*start_ampe)(void *ctx, const u8 *sta_addr); |
| 233 | #endif /* CONFIG_MESH */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 234 | }; |
| 235 | |
| 236 | struct wpa_authenticator * wpa_init(const u8 *addr, |
| 237 | struct wpa_auth_config *conf, |
| 238 | struct wpa_auth_callbacks *cb); |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 239 | int wpa_init_keys(struct wpa_authenticator *wpa_auth); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 240 | void wpa_deinit(struct wpa_authenticator *wpa_auth); |
| 241 | int wpa_reconfig(struct wpa_authenticator *wpa_auth, |
| 242 | struct wpa_auth_config *conf); |
| 243 | |
| 244 | enum { |
| 245 | WPA_IE_OK, WPA_INVALID_IE, WPA_INVALID_GROUP, WPA_INVALID_PAIRWISE, |
| 246 | WPA_INVALID_AKMP, WPA_NOT_ENABLED, WPA_ALLOC_FAIL, |
| 247 | WPA_MGMT_FRAME_PROTECTION_VIOLATION, WPA_INVALID_MGMT_GROUP_CIPHER, |
| 248 | WPA_INVALID_MDIE, WPA_INVALID_PROTO |
| 249 | }; |
| 250 | |
| 251 | int wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth, |
| 252 | struct wpa_state_machine *sm, |
| 253 | const u8 *wpa_ie, size_t wpa_ie_len, |
| 254 | const u8 *mdie, size_t mdie_len); |
Dmitry Shmidt | f21452a | 2014-02-26 10:55:25 -0800 | [diff] [blame] | 255 | int wpa_validate_osen(struct wpa_authenticator *wpa_auth, |
| 256 | struct wpa_state_machine *sm, |
| 257 | const u8 *osen_ie, size_t osen_ie_len); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 258 | int wpa_auth_uses_mfp(struct wpa_state_machine *sm); |
| 259 | struct wpa_state_machine * |
Dmitry Shmidt | 391c59f | 2013-09-03 12:16:28 -0700 | [diff] [blame] | 260 | wpa_auth_sta_init(struct wpa_authenticator *wpa_auth, const u8 *addr, |
| 261 | const u8 *p2p_dev_addr); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 262 | int wpa_auth_sta_associated(struct wpa_authenticator *wpa_auth, |
| 263 | struct wpa_state_machine *sm); |
| 264 | void wpa_auth_sta_no_wpa(struct wpa_state_machine *sm); |
| 265 | void wpa_auth_sta_deinit(struct wpa_state_machine *sm); |
| 266 | void wpa_receive(struct wpa_authenticator *wpa_auth, |
| 267 | struct wpa_state_machine *sm, |
| 268 | u8 *data, size_t data_len); |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 269 | enum wpa_event { |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 270 | WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, |
| 271 | WPA_REAUTH_EAPOL, WPA_ASSOC_FT |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 272 | }; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 273 | void wpa_remove_ptk(struct wpa_state_machine *sm); |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 274 | int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 275 | void wpa_auth_sm_notify(struct wpa_state_machine *sm); |
| 276 | void wpa_gtk_rekey(struct wpa_authenticator *wpa_auth); |
| 277 | int wpa_get_mib(struct wpa_authenticator *wpa_auth, char *buf, size_t buflen); |
| 278 | int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen); |
| 279 | void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth); |
| 280 | int wpa_auth_pairwise_set(struct wpa_state_machine *sm); |
| 281 | int wpa_auth_get_pairwise(struct wpa_state_machine *sm); |
| 282 | int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); |
| 283 | int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); |
| 284 | int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, |
| 285 | struct rsn_pmksa_cache_entry *entry); |
| 286 | struct rsn_pmksa_cache_entry * |
| 287 | wpa_auth_sta_get_pmksa(struct wpa_state_machine *sm); |
| 288 | void wpa_auth_sta_local_mic_failure_report(struct wpa_state_machine *sm); |
| 289 | const u8 * wpa_auth_get_wpa_ie(struct wpa_authenticator *wpa_auth, |
| 290 | size_t *len); |
| 291 | int wpa_auth_pmksa_add(struct wpa_state_machine *sm, const u8 *pmk, |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 292 | unsigned int pmk_len, |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 293 | int session_timeout, struct eapol_state_machine *eapol); |
| 294 | int wpa_auth_pmksa_add_preauth(struct wpa_authenticator *wpa_auth, |
| 295 | const u8 *pmk, size_t len, const u8 *sta_addr, |
| 296 | int session_timeout, |
| 297 | struct eapol_state_machine *eapol); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 298 | int wpa_auth_pmksa_add_sae(struct wpa_authenticator *wpa_auth, const u8 *addr, |
Dmitry Shmidt | 57c2d39 | 2016-02-23 13:40:19 -0800 | [diff] [blame] | 299 | const u8 *pmk, const u8 *pmkid); |
Dmitry Shmidt | f7e0a99 | 2013-05-23 11:03:10 -0700 | [diff] [blame] | 300 | void wpa_auth_pmksa_remove(struct wpa_authenticator *wpa_auth, |
| 301 | const u8 *sta_addr); |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 302 | int wpa_auth_pmksa_list(struct wpa_authenticator *wpa_auth, char *buf, |
| 303 | size_t len); |
| 304 | void wpa_auth_pmksa_flush(struct wpa_authenticator *wpa_auth); |
| 305 | struct rsn_pmksa_cache_entry * |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame^] | 306 | wpa_auth_pmksa_get(struct wpa_authenticator *wpa_auth, const u8 *sta_addr, |
| 307 | const u8 *pmkid); |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 308 | void wpa_auth_pmksa_set_to_sm(struct rsn_pmksa_cache_entry *pmksa, |
| 309 | struct wpa_state_machine *sm, |
| 310 | struct wpa_authenticator *wpa_auth, |
| 311 | u8 *pmkid, u8 *pmk); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 312 | int wpa_auth_sta_set_vlan(struct wpa_state_machine *sm, int vlan_id); |
| 313 | void wpa_auth_eapol_key_tx_status(struct wpa_authenticator *wpa_auth, |
| 314 | struct wpa_state_machine *sm, int ack); |
| 315 | |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame^] | 316 | #ifdef CONFIG_IEEE80211R_AP |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 317 | u8 * wpa_sm_write_assoc_resp_ies(struct wpa_state_machine *sm, u8 *pos, |
| 318 | size_t max_len, int auth_alg, |
| 319 | const u8 *req_ies, size_t req_ies_len); |
| 320 | void wpa_ft_process_auth(struct wpa_state_machine *sm, const u8 *bssid, |
| 321 | u16 auth_transaction, const u8 *ies, size_t ies_len, |
| 322 | void (*cb)(void *ctx, const u8 *dst, const u8 *bssid, |
| 323 | u16 auth_transaction, u16 resp, |
| 324 | const u8 *ies, size_t ies_len), |
| 325 | void *ctx); |
| 326 | u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies, |
| 327 | size_t ies_len); |
| 328 | int wpa_ft_action_rx(struct wpa_state_machine *sm, const u8 *data, size_t len); |
| 329 | int wpa_ft_rrb_rx(struct wpa_authenticator *wpa_auth, const u8 *src_addr, |
| 330 | const u8 *data, size_t data_len); |
| 331 | void wpa_ft_push_pmk_r1(struct wpa_authenticator *wpa_auth, const u8 *addr); |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame^] | 332 | #endif /* CONFIG_IEEE80211R_AP */ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 333 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 334 | void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm); |
| 335 | void wpa_set_wnmsleep(struct wpa_state_machine *sm, int flag); |
| 336 | int wpa_wnmsleep_gtk_subelem(struct wpa_state_machine *sm, u8 *pos); |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 337 | int wpa_wnmsleep_igtk_subelem(struct wpa_state_machine *sm, u8 *pos); |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 338 | |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 339 | int wpa_auth_uses_sae(struct wpa_state_machine *sm); |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 340 | int wpa_auth_uses_ft_sae(struct wpa_state_machine *sm); |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 341 | |
Dmitry Shmidt | cf32e60 | 2014-01-28 10:57:39 -0800 | [diff] [blame] | 342 | int wpa_auth_get_ip_addr(struct wpa_state_machine *sm, u8 *addr); |
| 343 | |
Dmitry Shmidt | 2f74e36 | 2015-01-21 13:19:05 -0800 | [diff] [blame] | 344 | struct radius_das_attrs; |
| 345 | int wpa_auth_radius_das_disconnect_pmksa(struct wpa_authenticator *wpa_auth, |
| 346 | struct radius_das_attrs *attr); |
Dmitry Shmidt | 7f65602 | 2015-02-25 14:36:37 -0800 | [diff] [blame] | 347 | void wpa_auth_reconfig_group_keys(struct wpa_authenticator *wpa_auth); |
Dmitry Shmidt | 2f74e36 | 2015-01-21 13:19:05 -0800 | [diff] [blame] | 348 | |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 349 | int wpa_auth_ensure_group(struct wpa_authenticator *wpa_auth, int vlan_id); |
| 350 | int wpa_auth_release_group(struct wpa_authenticator *wpa_auth, int vlan_id); |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame^] | 351 | int fils_auth_pmk_to_ptk(struct wpa_state_machine *sm, const u8 *pmk, |
| 352 | size_t pmk_len, const u8 *snonce, const u8 *anonce); |
| 353 | int fils_decrypt_assoc(struct wpa_state_machine *sm, const u8 *fils_session, |
| 354 | const struct ieee80211_mgmt *mgmt, size_t frame_len, |
| 355 | u8 *pos, size_t left); |
| 356 | int fils_encrypt_assoc(struct wpa_state_machine *sm, u8 *buf, |
| 357 | size_t current_len, size_t max_len); |
| 358 | int fils_set_tk(struct wpa_state_machine *sm); |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 359 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 360 | #endif /* WPA_AUTH_H */ |