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