annotate src/sslconn.h @ 7087:bbf7f4604140

[gaim-migrate @ 7652] This should hopefully fix the problem where gaim tries to use NSS if GNUTLS fails, even if NSS also fails. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 30 Sep 2003 23:17:49 +0000
parents 8105c9cd573f
children 448e39ace278
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file sslconn.h SSL API
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * (at your option) any later version.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * GNU General Public License for more details.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 #ifndef _GAIM_SSL_H_
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #define _GAIM_SSL_H_
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 #include "proxy.h"
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
28 #define GAIM_SSL_DEFAULT_PORT 443
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
29
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
30 typedef struct _GaimSslConnection GaimSslConnection;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
31
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
32 typedef void (*GaimSslInputFunction)(gpointer, GaimSslConnection *,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
33 GaimInputCondition);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
34
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
35 struct _GaimSslConnection
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
36 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
37 char *host;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
38 int port;
6764
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
39 void *connect_cb_data;
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
40 GaimSslInputFunction connect_cb;
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
41 void *recv_cb_data;
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
42 GaimSslInputFunction recv_cb;
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
43
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
44 int fd;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
45 int inpa;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
46
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
47 void *private_data;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
48 };
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
49
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
50 /**
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
51 * SSL implementation operations structure.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
52 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
53 * Every SSL implementation must provide one of these and register it.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
54 */
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
55 typedef struct
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
56 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
57 gboolean (*init)(void);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
58 void (*uninit)(void);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
59 GaimInputFunction connect_cb;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
60 void (*close)(GaimSslConnection *gsc);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
61 size_t (*read)(GaimSslConnection *gsc, void *data, size_t len);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
62 size_t (*write)(GaimSslConnection *gsc, const void *data, size_t len);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
63
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
64 } GaimSslOps;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
65
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 #ifdef __cplusplus
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 extern "C" {
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 #endif
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 /**************************************************************************/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 /** @name SSL API */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 /**************************************************************************/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 /*@{*/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 * Returns whether or not SSL is currently supported.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 * @return TRUE if SSL is supported, or FALSE otherwise.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 gboolean gaim_ssl_is_supported(void);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 * Makes a SSL connection to the specified host and port.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 * @param account The account making the connection.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 * @param host The destination host.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 * @param port The destination port.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 * @param func The SSL input handler function.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 * @param data User-defined data.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 * @return The SSL connection handle.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 GaimSslConnection *gaim_ssl_connect(GaimAccount *account, const char *host,
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 int port, GaimSslInputFunction func,
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 void *data);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 /**
6764
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
98 * Adds an input watcher for the specified SSL connection.
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
99 *
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
100 * @param gsc The SSL connection handle.
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
101 * @param func The callback function.
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
102 * @param data User-defined data.
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
103 */
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
104 void gaim_ssl_input_add(GaimSslConnection *gsc, GaimSslInputFunction func,
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
105 void *data);
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
106
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
107 /**
6762
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
108 * Makes a SSL connection using an already open file descriptor.
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
109 *
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
110 * @param account The account making the connection.
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
111 * @param fd The file descriptor.
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
112 * @param func The SSL input handler function.
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
113 * @param data User-defined data.
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
114 *
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
115 * @return The SSL connection handle.
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
116 */
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
117 GaimSslConnection *gaim_ssl_connect_fd(GaimAccount *account, int fd,
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
118 GaimSslInputFunction func, void *data);
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
119
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
120 /**
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 * Closes a SSL connection.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 * @param gsc The SSL connection to close.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 void gaim_ssl_close(GaimSslConnection *gsc);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128 * Reads data from an SSL connection.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 * @param gsc The SSL connection handle.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 * @param buffer The destination buffer.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132 * @param len The maximum number of bytes to read.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134 * @return The number of bytes read.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 */
6720
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
136 size_t gaim_ssl_read(GaimSslConnection *gsc, void *buffer, size_t len);
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 * Writes data to an SSL connection.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 *
6720
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
141 * @param gsc The SSL connection handle.
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
142 * @param buffer The buffer to write.
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
143 * @param len The length of the data to write.
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 * @return The number of bytes written.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 */
6720
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
147 size_t gaim_ssl_write(GaimSslConnection *gsc, const void *buffer, size_t len);
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 /*@}*/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 /**************************************************************************/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152 /** @name Subsystem API */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 /**************************************************************************/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 /*@{*/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 /**
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
157 * Sets the current SSL operations structure.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
158 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
159 * @param ops The SSL operations structure to assign.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
160 */
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
161 void gaim_ssl_set_ops(GaimSslOps *ops);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
162
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
163 /**
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
164 * Returns the current SSL operations structure.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
165 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
166 * @return The SSL operations structure.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
167 */
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
168 GaimSslOps *gaim_ssl_get_ops(void);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
169
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
170 /**
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171 * Initializes the SSL subsystem.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 void gaim_ssl_init(void);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176 * Uninitializes the SSL subsystem.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
177 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 void gaim_ssl_uninit(void);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180 /*@}*/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
182 #ifdef __cplusplus
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183 }
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
184 #endif
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
186 #endif /* _GAIM_SSL_H_ */