peerkey.h
Go to the documentation of this file.00001
00016 #ifndef PEERKEY_H
00017 #define PEERKEY_H
00018
00019 #define PEERKEY_MAX_IE_LEN 80
00020 struct wpa_peerkey {
00021 struct wpa_peerkey *next;
00022 int initiator;
00023 u8 addr[ETH_ALEN];
00024 u8 inonce[WPA_NONCE_LEN];
00025 u8 pnonce[WPA_NONCE_LEN];
00026 u8 rsnie_i[PEERKEY_MAX_IE_LEN];
00027 size_t rsnie_i_len;
00028 u8 rsnie_p[PEERKEY_MAX_IE_LEN];
00029 size_t rsnie_p_len;
00030 u8 smk[PMK_LEN];
00031 int smk_complete;
00032 u8 smkid[PMKID_LEN];
00033 u32 lifetime;
00034 os_time_t expiration;
00035 int cipher;
00036 u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
00037 int replay_counter_set;
00038 int use_sha256;
00039
00040 struct wpa_ptk stk, tstk;
00041 int stk_set, tstk_set;
00042 };
00043
00044
00045 #ifdef CONFIG_PEERKEY
00046
00047 int peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
00048 struct wpa_peerkey *peerkey,
00049 struct wpa_eapol_key *key, u16 ver,
00050 const u8 *buf, size_t len);
00051 void peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
00052 struct wpa_eapol_key *key, u16 key_info, u16 ver);
00053 void peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
00054 struct wpa_eapol_key *key, size_t extra_len,
00055 u16 key_info, u16 ver);
00056 void peerkey_deinit(struct wpa_sm *sm);
00057
00058 #else
00059
00060 static inline int
00061 peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
00062 struct wpa_peerkey *peerkey,
00063 struct wpa_eapol_key *key, u16 ver,
00064 const u8 *buf, size_t len)
00065 {
00066 return -1;
00067 }
00068
00069 static inline void
00070 peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
00071 struct wpa_eapol_key *key, u16 key_info, u16 ver)
00072 {
00073 }
00074
00075 static inline void
00076 peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
00077 struct wpa_eapol_key *key, size_t extra_len,
00078 u16 key_info, u16 ver)
00079 {
00080 }
00081
00082 static inline void peerkey_deinit(struct wpa_sm *sm)
00083 {
00084 }
00085
00086 #endif
00087
00088 #endif
00089