Mercurial > pidgin
annotate libpurple/sslconn.h @ 28693:6aea98f6a5cd
Get rid of slpmsg->fp since the core is handling all the partial reads and
writes, and this is no longer used.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 20 Nov 2009 01:17:51 +0000 |
parents | 12f5a7916131 |
children | d337a23e5536 3828a61c44da |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file sslconn.h SSL API |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * @ingroup core |
20074
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19681
diff
changeset
|
4 */ |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19681
diff
changeset
|
5 |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19681
diff
changeset
|
6 /* purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
15822 | 8 * Purple is the legal property of its developers, whose names are too numerous |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18968
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 */ |
15822 | 26 #ifndef _PURPLE_SSLCONN_H_ |
27 #define _PURPLE_SSLCONN_H_ | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
29 /** Possible SSL errors. */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 typedef enum |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 { |
15822 | 32 PURPLE_SSL_HANDSHAKE_FAILED = 1, |
18954
d07258902ff3
- Add PURPLE_SSL_CERTIFICATE_INVALID error code
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18944
diff
changeset
|
33 PURPLE_SSL_CONNECT_FAILED = 2, |
d07258902ff3
- Add PURPLE_SSL_CERTIFICATE_INVALID error code
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18944
diff
changeset
|
34 PURPLE_SSL_CERTIFICATE_INVALID = 3 |
15822 | 35 } PurpleSslErrorType; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 |
20115
a68d51d60177
Create purple_connection_ssl_error(), which converts a PurpleSslErrorType
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
37 #include "certificate.h" |
a68d51d60177
Create purple_connection_ssl_error(), which converts a PurpleSslErrorType
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
38 #include "proxy.h" |
a68d51d60177
Create purple_connection_ssl_error(), which converts a PurpleSslErrorType
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
39 |
a68d51d60177
Create purple_connection_ssl_error(), which converts a PurpleSslErrorType
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
40 #define PURPLE_SSL_DEFAULT_PORT 443 |
a68d51d60177
Create purple_connection_ssl_error(), which converts a PurpleSslErrorType
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
41 |
25487
96af49d5758d
Sprinkle some @copydoc directives around to shut up some doxygen whining.
Etan Reisner <pidgin@unreliablesource.net>
parents:
24350
diff
changeset
|
42 /** @copydoc _PurpleSslConnection */ |
15822 | 43 typedef struct _PurpleSslConnection PurpleSslConnection; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 |
15822 | 45 typedef void (*PurpleSslInputFunction)(gpointer, PurpleSslConnection *, |
46 PurpleInputCondition); | |
47 typedef void (*PurpleSslErrorFunction)(PurpleSslConnection *, PurpleSslErrorType, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 gpointer); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
15822 | 50 struct _PurpleSslConnection |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 { |
17231
a7887e79b723
Partial documentation on SslConnection struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17230
diff
changeset
|
52 /** Hostname to which the SSL connection will be made */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 char *host; |
17231
a7887e79b723
Partial documentation on SslConnection struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17230
diff
changeset
|
54 /** Port to connect to */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 int port; |
17232
bf516a0c430e
More documenting
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17231
diff
changeset
|
56 /** Data to pass to PurpleSslConnection::connect_cb() */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 void *connect_cb_data; |
17232
bf516a0c430e
More documenting
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17231
diff
changeset
|
58 /** Callback triggered once the SSL handshake is complete */ |
15822 | 59 PurpleSslInputFunction connect_cb; |
17233
3bccbafea8c1
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17232
diff
changeset
|
60 /** Callback triggered if there is an error during connection */ |
15822 | 61 PurpleSslErrorFunction error_cb; |
17232
bf516a0c430e
More documenting
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17231
diff
changeset
|
62 /** Data passed to PurpleSslConnection::recv_cb() */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 void *recv_cb_data; |
17233
3bccbafea8c1
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17232
diff
changeset
|
64 /** User-defined callback executed when the SSL connection receives data */ |
15822 | 65 PurpleSslInputFunction recv_cb; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 |
17231
a7887e79b723
Partial documentation on SslConnection struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17230
diff
changeset
|
67 /** File descriptor used to refer to the socket */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 int fd; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
24350
diff
changeset
|
69 /** Glib event source ID; used to refer to the received data callback |
17233
3bccbafea8c1
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17232
diff
changeset
|
70 * in the glib eventloop */ |
24065
85bed17fe5c1
The variable we use to keep track of the watcher of the ssl connection
Mark Doliner <mark@kingant.net>
parents:
21355
diff
changeset
|
71 guint inpa; |
17233
3bccbafea8c1
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17232
diff
changeset
|
72 /** Data related to the underlying TCP connection */ |
15822 | 73 PurpleProxyConnectData *connect_data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 |
17231
a7887e79b723
Partial documentation on SslConnection struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17230
diff
changeset
|
75 /** Internal connection data managed by the SSL backend (GnuTLS/LibNSS/whatever) */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 void *private_data; |
18944
3a71a46d171c
- Add verifier field to SslConnection
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18931
diff
changeset
|
77 |
3a71a46d171c
- Add verifier field to SslConnection
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18931
diff
changeset
|
78 /** Verifier to use in authenticating the peer */ |
3a71a46d171c
- Add verifier field to SslConnection
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18931
diff
changeset
|
79 PurpleCertificateVerifier *verifier; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 * SSL implementation operations structure. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 * |
17232
bf516a0c430e
More documenting
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17231
diff
changeset
|
85 * Every SSL implementation must provide all of these and register it via purple_ssl_set_ops() |
17230
4248f884451f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17229
diff
changeset
|
86 * These should not be called directly! Instead, use the purple_ssl_* functions. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 { |
17229
b765fdcde59e
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16664
diff
changeset
|
90 /** Initializes the SSL system provided. |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
91 * @return @a TRUE if initialization succeeded |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
92 * @see purple_ssl_init |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
93 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 gboolean (*init)(void); |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
95 /** Unloads the SSL system. Inverse of PurpleSslOps::init. |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
96 * @see purple_ssl_uninit |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
97 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 void (*uninit)(void); |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
99 /** Sets up the SSL connection for a #PurpleSslConnection once |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
100 * the TCP connection has been established |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
101 * @see purple_ssl_connect |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
102 */ |
15822 | 103 void (*connectfunc)(PurpleSslConnection *gsc); |
17230
4248f884451f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17229
diff
changeset
|
104 /** Destroys the internal data of the SSL connection provided. |
4248f884451f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17229
diff
changeset
|
105 * Freeing gsc itself is left to purple_ssl_close() |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
106 * @see purple_ssl_close |
17230
4248f884451f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17229
diff
changeset
|
107 */ |
15822 | 108 void (*close)(PurpleSslConnection *gsc); |
17229
b765fdcde59e
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16664
diff
changeset
|
109 /** Reads data from a connection (like POSIX read()) |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
110 * @param gsc Connection context |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
111 * @param data Pointer to buffer to drop data into |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
112 * @param len Maximum number of bytes to read |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
113 * @return Number of bytes actually written into @a data (which may be |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
114 * less than @a len), or <0 on error |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
115 * @see purple_ssl_read |
17229
b765fdcde59e
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16664
diff
changeset
|
116 */ |
15822 | 117 size_t (*read)(PurpleSslConnection *gsc, void *data, size_t len); |
17229
b765fdcde59e
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16664
diff
changeset
|
118 /** Writes data to a connection (like POSIX send()) |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
119 * @param gsc Connection context |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
120 * @param data Data buffer to send data from |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
121 * @param len Number of bytes to send from buffer |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
122 * @return The number of bytes written to @a data (may be less than |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
123 * @a len) or <0 on error |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
124 * @see purple_ssl_write |
17229
b765fdcde59e
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16664
diff
changeset
|
125 */ |
15822 | 126 size_t (*write)(PurpleSslConnection *gsc, const void *data, size_t len); |
18187
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
127 /** Obtains the certificate chain provided by the peer |
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
128 * |
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
129 * @param gsc Connection context |
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
130 * @return A newly allocated list containing the certificates |
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
131 * the peer provided. |
18944
3a71a46d171c
- Add verifier field to SslConnection
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18931
diff
changeset
|
132 * @see PurpleCertificate |
18187
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
133 * @todo Decide whether the ordering of certificates in this |
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
134 * list can be guaranteed. |
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
135 */ |
33690062e8b3
- Expose get_peer_certificates in the SslOps struct, and modify gnutls
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17781
diff
changeset
|
136 GList * (* get_peer_certificates)(PurpleSslConnection * gsc); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
24350
diff
changeset
|
137 |
16664
516f14bef90e
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15822
diff
changeset
|
138 void (*_purple_reserved2)(void); |
516f14bef90e
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15822
diff
changeset
|
139 void (*_purple_reserved3)(void); |
516f14bef90e
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15822
diff
changeset
|
140 void (*_purple_reserved4)(void); |
15822 | 141 } PurpleSslOps; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 #ifdef __cplusplus |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 extern "C" { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 /** @name SSL API */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 * Returns whether or not SSL is currently supported. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 * |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
155 * @return @a TRUE if SSL is supported, or @a FALSE otherwise. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 */ |
15822 | 157 gboolean purple_ssl_is_supported(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 /** |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
160 * Returns a human-readable string for an SSL error. |
18968
1677ead39ee3
- Add purple_ssl_strerror for handy error description power!
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18954
diff
changeset
|
161 * |
1677ead39ee3
- Add purple_ssl_strerror for handy error description power!
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18954
diff
changeset
|
162 * @param error Error code |
1677ead39ee3
- Add purple_ssl_strerror for handy error description power!
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18954
diff
changeset
|
163 * @return Human-readable error explanation |
1677ead39ee3
- Add purple_ssl_strerror for handy error description power!
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18954
diff
changeset
|
164 */ |
1677ead39ee3
- Add purple_ssl_strerror for handy error description power!
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18954
diff
changeset
|
165 const gchar * purple_ssl_strerror(PurpleSslErrorType error); |
1677ead39ee3
- Add purple_ssl_strerror for handy error description power!
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18954
diff
changeset
|
166 |
1677ead39ee3
- Add purple_ssl_strerror for handy error description power!
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18954
diff
changeset
|
167 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 * Makes a SSL connection to the specified host and port. The caller |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 * should keep track of the returned value and use it to cancel the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 * connection, if needed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 * @param account The account making the connection. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 * @param host The destination host. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 * @param port The destination port. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 * @param func The SSL input handler function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 * @param error_func The SSL error handler function. This function |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
177 * should <strong>NOT</strong> call purple_ssl_close(). In |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
178 * the event of an error the #PurpleSslConnection will be |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 * destroyed for you. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 * @param data User-defined data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 * @return The SSL connection handle. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 */ |
15822 | 184 PurpleSslConnection *purple_ssl_connect(PurpleAccount *account, const char *host, |
185 int port, PurpleSslInputFunction func, | |
186 PurpleSslErrorFunction error_func, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 void *data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 |
27555
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
189 /** |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
190 * Makes a SSL connection to the specified host and port, using the separate |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
191 * name to verify with the certificate. The caller should keep track of the |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
192 * returned value and use it to cancel the connection, if needed. |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
193 * |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
194 * @param account The account making the connection. |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
195 * @param host The destination host. |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
196 * @param port The destination port. |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
197 * @param func The SSL input handler function. |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
198 * @param error_func The SSL error handler function. This function |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
199 * should <strong>NOT</strong> call purple_ssl_close(). In |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
200 * the event of an error the #PurpleSslConnection will be |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
201 * destroyed for you. |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
202 * @param ssl_host The hostname of the other peer (to verify the CN) |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
203 * @param data User-defined data. |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
204 * |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
205 * @return The SSL connection handle. |
27556 | 206 * @since 2.6.0 |
27555
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
207 */ |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
208 PurpleSslConnection *purple_ssl_connect_with_ssl_cn(PurpleAccount *account, const char *host, |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
209 int port, PurpleSslInputFunction func, |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
210 PurpleSslErrorFunction error_func, |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
211 const char *ssl_host, |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
212 void *data); |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
213 |
24350
8282911d5e17
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@wiktel.com>
parents:
24065
diff
changeset
|
214 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_SSLCONN_C_) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 * Makes a SSL connection using an already open file descriptor. |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
217 * |
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
218 * @deprecated Use purple_ssl_connect_with_host_fd() instead. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 * @param account The account making the connection. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 * @param fd The file descriptor. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 * @param func The SSL input handler function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 * @param error_func The SSL error handler function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 * @param data User-defined data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 * @return The SSL connection handle. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 */ |
15822 | 228 PurpleSslConnection *purple_ssl_connect_fd(PurpleAccount *account, int fd, |
229 PurpleSslInputFunction func, | |
230 PurpleSslErrorFunction error_func, | |
18929
67cb28c0ec89
applied changes from e52b685d84ca8874da6e3e71199829e513500642
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18187
diff
changeset
|
231 void *data); |
21190
34de8ef19294
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@wiktel.com>
parents:
20134
diff
changeset
|
232 #endif |
18929
67cb28c0ec89
applied changes from e52b685d84ca8874da6e3e71199829e513500642
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18187
diff
changeset
|
233 |
67cb28c0ec89
applied changes from e52b685d84ca8874da6e3e71199829e513500642
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18187
diff
changeset
|
234 /** |
20875
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
235 * Makes a SSL connection using an already open file descriptor. |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
236 * |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
237 * @param account The account making the connection. |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
238 * @param fd The file descriptor. |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
239 * @param func The SSL input handler function. |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
240 * @param error_func The SSL error handler function. |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
241 * @param host The hostname of the other peer (to verify the CN) |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
242 * @param data User-defined data. |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
243 * |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
244 * @return The SSL connection handle. |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
245 * |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
246 * @since 2.2.0 |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
247 */ |
18929
67cb28c0ec89
applied changes from e52b685d84ca8874da6e3e71199829e513500642
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18187
diff
changeset
|
248 PurpleSslConnection *purple_ssl_connect_with_host_fd(PurpleAccount *account, int fd, |
67cb28c0ec89
applied changes from e52b685d84ca8874da6e3e71199829e513500642
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18187
diff
changeset
|
249 PurpleSslInputFunction func, |
67cb28c0ec89
applied changes from e52b685d84ca8874da6e3e71199829e513500642
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18187
diff
changeset
|
250 PurpleSslErrorFunction error_func, |
67cb28c0ec89
applied changes from e52b685d84ca8874da6e3e71199829e513500642
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18187
diff
changeset
|
251 const char *host, |
67cb28c0ec89
applied changes from e52b685d84ca8874da6e3e71199829e513500642
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18187
diff
changeset
|
252 void *data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 * Adds an input watcher for the specified SSL connection. |
17251
2d2c72f70e8c
Add note on use of purple_ssl_input_add
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17233
diff
changeset
|
256 * Once the SSL handshake is complete, use this to watch for actual data across it. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 * @param gsc The SSL connection handle. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 * @param func The callback function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 * @param data User-defined data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 */ |
15822 | 262 void purple_ssl_input_add(PurpleSslConnection *gsc, PurpleSslInputFunction func, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 void *data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 * Closes a SSL connection. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 * @param gsc The SSL connection to close. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 */ |
15822 | 270 void purple_ssl_close(PurpleSslConnection *gsc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 * Reads data from an SSL connection. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 * @param gsc The SSL connection handle. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 * @param buffer The destination buffer. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 * @param len The maximum number of bytes to read. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 * @return The number of bytes read. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 */ |
15822 | 281 size_t purple_ssl_read(PurpleSslConnection *gsc, void *buffer, size_t len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 * Writes data to an SSL connection. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 * @param gsc The SSL connection handle. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 * @param buffer The buffer to write. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 * @param len The length of the data to write. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 * @return The number of bytes written. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 */ |
15822 | 292 size_t purple_ssl_write(PurpleSslConnection *gsc, const void *buffer, size_t len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 |
18931
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
294 /** |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
295 * Obtains the peer's presented certificates |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
296 * |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
297 * @param gsc The SSL connection handle |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
298 * |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
299 * @return The peer certificate chain, in the order of certificate, issuer, |
20134
f56ce942adf2
Bunch of documentation tidying for the ssl api, and add a doxycomment to
Will Thompson <will.thompson@collabora.co.uk>
parents:
20074
diff
changeset
|
300 * issuer's issuer, etc. @a NULL if no certificates have been provided, |
20875
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
301 * |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20134
diff
changeset
|
302 * @since 2.2.0 |
18931
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
303 */ |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
304 GList * purple_ssl_get_peer_certificates(PurpleSslConnection *gsc); |
e634122cec47
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18929
diff
changeset
|
305 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 /** @name Subsystem API */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
312 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
314 * Sets the current SSL operations structure. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 * @param ops The SSL operations structure to assign. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 */ |
15822 | 318 void purple_ssl_set_ops(PurpleSslOps *ops); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 * Returns the current SSL operations structure. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 * @return The SSL operations structure. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 */ |
15822 | 325 PurpleSslOps *purple_ssl_get_ops(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 * Initializes the SSL subsystem. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 */ |
15822 | 330 void purple_ssl_init(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 * Uninitializes the SSL subsystem. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 */ |
15822 | 335 void purple_ssl_uninit(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 #ifdef __cplusplus |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 |
15822 | 343 #endif /* _PURPLE_SSLCONN_H_ */ |