2 * WPA Supplicant - PeerKey for Direct Link Setup (DLS)
3 * Copyright (c) 2006-2008, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 #define PEERKEY_MAX_IE_LEN 80
20 struct wpa_peerkey *next;
21 int initiator; /* whether this end was initator for SMK handshake */
22 u8 addr[ETH_ALEN]; /* other end MAC address */
23 u8 inonce[WPA_NONCE_LEN]; /* Initiator Nonce */
24 u8 pnonce[WPA_NONCE_LEN]; /* Peer Nonce */
25 u8 rsnie_i[PEERKEY_MAX_IE_LEN]; /* Initiator RSN IE */
27 u8 rsnie_p[PEERKEY_MAX_IE_LEN]; /* Peer RSN IE */
34 int cipher; /* Selected cipher (WPA_CIPHER_*) */
35 u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
36 int replay_counter_set;
37 int use_sha256; /* whether AKMP indicate SHA256-based derivations */
39 struct wpa_ptk stk, tstk;
40 int stk_set, tstk_set;
46 int peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
47 struct wpa_peerkey *peerkey,
48 struct wpa_eapol_key *key, u16 ver,
49 const u8 *buf, size_t len);
50 void peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
51 struct wpa_eapol_key *key, u16 key_info, u16 ver);
52 void peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
53 struct wpa_eapol_key *key, size_t extra_len,
54 u16 key_info, u16 ver);
55 void peerkey_deinit(struct wpa_sm *sm);
57 #else /* CONFIG_PEERKEY */
60 peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
61 struct wpa_peerkey *peerkey,
62 struct wpa_eapol_key *key, u16 ver,
63 const u8 *buf, size_t len)
69 peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
70 struct wpa_eapol_key *key, u16 key_info, u16 ver)
75 peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
76 struct wpa_eapol_key *key, size_t extra_len,
77 u16 key_info, u16 ver)
81 static inline void peerkey_deinit(struct wpa_sm *sm)
85 #endif /* CONFIG_PEERKEY */
87 #endif /* PEERKEY_H */