xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/mvl88w8977/mlan/esa/keyMgmtAp_rom.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /** @file keyMgmtAp_rom.h
2  *
3  *  @brief This file contains define for key management
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 KEYMGMTAP_ROM_H__
26 #define KEYMGMTAP_ROM_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 #include "keyMgmtApStaCommon.h"
40 
41 /* This flags if the Secure flag in EAPOL key frame must be set */
42 #define SECURE_HANDSHAKE_FLAG 0x0080
43 /* Whether the EAPOL frame is for pairwise or group Key */
44 #define PAIRWISE_KEY_MSG    0x0800
45 /* Flags when WPA2 is enabled, not used for WPA */
46 #define WPA2_HANDSHAKE      0x8000
47 
48 extern void GenerateGTK_internal(hostsa_private *priv, KeyData_t *grpKeyData,
49 				 UINT8 *nonce, UINT8 *StaMacAddr);
50 
51 extern void PopulateKeyMsg(hostsa_private *priv,
52 			   EAPOL_KeyMsg_Tx_t *tx_eapol_ptr, Cipher_t *Cipher,
53 			   UINT16 Type, UINT32 replay_cnt[2], UINT8 *Nonce);
54 
55 extern void prepareKDE(hostsa_private *priv, EAPOL_KeyMsg_Tx_t *tx_eapol_ptr,
56 		       KeyData_t *grKey, Cipher_t *cipher);
57 
58 extern BOOLEAN Encrypt_keyData(hostsa_private *priv,
59 			       EAPOL_KeyMsg_Tx_t *tx_eapol_ptr,
60 			       UINT8 *EAPOL_Encr_Key, Cipher_t *cipher);
61 
62 extern void ROM_InitGTK(hostsa_private *priv, KeyData_t *grpKeyData,
63 			UINT8 *nonce, UINT8 *StaMacAddr);
64 
65 extern void KeyData_AddGTK(hostsa_private *priv, EAPOL_KeyMsg_Tx_t *pTxEAPOL,
66 			   KeyData_t *grKey, Cipher_t *cipher);
67 
68 extern BOOLEAN KeyData_AddKey(hostsa_private *priv, EAPOL_KeyMsg_Tx_t *pTxEAPOL,
69 			      SecurityMode_t *pSecType,
70 			      KeyData_t *grKey, Cipher_t *cipher);
71 
72 extern BOOLEAN KeyData_CopyWPAWP2(hostsa_private *priv,
73 				  EAPOL_KeyMsg_Tx_t *pTxEAPOL, void *pIe);
74 
75 extern BOOLEAN KeyData_UpdateKeyMaterial(hostsa_private *priv,
76 					 EAPOL_KeyMsg_Tx_t *pTxEAPOL,
77 					 SecurityMode_t *pSecType, void *pWPA,
78 					 void *pWPA2);
79 extern void KeyMgmtAp_DerivePTK(hostsa_private *priv, UINT8 *pPMK, t_u8 *da,
80 				t_u8 *sa, UINT8 *ANonce, UINT8 *SNonce,
81 				UINT8 *EAPOL_MIC_Key, UINT8 *EAPOL_Encr_Key,
82 				KeyData_t *newPWKey, BOOLEAN use_kdf);
83 
84 #endif //_KEYMGMTAP_ROM_H_
85