3fc3d6a1646e3275914a3380f4111ae9729142d6
[strongswan.git] / src / charon / plugins / eap_tls / tls / tls_peer.c
1 /*
2 * Copyright (C) 2010 Martin Willi
3 * Copyright (C) 2010 revosec AG
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 #include "tls_peer.h"
17
18 #include <daemon.h>
19
20 #include <time.h>
21
22 typedef struct private_tls_peer_t private_tls_peer_t;
23
24 /**
25 * Private data of an tls_peer_t object.
26 */
27 struct private_tls_peer_t {
28
29 /**
30 * Public tls_peer_t interface.
31 */
32 tls_peer_t public;
33 };
34
35 METHOD(tls_handshake_t, process, status_t,
36 private_tls_peer_t *this, tls_handshake_type_t type, chunk_t data)
37 {
38 return NEED_MORE;
39 }
40
41 METHOD(tls_handshake_t, build, status_t,
42 private_tls_peer_t *this, tls_handshake_type_t *type, chunk_t *data)
43 {
44 return INVALID_STATE;
45 }
46
47 METHOD(tls_handshake_t, destroy, void,
48 private_tls_peer_t *this)
49 {
50 free(this);
51 }
52
53 /**
54 * See header
55 */
56 tls_peer_t *tls_peer_create()
57 {
58 private_tls_peer_t *this;
59
60 INIT(this,
61 .public.handshake = {
62 .process = _process,
63 .build = _build,
64 .destroy = _destroy,
65 },
66 );
67
68 return &this->public;
69 }