xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/mvl88w8977/mlan/esa/keyMgmtApStaCommon.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /** @file keyMgmtApStaCommon.h
2  *
3  *  @brief This file contains common api for authenticator and supplicant.
4  *
5  * Copyright (C) 2014-2017, Marvell International Ltd.
6  *
7  * This software file (the "File") is distributed by Marvell International
8  * Ltd. under the terms of the GNU General Public License Version 2, June 1991
9  * (the "License").  You may use, redistribute and/or modify this File in
10  * accordance with the terms and conditions of the License, a copy of which
11  * is available by writing to the Free Software Foundation, Inc.,
12  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
13  * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
14  *
15  * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
17  * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
18  * this warranty disclaimer.
19  */
20 
21 /******************************************************
22 Change log:
23     03/07/2014: Initial version
24 ******************************************************/
25 #ifndef KEYMGMTAPSTACOMMON_H__
26 #define KEYMGMTAPSTACOMMON_H__
27 //Authenticator related data structures, function prototypes
28 
29 #include "wltypes.h"
30 #include "IEEE_types.h"
31 #include "sha1.h"
32 #include "keyMgmtStaTypes.h"
33 #include "wl_macros.h"
34 #include "keyMgmtApTypes.h"
35 #include "rc4_rom.h"
36 
37 #include "keyCommonDef.h"
38 #include "authenticator.h"
39 
40 extern t_u32 wlan_strlen(const char *str);
41 extern void supplicantGenerateRand(hostsa_private *priv, UINT8 *dataOut,
42 				   UINT32 length);
43 extern void SetEAPOLKeyDescTypeVersion(EAPOL_KeyMsg_Tx_t *pTxEapol,
44 				       BOOLEAN isWPA2, BOOLEAN isKDF,
45 				       BOOLEAN nonTKIP);
46 extern void ComputeEAPOL_MIC(phostsa_private priv, EAPOL_KeyMsg_t *pKeyMsg,
47 			     UINT16 data_length, UINT8 *MIC_Key,
48 			     UINT8 MIC_Key_length, UINT8 micKeyDescVersion);
49 extern BOOLEAN IsEAPOL_MICValid(phostsa_private priv, EAPOL_KeyMsg_t *pKeyMsg,
50 				UINT8 *pMICKey);
51 extern void supplicantConstructContext(phostsa_private priv, UINT8 *pAddr1,
52 				       UINT8 *pAddr2, UINT8 *pNonce1,
53 				       UINT8 *pNonce2, UINT8 *pContext);
54 extern UINT16 KeyMgmtSta_PopulateEAPOLLengthMic(phostsa_private priv,
55 						EAPOL_KeyMsg_Tx_t *pTxEapol,
56 						UINT8 *pEAPOLMICKey,
57 						UINT8 eapolProtocolVersion,
58 						UINT8 forceKeyDescVersion);
59 extern void KeyMgmt_DerivePTK(phostsa_private priv, UINT8 *pAddr1,
60 			      UINT8 *pAddr2, UINT8 *pNonce1, UINT8 *pNonce2,
61 			      UINT8 *pPTK, UINT8 *pPMK, BOOLEAN use_kdf);
62 extern void KeyMgmtSta_DeriveKeys(hostsa_private *priv, UINT8 *pPMK, UINT8 *da,
63 				  UINT8 *sa, UINT8 *ANonce, UINT8 *SNonce,
64 				  UINT8 *EAPOL_MIC_Key, UINT8 *EAPOL_Encr_Key,
65 				  KeyData_t *newPWKey, BOOLEAN use_kdf);
66 extern void UpdateEAPOLWcbLenAndTransmit(hostsa_private *priv,
67 					 pmlan_buffer pmbuf, UINT16 frameLen);
68 extern void formEAPOLEthHdr(phostsa_private priv, EAPOL_KeyMsg_Tx_t *pTxEapol,
69 			    t_u8 *da, t_u8 *sa);
70 extern void supplicantParseWpaIe(phostsa_private priv,
71 				 IEEEtypes_WPAElement_t *pIe,
72 				 SecurityMode_t *pWpaType,
73 				 Cipher_t *pMcstCipher, Cipher_t *pUcstCipher,
74 				 AkmSuite_t *pAkmList, UINT8 akmOutMax);
75 extern void supplicantParseRsnIe(phostsa_private priv,
76 				 IEEEtypes_RSNElement_t *pRsnIe,
77 				 SecurityMode_t *pWpaTypeOut,
78 				 Cipher_t *pMcstCipherOut,
79 				 Cipher_t *pUcstCipherOut,
80 				 AkmSuite_t *pAkmListOut, UINT8 akmOutMax,
81 				 IEEEtypes_RSNCapability_t *pRsnCapOut,
82 				 Cipher_t *pGrpMgmtCipherOut);
83 #endif //KEYMGMTAPSTACOMMON_H__
84