2 ***************************************************************************
4 * 4F, No. 2 Technology 5th Rd.
5 * Science-based Industrial Park
6 * Hsin-chu, Taiwan, R.O.C.
8 * (c) Copyright 2002, Ralink Technology, Inc.
10 * All rights reserved. Ralink's source code is an unpublished work and the
11 * use of a copyright notice does not imply otherwise. This source code
12 * contains confidential trade secret material of Ralink Tech. Any attemp
13 * or participation in deciphering, decoding, reverse engineering or in any
14 * way altering the source code is stricitly prohibited, unless the prior
15 * written consent of Ralink Technology, Inc. is obtained.
16 ***************************************************************************
25 -------- ---------- ----------------------------------------------
26 Name Date Modification logs
32 //Messages for the wpa state machine,
33 #define WPA_MACHINE_BASE 21
34 #define EAP_MSG_TYPE_EAPPacket 21
35 #define EAP_MSG_TYPE_EAPOLStart 22
36 #define EAP_MSG_TYPE_EAPOLLogoff 23
37 #define EAP_MSG_TYPE_EAPOLKey 24
38 #define EAP_MSG_TYPE_EAPOLASFAlert 25
39 #define MAX_WPA_PSK_MSG 5
41 // WpaPsk EAPOL Key descripter frame format related length
42 #define LEN_KEY_DESC_NONCE 32
43 #define LEN_KEY_DESC_IV 16
44 #define LEN_KEY_DESC_RSC 8
45 #define LEN_KEY_DESC_ID 8
46 #define LEN_KEY_DESC_REPLAY 8
47 #define LEN_KEY_DESC_MIC 16
51 #define DESC_TYPE_TKIP 1
52 #define DESC_TYPE_AES 2
53 #define RSN_KEY_DESC 0xfe
55 #define LEN_MASTER_KEY 32
59 #define LEN_EAP_MICK 16
60 #define LEN_EAP_KEY ((LEN_EAP_EK)+(LEN_EAP_MICK))
62 #define LEN_TKIP_EK 16
63 #define LEN_TKIP_RXMICK 8
64 #define LEN_TKIP_TXMICK 8
66 #define LEN_AES_KEY LEN_AES_EK
67 #define LEN_TKIP_KEY ((LEN_TKIP_EK)+(LEN_TKIP_RXMICK)+(LEN_TKIP_TXMICK))
68 #define TKIP_AP_TXMICK_OFFSET ((LEN_EAP_KEY)+(LEN_TKIP_EK))
69 #define TKIP_AP_RXMICK_OFFSET (TKIP_AP_TXMICK_OFFSET+LEN_TKIP_TXMICK)
70 #define TKIP_GTK_LENGTH ((LEN_TKIP_EK)+(LEN_TKIP_RXMICK)+(LEN_TKIP_TXMICK))
71 #define LEN_PTK ((LEN_EAP_KEY)+(LEN_TKIP_KEY))
72 #define MAX_LEN_OF_RSNIE 48
79 #define EAPOLASFAlert 4
82 #define EAPOL_MSG_INVALID 0
83 #define EAPOL_PAIR_MSG_1 1
84 #define EAPOL_PAIR_MSG_3 2
85 #define EAPOL_GROUP_MSG_1 3
87 // EAPOL Key Information definition within Key descriptor format
88 typedef struct PACKED _KEY_INFO
115 } KEY_INFO
, *PKEY_INFO
;
117 // EAPOL Key descriptor format
118 typedef struct PACKED _KEY_DESCRIPTER
123 UCHAR ReplayCounter
[LEN_KEY_DESC_REPLAY
];
124 UCHAR KeyNonce
[LEN_KEY_DESC_NONCE
];
125 UCHAR KeyIv
[LEN_KEY_DESC_IV
];
126 UCHAR KeyRsc
[LEN_KEY_DESC_RSC
];
127 UCHAR KeyId
[LEN_KEY_DESC_ID
];
128 UCHAR KeyMic
[LEN_KEY_DESC_MIC
];
130 UCHAR KeyData
[MAX_LEN_OF_RSNIE
];
131 } KEY_DESCRIPTER
, *PKEY_DESCRIPTER
;
133 typedef struct PACKED _EAPOL_PACKET
138 KEY_DESCRIPTER KeyDesc
;
139 } EAPOL_PACKET
, *PEAPOL_PACKET
;
141 // For supplicant state machine states. 802.11i Draft 4.1, p. 97
143 typedef enum _WpaState