PageRenderTime 52ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/src/core/rsn/admCtrlWpa2.c

http://github.com/CyanogenMod/cm-kernel
C | 1702 lines | 1109 code | 231 blank | 362 comment | 139 complexity | dcc3da453cc77bc6660bbb1bb34d78a4 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0

Large files files are truncated, but you can click here to view the full file

  1. /****************************************************************************
  2. **+-----------------------------------------------------------------------+**
  3. **| |**
  4. **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
  5. **| All rights reserved. |**
  6. **| |**
  7. **| Redistribution and use in source and binary forms, with or without |**
  8. **| modification, are permitted provided that the following conditions |**
  9. **| are met: |**
  10. **| |**
  11. **| * Redistributions of source code must retain the above copyright |**
  12. **| notice, this list of conditions and the following disclaimer. |**
  13. **| * Redistributions in binary form must reproduce the above copyright |**
  14. **| notice, this list of conditions and the following disclaimer in |**
  15. **| the documentation and/or other materials provided with the |**
  16. **| distribution. |**
  17. **| * Neither the name Texas Instruments nor the names of its |**
  18. **| contributors may be used to endorse or promote products derived |**
  19. **| from this software without specific prior written permission. |**
  20. **| |**
  21. **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
  22. **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
  23. **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
  24. **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |**
  25. **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
  26. **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |**
  27. **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
  28. **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
  29. **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
  30. **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
  31. **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
  32. **| |**
  33. **+-----------------------------------------------------------------------+**
  34. ****************************************************************************/
  35. /** \file admCtrlWpa2.c
  36. * \brief WPA2 Admission control methods
  37. *
  38. * \see admCtrl.h
  39. */
  40. #include "osApi.h"
  41. #include "utils.h"
  42. #include "paramOut.h"
  43. #include "paramIn.h"
  44. #include "mlmeApi.h"
  45. #include "802_11Defs.h"
  46. #include "DataCtrl_Api.h"
  47. #include "report.h"
  48. /*
  49. #include "fsm.h"
  50. #include "utils.h"
  51. */
  52. #include "rsn.h"
  53. #include "admCtrl.h"
  54. #include "admCtrlWpa2.h"
  55. #include "osDot11.h"
  56. #include "siteMgrApi.h"
  57. #include "EvHandler.h"
  58. #include "admCtrl.h"
  59. #ifdef EXC_MODULE_INCLUDED
  60. #include "admCtrlWpa.h"
  61. #include "admCtrlExc.h"
  62. #include "excMngr.h"
  63. #endif
  64. /* Constants */
  65. #define MAX_NETWORK_MODE 2
  66. #define MAX_WPA2_CIPHER_SUITE 6
  67. #define PMKID_CAND_LIST_MEMBUFF_SIZE (2*sizeof(UINT32) + (sizeof(OS_802_11_PMKID_CANDIDATE) * PMKID_MAX_NUMBER))
  68. #define PMKID_MIN_BUFFER_SIZE 2*sizeof(UINT32) + MAC_ADDR_LEN + PMKID_VALUE_SIZE
  69. #define TI_WLAN_COPY_UINT16_UNALIGNED(addr, val) {\
  70. *((UINT8 *) &(addr)) = (UINT8)(val & 0x00FF); \
  71. *((UINT8 *) &(addr) + 1) = (UINT8)((val & 0xFF00) >> 8);}
  72. /* Enumerations */
  73. /* Typedefs */
  74. /* Structures */
  75. /* External data definitions */
  76. /* Local functions definitions */
  77. /* Global variables */
  78. static UINT8 wpa2IeOuiIe[3] = { 0x00, 0x0f, 0xac};
  79. /**************************************************************/
  80. /* reduce stack usage (admCtrlWpa_setSite)*/
  81. /**************************************************************/
  82. static paramInfo_t param;
  83. static whalParamInfo_t whalParam;
  84. static wpa2IeData_t wpa2DataIE;
  85. /**************************************************************/
  86. static BOOL broadcastCipherSuiteValidity[MAX_NETWORK_MODE][MAX_WPA2_CIPHER_SUITE]=
  87. {
  88. /* RSN_IBSS */ {
  89. /* NONE */ FALSE,
  90. /* WEP40 */ FALSE,
  91. /* TKIP */ TRUE,
  92. /* AES_WRAP */ FALSE,
  93. /* AES_CCMP */ TRUE,
  94. /* WEP104 */ FALSE},
  95. /* RSN_INFRASTRUCTURE */ {
  96. /* NONE */ FALSE,
  97. /* WEP */ TRUE,
  98. /* TKIP */ TRUE,
  99. /* AES_WRAP */ FALSE,
  100. /* AES_CCMP */ TRUE,
  101. /* WEP104 */ TRUE}
  102. };
  103. /** WPA2 admission table. Used to verify admission parameters to an AP */
  104. /* table parameters:
  105. Max unicast cipher in the IE
  106. Max broadcast cipher in the IE
  107. Encryption status
  108. */
  109. typedef struct
  110. {
  111. TI_STATUS status;
  112. cipherSuite_e unicast;
  113. cipherSuite_e broadcast;
  114. UINT8 evaluation;
  115. } admCtrlWpa2_validity_t;
  116. static admCtrlWpa2_validity_t admCtrlWpa2_validityTable[MAX_WPA2_CIPHER_SUITE][MAX_WPA2_CIPHER_SUITE][MAX_WPA2_CIPHER_SUITE] =
  117. {
  118. /* AP unicast NONE */ {
  119. /* AP multicast NONE */ {
  120. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  121. /* STA WEP40 */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  122. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  123. /* STA WRAP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  124. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  125. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  126. /* AP multicast WEP40 */ {
  127. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  128. /* STA WEP40 */ { OK, RSN_CIPHER_NONE, RSN_CIPHER_WEP ,1},
  129. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  130. /* STA WRAP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  131. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  132. /* STA WEP104 */{ OK, RSN_CIPHER_NONE, RSN_CIPHER_WEP104 ,1}},
  133. /* AP multicast TKIP */ {
  134. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  135. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  136. /* STA TKIP */ { OK, RSN_CIPHER_NONE, RSN_CIPHER_TKIP ,2},
  137. /* STA WRAP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  138. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  139. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  140. /* AP multicast WRAP */ {
  141. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  142. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  143. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  144. /* STA WRAP */ { OK, RSN_CIPHER_NONE, RSN_CIPHER_AES_WRAP ,3},
  145. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  146. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  147. /* AP multicast CCMP */ {
  148. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  149. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  150. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  151. /* STA WRAP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  152. /* STA CCMP */ { OK, RSN_CIPHER_NONE, RSN_CIPHER_AES_CCMP ,3},
  153. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  154. /* AP multicast WEP104 */ {
  155. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  156. /* STA WEP40 */ { OK, RSN_CIPHER_NONE, RSN_CIPHER_WEP ,1},
  157. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  158. /* STA WRAP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  159. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  160. /* STA WEP104 */{ OK, RSN_CIPHER_NONE, RSN_CIPHER_WEP104 ,1}}},
  161. /* AP unicast WEP */ {
  162. /* AP multicast NONE */ {
  163. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  164. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  165. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  166. /* STA WRAP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  167. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  168. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  169. /* AP multicast WEP */ {
  170. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  171. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  172. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  173. /* STA WRAP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  174. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  175. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  176. /* AP multicast TKIP */ {
  177. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  178. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  179. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  180. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  181. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  182. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  183. /* AP multicast WRAP */ {
  184. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  185. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  186. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  187. /* STA WRAP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  188. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  189. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  190. /* AP multicast CCMP */ {
  191. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  192. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  193. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  194. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  195. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  196. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  197. /* AP multicast WEP104 */ {
  198. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  199. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  200. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  201. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  202. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  203. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}}},
  204. /* AP unicast TKIP */ {
  205. /* AP multicast NONE */ {
  206. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  207. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  208. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  209. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  210. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  211. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  212. /* AP multicast WEP */ {
  213. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  214. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  215. /* STA TKIP */ { OK, RSN_CIPHER_TKIP, RSN_CIPHER_WEP ,4},
  216. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  217. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  218. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  219. /* AP multicast TKIP */ {
  220. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  221. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  222. /* STA TKIP */ { OK, RSN_CIPHER_TKIP, RSN_CIPHER_TKIP ,7},
  223. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  224. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  225. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  226. /* AP multicast WRAP */ {
  227. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  228. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  229. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  230. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  231. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  232. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  233. /* AP multicast CCMP */ {
  234. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  235. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  236. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  237. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  238. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  239. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  240. /* AP multicast WEP104 */ {
  241. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  242. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  243. /* STA TKIP */ { OK, RSN_CIPHER_TKIP, RSN_CIPHER_WEP104 ,4},
  244. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  245. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  246. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}}},
  247. /* AP unicast AES_WRAP */ {
  248. /* AP multicast NONE */ {
  249. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  250. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  251. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  252. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  253. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  254. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  255. /* AP multicast WEP40 */ {
  256. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  257. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  258. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  259. /* STA AES */ { OK, RSN_CIPHER_AES_WRAP, RSN_CIPHER_WEP ,5},
  260. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  261. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  262. /* AP multicast TKIP */ {
  263. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  264. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  265. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  266. /* STA AES */ { OK, RSN_CIPHER_AES_WRAP, RSN_CIPHER_TKIP ,6},
  267. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  268. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  269. /* AP multicast WRAP */ {
  270. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  271. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  272. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  273. /* STA AES */ { OK, RSN_CIPHER_AES_WRAP, RSN_CIPHER_AES_WRAP ,8},
  274. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  275. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  276. /* AP multicast CCMP */ {
  277. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  278. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  279. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  280. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  281. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  282. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  283. /* AP multicast WEP104 */ {
  284. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  285. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  286. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  287. /* STA AES */ { OK, RSN_CIPHER_AES_WRAP, RSN_CIPHER_WEP104 ,5},
  288. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  289. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}}},
  290. /* AP unicast AES_CCMP */ {
  291. /* AP multicast NONE */ {
  292. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  293. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  294. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  295. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  296. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  297. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  298. /* AP multicast WEP */ {
  299. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  300. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  301. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  302. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  303. /* STA CCMP */ { OK, RSN_CIPHER_AES_CCMP, RSN_CIPHER_WEP ,5},
  304. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  305. /* AP multicast TKIP */ {
  306. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  307. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  308. /* STA TKIP */ { OK, RSN_CIPHER_AES_CCMP, RSN_CIPHER_TKIP ,6},
  309. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  310. /* STA CCMP */ { OK, RSN_CIPHER_AES_CCMP, RSN_CIPHER_TKIP ,6},
  311. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  312. /* AP multicast WRAP */ {
  313. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  314. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  315. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  316. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  317. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  318. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  319. /* AP multicast CCMP */ {
  320. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  321. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  322. /* STA TKIP */ { OK, RSN_CIPHER_AES_CCMP, RSN_CIPHER_AES_CCMP ,6},
  323. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  324. /* STA CCMP */ { OK, RSN_CIPHER_AES_CCMP, RSN_CIPHER_AES_CCMP ,8},
  325. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  326. /* AP multicast WEP */ {
  327. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  328. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  329. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  330. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  331. /* STA CCMP */ { OK, RSN_CIPHER_AES_CCMP, RSN_CIPHER_WEP104 ,5},
  332. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}}},
  333. /* AP unicast WEP104 */ {
  334. /* AP multicast NONE */ {
  335. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  336. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  337. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  338. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  339. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  340. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  341. /* AP multicast WEP */ {
  342. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  343. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  344. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  345. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  346. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  347. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  348. /* AP multicast TKIP */ {
  349. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  350. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  351. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  352. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  353. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  354. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  355. /* AP multicast WRAP */ {
  356. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  357. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  358. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  359. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  360. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  361. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  362. /* AP multicast CCMP */ {
  363. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  364. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  365. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  366. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  367. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  368. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}},
  369. /* AP multicast WEP104 */ {
  370. /* STA NONE */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  371. /* STA WEP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  372. /* STA TKIP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  373. /* STA AES */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  374. /* STA CCMP */ { NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0},
  375. /* STA WEP104 */{ NOK, RSN_CIPHER_NONE, RSN_CIPHER_NONE ,0}}}
  376. };
  377. /* PMKID cache */
  378. /* static wpa2_pmkid_cache_t wpa2_pmkid_cache; */
  379. /* Function prototypes */
  380. TI_STATUS admCtrlWpa2_parseIe(admCtrl_t *pAdmCtrl, UINT8 *pWpa2Ie, wpa2IeData_t *pWpa2Data);
  381. UINT16 admCtrlWpa2_buildCapabilities(admCtrl_t *pAdmCtrl);
  382. UINT32 admCtrlWpa2_parseSuiteVal(admCtrl_t *pAdmCtrl, UINT8* suiteVal, UINT32 maxVal, UINT32 unknownVal);
  383. TI_STATUS admCtrlWpa2_checkCipherSuiteValidity(cipherSuite_e unicastSuite, cipherSuite_e broadcastSuite, cipherSuite_e encryptionStatus);
  384. TI_STATUS admCtrlWpa2_getCipherSuiteMetric (admCtrl_t *pAdmCtrl, wpa2IeData_t *pWpa2Data, UINT32 *metric,
  385. cipherSuite_e *uSuite, cipherSuite_e *bSuite);
  386. TI_STATUS admCtrlWpa2_DynamicConfig(admCtrl_t *pAdmCtrl, rsn_paeConfig_t *pPaeConfig);
  387. TI_STATUS admCtrlWpa2_resetPMKIDCache(admCtrl_t *pAdmCtrl);
  388. /*TI_STATUS admCtrlWpa2_sendPMKIDCandListAfterDelay(admCtrl_t * pAdmCtrl, UINT32 delay);*/
  389. TI_STATUS admCtrlWpa2_getPMKIDList(admCtrl_t * pAdmCtrl,OS_802_11_PMKID *pmkidList);
  390. TI_STATUS admCtrlWpa2_setPMKIDList(admCtrl_t * pAdmCtrl, OS_802_11_PMKID *pmkidList);
  391. TI_STATUS admCtrlWpa2_addPMKID(admCtrl_t * pAdmCtrl, macAddress_t * pBSSID, pmkidValue_t pmkID);
  392. TI_STATUS admCtrlWpa2_findPMKID(admCtrl_t * pAdmCtrl, macAddress_t *pBSSID,
  393. pmkidValue_t *pPMKID, UINT8 *cacheIndex);
  394. static BOOL admCtrlWpa2_getPreAuthStatus(admCtrl_t *pAdmCtrl, macAddress_t *givenAP, UINT8 *cacheIndex);
  395. static TI_STATUS admCtrlWpa2_startPreAuth(admCtrl_t *pAdmCtrl, bssidList4PreAuth_t *pBssidList);
  396. static void admCtrlWpa2_buildAndSendPMKIDCandList(TI_HANDLE hHandle, bssidList4PreAuth_t *apList);
  397. static TI_STATUS admCtrlWpa2_get802_1x_AkmExists (admCtrl_t *pAdmCtrl, BOOL *wpa_802_1x_AkmExists);
  398. /**
  399. *
  400. * admCtrlWpa_config - Configure EXC admission control.
  401. *
  402. * \b Description:
  403. *
  404. * Configure EXC admission control.
  405. *
  406. * \b ARGS:
  407. *
  408. * I - pAdmCtrl - context \n
  409. *
  410. * \b RETURNS:
  411. *
  412. * OK on success, NOK on failure.
  413. *
  414. * \sa
  415. */
  416. TI_STATUS admCtrlWpa2_config(admCtrl_t *pAdmCtrl)
  417. {
  418. TI_STATUS status;
  419. rsn_paeConfig_t paeConfig;
  420. /* check and set admission control default parameters */
  421. pAdmCtrl->authSuite = RSN_AUTH_OPEN;
  422. if (pAdmCtrl->unicastSuite == RSN_CIPHER_NONE)
  423. {
  424. pAdmCtrl->unicastSuite = RSN_CIPHER_AES_CCMP;
  425. }
  426. if (pAdmCtrl->broadcastSuite == RSN_CIPHER_NONE)
  427. {
  428. pAdmCtrl->broadcastSuite = RSN_CIPHER_AES_CCMP;
  429. }
  430. /* set callback functions (API) */
  431. pAdmCtrl->getInfoElement = admCtrlWpa2_getInfoElement;
  432. pAdmCtrl->setSite = admCtrlWpa2_setSite;
  433. pAdmCtrl->evalSite = admCtrlWpa2_evalSite;
  434. pAdmCtrl->getPmkidList = admCtrlWpa2_getPMKIDList;
  435. pAdmCtrl->setPmkidList = admCtrlWpa2_setPMKIDList;
  436. pAdmCtrl->resetPmkidList = admCtrlWpa2_resetPMKIDCache;
  437. pAdmCtrl->getPreAuthStatus = admCtrlWpa2_getPreAuthStatus;
  438. pAdmCtrl->startPreAuth = admCtrlWpa2_startPreAuth;
  439. pAdmCtrl->get802_1x_AkmExists = admCtrlWpa2_get802_1x_AkmExists;
  440. /* set key management suite (AKMP) */
  441. switch (pAdmCtrl->externalAuthMode)
  442. {
  443. case RSN_EXT_AUTH_MODE_WPA2:
  444. case RSN_EXT_AUTH_MODE_WPA2PSK:
  445. pAdmCtrl->keyMngSuite = RSN_KEY_MNG_802_1X;
  446. break;
  447. case RSN_EXT_AUTH_MODE_WPANONE:
  448. pAdmCtrl->keyMngSuite = RSN_KEY_MNG_NONE;
  449. /* Not supported */
  450. default:
  451. return NOK;
  452. }
  453. paeConfig.authProtocol = pAdmCtrl->externalAuthMode;
  454. paeConfig.unicastSuite = pAdmCtrl->unicastSuite;
  455. paeConfig.broadcastSuite = pAdmCtrl->broadcastSuite;
  456. paeConfig.keyExchangeProtocol = pAdmCtrl->keyMngSuite;
  457. /* set default PAE configuration */
  458. status = pAdmCtrl->pRsn->setPaeConfig(pAdmCtrl->pRsn, &paeConfig);
  459. return status;
  460. }
  461. /**
  462. *
  463. * admCtrlWpa2_getInfoElement - Get the current information element.
  464. *
  465. * \b Description:
  466. *
  467. * Get the current information element.
  468. *
  469. * \b ARGS:
  470. *
  471. * I - pAdmCtrl - context \n
  472. * I - pIe - IE buffer \n
  473. * I - pLength - length of IE \n
  474. *
  475. * \b RETURNS:
  476. *
  477. * OK on success, NOK on failure.
  478. *
  479. * \sa
  480. */
  481. TI_STATUS admCtrlWpa2_getInfoElement(admCtrl_t *pAdmCtrl, UINT8 *pIe, UINT8 *pLength)
  482. {
  483. wpa2IePacket_t *pWpa2IePacket;
  484. UINT8 length = 0;
  485. macAddress_t assocBssid;
  486. paramInfo_t param;
  487. pmkidValue_t pmkId;
  488. TI_STATUS status;
  489. UINT8 index;
  490. #ifdef FOUR_ALIGNMENT
  491. UINT16 tempInt;
  492. #endif
  493. if (pIe==NULL)
  494. {
  495. *pLength = 0;
  496. return NOK;
  497. }
  498. /* check Group suite validity */
  499. if (!broadcastCipherSuiteValidity[pAdmCtrl->networkMode][pAdmCtrl->broadcastSuite])
  500. {
  501. *pLength = 0;
  502. return NOK;
  503. }
  504. /* Init Wpa2 IE (RSN IE) */
  505. pWpa2IePacket = (wpa2IePacket_t*)pIe;
  506. os_memoryZero(pAdmCtrl->hOs, pWpa2IePacket, sizeof(wpa2IePacket_t));
  507. /* Fill the element ID */
  508. pWpa2IePacket->elementid = RSN_IE_ID;
  509. #ifndef FOUR_ALIGNMENT
  510. pWpa2IePacket->version = ENDIAN_HANDLE_WORD(WPA2_OUI_MAX_VERSION);
  511. #else
  512. /* required for WinCe, when the pointer is not even */
  513. tempInt = ENDIAN_HANDLE_WORD(WPA2_OUI_MAX_VERSION);
  514. os_memoryCopy(pAdmCtrl->hOs, (UINT8 *)&pWpa2IePacket->version, &tempInt, sizeof(pWpa2IePacket->version));
  515. #endif
  516. length += 2;
  517. /* build group suite */
  518. os_memoryCopy(pAdmCtrl->hOs, (void *)pWpa2IePacket->groupSuite, wpa2IeOuiIe, 3);
  519. pWpa2IePacket->groupSuite[3] = (UINT8)pAdmCtrl->pRsn->paeConfig.broadcastSuite;
  520. length += 4;
  521. /* build pairwise suite - we always send only one pairwise suite */
  522. #ifndef FOUR_ALIGNMENT
  523. pWpa2IePacket->pairwiseSuiteCnt = ENDIAN_HANDLE_WORD(0x0001);
  524. #else
  525. /* required for WinCe, when the pointer is not even */
  526. tempInt = ENDIAN_HANDLE_WORD(0x0001);
  527. os_memoryCopy(pAdmCtrl->hOs, (UINT8 *)&pWpa2IePacket->pairwiseSuiteCnt, &tempInt, sizeof(pWpa2IePacket->pairwiseSuiteCnt));
  528. #endif
  529. length += 2;
  530. os_memoryCopy(pAdmCtrl->hOs, (void *)pWpa2IePacket->pairwiseSuite, wpa2IeOuiIe, 3);
  531. pWpa2IePacket->pairwiseSuite[3] = (UINT8)pAdmCtrl->pRsn->paeConfig.unicastSuite;
  532. length += 4;
  533. /* build keyMng suite - we always send only one key mgmt suite*/
  534. #ifndef FOUR_ALIGNMENT
  535. pWpa2IePacket->authKeyMngSuiteCnt = ENDIAN_HANDLE_WORD(0x0001);
  536. #else
  537. /* required for WinCe, when the pointer is not even */
  538. tempInt = ENDIAN_HANDLE_WORD(0x0001);
  539. os_memoryCopy(pAdmCtrl->hOs, (UINT8 *)&pWpa2IePacket->authKeyMngSuiteCnt, &tempInt, sizeof(pWpa2IePacket->authKeyMngSuiteCnt));
  540. #endif
  541. length += 2;
  542. os_memoryCopy(pAdmCtrl->hOs, (void *)pWpa2IePacket->authKeyMngSuite, wpa2IeOuiIe, 3);
  543. switch (pAdmCtrl->externalAuthMode)
  544. {
  545. case RSN_EXT_AUTH_MODE_OPEN:
  546. case RSN_EXT_AUTH_MODE_SHARED_KEY:
  547. case RSN_EXT_AUTH_MODE_AUTO_SWITCH:
  548. pWpa2IePacket->authKeyMngSuite[3] = WPA2_IE_KEY_MNG_NONE;
  549. break;
  550. case RSN_EXT_AUTH_MODE_WPA2:
  551. case RSN_EXT_AUTH_MODE_WPA: /* for Any-WPA/WPA-Mixed mode */
  552. {
  553. #ifdef EXC_MODULE_INCLUDED
  554. UINT8 akmSuite[DOT11_OUI_LEN+1];
  555. if (admCtrlExc_getCckmAkm(pAdmCtrl, akmSuite))
  556. {
  557. os_memoryCopy(pAdmCtrl->hOs, (PVOID)pWpa2IePacket->authKeyMngSuite, akmSuite, DOT11_OUI_LEN+1);
  558. }
  559. else
  560. #endif
  561. {
  562. pWpa2IePacket->authKeyMngSuite[3] = WPA2_IE_KEY_MNG_801_1X;
  563. }
  564. }
  565. break;
  566. case RSN_EXT_AUTH_MODE_WPA2PSK:
  567. case RSN_EXT_AUTH_MODE_WPAPSK:
  568. pWpa2IePacket->authKeyMngSuite[3] = WPA2_IE_KEY_MNG_PSK_801_1X;
  569. break;
  570. default:
  571. pWpa2IePacket->authKeyMngSuite[3] = WPA2_IE_KEY_MNG_NONE;
  572. break;
  573. }
  574. length += 4;
  575. /* build Capabilities */
  576. #ifndef FOUR_ALIGNMENT
  577. pWpa2IePacket->capabilities = ENDIAN_HANDLE_WORD(admCtrlWpa2_buildCapabilities(pAdmCtrl));
  578. #else
  579. /* required for WinCe, when the pointer is not even */
  580. tempInt = ENDIAN_HANDLE_WORD(admCtrlWpa2_buildCapabilities(pAdmCtrl));
  581. os_memoryCopy(pAdmCtrl->hOs, (UINT8 *)&pWpa2IePacket->capabilities, &tempInt, sizeof(pWpa2IePacket->capabilities));
  582. #endif
  583. length += 2;
  584. /* build PMKID list: we support no more than 1 PMKSA per AP, */
  585. /* so no more than 1 PMKID can be sent in the RSN IE */
  586. if(pAdmCtrl->preAuthSupport &&
  587. (pAdmCtrl->pRsn->paeConfig.authProtocol == RSN_EXT_AUTH_MODE_WPA2))
  588. {
  589. /* Init value of PMKID count is 0 */
  590. #ifndef FOUR_ALIGNMENT
  591. pWpa2IePacket->pmkIdCnt = ENDIAN_HANDLE_WORD(0);
  592. #else
  593. /* required for WinCe, when the pointer is not even */
  594. tempInt = ENDIAN_HANDLE_WORD(0);
  595. os_memoryCopy(pAdmCtrl->hOs, (UINT8 *)&pWpa2IePacket->pmkIdCnt, &tempInt, sizeof(pWpa2IePacket->pmkIdCnt));
  596. #endif
  597. length += 2;
  598. param.paramType = CTRL_DATA_CURRENT_BSSID_PARAM;
  599. status = ctrlData_getParam(pAdmCtrl->pRsn->hCtrlData, &param);
  600. assocBssid = param.content.ctrlDataCurrentBSSID;
  601. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  602. ("admCtrlWpa2_getInfoElement - find PMKID \n"));
  603. status = admCtrlWpa2_findPMKID(pAdmCtrl, &assocBssid, &pmkId, &index);
  604. if(status == OK)
  605. {
  606. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  607. ("admCtrlWpa2_getInfoElement - PMKID was found! \n"));
  608. #ifndef FOUR_ALIGNMENT
  609. pWpa2IePacket->pmkIdCnt = ENDIAN_HANDLE_WORD(1);
  610. #else
  611. /* required for WinCe, when the pointer is not even */
  612. tempInt = ENDIAN_HANDLE_WORD(1);
  613. os_memoryCopy(pAdmCtrl->hOs, (UINT8 *)&pWpa2IePacket->pmkIdCnt, &tempInt, sizeof(pWpa2IePacket->pmkIdCnt));
  614. #endif
  615. os_memoryCopy(pAdmCtrl->hOs, (UINT8 *)pWpa2IePacket->pmkId,
  616. (UINT8 *)pmkId, PMKID_VALUE_SIZE);
  617. length += PMKID_VALUE_SIZE;
  618. }
  619. }
  620. pWpa2IePacket->length = length; /* RSN IE length without IEid and length field */
  621. *pLength = length+2; /* The whole length of the RSN IE */
  622. WLAN_REPORT_HEX_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  623. pIe, *pLength);
  624. return OK;
  625. }
  626. /**
  627. *
  628. * admCtrlWpa2_setSite - Set current primary site parameters for registration.
  629. *
  630. * \b Description:
  631. *
  632. * Set current primary site parameters for registration.
  633. *
  634. * \b ARGS:
  635. *
  636. * I - pAdmCtrl - context \n
  637. * I - pRsnData - site's RSN data \n
  638. * O - pAssocIe - result IE of evaluation \n
  639. * O - pAssocIeLen - length of result IE of evaluation \n
  640. *
  641. * \b RETURNS:
  642. *
  643. * OK on site is aproved, NOK on site is rejected.
  644. *
  645. * \sa
  646. */
  647. TI_STATUS admCtrlWpa2_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pAssocIe, UINT8 *pAssocIeLen)
  648. {
  649. TI_STATUS status;
  650. rsn_paeConfig_t paeConfig;
  651. UINT8 *pWpa2Ie;
  652. cipherSuite_e uSuite, bSuite;
  653. *pAssocIeLen = 0;
  654. if (pRsnData==NULL)
  655. {
  656. return NOK;
  657. }
  658. if (pRsnData->pIe==NULL)
  659. {
  660. /* configure the MLME module with the 802.11 OPEN authentication suite,
  661. THe MLME will configure later the authentication module */
  662. param.paramType = MLME_LEGACY_TYPE_PARAM;
  663. param.content.mlmeLegacyAuthType = AUTH_LEGACY_OPEN_SYSTEM;
  664. status = mlme_setParam(pAdmCtrl->hMlme, &param);
  665. if (status != OK)
  666. {
  667. return status;
  668. }
  669. return OK;
  670. }
  671. #ifdef EXC_MODULE_INCLUDED
  672. /* Clean MIC and KP flags in the HAL. */
  673. /* It is needed if the previous privacy mode was EXC */
  674. whalParam.paramType = HAL_CTRL_RSN_EXC_SW_ENC_ENABLE_PARAM;
  675. whalParam.content.rsnExcSwEncFlag = FALSE;
  676. status = whalCtrl_SetParam(pAdmCtrl->pRsn->hWhalCtrl, &whalParam);
  677. whalParam.paramType = HAL_CTRL_RSN_EXC_MIC_FIELD_ENABLE_PARAM;
  678. whalParam.content.rsnExcMicFieldFlag = FALSE;
  679. status = whalCtrl_SetParam(pAdmCtrl->pRsn->hWhalCtrl, &whalParam);
  680. /* Check if Aironet IE exists */
  681. admCtrlExc_setExtendedParams(pAdmCtrl, pRsnData);
  682. #endif /*EXC_MODULE_INCLUDED*/
  683. status = admCtrl_parseIe(pAdmCtrl, pRsnData, &pWpa2Ie, RSN_IE_ID);
  684. if (status != OK)
  685. {
  686. return status;
  687. }
  688. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  689. ("admCtrlWpa2_setSite: RSN_IE=\n"));
  690. WLAN_REPORT_HEX_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG, pRsnData->pIe, pRsnData->ieLen);
  691. status = admCtrlWpa2_parseIe(pAdmCtrl, pWpa2Ie, &wpa2DataIE);
  692. if (status != OK)
  693. {
  694. return status;
  695. }
  696. if ((wpa2DataIE.unicastSuite[0]>=MAX_WPA2_CIPHER_SUITE) ||
  697. (wpa2DataIE.broadcastSuite>=MAX_WPA2_CIPHER_SUITE) ||
  698. (pAdmCtrl->unicastSuite>=MAX_WPA2_CIPHER_SUITE))
  699. {
  700. return NOK;
  701. }
  702. /* Check validity of Group suite */
  703. if (!broadcastCipherSuiteValidity[pAdmCtrl->networkMode][wpa2DataIE.broadcastSuite])
  704. { /* check Group suite validity */
  705. return NOK;
  706. }
  707. if(admCtrlWpa2_getCipherSuiteMetric (pAdmCtrl, &wpa2DataIE, NULL, &uSuite, &bSuite) != OK)
  708. return NOK;
  709. /* set replay counter */
  710. pAdmCtrl->replayCnt = wpa2DataIE.ptkReplayCounters;
  711. *pAssocIeLen = pRsnData->ieLen;
  712. if (pAssocIe != NULL)
  713. {
  714. os_memoryCopy(pAdmCtrl->hOs, pAssocIe, &wpa2DataIE, sizeof(wpa2IeData_t));
  715. }
  716. /* re-config PAE with updated unicast and broadcast suite values */
  717. /* If STA works in WpaMixed mode/AnyWpa mode, set PAE auth. mode to WPA2 */
  718. paeConfig.authProtocol = pAdmCtrl->externalAuthMode;
  719. if(pAdmCtrl->WPAPromoteFlags)
  720. {
  721. if(pAdmCtrl->externalAuthMode == RSN_EXT_AUTH_MODE_WPA)
  722. paeConfig.authProtocol = RSN_EXT_AUTH_MODE_WPA2;
  723. if(pAdmCtrl->externalAuthMode == RSN_EXT_AUTH_MODE_WPAPSK)
  724. paeConfig.authProtocol = RSN_EXT_AUTH_MODE_WPA2PSK;
  725. }
  726. #ifdef EXC_MODULE_INCLUDED
  727. param.paramType = EXC_CCKM_EXISTS;
  728. param.content.excCckmExists = (wpa2Data.KeyMngSuite[0]==WPA2_IE_KEY_MNG_CCKM) ? TRUE : FALSE;
  729. excMngr_setParam(pAdmCtrl->hExcMngr, &param);
  730. #endif
  731. paeConfig.keyExchangeProtocol = pAdmCtrl->keyMngSuite;
  732. paeConfig.unicastSuite = uSuite; /* Updated value */
  733. paeConfig.broadcastSuite = bSuite; /* Updated value */
  734. status = admCtrlWpa2_DynamicConfig(pAdmCtrl, &paeConfig);
  735. if (status != OK)
  736. {
  737. return status;
  738. }
  739. /* Now we configure the MLME module with the 802.11 legacy authentication suite,
  740. THe MLME will configure later the authentication module */
  741. param.paramType = MLME_LEGACY_TYPE_PARAM;
  742. #ifdef EXC_MODULE_INCLUDED
  743. if (pAdmCtrl->networkEapMode!=OS_EXC_NETWORK_EAP_OFF)
  744. {
  745. param.content.mlmeLegacyAuthType = AUTH_LEGACY_RESERVED1;
  746. }
  747. else
  748. #endif
  749. {
  750. param.content.mlmeLegacyAuthType = AUTH_LEGACY_OPEN_SYSTEM;
  751. }
  752. status = mlme_setParam(pAdmCtrl->hMlme, &param);
  753. if (status != OK)
  754. {
  755. return status;
  756. }
  757. param.paramType = RX_DATA_EAPOL_DESTINATION_PARAM;
  758. param.content.rxDataEapolDestination = OS_ABS_LAYER;
  759. status = rxData_setParam(pAdmCtrl->hRx, &param);
  760. if (status != OK)
  761. {
  762. return status;
  763. }
  764. /* Configure privacy status in HAL so that HW is prepared to recieve keys */
  765. whalParam.paramType = HAL_CTRL_RSN_SECURITY_MODE_PARAM;
  766. whalParam.content.rsnEncryptionStatus = (halCtrl_CipherSuite_e)paeConfig.unicastSuite;
  767. status = whalCtrl_SetParam(pAdmCtrl->pRsn->hWhalCtrl, &whalParam);
  768. return status;
  769. }
  770. /**
  771. *
  772. * admCtrlWpa_evalSite - Evaluate site for registration.
  773. *
  774. * \b Description:
  775. *
  776. * evaluate site RSN capabilities against the station's cap.
  777. * If the BSS type is infrastructure, the station matches the site only if it's WEP status is same as the site
  778. * In IBSS, it does not matter
  779. *
  780. * \b ARGS:
  781. *
  782. * I - pAdmCtrl - Context \n
  783. * I - pRsnData - site's RSN data \n
  784. * O - pEvaluation - Result of evaluation \n
  785. *
  786. * \b RETURNS:
  787. *
  788. * OK
  789. *
  790. * \sa
  791. */
  792. TI_STATUS admCtrlWpa2_evalSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, bssType_e bssType, UINT32 *pEvaluation)
  793. {
  794. TI_STATUS status;
  795. wpa2IeData_t wpa2Data;
  796. UINT8 *pWpa2Ie;
  797. cipherSuite_e uSuite, bSuite;
  798. UINT8 i = 0;
  799. *pEvaluation = 0;
  800. if (pRsnData==NULL)
  801. {
  802. return NOK;
  803. }
  804. if (pRsnData->pIe==NULL)
  805. {
  806. return NOK;
  807. }
  808. if (bssType != BSS_INFRASTRUCTURE)
  809. {
  810. return NOK;
  811. }
  812. status = admCtrl_parseIe(pAdmCtrl, pRsnData, &pWpa2Ie, RSN_IE_ID);
  813. if (status != OK)
  814. {
  815. return status;
  816. }
  817. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  818. ("admCtrlWpa2_evalSite, IE=\n"));
  819. WLAN_REPORT_HEX_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG, pRsnData->pIe, pRsnData->ieLen);
  820. status = admCtrlWpa2_parseIe(pAdmCtrl, pWpa2Ie, &wpa2Data);
  821. if (status != OK)
  822. {
  823. return status;
  824. }
  825. /* check keyMngSuite validity */
  826. status = NOK;
  827. for(i = 0;
  828. (i < wpa2Data.KeyMngSuiteCnt) &&(i<MAX_WPA2_KEY_MNG_SUITES)&& (status != OK);
  829. i++)
  830. {
  831. switch (wpa2Data.KeyMngSuite[i])
  832. {
  833. case WPA2_IE_KEY_MNG_NONE:
  834. status = (pAdmCtrl->externalAuthMode <= RSN_EXT_AUTH_MODE_AUTO_SWITCH) ? OK : NOK;
  835. break;
  836. case WPA2_IE_KEY_MNG_801_1X:
  837. #ifdef EXC_MODULE_INCLUDED
  838. case WPA2_IE_KEY_MNG_CCKM:
  839. /* CCKM is allowed only in 802.1x auth */
  840. #endif
  841. if(!pAdmCtrl->WPAPromoteFlags)
  842. status = (pAdmCtrl->externalAuthMode == RSN_EXT_AUTH_MODE_WPA2) ? OK : NOK;
  843. else
  844. /* Any-WPA mode is supported */
  845. status = ((pAdmCtrl->externalAuthMode == RSN_EXT_AUTH_MODE_WPA2) ||
  846. (pAdmCtrl->externalAuthMode == RSN_EXT_AUTH_MODE_WPA)) ? OK : NOK;
  847. break;
  848. case WPA2_IE_KEY_MNG_PSK_801_1X:
  849. if(!pAdmCtrl->WPAPromoteFlags)
  850. status = (pAdmCtrl->externalAuthMode == RSN_EXT_AUTH_MODE_WPA2PSK) ? OK : NOK;
  851. else
  852. /* Any-WPA mode is supported */
  853. status = ((pAdmCtrl->externalAuthMode == RSN_EXT_AUTH_MODE_WPA2PSK) ||
  854. (pAdmCtrl->externalAuthMode == RSN_EXT_AUTH_MODE_WPAPSK)) ? OK : NOK;
  855. break;
  856. default:
  857. WLAN_REPORT_ERROR(pAdmCtrl->hReport, RSN_MODULE_LOG,
  858. ("admCtrlWpa2_evalSite, default, wpa2Data.KeyMngSuite[i]=%d \n",wpa2Data.KeyMngSuite[i]));
  859. status = NOK;
  860. break;
  861. }
  862. }
  863. if (status != OK)
  864. {
  865. WLAN_REPORT_ERROR(pAdmCtrl->hReport, RSN_MODULE_LOG,
  866. ("admCtrlWpa2_evalSite, status=%d, externalAuthMode=%d, WPAPromoteFlags=%d \n",
  867. status, pAdmCtrl->externalAuthMode,
  868. pAdmCtrl->WPAPromoteFlags));
  869. return status;
  870. }
  871. /* Check cipher suite validity */
  872. if(admCtrlWpa2_getCipherSuiteMetric(pAdmCtrl, &wpa2Data, pEvaluation, &uSuite, &bSuite) != OK)
  873. return NOK;
  874. /* Check privacy bit if not in mixed mode */
  875. if (!pAdmCtrl->mixedMode)
  876. { /* There's no mixed mode, so make sure that the privacy Bit matches the privacy mode*/
  877. if (((pRsnData->privacy) && (uSuite == RSN_CIPHER_NONE)) ||
  878. ((!pRsnData->privacy) && (uSuite > RSN_CIPHER_NONE)))
  879. {
  880. *pEvaluation = 0;
  881. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  882. ("admCtrlWpa2_evalSite, mixedMode is FALSE, privacy=%d, uSuite=%d\n",
  883. pRsnData->privacy, uSuite));
  884. return NOK;
  885. }
  886. }
  887. /* always return OK */
  888. return OK;
  889. }
  890. /**
  891. *
  892. * admCtrlWpa2_parseIe - Parse an WPA information element.
  893. *
  894. * \b Description:
  895. *
  896. * Parse an WPA information element.
  897. * Builds a structure of the unicast adn broadcast cihper suites,
  898. * the key management suite and the capabilities.
  899. *
  900. * \b ARGS:
  901. *
  902. * I - pAdmCtrl - pointer to admCtrl context
  903. * I - pWpa2Ie - pointer to WPA IE (RSN IE) buffer \n
  904. * O - pWpa2Data - WPA2 IE (RSN IE) structure after parsing
  905. *
  906. *
  907. * \b RETURNS:
  908. *
  909. * OK on success, NOK on failure.
  910. *
  911. * \sa
  912. */
  913. TI_STATUS admCtrlWpa2_parseIe(admCtrl_t *pAdmCtrl, UINT8 *pWpa2Ie, wpa2IeData_t *pWpa2Data)
  914. {
  915. dot11_RSN_t *wpa2Ie = (dot11_RSN_t *)pWpa2Ie;
  916. UINT16 temp2bytes, capabilities;
  917. UINT16 KeyMngSuiteCntTemp=0;
  918. UINT8 dataOffset = 0, i = 0, j = 0, curKeyMngSuite = 0;
  919. cipherSuite_e curCipherSuite = RSN_CIPHER_NONE;
  920. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  921. ("Wpa2_IE: DEBUG: admCtrlWpa2_parseIe\n\n"));
  922. if ((pWpa2Data == NULL) || (pWpa2Ie == NULL))
  923. {
  924. return NOK;
  925. }
  926. /* get Version value from the info element */
  927. temp2bytes = ENDIAN_HANDLE_WORD(*wpa2Ie->rsnIeData);
  928. dataOffset += 2;
  929. /* Check the header fields and the version */
  930. if((wpa2Ie->hdr.eleId != RSN_IE_ID) || (wpa2Ie->hdr.eleLen < WPA2_IE_MIN_LENGTH) ||
  931. (temp2bytes != WPA2_OUI_MAX_VERSION))
  932. {
  933. WLAN_REPORT_ERROR(pAdmCtrl->hReport, RSN_MODULE_LOG,
  934. ("Wpa2_ParseIe Error: length=0x%x, elementid=0x%x, version=0x%x\n",
  935. wpa2Ie->hdr.eleLen,wpa2Ie->hdr.eleId,temp2bytes));
  936. return NOK;
  937. }
  938. /* Set default values */
  939. os_memoryZero(pAdmCtrl->hOs, pWpa2Data, sizeof(wpa2IeData_t));
  940. pWpa2Data->broadcastSuite = RSN_CIPHER_AES_CCMP;
  941. pWpa2Data->unicastSuiteCnt = 1;
  942. pWpa2Data->unicastSuite[0] = RSN_CIPHER_AES_CCMP;
  943. pWpa2Data->KeyMngSuiteCnt = 1;
  944. pWpa2Data->KeyMngSuite[0] = WPA2_IE_KEY_MNG_801_1X;
  945. /* If we've reached the end of the received RSN IE */
  946. if(wpa2Ie->hdr.eleLen < WPA2_IE_GROUP_SUITE_LENGTH)
  947. return OK;
  948. /* Processing of Group Suite field - 4 bytes*/
  949. pWpa2Data->broadcastSuite = (cipherSuite_e)admCtrlWpa2_parseSuiteVal(pAdmCtrl, (UINT8 *)wpa2Ie->rsnIeData + dataOffset,
  950. RSN_CIPHER_WEP104, RSN_CIPHER_UNKNOWN);
  951. dataOffset +=4;
  952. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  953. ("Wpa2_IE: GroupSuite %x \n", pWpa2Data->broadcastSuite));
  954. /* Processing of Pairwise (Unicast) Cipher Suite - 2 bytes counter and list of 4-byte entries */
  955. if(wpa2Ie->hdr.eleLen < WPA2_IE_MIN_PAIRWISE_SUITE_LENGTH)
  956. return OK;
  957. pWpa2Data->unicastSuiteCnt = ENDIAN_HANDLE_WORD(*(wpa2Ie->rsnIeData + dataOffset));
  958. dataOffset += 2;
  959. if(pWpa2Data->unicastSuiteCnt > UNICAST_CIPHER_MAXNO_IN_RSNIE)
  960. {
  961. /* something wrong in the RSN IE */
  962. WLAN_REPORT_ERROR(pAdmCtrl->hReport, RSN_MODULE_LOG,
  963. ("Wpa2_ParseIe Error: Pairwise cipher suite count is %d \n", pWpa2Data->unicastSuiteCnt));
  964. return NOK;
  965. }
  966. /* Get unicast cipher suites */
  967. for(i = 0; i < pWpa2Data->unicastSuiteCnt; i++)
  968. {
  969. curCipherSuite = (cipherSuite_e)admCtrlWpa2_parseSuiteVal(pAdmCtrl, (UINT8 *)wpa2Ie->rsnIeData + dataOffset,
  970. RSN_CIPHER_WEP104, RSN_CIPHER_UNKNOWN);
  971. if(curCipherSuite == RSN_CIPHER_NONE)
  972. curCipherSuite = pWpa2Data->broadcastSuite;
  973. pWpa2Data->unicastSuite[i] = curCipherSuite;
  974. dataOffset +=4;
  975. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  976. ("Wpa_IE: unicast suite %x \n", curCipherSuite));
  977. }
  978. /* Sort all the unicast suites supported by the AP in the decreasing order */
  979. /* (so the best cipher suite will be the first) */
  980. if(pWpa2Data->unicastSuiteCnt > 1)
  981. {
  982. for(i = 0; i < (pWpa2Data->unicastSuiteCnt -1); i ++)
  983. {
  984. for(j = 0; j < i; j ++)
  985. {
  986. if(pWpa2Data->unicastSuite[j] > pWpa2Data->unicastSuite[j + 1])
  987. {
  988. curCipherSuite = pWpa2Data->unicastSuite[j];
  989. pWpa2Data->unicastSuite[j] = pWpa2Data->unicastSuite[j+1];
  990. pWpa2Data->unicastSuite[j+1] = curCipherSuite;
  991. }
  992. }
  993. }
  994. }
  995. /* If we've reached the end of the received RSN IE */
  996. if (wpa2Ie->hdr.eleLen == dataOffset)
  997. return OK;
  998. /* KeyMng Suite */
  999. /* pWpa2Data->KeyMngSuiteCnt = ENDIAN_HANDLE_WORD(*((UINT16 *)(wpa2Ie->rsnIeData + dataOffset))); */
  1000. /*Fixing unaligned half word access */
  1001. COPY_UNALIGNED_WORD(&KeyMngSuiteCntTemp,((UINT16 *)(wpa2Ie->rsnIeData + dataOffset)));
  1002. KeyMngSuiteCntTemp = ENDIAN_HANDLE_WORD(KeyMngSuiteCntTemp);
  1003. TI_WLAN_COPY_UINT16_UNALIGNED(pWpa2Data->KeyMngSuiteCnt, KeyMngSuiteCntTemp);
  1004. dataOffset += 2;
  1005. pAdmCtrl->wpaAkmExists = FALSE;
  1006. for(i = 0; i < pWpa2Data->KeyMngSuiteCnt; i++)
  1007. {
  1008. #ifdef EXC_MODULE_INCLUDED
  1009. curKeyMngSuite = admCtrlExc_parseCckmSuiteVal4Wpa2(pAdmCtrl, (UINT8 *)(wpa2Ie->rsnIeData + dataOffset));
  1010. if (curKeyMngSuite == WPA2_IE_KEY_MNG_CCKM)
  1011. { /* CCKM is the maximum AKM */
  1012. pWpa2Data->KeyMngSuite[i] = curKeyMngSuite;
  1013. }
  1014. else
  1015. #endif
  1016. {
  1017. curKeyMngSuite = admCtrlWpa2_parseSuiteVal(pAdmCtrl, (UINT8 *)wpa2Ie->rsnIeData + dataOffset,
  1018. WPA2_IE_KEY_MNG_PSK_801_1X, WPA2_IE_KEY_MNG_NA);
  1019. }
  1020. WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG,
  1021. ("Wpa2_IE: authKeyMng %x \n", curKeyMngSuite));
  1022. if ((curKeyMngSuite != WPA2_IE_KEY_MNG_NA) &&
  1023. (curKeyMngSuite != WPA2_IE_KEY_MNG_CCKM))
  1024. {
  1025. pWpa2Data->KeyMngSuite[i] = curKeyMngSuite;
  1026. }
  1027. if (curKeyMngSuite==WPA2_IE_KEY_MNG_801_1X)
  1028. { /* If 2 AKM exist, save also the second priority */
  1029. pAdmCtrl->wpaAkmExists = TRUE;
  1030. }
  1031. dataOffset += 4;
  1032. }
  1033. /* If we've reached the end of the received RSN IE */
  1034. if (wpa2Ie->hdr.eleLen == dataOffset)
  1035. return OK;
  1036. /* Parse capabilities */
  1037. /* capabilities = ENDIAN_HANDLE_WORD(*((UINT16 *)(wpa2Ie->rsnIeData + dataOffset))); */
  1038. /* Fixing unaligned half word access */
  1039. COPY_UNALIGNED_WORD(&capabilities,((UINT16 *)(wpa2Ie->rsnIeData + dataOffset)));
  1040. capabilities = ENDIAN_HANDLE_WORD(capabilities);
  1041. pWpa2Data->bcastForUnicatst = (UINT8)(capabilities & WPA2_GROUP_4_UNICAST_CAPABILITY_MASK)>>
  1042. WPA2_GROUP_4_UNICAST_CAPABILITY_SHIFT;
  1043. pWpa2Data->ptkReplayCounters = (UINT8)(capabilities & WPA2_PTK_REPLAY_COUNTERS_CAPABILITY_MASK)>>
  1044. WPA2_PTK_REPLAY_COUNTERS_CAPABILITY_SHIFT;
  1045. switch (pWpa2Data->ptkReplayCounters)
  1046. {
  1047. case 0: pWpa2Data->ptkReplayCounters=1;
  1048. break;
  1049. case 1: pWpa2Data->ptkReplayCounters=2;
  1050. br

Large files files are truncated, but you can click here to view the full file