eap_gpsk_common.h

Go to the documentation of this file.
00001 
00016 #ifndef EAP_GPSK_COMMON_H
00017 #define EAP_GPSK_COMMON_H
00018 
00019 #define EAP_GPSK_OPCODE_GPSK_1 1
00020 #define EAP_GPSK_OPCODE_GPSK_2 2
00021 #define EAP_GPSK_OPCODE_GPSK_3 3
00022 #define EAP_GPSK_OPCODE_GPSK_4 4
00023 #define EAP_GPSK_OPCODE_FAIL 5
00024 #define EAP_GPSK_OPCODE_PROTECTED_FAIL 6
00025 
00026 /* Failure-Code in GPSK-Fail and GPSK-Protected-Fail */
00027 #define EAP_GPSK_FAIL_PSK_NOT_FOUND 0x00000001
00028 #define EAP_GPSK_FAIL_AUTHENTICATION_FAILURE 0x00000002
00029 #define EAP_GPSK_FAIL_AUTHORIZATION_FAILURE 0x00000003
00030 
00031 #define EAP_GPSK_RAND_LEN 32
00032 #define EAP_GPSK_MAX_SK_LEN 32
00033 #define EAP_GPSK_MAX_PK_LEN 32
00034 #define EAP_GPSK_MAX_MIC_LEN 32
00035 
00036 #define EAP_GPSK_VENDOR_IETF            0x00000000
00037 #define EAP_GPSK_CIPHER_RESERVED        0x000000
00038 #define EAP_GPSK_CIPHER_AES             0x000001
00039 #define EAP_GPSK_CIPHER_SHA256          0x000002
00040 
00041 
00042 #ifdef _MSC_VER
00043 #pragma pack(push, 1)
00044 #endif /* _MSC_VER */
00045 
00046 struct eap_gpsk_csuite {
00047         u8 vendor[4];
00048         u8 specifier[2];
00049 } STRUCT_PACKED;
00050 
00051 #ifdef _MSC_VER
00052 #pragma pack(pop)
00053 #endif /* _MSC_VER */
00054 
00055 int eap_gpsk_supported_ciphersuite(int vendor, int specifier);
00056 int eap_gpsk_derive_keys(const u8 *psk, size_t psk_len, int vendor,
00057                          int specifier,
00058                          const u8 *rand_client, const u8 *rand_server,
00059                          const u8 *id_client, size_t id_client_len,
00060                          const u8 *id_server, size_t id_server_len,
00061                          u8 *msk, u8 *emsk, u8 *sk, size_t *sk_len,
00062                          u8 *pk, size_t *pk_len);
00063 size_t eap_gpsk_mic_len(int vendor, int specifier);
00064 int eap_gpsk_compute_mic(const u8 *sk, size_t sk_len, int vendor,
00065                          int specifier, const u8 *data, size_t len, u8 *mic);
00066 
00067 #endif /* EAP_GPSK_COMMON_H */
00068 
 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