wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
peerkey.h
Go to the documentation of this file.
1 
5 #ifndef PEERKEY_H
6 #define PEERKEY_H
7 
8 #define PEERKEY_MAX_IE_LEN 80
9 struct wpa_peerkey {
10  struct wpa_peerkey *next;
11  int initiator; /* whether this end was initator for SMK handshake */
12  u8 addr[ETH_ALEN]; /* other end MAC address */
13  u8 inonce[WPA_NONCE_LEN]; /* Initiator Nonce */
14  u8 pnonce[WPA_NONCE_LEN]; /* Peer Nonce */
15  u8 rsnie_i[PEERKEY_MAX_IE_LEN]; /* Initiator RSN IE */
16  size_t rsnie_i_len;
17  u8 rsnie_p[PEERKEY_MAX_IE_LEN]; /* Peer RSN IE */
18  size_t rsnie_p_len;
19  u8 smk[PMK_LEN];
20  int smk_complete;
21  u8 smkid[PMKID_LEN];
22  u32 lifetime;
23  int cipher; /* Selected cipher (WPA_CIPHER_*) */
24  u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
25  int replay_counter_set;
26  int akmp;
27 
28  struct wpa_ptk stk, tstk;
29  int stk_set, tstk_set;
30 };
31 
32 
33 #ifdef CONFIG_PEERKEY
34 
35 int peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
36  struct wpa_peerkey *peerkey,
37  struct wpa_eapol_key_192 *key, u16 ver,
38  const u8 *buf, size_t len);
39 void peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
40  struct wpa_eapol_key *key, u16 key_info, u16 ver,
41  const u8 *key_data, size_t key_data_len);
42 void peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
43  struct wpa_eapol_key *key, size_t extra_len,
44  u16 key_info, u16 ver);
45 void peerkey_deinit(struct wpa_sm *sm);
46 
47 #else /* CONFIG_PEERKEY */
48 
49 static inline int
50 peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
51  struct wpa_peerkey *peerkey,
52  struct wpa_eapol_key *key, u16 ver,
53  const u8 *buf, size_t len)
54 {
55  return -1;
56 }
57 
58 static inline void
59 peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
60  struct wpa_eapol_key *key, u16 key_info, u16 ver,
61  const u8 *key_data, size_t key_data_len)
62 {
63 }
64 
65 static inline void
66 peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
67  struct wpa_eapol_key *key, size_t extra_len,
68  u16 key_info, u16 ver)
69 {
70 }
71 
72 static inline void peerkey_deinit(struct wpa_sm *sm)
73 {
74 }
75 
76 #endif /* CONFIG_PEERKEY */
77 
78 #endif /* PEERKEY_H */
Definition: wpa_common.h:181
Definition: wpa_common.h:166
WPA Pairwise Transient Key IEEE Std 802.11i-2004 - 8.5.1.2 Pairwise key hierarchy.
Definition: wpa_common.h:205
Definition: peerkey.h:9
Internal WPA state machine data.
Definition: wpa_i.h:18