eap_tls_common.h

Go to the documentation of this file.
00001 
00016 #ifndef EAP_TLS_COMMON_H
00017 #define EAP_TLS_COMMON_H
00018 
00019 struct eap_ssl_data {
00020         struct tls_connection *conn;
00021 
00022         size_t tls_out_limit;
00023 
00024         int phase2;
00025 
00026         struct eap_sm *eap;
00027 
00028         enum { MSG, FRAG_ACK, WAIT_FRAG_ACK } state;
00029         struct wpabuf *in_buf;
00030         struct wpabuf *out_buf;
00031         size_t out_used;
00032         struct wpabuf tmpbuf;
00033 };
00034 
00035 
00036 /* EAP TLS Flags */
00037 #define EAP_TLS_FLAGS_LENGTH_INCLUDED 0x80
00038 #define EAP_TLS_FLAGS_MORE_FRAGMENTS 0x40
00039 #define EAP_TLS_FLAGS_START 0x20
00040 #define EAP_TLS_VERSION_MASK 0x07
00041 
00042  /* could be up to 128 bytes, but only the first 64 bytes are used */
00043 #define EAP_TLS_KEY_LEN 64
00044 
00045 
00046 int eap_server_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
00047                             int verify_peer);
00048 void eap_server_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data);
00049 u8 * eap_server_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
00050                                char *label, size_t len);
00051 struct wpabuf * eap_server_tls_build_msg(struct eap_ssl_data *data,
00052                                          int eap_type, int version, u8 id);
00053 struct wpabuf * eap_server_tls_build_ack(u8 id, int eap_type, int version);
00054 int eap_server_tls_phase1(struct eap_sm *sm, struct eap_ssl_data *data);
00055 struct wpabuf * eap_server_tls_encrypt(struct eap_sm *sm,
00056                                        struct eap_ssl_data *data,
00057                                        const u8 *plain, size_t plain_len);
00058 int eap_server_tls_process(struct eap_sm *sm, struct eap_ssl_data *data,
00059                            struct wpabuf *respData, void *priv, int eap_type,
00060                            int (*proc_version)(struct eap_sm *sm, void *priv,
00061                                                int peer_version),
00062                            void (*proc_msg)(struct eap_sm *sm, void *priv,
00063                                             const struct wpabuf *respData));
00064 
00065 #endif /* EAP_TLS_COMMON_H */
00066 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:16:52 2009 for hostapd by  doxygen 1.6.1