eap_fast_common.h
Go to the documentation of this file.00001
00016 #ifndef EAP_FAST_H
00017 #define EAP_FAST_H
00018
00019 #define EAP_FAST_VERSION 1
00020 #define EAP_FAST_KEY_LEN 64
00021 #define EAP_FAST_SIMCK_LEN 40
00022 #define EAP_FAST_SKS_LEN 40
00023 #define EAP_FAST_CMK_LEN 20
00024
00025 #define TLS_EXT_PAC_OPAQUE 35
00026
00027
00028
00029
00030
00031
00032 #define PAC_TYPE_PAC_KEY 1
00033 #define PAC_TYPE_PAC_OPAQUE 2
00034 #define PAC_TYPE_CRED_LIFETIME 3
00035 #define PAC_TYPE_A_ID 4
00036 #define PAC_TYPE_I_ID 5
00037
00038
00039
00040
00041 #define PAC_TYPE_A_ID_INFO 7
00042 #define PAC_TYPE_PAC_ACKNOWLEDGEMENT 8
00043 #define PAC_TYPE_PAC_INFO 9
00044 #define PAC_TYPE_PAC_TYPE 10
00045
00046 #ifdef _MSC_VER
00047 #pragma pack(push, 1)
00048 #endif
00049
00050 struct pac_tlv_hdr {
00051 be16 type;
00052 be16 len;
00053 } STRUCT_PACKED;
00054
00055 #ifdef _MSC_VER
00056 #pragma pack(pop)
00057 #endif
00058
00059
00060 #define EAP_FAST_PAC_KEY_LEN 32
00061
00062
00063 #define PAC_TYPE_TUNNEL_PAC 1
00064
00065
00066 #define PAC_TYPE_USER_AUTHORIZATION 3
00067
00068
00069 #define PAC_TYPE_MACHINE_AUTHENTICATION 2
00070
00071
00072
00073
00074
00075
00076 struct eap_fast_key_block_provisioning {
00077
00078 u8 session_key_seed[EAP_FAST_SKS_LEN];
00079 u8 server_challenge[16];
00080 u8 client_challenge[16];
00081 };
00082
00083
00084 struct wpabuf;
00085 struct tls_connection;
00086
00087 struct eap_fast_tlv_parse {
00088 u8 *eap_payload_tlv;
00089 size_t eap_payload_tlv_len;
00090 struct eap_tlv_crypto_binding_tlv *crypto_binding;
00091 size_t crypto_binding_len;
00092 int iresult;
00093 int result;
00094 int request_action;
00095 u8 *pac;
00096 size_t pac_len;
00097 };
00098
00099 void eap_fast_put_tlv_hdr(struct wpabuf *buf, u16 type, u16 len);
00100 void eap_fast_put_tlv(struct wpabuf *buf, u16 type, const void *data,
00101 u16 len);
00102 void eap_fast_put_tlv_buf(struct wpabuf *buf, u16 type,
00103 const struct wpabuf *data);
00104 struct wpabuf * eap_fast_tlv_eap_payload(struct wpabuf *buf);
00105 void eap_fast_derive_master_secret(const u8 *pac_key, const u8 *server_random,
00106 const u8 *client_random, u8 *master_secret);
00107 u8 * eap_fast_derive_key(void *ssl_ctx, struct tls_connection *conn,
00108 const char *label, size_t len);
00109 void eap_fast_derive_eap_msk(const u8 *simck, u8 *msk);
00110 void eap_fast_derive_eap_emsk(const u8 *simck, u8 *emsk);
00111 int eap_fast_parse_tlv(struct eap_fast_tlv_parse *tlv,
00112 int tlv_type, u8 *pos, int len);
00113
00114 #endif
00115