annotate src/ssl-gnutls.c @ 7214:471c2850ca51

[gaim-migrate @ 7783] Removing gtk-wimp for now.. committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Thu, 09 Oct 2003 21:29:31 +0000
parents 6d0d4e9149b9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file ssl-gnutls.c SSL Operations for GNUTLS
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * (at your option) any later version.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * GNU General Public License for more details.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 */
6747
82348b5ab87e [gaim-migrate @ 7279]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
23 #include "internal.h"
82348b5ab87e [gaim-migrate @ 7279]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
24
82348b5ab87e [gaim-migrate @ 7279]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
25 #ifdef HAVE_GNUTLS
82348b5ab87e [gaim-migrate @ 7279]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
26
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 #include "debug.h"
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #include "sslconn.h"
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 #include <gnutls/gnutls.h>
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 typedef struct
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 gnutls_session session;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 } GaimSslGnutlsData;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 #define GAIM_SSL_GNUTLS_DATA(gsc) ((GaimSslGnutlsData *)gsc->private_data)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 static gnutls_certificate_client_credentials xcred;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 static gboolean
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 ssl_gnutls_init(void)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 gnutls_global_init();
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 gnutls_certificate_allocate_credentials(&xcred);
6758
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
48 gnutls_certificate_set_x509_trust_file(xcred, "ca.pem",
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
49 GNUTLS_X509_FMT_PEM);
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 return TRUE;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 }
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 static void
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 ssl_gnutls_uninit(void)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 gnutls_global_deinit();
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 gnutls_certificate_free_credentials(xcred);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 }
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 static void
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 ssl_gnutls_connect_cb(gpointer data, gint source, GaimInputCondition cond)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 GaimSslConnection *gsc = (GaimSslConnection *)data;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 GaimSslGnutlsData *gnutls_data;
6758
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
67 static const int cert_type_priority[2] = { GNUTLS_CRT_X509, 0 };
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 int ret;
6758
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
69
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
70 if (source < 0)
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
71 return;
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 gsc->fd = source;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 gnutls_data = g_new0(GaimSslGnutlsData, 1);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 gsc->private_data = gnutls_data;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 gnutls_init(&gnutls_data->session, GNUTLS_CLIENT);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 gnutls_set_default_priority(gnutls_data->session);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 gnutls_certificate_type_set_priority(gnutls_data->session,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 cert_type_priority);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 gnutls_credentials_set(gnutls_data->session, GNUTLS_CRD_CERTIFICATE,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 xcred);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 gnutls_transport_set_ptr(gnutls_data->session, GINT_TO_POINTER(source));
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 gaim_debug_info("gnutls", "Handshaking\n");
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 ret = gnutls_handshake(gnutls_data->session);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 if (ret < 0)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 {
6758
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
94 gaim_debug_error("gnutls", "Handshake failed\n");
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
95
6764
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6758
diff changeset
96 /* XXX: notify the guy expecting the callback somehow? */
6758
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
97 gaim_ssl_close(gsc);
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 }
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 else
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 {
6764
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6758
diff changeset
101 gsc->connect_cb(gsc->connect_cb_data, gsc, cond);
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102 }
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103 }
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105 static void
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 ssl_gnutls_close(GaimSslConnection *gsc)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 GaimSslGnutlsData *gnutls_data = GAIM_SSL_GNUTLS_DATA(gsc);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 gnutls_bye(gnutls_data->session, GNUTLS_SHUT_RDWR);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112 gnutls_deinit(gnutls_data->session);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 g_free(gnutls_data);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 }
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 static size_t
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 ssl_gnutls_read(GaimSslConnection *gsc, void *data, size_t len)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 GaimSslGnutlsData *gnutls_data = GAIM_SSL_GNUTLS_DATA(gsc);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 int s;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 s = gnutls_record_recv(gnutls_data->session, data, len);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 if (s < 0)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 s = 0;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128 return s;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 }
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 static size_t
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132 ssl_gnutls_write(GaimSslConnection *gsc, const void *data, size_t len)
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134 GaimSslGnutlsData *gnutls_data = GAIM_SSL_GNUTLS_DATA(gsc);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 size_t s;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136
6758
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
137 s = gnutls_record_send(gnutls_data->session, data, len);
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138
6758
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
139 if (s < 0)
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
140 s = 0;
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
141
424647996866 [gaim-migrate @ 7290]
Christian Hammond <chipx86@chipx86.com>
parents: 6747
diff changeset
142 return s;
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 }
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 static GaimSslOps ssl_ops =
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147 ssl_gnutls_init,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148 ssl_gnutls_uninit,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 ssl_gnutls_connect_cb,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150 ssl_gnutls_close,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 ssl_gnutls_read,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152 ssl_gnutls_write
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 };
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 GaimSslOps *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 gaim_ssl_gnutls_get_ops()
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158 return &ssl_ops;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
159 }
6747
82348b5ab87e [gaim-migrate @ 7279]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
160
82348b5ab87e [gaim-migrate @ 7279]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
161 #endif /* HAVE_GNUTLS */