wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eap_pax_common.h
Go to the documentation of this file.
1 
5 #ifndef EAP_PAX_COMMON_H
6 #define EAP_PAX_COMMON_H
7 
8 #ifdef _MSC_VER
9 #pragma pack(push, 1)
10 #endif /* _MSC_VER */
11 
12 struct eap_pax_hdr {
13  u8 op_code;
14  u8 flags;
15  u8 mac_id;
16  u8 dh_group_id;
17  u8 public_key_id;
18  /* Followed by variable length payload and ICV */
19 } STRUCT_PACKED;
20 
21 #ifdef _MSC_VER
22 #pragma pack(pop)
23 #endif /* _MSC_VER */
24 
25 
26 /* op_code: */
27 enum {
28  EAP_PAX_OP_STD_1 = 0x01,
29  EAP_PAX_OP_STD_2 = 0x02,
30  EAP_PAX_OP_STD_3 = 0x03,
31  EAP_PAX_OP_SEC_1 = 0x11,
32  EAP_PAX_OP_SEC_2 = 0x12,
33  EAP_PAX_OP_SEC_3 = 0x13,
34  EAP_PAX_OP_SEC_4 = 0x14,
35  EAP_PAX_OP_SEC_5 = 0x15,
36  EAP_PAX_OP_ACK = 0x21
37 };
38 
39 /* flags: */
40 #define EAP_PAX_FLAGS_MF 0x01
41 #define EAP_PAX_FLAGS_CE 0x02
42 #define EAP_PAX_FLAGS_AI 0x04
43 
44 /* mac_id: */
45 #define EAP_PAX_MAC_HMAC_SHA1_128 0x01
46 #define EAP_PAX_HMAC_SHA256_128 0x02
47 
48 /* dh_group_id: */
49 #define EAP_PAX_DH_GROUP_NONE 0x00
50 #define EAP_PAX_DH_GROUP_2048_MODP 0x01
51 #define EAP_PAX_DH_GROUP_3072_MODP 0x02
52 #define EAP_PAX_DH_GROUP_NIST_ECC_P_256 0x03
53 
54 /* public_key_id: */
55 #define EAP_PAX_PUBLIC_KEY_NONE 0x00
56 #define EAP_PAX_PUBLIC_KEY_RSAES_OAEP 0x01
57 #define EAP_PAX_PUBLIC_KEY_RSA_PKCS1_V1_5 0x02
58 #define EAP_PAX_PUBLIC_KEY_EL_GAMAL_NIST_ECC 0x03
59 
60 /* ADE type: */
61 #define EAP_PAX_ADE_VENDOR_SPECIFIC 0x01
62 #define EAP_PAX_ADE_CLIENT_CHANNEL_BINDING 0x02
63 #define EAP_PAX_ADE_SERVER_CHANNEL_BINDING 0x03
64 
65 
66 #define EAP_PAX_RAND_LEN 32
67 #define EAP_PAX_MAC_LEN 16
68 #define EAP_PAX_ICV_LEN 16
69 #define EAP_PAX_AK_LEN 16
70 #define EAP_PAX_MK_LEN 16
71 #define EAP_PAX_CK_LEN 16
72 #define EAP_PAX_ICK_LEN 16
73 #define EAP_PAX_MID_LEN 16
74 
75 
76 int eap_pax_kdf(u8 mac_id, const u8 *key, size_t key_len,
77  const char *identifier,
78  const u8 *entropy, size_t entropy_len,
79  size_t output_len, u8 *output);
80 int eap_pax_mac(u8 mac_id, const u8 *key, size_t key_len,
81  const u8 *data1, size_t data1_len,
82  const u8 *data2, size_t data2_len,
83  const u8 *data3, size_t data3_len,
84  u8 *mac);
85 int eap_pax_initial_key_derivation(u8 mac_id, const u8 *ak, const u8 *e,
86  u8 *mk, u8 *ck, u8 *ick, u8 *mid);
87 
88 #endif /* EAP_PAX_COMMON_H */
Definition: eap_pax_common.h:12
int eap_pax_kdf(u8 mac_id, const u8 *key, size_t key_len, const char *identifier, const u8 *entropy, size_t entropy_len, size_t output_len, u8 *output)
PAX Key Derivation Function.
Definition: eap_pax_common.c:26
int eap_pax_mac(u8 mac_id, const u8 *key, size_t key_len, const u8 *data1, size_t data1_len, const u8 *data2, size_t data2_len, const u8 *data3, size_t data3_len, u8 *mac)
EAP-PAX MAC.
Definition: eap_pax_common.c:82
int eap_pax_initial_key_derivation(u8 mac_id, const u8 *ak, const u8 *e, u8 *mk, u8 *ck, u8 *ick, u8 *mid)
EAP-PAX initial key derivation.
Definition: eap_pax_common.c:123