Added TLS crypto helper, currently supports cipher suite selection
[strongswan.git] / src / charon / plugins / eap_tls / tls / tls_server.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_server.h"
17
18 #include <daemon.h>
19
20 typedef struct private_tls_server_t private_tls_server_t;
21
22 /**
23 * Private data of an tls_server_t object.
24 */
25 struct private_tls_server_t {
26
27 /**
28 * Public tls_server_t interface.
29 */
30 tls_server_t public;
31
32 /**
33 * TLS crypto context
34 */
35 tls_crypto_t *crypto;
36 };
37
38
39 METHOD(tls_handshake_t, process, status_t,
40 private_tls_server_t *this, tls_handshake_type_t type, chunk_t data)
41 {
42 return NEED_MORE;
43 }
44
45 METHOD(tls_handshake_t, build, status_t,
46 private_tls_server_t *this, tls_handshake_type_t *type, chunk_t *data)
47 {
48 return INVALID_STATE;
49 }
50
51 METHOD(tls_handshake_t, destroy, void,
52 private_tls_server_t *this)
53 {
54 free(this);
55 }
56
57 /**
58 * See header
59 */
60 tls_server_t *tls_server_create(tls_crypto_t *crypto)
61 {
62 private_tls_server_t *this;
63
64 INIT(this,
65 .public.handshake = {
66 .process = _process,
67 .build = _build,
68 .destroy = _destroy,
69 },
70 .crypto = crypto,
71 );
72
73 return &this->public;
74 }