Mercurial > pidgin
annotate src/sslconn.c @ 14166:fcae2cfe26eb
[gaim-migrate @ 16816]
I will apologize in advance for this ugliness - it is necessary because we have a "connect" macro to cause the wgaim_connect() wrapper function to be used.
committer: Tailor Script <tailor@pidgin.im>
| author | Daniel Atallah <daniel.atallah@gmail.com> |
|---|---|
| date | Thu, 17 Aug 2006 15:19:12 +0000 |
| parents | c8ebbc0110f4 |
| children | 8160857cd958 |
| rev | line source |
|---|---|
| 6703 | 1 /** |
| 2 * @file sslconn.c SSL API | |
| 3 * @ingroup core | |
| 4 * | |
| 5 * gaim | |
| 6 * | |
| 8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
| 8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 * source distribution. | |
| 6703 | 10 * |
| 11 * This program is free software; you can redistribute it and/or modify | |
| 12 * it under the terms of the GNU General Public License as published by | |
| 13 * the Free Software Foundation; either version 2 of the License, or | |
| 14 * (at your option) any later version. | |
| 15 * | |
| 16 * This program is distributed in the hope that it will be useful, | |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 * GNU General Public License for more details. | |
| 20 * | |
| 21 * You should have received a copy of the GNU General Public License | |
| 22 * along with this program; if not, write to the Free Software | |
| 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 */ | |
| 25 #include "internal.h" | |
| 26 | |
| 27 #include "debug.h" | |
| 28 #include "sslconn.h" | |
| 29 | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
30 static gboolean _ssl_initialized = FALSE; |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
31 static GaimSslOps *_ssl_ops = NULL; |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
32 |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
33 static gboolean |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
34 ssl_init(void) |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
35 { |
|
7018
cd8a9907c779
[gaim-migrate @ 7581]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
36 GaimPlugin *plugin; |
| 7863 | 37 GaimSslOps *ops; |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
38 |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
39 if (_ssl_initialized) |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
40 return FALSE; |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
41 |
|
7024
001d11a7e345
[gaim-migrate @ 7587]
Christian Hammond <chipx86@chipx86.com>
parents:
7018
diff
changeset
|
42 plugin = gaim_plugins_find_with_id("core-ssl"); |
|
7018
cd8a9907c779
[gaim-migrate @ 7581]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
43 |
|
cd8a9907c779
[gaim-migrate @ 7581]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
44 if (plugin != NULL && !gaim_plugin_is_loaded(plugin)) |
|
cd8a9907c779
[gaim-migrate @ 7581]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
45 gaim_plugin_load(plugin); |
|
cd8a9907c779
[gaim-migrate @ 7581]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
46 |
| 7863 | 47 ops = gaim_ssl_get_ops(); |
| 14160 | 48 if ((ops == NULL) || (ops->init == NULL) || (ops->uninit == NULL) || |
| 49 (ops->connect == NULL) || (ops->close == NULL) || | |
| 50 (ops->read == NULL) || (ops->write == NULL)) | |
| 51 { | |
| 7863 | 52 return FALSE; |
| 14160 | 53 } |
| 54 | |
| 55 return ops->init(); | |
| 6703 | 56 } |
| 57 | |
| 58 gboolean | |
| 59 gaim_ssl_is_supported(void) | |
| 60 { | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
61 #ifdef HAVE_SSL |
| 7355 | 62 ssl_init(); |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
63 return (gaim_ssl_get_ops() != NULL); |
| 6703 | 64 #else |
| 65 return FALSE; | |
| 66 #endif | |
| 67 } | |
| 68 | |
| 14160 | 69 static void |
| 70 gaim_ssl_connect_cb(gpointer data, gint source, const gchar *error_message) | |
| 71 { | |
| 72 GaimSslConnection *gsc; | |
| 73 GaimSslOps *ops; | |
|
14166
fcae2cfe26eb
[gaim-migrate @ 16816]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14160
diff
changeset
|
74 void (*connect_func)(GaimSslConnection *gsc); |
| 14160 | 75 |
| 76 gsc = data; | |
| 77 gsc->connect_info = NULL; | |
| 78 | |
| 79 if (source < 0) | |
| 80 { | |
| 81 if (gsc->error_cb != NULL) | |
| 82 gsc->error_cb(gsc, GAIM_SSL_CONNECT_FAILED, gsc->connect_cb_data); | |
| 83 | |
| 84 gaim_ssl_close(gsc); | |
| 85 return; | |
| 86 } | |
| 87 | |
| 88 gsc->fd = source; | |
| 89 | |
| 90 ops = gaim_ssl_get_ops(); | |
|
14166
fcae2cfe26eb
[gaim-migrate @ 16816]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14160
diff
changeset
|
91 connect_func = (ops->connect); |
|
fcae2cfe26eb
[gaim-migrate @ 16816]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14160
diff
changeset
|
92 connect_func(gsc); |
| 14160 | 93 } |
| 94 | |
| 6703 | 95 GaimSslConnection * |
| 96 gaim_ssl_connect(GaimAccount *account, const char *host, int port, | |
|
7274
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
97 GaimSslInputFunction func, GaimSslErrorFunction error_func, |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
98 void *data) |
| 6703 | 99 { |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
100 GaimSslConnection *gsc; |
| 6703 | 101 |
| 102 g_return_val_if_fail(host != NULL, NULL); | |
| 103 g_return_val_if_fail(port != 0 && port != -1, NULL); | |
| 104 g_return_val_if_fail(func != NULL, NULL); | |
| 105 g_return_val_if_fail(gaim_ssl_is_supported(), NULL); | |
| 106 | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
107 if (!_ssl_initialized) |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
108 { |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
109 if (!ssl_init()) |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
110 return NULL; |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
111 } |
| 6703 | 112 |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
113 gsc = g_new0(GaimSslConnection, 1); |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
114 |
| 14160 | 115 gsc->fd = -1; |
|
7274
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
116 gsc->host = g_strdup(host); |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
117 gsc->port = port; |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
118 gsc->connect_cb_data = data; |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
119 gsc->connect_cb = func; |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
120 gsc->error_cb = error_func; |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
121 |
| 14160 | 122 gsc->connect_info = gaim_proxy_connect(account, host, port, gaim_ssl_connect_cb, gsc); |
| 6703 | 123 |
| 14160 | 124 if (gsc->connect_info == NULL) |
| 6703 | 125 { |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
126 g_free(gsc->host); |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
127 g_free(gsc); |
| 6703 | 128 |
| 129 return NULL; | |
| 130 } | |
| 131 | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
132 return (GaimSslConnection *)gsc; |
| 6703 | 133 } |
| 134 | |
| 6764 | 135 static void |
| 136 recv_cb(gpointer data, gint source, GaimInputCondition cond) | |
| 137 { | |
| 138 GaimSslConnection *gsc = data; | |
| 139 | |
| 140 gsc->recv_cb(gsc->recv_cb_data, gsc, cond); | |
| 141 } | |
| 142 | |
| 143 void | |
|
7274
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
144 gaim_ssl_input_add(GaimSslConnection *gsc, GaimSslInputFunction func, |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
145 void *data) |
| 6764 | 146 { |
| 147 g_return_if_fail(func != NULL); | |
| 148 g_return_if_fail(gaim_ssl_is_supported()); | |
| 149 | |
| 150 gsc->recv_cb_data = data; | |
|
7274
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
151 gsc->recv_cb = func; |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
152 |
| 6764 | 153 gsc->inpa = gaim_input_add(gsc->fd, GAIM_INPUT_READ, recv_cb, gsc); |
| 154 } | |
| 155 | |
|
6762
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
156 GaimSslConnection * |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
157 gaim_ssl_connect_fd(GaimAccount *account, int fd, |
|
7274
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
158 GaimSslInputFunction func, |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
159 GaimSslErrorFunction error_func, void *data) |
|
6762
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
160 { |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
161 GaimSslConnection *gsc; |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
162 GaimSslOps *ops; |
|
14166
fcae2cfe26eb
[gaim-migrate @ 16816]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14160
diff
changeset
|
163 void (*connect_func)(GaimSslConnection *gsc); |
|
6762
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
164 |
| 13986 | 165 g_return_val_if_fail(fd != -1, NULL); |
|
6762
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
166 g_return_val_if_fail(func != NULL, NULL); |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
167 g_return_val_if_fail(gaim_ssl_is_supported(), NULL); |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
168 |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
169 if (!_ssl_initialized) |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
170 { |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
171 if (!ssl_init()) |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
172 return NULL; |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
173 } |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
174 |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
175 gsc = g_new0(GaimSslConnection, 1); |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
176 |
|
7274
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
177 gsc->connect_cb_data = data; |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
178 gsc->connect_cb = func; |
|
448e39ace278
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
7024
diff
changeset
|
179 gsc->error_cb = error_func; |
| 14160 | 180 gsc->fd = fd; |
|
6762
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
181 |
| 14160 | 182 ops = gaim_ssl_get_ops(); |
|
14166
fcae2cfe26eb
[gaim-migrate @ 16816]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14160
diff
changeset
|
183 connect_func = ops->connect; |
|
fcae2cfe26eb
[gaim-migrate @ 16816]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14160
diff
changeset
|
184 connect_func(gsc); |
|
6762
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
185 |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
186 return (GaimSslConnection *)gsc; |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
187 } |
|
818ce550d2ce
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6745
diff
changeset
|
188 |
| 6703 | 189 void |
| 190 gaim_ssl_close(GaimSslConnection *gsc) | |
| 191 { | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
192 GaimSslOps *ops; |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
193 |
| 6703 | 194 g_return_if_fail(gsc != NULL); |
| 195 | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
196 ops = gaim_ssl_get_ops(); |
| 14160 | 197 (ops->close)(gsc); |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
198 |
| 14160 | 199 if (gsc->connect_info != NULL) |
| 200 gaim_proxy_connect_cancel(gsc->connect_info); | |
| 201 | |
| 202 if (gsc->inpa > 0) | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
203 gaim_input_remove(gsc->inpa); |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
204 |
| 14160 | 205 if (gsc->fd >= 0) |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
206 close(gsc->fd); |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
207 |
| 13986 | 208 g_free(gsc->host); |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
209 g_free(gsc); |
| 6703 | 210 } |
| 211 | |
| 212 size_t | |
| 213 gaim_ssl_read(GaimSslConnection *gsc, void *data, size_t len) | |
| 214 { | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
215 GaimSslOps *ops; |
| 6703 | 216 |
| 217 g_return_val_if_fail(gsc != NULL, 0); | |
| 218 g_return_val_if_fail(data != NULL, 0); | |
| 219 g_return_val_if_fail(len > 0, 0); | |
| 220 | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
221 ops = gaim_ssl_get_ops(); |
| 14160 | 222 return (ops->read)(gsc, data, len); |
| 6703 | 223 } |
| 224 | |
| 225 size_t | |
| 226 gaim_ssl_write(GaimSslConnection *gsc, const void *data, size_t len) | |
| 227 { | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
228 GaimSslOps *ops; |
| 6703 | 229 |
| 230 g_return_val_if_fail(gsc != NULL, 0); | |
| 231 g_return_val_if_fail(data != NULL, 0); | |
| 232 g_return_val_if_fail(len > 0, 0); | |
| 233 | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
234 ops = gaim_ssl_get_ops(); |
| 14160 | 235 return (ops->write)(gsc, data, len); |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
236 } |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
237 |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
238 void |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
239 gaim_ssl_set_ops(GaimSslOps *ops) |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
240 { |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
241 _ssl_ops = ops; |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
242 } |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
243 |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
244 GaimSslOps * |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
245 gaim_ssl_get_ops(void) |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
246 { |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
247 return _ssl_ops; |
| 6703 | 248 } |
| 249 | |
| 250 void | |
| 251 gaim_ssl_init(void) | |
| 252 { | |
| 253 } | |
| 254 | |
| 255 void | |
| 256 gaim_ssl_uninit(void) | |
| 257 { | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
258 GaimSslOps *ops; |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
259 |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
260 if (!_ssl_initialized) |
| 6703 | 261 return; |
| 262 | |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
263 ops = gaim_ssl_get_ops(); |
| 14160 | 264 ops->uninit(); |
|
6738
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
265 |
|
6c95f01aaf49
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
266 _ssl_initialized = FALSE; |
| 6703 | 267 } |
