~ubuntu-branches/ubuntu/saucy/wpasupplicant/saucy

« back to all changes in this revision

Viewing changes to src/eap_server/eap_tls_common.h

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2010-11-22 09:43:43 UTC
  • mfrom: (1.1.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122094343-qgsxaojvmswfri77
Tags: 0.7.3-0ubuntu1
* Get wpasupplicant 0.7.3 from Debian's SVN. Leaving 0.7.3-1 as unreleased
  for now.
* Build-Depend on debhelper 8, since the packaging from Debian uses compat 8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * hostapd / EAP-TLS/PEAP/TTLS/FAST common functions
3
 
 * Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
 
2
 * EAP-TLS/PEAP/TTLS/FAST server common functions
 
3
 * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License version 2 as
15
15
#ifndef EAP_TLS_COMMON_H
16
16
#define EAP_TLS_COMMON_H
17
17
 
 
18
/**
 
19
 * struct eap_ssl_data - TLS data for EAP methods
 
20
 */
18
21
struct eap_ssl_data {
 
22
        /**
 
23
         * conn - TLS connection context data from tls_connection_init()
 
24
         */
19
25
        struct tls_connection *conn;
20
26
 
 
27
        /**
 
28
         * tls_out - TLS message to be sent out in fragments
 
29
         */
 
30
        struct wpabuf *tls_out;
 
31
 
 
32
        /**
 
33
         * tls_out_pos - The current position in the outgoing TLS message
 
34
         */
 
35
        size_t tls_out_pos;
 
36
 
 
37
        /**
 
38
         * tls_out_limit - Maximum fragment size for outgoing TLS messages
 
39
         */
21
40
        size_t tls_out_limit;
22
41
 
 
42
        /**
 
43
         * tls_in - Received TLS message buffer for re-assembly
 
44
         */
 
45
        struct wpabuf *tls_in;
 
46
 
 
47
        /**
 
48
         * phase2 - Whether this TLS connection is used in EAP phase 2 (tunnel)
 
49
         */
23
50
        int phase2;
24
51
 
 
52
        /**
 
53
         * eap - EAP state machine allocated with eap_server_sm_init()
 
54
         */
25
55
        struct eap_sm *eap;
26
56
 
27
57
        enum { MSG, FRAG_ACK, WAIT_FRAG_ACK } state;
28
 
        struct wpabuf *in_buf;
29
 
        struct wpabuf *out_buf;
30
 
        size_t out_used;
31
58
        struct wpabuf tmpbuf;
32
59
};
33
60
 
53
80
int eap_server_tls_phase1(struct eap_sm *sm, struct eap_ssl_data *data);
54
81
struct wpabuf * eap_server_tls_encrypt(struct eap_sm *sm,
55
82
                                       struct eap_ssl_data *data,
56
 
                                       const u8 *plain, size_t plain_len);
 
83
                                       const struct wpabuf *plain);
57
84
int eap_server_tls_process(struct eap_sm *sm, struct eap_ssl_data *data,
58
85
                           struct wpabuf *respData, void *priv, int eap_type,
59
86
                           int (*proc_version)(struct eap_sm *sm, void *priv,