1 /*
2 * SSL/TLS interface functions for no TLS case
3 * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8
9 #include "includes.h"
10
11 #include "common.h"
12 #include "tls.h"
13
tls_init(const struct tls_config * conf)14 void * tls_init(const struct tls_config *conf)
15 {
16 return (void *) 1;
17 }
18
19
tls_deinit(void * ssl_ctx)20 void tls_deinit(void *ssl_ctx)
21 {
22 }
23
24
tls_get_errors(void * tls_ctx)25 int tls_get_errors(void *tls_ctx)
26 {
27 return 0;
28 }
29
30
tls_connection_init(void * tls_ctx)31 struct tls_connection * tls_connection_init(void *tls_ctx)
32 {
33 return NULL;
34 }
35
36
tls_connection_deinit(void * tls_ctx,struct tls_connection * conn)37 void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn)
38 {
39 }
40
41
tls_connection_established(void * tls_ctx,struct tls_connection * conn)42 int tls_connection_established(void *tls_ctx, struct tls_connection *conn)
43 {
44 return -1;
45 }
46
47
tls_connection_shutdown(void * tls_ctx,struct tls_connection * conn)48 int tls_connection_shutdown(void *tls_ctx, struct tls_connection *conn)
49 {
50 return -1;
51 }
52
53
tls_connection_set_params(void * tls_ctx,struct tls_connection * conn,const struct tls_connection_params * params)54 int tls_connection_set_params(void *tls_ctx, struct tls_connection *conn,
55 const struct tls_connection_params *params)
56 {
57 return -1;
58 }
59
60
tls_global_set_params(void * tls_ctx,const struct tls_connection_params * params)61 int tls_global_set_params(void *tls_ctx,
62 const struct tls_connection_params *params)
63 {
64 return -1;
65 }
66
67
tls_global_set_verify(void * tls_ctx,int check_crl)68 int tls_global_set_verify(void *tls_ctx, int check_crl)
69 {
70 return -1;
71 }
72
73
tls_connection_set_verify(void * tls_ctx,struct tls_connection * conn,int verify_peer,unsigned int flags,const u8 * session_ctx,size_t session_ctx_len)74 int tls_connection_set_verify(void *tls_ctx, struct tls_connection *conn,
75 int verify_peer, unsigned int flags,
76 const u8 *session_ctx, size_t session_ctx_len)
77 {
78 return -1;
79 }
80
81
tls_connection_get_random(void * tls_ctx,struct tls_connection * conn,struct tls_random * data)82 int tls_connection_get_random(void *tls_ctx, struct tls_connection *conn,
83 struct tls_random *data)
84 {
85 return -1;
86 }
87
88
tls_connection_export_key(void * tls_ctx,struct tls_connection * conn,const char * label,u8 * out,size_t out_len)89 int tls_connection_export_key(void *tls_ctx, struct tls_connection *conn,
90 const char *label, u8 *out, size_t out_len)
91 {
92 return -1;
93 }
94
95
tls_connection_get_eap_fast_key(void * tls_ctx,struct tls_connection * conn,u8 * out,size_t out_len)96 int tls_connection_get_eap_fast_key(void *tls_ctx, struct tls_connection *conn,
97 u8 *out, size_t out_len)
98 {
99 return -1;
100 }
101
102
tls_connection_handshake(void * tls_ctx,struct tls_connection * conn,const struct wpabuf * in_data,struct wpabuf ** appl_data)103 struct wpabuf * tls_connection_handshake(void *tls_ctx,
104 struct tls_connection *conn,
105 const struct wpabuf *in_data,
106 struct wpabuf **appl_data)
107 {
108 return NULL;
109 }
110
111
tls_connection_server_handshake(void * tls_ctx,struct tls_connection * conn,const struct wpabuf * in_data,struct wpabuf ** appl_data)112 struct wpabuf * tls_connection_server_handshake(void *tls_ctx,
113 struct tls_connection *conn,
114 const struct wpabuf *in_data,
115 struct wpabuf **appl_data)
116 {
117 return NULL;
118 }
119
120
tls_connection_encrypt(void * tls_ctx,struct tls_connection * conn,const struct wpabuf * in_data)121 struct wpabuf * tls_connection_encrypt(void *tls_ctx,
122 struct tls_connection *conn,
123 const struct wpabuf *in_data)
124 {
125 return NULL;
126 }
127
128
tls_connection_decrypt(void * tls_ctx,struct tls_connection * conn,const struct wpabuf * in_data)129 struct wpabuf * tls_connection_decrypt(void *tls_ctx,
130 struct tls_connection *conn,
131 const struct wpabuf *in_data)
132 {
133 return NULL;
134 }
135
136
tls_connection_resumed(void * tls_ctx,struct tls_connection * conn)137 int tls_connection_resumed(void *tls_ctx, struct tls_connection *conn)
138 {
139 return 0;
140 }
141
142
tls_connection_set_cipher_list(void * tls_ctx,struct tls_connection * conn,u8 * ciphers)143 int tls_connection_set_cipher_list(void *tls_ctx, struct tls_connection *conn,
144 u8 *ciphers)
145 {
146 return -1;
147 }
148
149
tls_get_version(void * ssl_ctx,struct tls_connection * conn,char * buf,size_t buflen)150 int tls_get_version(void *ssl_ctx, struct tls_connection *conn,
151 char *buf, size_t buflen)
152 {
153 return -1;
154 }
155
156
tls_get_cipher(void * tls_ctx,struct tls_connection * conn,char * buf,size_t buflen)157 int tls_get_cipher(void *tls_ctx, struct tls_connection *conn,
158 char *buf, size_t buflen)
159 {
160 return -1;
161 }
162
163
tls_connection_enable_workaround(void * tls_ctx,struct tls_connection * conn)164 int tls_connection_enable_workaround(void *tls_ctx,
165 struct tls_connection *conn)
166 {
167 return -1;
168 }
169
170
tls_connection_client_hello_ext(void * tls_ctx,struct tls_connection * conn,int ext_type,const u8 * data,size_t data_len)171 int tls_connection_client_hello_ext(void *tls_ctx, struct tls_connection *conn,
172 int ext_type, const u8 *data,
173 size_t data_len)
174 {
175 return -1;
176 }
177
178
tls_connection_get_failed(void * tls_ctx,struct tls_connection * conn)179 int tls_connection_get_failed(void *tls_ctx, struct tls_connection *conn)
180 {
181 return 0;
182 }
183
184
tls_connection_get_read_alerts(void * tls_ctx,struct tls_connection * conn)185 int tls_connection_get_read_alerts(void *tls_ctx, struct tls_connection *conn)
186 {
187 return 0;
188 }
189
190
tls_connection_get_write_alerts(void * tls_ctx,struct tls_connection * conn)191 int tls_connection_get_write_alerts(void *tls_ctx,
192 struct tls_connection *conn)
193 {
194 return 0;
195 }
196
197
tls_get_library_version(char * buf,size_t buf_len)198 int tls_get_library_version(char *buf, size_t buf_len)
199 {
200 return os_snprintf(buf, buf_len, "none");
201 }
202
203
tls_connection_set_success_data(struct tls_connection * conn,struct wpabuf * data)204 void tls_connection_set_success_data(struct tls_connection *conn,
205 struct wpabuf *data)
206 {
207 }
208
209
tls_connection_set_success_data_resumed(struct tls_connection * conn)210 void tls_connection_set_success_data_resumed(struct tls_connection *conn)
211 {
212 }
213
214
215 const struct wpabuf *
tls_connection_get_success_data(struct tls_connection * conn)216 tls_connection_get_success_data(struct tls_connection *conn)
217 {
218 return NULL;
219 }
220
221
tls_connection_remove_session(struct tls_connection * conn)222 void tls_connection_remove_session(struct tls_connection *conn)
223 {
224 }
225