2 * WPA Supplicant - PeerKey for Direct Link Setup (DLS)
3 * Copyright (c) 2006-2008, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
12 #define PEERKEY_MAX_IE_LEN 80
14 struct wpa_peerkey *next;
15 int initiator; /* whether this end was initator for SMK handshake */
16 u8 addr[ETH_ALEN]; /* other end MAC address */
17 u8 inonce[WPA_NONCE_LEN]; /* Initiator Nonce */
18 u8 pnonce[WPA_NONCE_LEN]; /* Peer Nonce */
19 u8 rsnie_i[PEERKEY_MAX_IE_LEN]; /* Initiator RSN IE */
21 u8 rsnie_p[PEERKEY_MAX_IE_LEN]; /* Peer RSN IE */
27 int cipher; /* Selected cipher (WPA_CIPHER_*) */
28 u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
29 int replay_counter_set;
30 int use_sha256; /* whether AKMP indicate SHA256-based derivations */
32 struct wpa_ptk stk, tstk;
33 int stk_set, tstk_set;
39 int peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
40 struct wpa_peerkey *peerkey,
41 struct wpa_eapol_key *key, u16 ver,
42 const u8 *buf, size_t len);
43 void peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
44 struct wpa_eapol_key *key, u16 key_info, u16 ver);
45 void peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
46 struct wpa_eapol_key *key, size_t extra_len,
47 u16 key_info, u16 ver);
48 void peerkey_deinit(struct wpa_sm *sm);
50 #else /* CONFIG_PEERKEY */
53 peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
54 struct wpa_peerkey *peerkey,
55 struct wpa_eapol_key *key, u16 ver,
56 const u8 *buf, size_t len)
62 peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
63 struct wpa_eapol_key *key, u16 key_info, u16 ver)
68 peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
69 struct wpa_eapol_key *key, size_t extra_len,
70 u16 key_info, u16 ver)
74 static inline void peerkey_deinit(struct wpa_sm *sm)
78 #endif /* CONFIG_PEERKEY */
80 #endif /* PEERKEY_H */