00001
00016 #ifndef EAP_PAX_COMMON_H
00017 #define EAP_PAX_COMMON_H
00018
00019 struct eap_pax_hdr {
00020 u8 code;
00021 u8 identifier;
00022 u16 length;
00023 u8 type;
00024 u8 op_code;
00025 u8 flags;
00026 u8 mac_id;
00027 u8 dh_group_id;
00028 u8 public_key_id;
00029
00030 } __attribute__ ((packed));
00031
00032
00033
00034 enum {
00035 EAP_PAX_OP_STD_1 = 0x01,
00036 EAP_PAX_OP_STD_2 = 0x02,
00037 EAP_PAX_OP_STD_3 = 0x03,
00038 EAP_PAX_OP_SEC_1 = 0x11,
00039 EAP_PAX_OP_SEC_2 = 0x12,
00040 EAP_PAX_OP_SEC_3 = 0x13,
00041 EAP_PAX_OP_SEC_4 = 0x14,
00042 EAP_PAX_OP_SEC_5 = 0x15,
00043 EAP_PAX_OP_ACK = 0x21
00044 };
00045
00046
00047 #define EAP_PAX_FLAGS_MF 0x01
00048 #define EAP_PAX_FLAGS_CE 0x02
00049
00050
00051 #define EAP_PAX_MAC_HMAC_SHA1_128 0x01
00052 #define EAP_PAX_MAC_AES_CBC_MAC_128 0x02
00053
00054
00055 #define EAP_PAX_DH_GROUP_NONE 0x00
00056 #define EAP_PAX_DH_GROUP_3072_MODP 0x01
00057
00058
00059 #define EAP_PAX_PUBLIC_KEY_NONE 0x00
00060 #define EAP_PAX_PUBLIC_KEY_RSA_OAEP_2048 0x01
00061
00062
00063 #define EAP_PAX_RAND_LEN 32
00064 #define EAP_PAX_MSK_LEN 64
00065 #define EAP_PAX_MAC_LEN 16
00066 #define EAP_PAX_ICV_LEN 16
00067 #define EAP_PAX_AK_LEN 16
00068 #define EAP_PAX_MK_LEN 16
00069 #define EAP_PAX_CK_LEN 16
00070 #define EAP_PAX_ICK_LEN 16
00071
00072
00073 int eap_pax_kdf(u8 mac_id, const u8 *key, size_t key_len,
00074 const char *identifier,
00075 const u8 *entropy, size_t entropy_len,
00076 size_t output_len, u8 *output);
00077 int eap_pax_mac(u8 mac_id, const u8 *key, size_t key_len,
00078 const u8 *data1, size_t data1_len,
00079 const u8 *data2, size_t data2_len,
00080 const u8 *data3, size_t data3_len,
00081 u8 *mac);
00082 int eap_pax_initial_key_derivation(u8 mac_id, const u8 *ak, const u8 *e,
00083 u8 *mk, u8 *ck, u8 *ick);
00084
00085 #endif
00086