2008-02-28 02:34:43 +01:00
|
|
|
/*
|
|
|
|
* WPA Supplicant - PeerKey for Direct Link Setup (DLS)
|
2015-01-25 15:49:18 +01:00
|
|
|
* Copyright (c) 2006-2015, Jouni Malinen <j@w1.fi>
|
2008-02-28 02:34:43 +01:00
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-02-28 02:34:43 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PEERKEY_H
|
|
|
|
#define PEERKEY_H
|
|
|
|
|
|
|
|
#define PEERKEY_MAX_IE_LEN 80
|
|
|
|
struct wpa_peerkey {
|
|
|
|
struct wpa_peerkey *next;
|
|
|
|
int initiator; /* whether this end was initator for SMK handshake */
|
|
|
|
u8 addr[ETH_ALEN]; /* other end MAC address */
|
|
|
|
u8 inonce[WPA_NONCE_LEN]; /* Initiator Nonce */
|
|
|
|
u8 pnonce[WPA_NONCE_LEN]; /* Peer Nonce */
|
|
|
|
u8 rsnie_i[PEERKEY_MAX_IE_LEN]; /* Initiator RSN IE */
|
|
|
|
size_t rsnie_i_len;
|
|
|
|
u8 rsnie_p[PEERKEY_MAX_IE_LEN]; /* Peer RSN IE */
|
|
|
|
size_t rsnie_p_len;
|
|
|
|
u8 smk[PMK_LEN];
|
|
|
|
int smk_complete;
|
|
|
|
u8 smkid[PMKID_LEN];
|
|
|
|
u32 lifetime;
|
|
|
|
int cipher; /* Selected cipher (WPA_CIPHER_*) */
|
|
|
|
u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
|
|
|
|
int replay_counter_set;
|
2015-01-25 15:49:18 +01:00
|
|
|
int akmp;
|
2008-02-28 02:34:43 +01:00
|
|
|
|
|
|
|
struct wpa_ptk stk, tstk;
|
|
|
|
int stk_set, tstk_set;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_PEERKEY
|
|
|
|
|
|
|
|
int peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
|
|
|
|
struct wpa_peerkey *peerkey,
|
2015-09-02 21:55:03 +02:00
|
|
|
struct wpa_eapol_key *key, u16 ver,
|
2008-02-28 02:34:43 +01:00
|
|
|
const u8 *buf, size_t len);
|
|
|
|
void peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
|
2014-06-29 17:32:12 +02:00
|
|
|
struct wpa_eapol_key *key, u16 key_info, u16 ver,
|
|
|
|
const u8 *key_data, size_t key_data_len);
|
2008-02-28 02:34:43 +01:00
|
|
|
void peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
|
2016-12-18 18:07:29 +01:00
|
|
|
struct wpa_eapol_key *key, const u8 *key_data,
|
|
|
|
size_t key_data_len, u16 key_info, u16 ver);
|
2008-02-28 02:34:43 +01:00
|
|
|
void peerkey_deinit(struct wpa_sm *sm);
|
|
|
|
|
|
|
|
#else /* CONFIG_PEERKEY */
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
|
|
|
|
struct wpa_peerkey *peerkey,
|
|
|
|
struct wpa_eapol_key *key, u16 ver,
|
|
|
|
const u8 *buf, size_t len)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
|
2014-06-29 17:32:12 +02:00
|
|
|
struct wpa_eapol_key *key, u16 key_info, u16 ver,
|
|
|
|
const u8 *key_data, size_t key_data_len)
|
2008-02-28 02:34:43 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
|
2016-12-18 18:07:29 +01:00
|
|
|
struct wpa_eapol_key *key, const u8 *key_data,
|
|
|
|
size_t key_data_len, u16 key_info, u16 ver)
|
2008-02-28 02:34:43 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void peerkey_deinit(struct wpa_sm *sm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_PEERKEY */
|
|
|
|
|
|
|
|
#endif /* PEERKEY_H */
|