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; /* whether this end was initator for SMK handshake */
00023         u8 addr[ETH_ALEN]; /* other end MAC address */
00024         u8 inonce[WPA_NONCE_LEN]; /* Initiator Nonce */
00025         u8 pnonce[WPA_NONCE_LEN]; /* Peer Nonce */
00026         u8 rsnie_i[PEERKEY_MAX_IE_LEN]; /* Initiator RSN IE */
00027         size_t rsnie_i_len;
00028         u8 rsnie_p[PEERKEY_MAX_IE_LEN]; /* Peer RSN IE */
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; /* Selected cipher (WPA_CIPHER_*) */
00036         u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
00037         int replay_counter_set;
00038         int use_sha256; /* whether AKMP indicate SHA256-based derivations */
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 /* CONFIG_PEERKEY */
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 /* CONFIG_PEERKEY */
00087 
00088 #endif /* PEERKEY_H */
00089 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:16:53 2009 for hostapd by  doxygen 1.6.1