wpa_supplicant / hostapd 2.0

peerkey.h

Go to the documentation of this file.
00001 
00010 #ifndef PEERKEY_H
00011 #define PEERKEY_H
00012 
00013 #define PEERKEY_MAX_IE_LEN 80
00014 struct wpa_peerkey {
00015         struct wpa_peerkey *next;
00016         int initiator; /* whether this end was initator for SMK handshake */
00017         u8 addr[ETH_ALEN]; /* other end MAC address */
00018         u8 inonce[WPA_NONCE_LEN]; /* Initiator Nonce */
00019         u8 pnonce[WPA_NONCE_LEN]; /* Peer Nonce */
00020         u8 rsnie_i[PEERKEY_MAX_IE_LEN]; /* Initiator RSN IE */
00021         size_t rsnie_i_len;
00022         u8 rsnie_p[PEERKEY_MAX_IE_LEN]; /* Peer RSN IE */
00023         size_t rsnie_p_len;
00024         u8 smk[PMK_LEN];
00025         int smk_complete;
00026         u8 smkid[PMKID_LEN];
00027         u32 lifetime;
00028         os_time_t expiration;
00029         int cipher; /* Selected cipher (WPA_CIPHER_*) */
00030         u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
00031         int replay_counter_set;
00032         int use_sha256; /* whether AKMP indicate SHA256-based derivations */
00033 
00034         struct wpa_ptk stk, tstk;
00035         int stk_set, tstk_set;
00036 };
00037 
00038 
00039 #ifdef CONFIG_PEERKEY
00040 
00041 int peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
00042                                  struct wpa_peerkey *peerkey,
00043                                  struct wpa_eapol_key *key, u16 ver,
00044                                  const u8 *buf, size_t len);
00045 void peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
00046                            struct wpa_eapol_key *key, u16 key_info, u16 ver);
00047 void peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
00048                           struct wpa_eapol_key *key, size_t extra_len,
00049                           u16 key_info, u16 ver);
00050 void peerkey_deinit(struct wpa_sm *sm);
00051 
00052 #else /* CONFIG_PEERKEY */
00053 
00054 static inline int
00055 peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
00056                              struct wpa_peerkey *peerkey,
00057                              struct wpa_eapol_key *key, u16 ver,
00058                              const u8 *buf, size_t len)
00059 {
00060         return -1;
00061 }
00062 
00063 static inline void
00064 peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
00065                       struct wpa_eapol_key *key, u16 key_info, u16 ver)
00066 {
00067 }
00068 
00069 static inline void
00070 peerkey_rx_eapol_smk(struct wpa_sm *sm, const u8 *src_addr,
00071                      struct wpa_eapol_key *key, size_t extra_len,
00072                      u16 key_info, u16 ver)
00073 {
00074 }
00075 
00076 static inline void peerkey_deinit(struct wpa_sm *sm)
00077 {
00078 }
00079 
00080 #endif /* CONFIG_PEERKEY */
00081 
00082 #endif /* PEERKEY_H */
00083 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines