eap_psk_common.h

Go to the documentation of this file.
00001 
00016 #ifndef EAP_PSK_COMMON_H
00017 #define EAP_PSK_COMMON_H
00018 
00019 
00020 #define EAP_PSK_RAND_LEN 16
00021 #define EAP_PSK_MAC_LEN 16
00022 #define EAP_PSK_TEK_LEN 16
00023 #define EAP_PSK_PSK_LEN 16
00024 #define EAP_PSK_AK_LEN 16
00025 #define EAP_PSK_KDK_LEN 16
00026 
00027 #define EAP_PSK_R_FLAG_CONT 1
00028 #define EAP_PSK_R_FLAG_DONE_SUCCESS 2
00029 #define EAP_PSK_R_FLAG_DONE_FAILURE 3
00030 #define EAP_PSK_E_FLAG 0x20
00031 
00032 #define EAP_PSK_FLAGS_GET_T(flags) (((flags) & 0xc0) >> 6)
00033 #define EAP_PSK_FLAGS_SET_T(t) ((u8) (t) << 6)
00034 
00035 #ifdef _MSC_VER
00036 #pragma pack(push, 1)
00037 #endif /* _MSC_VER */
00038 
00039 /* EAP-PSK First Message (AS -> Supplicant) */
00040 struct eap_psk_hdr_1 {
00041         u8 flags;
00042         u8 rand_s[EAP_PSK_RAND_LEN];
00043         /* Followed by variable length ID_S */
00044 } STRUCT_PACKED;
00045 
00046 /* EAP-PSK Second Message (Supplicant -> AS) */
00047 struct eap_psk_hdr_2 {
00048         u8 flags;
00049         u8 rand_s[EAP_PSK_RAND_LEN];
00050         u8 rand_p[EAP_PSK_RAND_LEN];
00051         u8 mac_p[EAP_PSK_MAC_LEN];
00052         /* Followed by variable length ID_P */
00053 } STRUCT_PACKED;
00054 
00055 /* EAP-PSK Third Message (AS -> Supplicant) */
00056 struct eap_psk_hdr_3 {
00057         u8 flags;
00058         u8 rand_s[EAP_PSK_RAND_LEN];
00059         u8 mac_s[EAP_PSK_MAC_LEN];
00060         /* Followed by variable length PCHANNEL */
00061 } STRUCT_PACKED;
00062 
00063 /* EAP-PSK Fourth Message (Supplicant -> AS) */
00064 struct eap_psk_hdr_4 {
00065         u8 flags;
00066         u8 rand_s[EAP_PSK_RAND_LEN];
00067         /* Followed by variable length PCHANNEL */
00068 } STRUCT_PACKED;
00069 
00070 #ifdef _MSC_VER
00071 #pragma pack(pop)
00072 #endif /* _MSC_VER */
00073 
00074 
00075 int __must_check eap_psk_key_setup(const u8 *psk, u8 *ak, u8 *kdk);
00076 int __must_check eap_psk_derive_keys(const u8 *kdk, const u8 *rand_p, u8 *tek,
00077                                      u8 *msk, u8 *emsk);
00078 
00079 #endif /* EAP_PSK_COMMON_H */
00080 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

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