wpa_common.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. /*
  2. * WPA definitions shared between hostapd and wpa_supplicant
  3. * Copyright (c) 2002-2013, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef WPA_COMMON_H
  9. #define WPA_COMMON_H
  10. #define WPA_MAX_SSID_LEN 32
  11. /* IEEE 802.11i */
  12. #define PMKID_LEN 16
  13. #define PMK_LEN 32
  14. #define WPA_REPLAY_COUNTER_LEN 8
  15. #define WPA_NONCE_LEN 32
  16. #define WPA_KEY_RSC_LEN 8
  17. #define WPA_GMK_LEN 32
  18. #define WPA_GTK_MAX_LEN 32
  19. #define WPA_ALLOWED_PAIRWISE_CIPHERS \
  20. (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP | WPA_CIPHER_TKIP | WPA_CIPHER_NONE | \
  21. WPA_CIPHER_GCMP_256 | WPA_CIPHER_CCMP_256)
  22. #define WPA_ALLOWED_GROUP_CIPHERS \
  23. (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP | WPA_CIPHER_TKIP | WPA_CIPHER_WEP104 | \
  24. WPA_CIPHER_WEP40 | WPA_CIPHER_GCMP_256 | WPA_CIPHER_CCMP_256 | \
  25. WPA_CIPHER_GTK_NOT_USED)
  26. #define WPA_SELECTOR_LEN 4
  27. #define WPA_VERSION 1
  28. #define RSN_SELECTOR_LEN 4
  29. #define RSN_VERSION 1
  30. #define RSN_SELECTOR(a, b, c, d) \
  31. ((((u32) (a)) << 24) | (((u32) (b)) << 16) | (((u32) (c)) << 8) | \
  32. (u32) (d))
  33. #define WPA_AUTH_KEY_MGMT_NONE RSN_SELECTOR(0x00, 0x50, 0xf2, 0)
  34. #define WPA_AUTH_KEY_MGMT_UNSPEC_802_1X RSN_SELECTOR(0x00, 0x50, 0xf2, 1)
  35. #define WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X RSN_SELECTOR(0x00, 0x50, 0xf2, 2)
  36. #define WPA_AUTH_KEY_MGMT_CCKM RSN_SELECTOR(0x00, 0x40, 0x96, 0)
  37. #define WPA_CIPHER_SUITE_NONE RSN_SELECTOR(0x00, 0x50, 0xf2, 0)
  38. #define WPA_CIPHER_SUITE_WEP40 RSN_SELECTOR(0x00, 0x50, 0xf2, 1)
  39. #define WPA_CIPHER_SUITE_TKIP RSN_SELECTOR(0x00, 0x50, 0xf2, 2)
  40. #if 0
  41. #define WPA_CIPHER_SUITE_WRAP RSN_SELECTOR(0x00, 0x50, 0xf2, 3)
  42. #endif
  43. #define WPA_CIPHER_SUITE_CCMP RSN_SELECTOR(0x00, 0x50, 0xf2, 4)
  44. #define WPA_CIPHER_SUITE_WEP104 RSN_SELECTOR(0x00, 0x50, 0xf2, 5)
  45. #define RSN_AUTH_KEY_MGMT_UNSPEC_802_1X RSN_SELECTOR(0x00, 0x0f, 0xac, 1)
  46. #define RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X RSN_SELECTOR(0x00, 0x0f, 0xac, 2)
  47. #ifdef CONFIG_IEEE80211R
  48. #define RSN_AUTH_KEY_MGMT_FT_802_1X RSN_SELECTOR(0x00, 0x0f, 0xac, 3)
  49. #define RSN_AUTH_KEY_MGMT_FT_PSK RSN_SELECTOR(0x00, 0x0f, 0xac, 4)
  50. #endif /* CONFIG_IEEE80211R */
  51. #define RSN_AUTH_KEY_MGMT_802_1X_SHA256 RSN_SELECTOR(0x00, 0x0f, 0xac, 5)
  52. #define RSN_AUTH_KEY_MGMT_PSK_SHA256 RSN_SELECTOR(0x00, 0x0f, 0xac, 6)
  53. #define RSN_AUTH_KEY_MGMT_TPK_HANDSHAKE RSN_SELECTOR(0x00, 0x0f, 0xac, 7)
  54. #define RSN_AUTH_KEY_MGMT_SAE RSN_SELECTOR(0x00, 0x0f, 0xac, 8)
  55. #define RSN_AUTH_KEY_MGMT_FT_SAE RSN_SELECTOR(0x00, 0x0f, 0xac, 9)
  56. #define RSN_AUTH_KEY_MGMT_802_1X_SUITE_B RSN_SELECTOR(0x00, 0x0f, 0xac, 11)
  57. #define RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_384 RSN_SELECTOR(0x00, 0x0f, 0xac, 12)
  58. #define RSN_AUTH_KEY_MGMT_FT_802_1X_SUITE_B_384 \
  59. RSN_SELECTOR(0x00, 0x0f, 0xac, 13)
  60. #define RSN_AUTH_KEY_MGMT_CCKM RSN_SELECTOR(0x00, 0x40, 0x96, 0x00)
  61. #define RSN_AUTH_KEY_MGMT_OSEN RSN_SELECTOR(0x50, 0x6f, 0x9a, 0x01)
  62. #define RSN_CIPHER_SUITE_NONE RSN_SELECTOR(0x00, 0x0f, 0xac, 0)
  63. #define RSN_CIPHER_SUITE_WEP40 RSN_SELECTOR(0x00, 0x0f, 0xac, 1)
  64. #define RSN_CIPHER_SUITE_TKIP RSN_SELECTOR(0x00, 0x0f, 0xac, 2)
  65. #if 0
  66. #define RSN_CIPHER_SUITE_WRAP RSN_SELECTOR(0x00, 0x0f, 0xac, 3)
  67. #endif
  68. #define RSN_CIPHER_SUITE_CCMP RSN_SELECTOR(0x00, 0x0f, 0xac, 4)
  69. #define RSN_CIPHER_SUITE_WEP104 RSN_SELECTOR(0x00, 0x0f, 0xac, 5)
  70. #define RSN_CIPHER_SUITE_AES_128_CMAC RSN_SELECTOR(0x00, 0x0f, 0xac, 6)
  71. #define RSN_CIPHER_SUITE_NO_GROUP_ADDRESSED RSN_SELECTOR(0x00, 0x0f, 0xac, 7)
  72. #define RSN_CIPHER_SUITE_GCMP RSN_SELECTOR(0x00, 0x0f, 0xac, 8)
  73. #define RSN_CIPHER_SUITE_GCMP_256 RSN_SELECTOR(0x00, 0x0f, 0xac, 9)
  74. #define RSN_CIPHER_SUITE_CCMP_256 RSN_SELECTOR(0x00, 0x0f, 0xac, 10)
  75. #define RSN_CIPHER_SUITE_BIP_GMAC_128 RSN_SELECTOR(0x00, 0x0f, 0xac, 11)
  76. #define RSN_CIPHER_SUITE_BIP_GMAC_256 RSN_SELECTOR(0x00, 0x0f, 0xac, 12)
  77. #define RSN_CIPHER_SUITE_BIP_CMAC_256 RSN_SELECTOR(0x00, 0x0f, 0xac, 13)
  78. /* EAPOL-Key Key Data Encapsulation
  79. * GroupKey and PeerKey require encryption, otherwise, encryption is optional.
  80. */
  81. #define RSN_KEY_DATA_GROUPKEY RSN_SELECTOR(0x00, 0x0f, 0xac, 1)
  82. #if 0
  83. #define RSN_KEY_DATA_STAKEY RSN_SELECTOR(0x00, 0x0f, 0xac, 2)
  84. #endif
  85. #define RSN_KEY_DATA_MAC_ADDR RSN_SELECTOR(0x00, 0x0f, 0xac, 3)
  86. #define RSN_KEY_DATA_PMKID RSN_SELECTOR(0x00, 0x0f, 0xac, 4)
  87. #ifdef CONFIG_PEERKEY
  88. #define RSN_KEY_DATA_SMK RSN_SELECTOR(0x00, 0x0f, 0xac, 5)
  89. #define RSN_KEY_DATA_NONCE RSN_SELECTOR(0x00, 0x0f, 0xac, 6)
  90. #define RSN_KEY_DATA_LIFETIME RSN_SELECTOR(0x00, 0x0f, 0xac, 7)
  91. #define RSN_KEY_DATA_ERROR RSN_SELECTOR(0x00, 0x0f, 0xac, 8)
  92. #endif /* CONFIG_PEERKEY */
  93. #ifdef CONFIG_IEEE80211W
  94. #define RSN_KEY_DATA_IGTK RSN_SELECTOR(0x00, 0x0f, 0xac, 9)
  95. #endif /* CONFIG_IEEE80211W */
  96. #define RSN_KEY_DATA_KEYID RSN_SELECTOR(0x00, 0x0f, 0xac, 10)
  97. #define RSN_KEY_DATA_MULTIBAND_GTK RSN_SELECTOR(0x00, 0x0f, 0xac, 11)
  98. #define RSN_KEY_DATA_MULTIBAND_KEYID RSN_SELECTOR(0x00, 0x0f, 0xac, 12)
  99. #define WFA_KEY_DATA_IP_ADDR_REQ RSN_SELECTOR(0x50, 0x6f, 0x9a, 4)
  100. #define WFA_KEY_DATA_IP_ADDR_ALLOC RSN_SELECTOR(0x50, 0x6f, 0x9a, 5)
  101. #define WPA_OUI_TYPE RSN_SELECTOR(0x00, 0x50, 0xf2, 1)
  102. #define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
  103. #define RSN_SELECTOR_GET(a) WPA_GET_BE32((const u8 *) (a))
  104. #define RSN_NUM_REPLAY_COUNTERS_1 0
  105. #define RSN_NUM_REPLAY_COUNTERS_2 1
  106. #define RSN_NUM_REPLAY_COUNTERS_4 2
  107. #define RSN_NUM_REPLAY_COUNTERS_16 3
  108. #ifdef _MSC_VER
  109. #pragma pack(push, 1)
  110. #endif /* _MSC_VER */
  111. #ifdef CONFIG_IEEE80211W
  112. #define WPA_IGTK_LEN 16
  113. #define WPA_IGTK_MAX_LEN 32
  114. #endif /* CONFIG_IEEE80211W */
  115. /* IEEE 802.11, 7.3.2.25.3 RSN Capabilities */
  116. #define WPA_CAPABILITY_PREAUTH BIT(0)
  117. #define WPA_CAPABILITY_NO_PAIRWISE BIT(1)
  118. /* B2-B3: PTKSA Replay Counter */
  119. /* B4-B5: GTKSA Replay Counter */
  120. #define WPA_CAPABILITY_MFPR BIT(6)
  121. #define WPA_CAPABILITY_MFPC BIT(7)
  122. /* B8: Reserved */
  123. #define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
  124. #define WPA_CAPABILITY_SPP_A_MSDU_CAPABLE BIT(10)
  125. #define WPA_CAPABILITY_SPP_A_MSDU_REQUIRED BIT(11)
  126. #define WPA_CAPABILITY_PBAC BIT(12)
  127. #define WPA_CAPABILITY_EXT_KEY_ID_FOR_UNICAST BIT(13)
  128. /* B14-B15: Reserved */
  129. /* IEEE 802.11r */
  130. #define MOBILITY_DOMAIN_ID_LEN 2
  131. #define FT_R0KH_ID_MAX_LEN 48
  132. #define FT_R1KH_ID_LEN 6
  133. #define WPA_PMK_NAME_LEN 16
  134. /* IEEE 802.11, 8.5.2 EAPOL-Key frames */
  135. #define WPA_KEY_INFO_TYPE_MASK ((u16) (BIT(0) | BIT(1) | BIT(2)))
  136. #define WPA_KEY_INFO_TYPE_AKM_DEFINED 0
  137. #define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 BIT(0)
  138. #define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES BIT(1)
  139. #define WPA_KEY_INFO_TYPE_AES_128_CMAC 3
  140. #define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */
  141. /* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */
  142. #define WPA_KEY_INFO_KEY_INDEX_MASK (BIT(4) | BIT(5))
  143. #define WPA_KEY_INFO_KEY_INDEX_SHIFT 4
  144. #define WPA_KEY_INFO_INSTALL BIT(6) /* pairwise */
  145. #define WPA_KEY_INFO_TXRX BIT(6) /* group */
  146. #define WPA_KEY_INFO_ACK BIT(7)
  147. #define WPA_KEY_INFO_MIC BIT(8)
  148. #define WPA_KEY_INFO_SECURE BIT(9)
  149. #define WPA_KEY_INFO_ERROR BIT(10)
  150. #define WPA_KEY_INFO_REQUEST BIT(11)
  151. #define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12) /* IEEE 802.11i/RSN only */
  152. #define WPA_KEY_INFO_SMK_MESSAGE BIT(13)
  153. struct wpa_eapol_key {
  154. u8 type;
  155. /* Note: key_info, key_length, and key_data_length are unaligned */
  156. u8 key_info[2]; /* big endian */
  157. u8 key_length[2]; /* big endian */
  158. u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
  159. u8 key_nonce[WPA_NONCE_LEN];
  160. u8 key_iv[16];
  161. u8 key_rsc[WPA_KEY_RSC_LEN];
  162. u8 key_id[8]; /* Reserved in IEEE 802.11i/RSN */
  163. u8 key_mic[16];
  164. u8 key_data_length[2]; /* big endian */
  165. /* followed by key_data_length bytes of key_data */
  166. } STRUCT_PACKED;
  167. /**
  168. * struct wpa_ptk - WPA Pairwise Transient Key
  169. * IEEE Std 802.11i-2004 - 8.5.1.2 Pairwise key hierarchy
  170. */
  171. struct wpa_ptk {
  172. u8 kck[16]; /* EAPOL-Key Key Confirmation Key (KCK) */
  173. u8 kek[16]; /* EAPOL-Key Key Encryption Key (KEK) */
  174. u8 tk1[16]; /* Temporal Key 1 (TK1) */
  175. union {
  176. u8 tk2[16]; /* Temporal Key 2 (TK2) */
  177. struct {
  178. u8 tx_mic_key[8];
  179. u8 rx_mic_key[8];
  180. } auth;
  181. } u;
  182. } STRUCT_PACKED;
  183. /* WPA IE version 1
  184. * 00-50-f2:1 (OUI:OUI type)
  185. * 0x01 0x00 (version; little endian)
  186. * (all following fields are optional:)
  187. * Group Suite Selector (4 octets) (default: TKIP)
  188. * Pairwise Suite Count (2 octets, little endian) (default: 1)
  189. * Pairwise Suite List (4 * n octets) (default: TKIP)
  190. * Authenticated Key Management Suite Count (2 octets, little endian)
  191. * (default: 1)
  192. * Authenticated Key Management Suite List (4 * n octets)
  193. * (default: unspec 802.1X)
  194. * WPA Capabilities (2 octets, little endian) (default: 0)
  195. */
  196. struct wpa_ie_hdr {
  197. u8 elem_id;
  198. u8 len;
  199. u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
  200. u8 version[2]; /* little endian */
  201. } STRUCT_PACKED;
  202. /* 1/4: PMKID
  203. * 2/4: RSN IE
  204. * 3/4: one or two RSN IEs + GTK IE (encrypted)
  205. * 4/4: empty
  206. * 1/2: GTK IE (encrypted)
  207. * 2/2: empty
  208. */
  209. /* RSN IE version 1
  210. * 0x01 0x00 (version; little endian)
  211. * (all following fields are optional:)
  212. * Group Suite Selector (4 octets) (default: CCMP)
  213. * Pairwise Suite Count (2 octets, little endian) (default: 1)
  214. * Pairwise Suite List (4 * n octets) (default: CCMP)
  215. * Authenticated Key Management Suite Count (2 octets, little endian)
  216. * (default: 1)
  217. * Authenticated Key Management Suite List (4 * n octets)
  218. * (default: unspec 802.1X)
  219. * RSN Capabilities (2 octets, little endian) (default: 0)
  220. * PMKID Count (2 octets) (default: 0)
  221. * PMKID List (16 * n octets)
  222. * Management Group Cipher Suite (4 octets) (default: AES-128-CMAC)
  223. */
  224. struct rsn_ie_hdr {
  225. u8 elem_id; /* WLAN_EID_RSN */
  226. u8 len;
  227. u8 version[2]; /* little endian */
  228. } STRUCT_PACKED;
  229. #ifdef CONFIG_PEERKEY
  230. enum {
  231. STK_MUI_4WAY_STA_AP = 1,
  232. STK_MUI_4WAY_STAT_STA = 2,
  233. STK_MUI_GTK = 3,
  234. STK_MUI_SMK = 4
  235. };
  236. enum {
  237. STK_ERR_STA_NR = 1,
  238. STK_ERR_STA_NRSN = 2,
  239. STK_ERR_CPHR_NS = 3,
  240. STK_ERR_NO_STSL = 4
  241. };
  242. #endif /* CONFIG_PEERKEY */
  243. struct rsn_error_kde {
  244. be16 mui;
  245. be16 error_type;
  246. } STRUCT_PACKED;
  247. #ifdef CONFIG_IEEE80211W
  248. #define WPA_IGTK_KDE_PREFIX_LEN (2 + 6)
  249. struct wpa_igtk_kde {
  250. u8 keyid[2];
  251. u8 pn[6];
  252. u8 igtk[WPA_IGTK_MAX_LEN];
  253. } STRUCT_PACKED;
  254. #endif /* CONFIG_IEEE80211W */
  255. #ifdef CONFIG_IEEE80211R
  256. struct rsn_mdie {
  257. u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
  258. u8 ft_capab;
  259. } STRUCT_PACKED;
  260. #define RSN_FT_CAPAB_FT_OVER_DS BIT(0)
  261. #define RSN_FT_CAPAB_FT_RESOURCE_REQ_SUPP BIT(1)
  262. struct rsn_ftie {
  263. u8 mic_control[2];
  264. u8 mic[16];
  265. u8 anonce[WPA_NONCE_LEN];
  266. u8 snonce[WPA_NONCE_LEN];
  267. /* followed by optional parameters */
  268. } STRUCT_PACKED;
  269. #define FTIE_SUBELEM_R1KH_ID 1
  270. #define FTIE_SUBELEM_GTK 2
  271. #define FTIE_SUBELEM_R0KH_ID 3
  272. #define FTIE_SUBELEM_IGTK 4
  273. struct rsn_rdie {
  274. u8 id;
  275. u8 descr_count;
  276. le16 status_code;
  277. } STRUCT_PACKED;
  278. #endif /* CONFIG_IEEE80211R */
  279. #ifdef _MSC_VER
  280. #pragma pack(pop)
  281. #endif /* _MSC_VER */
  282. int wpa_eapol_key_mic(const u8 *key, int ver, const u8 *buf, size_t len,
  283. u8 *mic);
  284. void wpa_pmk_to_ptk(const u8 *pmk, size_t pmk_len, const char *label,
  285. const u8 *addr1, const u8 *addr2,
  286. const u8 *nonce1, const u8 *nonce2,
  287. u8 *ptk, size_t ptk_len, int use_sha256);
  288. #ifdef CONFIG_IEEE80211R
  289. int wpa_ft_mic(const u8 *kck, const u8 *sta_addr, const u8 *ap_addr,
  290. u8 transaction_seqnum, const u8 *mdie, size_t mdie_len,
  291. const u8 *ftie, size_t ftie_len,
  292. const u8 *rsnie, size_t rsnie_len,
  293. const u8 *ric, size_t ric_len, u8 *mic);
  294. void wpa_derive_pmk_r0(const u8 *xxkey, size_t xxkey_len,
  295. const u8 *ssid, size_t ssid_len,
  296. const u8 *mdid, const u8 *r0kh_id, size_t r0kh_id_len,
  297. const u8 *s0kh_id, u8 *pmk_r0, u8 *pmk_r0_name);
  298. void wpa_derive_pmk_r1_name(const u8 *pmk_r0_name, const u8 *r1kh_id,
  299. const u8 *s1kh_id, u8 *pmk_r1_name);
  300. void wpa_derive_pmk_r1(const u8 *pmk_r0, const u8 *pmk_r0_name,
  301. const u8 *r1kh_id, const u8 *s1kh_id,
  302. u8 *pmk_r1, u8 *pmk_r1_name);
  303. void wpa_pmk_r1_to_ptk(const u8 *pmk_r1, const u8 *snonce, const u8 *anonce,
  304. const u8 *sta_addr, const u8 *bssid,
  305. const u8 *pmk_r1_name,
  306. u8 *ptk, size_t ptk_len, u8 *ptk_name);
  307. #endif /* CONFIG_IEEE80211R */
  308. struct wpa_ie_data {
  309. int proto;
  310. int pairwise_cipher;
  311. int group_cipher;
  312. int key_mgmt;
  313. int capabilities;
  314. size_t num_pmkid;
  315. const u8 *pmkid;
  316. int mgmt_group_cipher;
  317. };
  318. int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len,
  319. struct wpa_ie_data *data);
  320. int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len,
  321. struct wpa_ie_data *data);
  322. void rsn_pmkid(const u8 *pmk, size_t pmk_len, const u8 *aa, const u8 *spa,
  323. u8 *pmkid, int use_sha256);
  324. const char * wpa_cipher_txt(int cipher);
  325. const char * wpa_key_mgmt_txt(int key_mgmt, int proto);
  326. int wpa_compare_rsn_ie(int ft_initial_assoc,
  327. const u8 *ie1, size_t ie1len,
  328. const u8 *ie2, size_t ie2len);
  329. int wpa_insert_pmkid(u8 *ies, size_t ies_len, const u8 *pmkid);
  330. struct wpa_ft_ies {
  331. const u8 *mdie;
  332. size_t mdie_len;
  333. const u8 *ftie;
  334. size_t ftie_len;
  335. const u8 *r1kh_id;
  336. const u8 *gtk;
  337. size_t gtk_len;
  338. const u8 *r0kh_id;
  339. size_t r0kh_id_len;
  340. const u8 *rsn;
  341. size_t rsn_len;
  342. const u8 *rsn_pmkid;
  343. const u8 *tie;
  344. size_t tie_len;
  345. const u8 *igtk;
  346. size_t igtk_len;
  347. const u8 *ric;
  348. size_t ric_len;
  349. };
  350. int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse);
  351. int wpa_cipher_key_len(int cipher);
  352. int wpa_cipher_rsc_len(int cipher);
  353. int wpa_cipher_to_alg(int cipher);
  354. int wpa_cipher_valid_pairwise(int cipher);
  355. int wpa_cipher_valid_mgmt_group(int cipher);
  356. u32 wpa_cipher_to_suite(int proto, int cipher);
  357. int rsn_cipher_put_suites(u8 *pos, int ciphers);
  358. int wpa_cipher_put_suites(u8 *pos, int ciphers);
  359. int wpa_pick_pairwise_cipher(int ciphers, int none_allowed);
  360. int wpa_pick_group_cipher(int ciphers);
  361. int wpa_parse_cipher(const char *value);
  362. int wpa_write_ciphers(char *start, char *end, int ciphers, const char *delim);
  363. int wpa_select_ap_group_cipher(int wpa, int wpa_pairwise, int rsn_pairwise);
  364. #endif /* WPA_COMMON_H */