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