Changeset 792a93b
- Timestamp:
- 2011-12-23T12:44:08Z (13 years ago)
- Branches:
- master
- Children:
- 200e151
- Parents:
- 2d93a51e (diff), 41658da (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.conf
r2d93a51e r792a93b 116 116 ## (Obviously, the username and password are optional) 117 117 ## 118 # #Proxy = http://john:doe@proxy.localnet.com:8080119 # #Proxy = socks4://socksproxy.localnet.com120 # #Proxy = socks5://socksproxy.localnet.com118 # Proxy = http://john:doe@proxy.localnet.com:8080 119 # Proxy = socks4://socksproxy.localnet.com 120 # Proxy = socks5://socksproxy.localnet.com 121 121 122 122 ## Protocols offered by bitlbee … … 126 126 ## nothing is given, there are no restrictions. 127 127 ## 128 # #Protocols = jabber yahoo128 # Protocols = jabber yahoo 129 129 130 ## Trusted CAs 131 ## 132 ## Path to a file containing a list of trusted certificate authorities used in 133 ## the verification of server certificates. 134 ## 135 ## Uncomment this and make sure the file actually exists and contains all 136 ## certificate authorities you're willing to accept (default value should 137 ## work on at least Debian/Ubuntu systems with the "ca-certificates" package 138 ## installed). As long as the line is commented out, SSL certificate 139 ## verification is completely disabled. 140 ## 141 ## The location of this file may be different on other distros/OSes. For 142 ## example, try /etc/ssl/ca-bundle.pem on OpenSUSE. 143 ## 144 # CAfile = /etc/ssl/certs/ca-certificates.crt 130 145 131 146 [defaults] -
conf.c
r2d93a51e r792a93b 67 67 conf->ft_listen = NULL; 68 68 conf->protocols = NULL; 69 conf->cafile = NULL; 69 70 proxytype = 0; 70 71 … … 177 178 fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", global.conf_file ); 178 179 180 if( conf->cafile && access( conf->cafile, R_OK ) != 0 ) 181 { 182 /* Let's treat this as a serious problem so people won't think 183 they're secure when in fact they're not. */ 184 fprintf( stderr, "Error: Could not read CA file %s: %s\n", conf->cafile, strerror( errno ) ); 185 return NULL; 186 } 187 179 188 return conf; 180 189 } … … 340 349 conf->protocols = g_strsplit_set( ini->value, " \t,;", -1 ); 341 350 } 351 else if( g_strcasecmp( ini->key, "cafile" ) == 0 ) 352 { 353 g_free( conf->cafile ); 354 conf->cafile = g_strdup( ini->value ); 355 } 342 356 else 343 357 { -
conf.h
r2d93a51e r792a93b 54 54 char *ft_listen; 55 55 char **protocols; 56 char *cafile; 56 57 } conf_t; 57 58 -
doc/user-guide/commands.xml
r2d93a51e r792a93b 1392 1392 <description> 1393 1393 <para> 1394 Currently only available for Jabber connections. Set this to true if the server accepts SSL connections. 1394 Currently only available for Jabber connections. Set this to true if you want to connect to the server on an SSL-enabled port (usually 5223). 1395 </para> 1396 1397 <para> 1398 Please note that this method of establishing a secure connection to the server has long been deprecated. You are encouraged to look at the <emphasis>tls</emphasis> setting instead. 1395 1399 </para> 1396 1400 </description> … … 1481 1485 <para> 1482 1486 If you want to force BitlBee to use TLS sessions only (and to give up if that doesn't seem to be possible) you can set this setting to <emphasis>true</emphasis>. Set it to <emphasis>false</emphasis> if you want the session to remain plain-text. 1487 </para> 1488 </description> 1489 </bitlbee-setting> 1490 1491 <bitlbee-setting name="tls_verify" type="boolean" scope="account"> 1492 <default>true</default> 1493 1494 <description> 1495 <para> 1496 Currently only available for Jabber connections in combination with the <emphasis>tls</emphasis> setting. Set this to <emphasis>true</emphasis> if you want BitlBee to strictly verify the server's certificate against a list of trusted certificate authorities. 1497 </para> 1498 1499 <para> 1500 The hostname used in the certificate verification is the value of the <emphasis>server</emphasis> setting if the latter is nonempty and the domain of the username else. If you get a hostname related error when connecting to Google Talk with a username from the gmail.com or googlemail.com domain, please try to empty the <emphasis>server</emphasis> setting. 1501 </para> 1502 1503 <para> 1504 Please note that no certificate verification is performed when the <emphasis>ssl</emphasis> setting is used, or when the <emphasis>CAfile</emphasis> setting in <emphasis>bitlbee.conf</emphasis> is not set. 1483 1505 </para> 1484 1506 </description> -
lib/http_client.c
r2d93a51e r792a93b 33 33 34 34 static gboolean http_connected( gpointer data, int source, b_input_condition cond ); 35 static gboolean http_ssl_connected( gpointer data, void *source, b_input_condition cond );35 static gboolean http_ssl_connected( gpointer data, int returncode, void *source, b_input_condition cond ); 36 36 static gboolean http_incoming_data( gpointer data, int source, b_input_condition cond ); 37 37 static void http_free( struct http_request *req ); … … 47 47 if( ssl ) 48 48 { 49 req->ssl = ssl_connect( host, port, http_ssl_connected, req );49 req->ssl = ssl_connect( host, port, TRUE, http_ssl_connected, req ); 50 50 if( req->ssl == NULL ) 51 51 error = 1; … … 163 163 164 164 error: 165 req->status_string = g_strdup( "Error while writing HTTP request" ); 165 if( req->status_string == NULL ) 166 req->status_string = g_strdup( "Error while writing HTTP request" ); 166 167 167 168 req->func( req ); … … 170 171 } 171 172 172 static gboolean http_ssl_connected( gpointer data, void *source, b_input_condition cond )173 static gboolean http_ssl_connected( gpointer data, int returncode, void *source, b_input_condition cond ) 173 174 { 174 175 struct http_request *req = data; 175 176 176 177 if( source == NULL ) 178 { 179 if( returncode != 0 ) 180 { 181 char *err = ssl_verify_strerror( returncode ); 182 req->status_string = g_strdup_printf( 183 "Certificate verification problem 0x%x: %s", 184 returncode, err ? err : "Unknown" ); 185 g_free( err ); 186 } 177 187 return http_connected( data, -1, cond ); 188 } 178 189 179 190 req->fd = ssl_getfd( source ); … … 439 450 if( new_proto == PROTO_HTTPS ) 440 451 { 441 req->ssl = ssl_connect( new_host, new_port, http_ssl_connected, req );452 req->ssl = ssl_connect( new_host, new_port, TRUE, http_ssl_connected, req ); 442 453 if( req->ssl == NULL ) 443 454 error = 1; -
lib/ssl_bogus.c
r2d93a51e r792a93b 32 32 } 33 33 34 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )34 void *ssl_connect( char *host, int port, gboolean verify, ssl_input_function func, gpointer data ) 35 35 { 36 36 return( NULL ); … … 56 56 } 57 57 58 void *ssl_starttls( int fd, ssl_input_function func, gpointer data )58 void *ssl_starttls( int fd, char *hostname, gboolean verify, ssl_input_function func, gpointer data ) 59 59 { 60 60 return NULL; … … 70 70 return 0; 71 71 } 72 73 char *ssl_verify_strerror( int code ) 74 { 75 return NULL; 76 } -
lib/ssl_client.h
r2d93a51e r792a93b 37 37 /* Some generic error codes. Especially SSL_AGAIN is important if you 38 38 want to do asynchronous I/O. */ 39 #define NSS_VERIFY_ERROR -2 40 #define OPENSSL_VERIFY_ERROR -1 39 41 #define SSL_OK 0 40 42 #define SSL_NOHANDSHAKE 1 41 43 #define SSL_AGAIN 2 44 #define VERIFY_CERT_ERROR 2 45 #define VERIFY_CERT_INVALID 4 46 #define VERIFY_CERT_REVOKED 8 47 #define VERIFY_CERT_SIGNER_NOT_FOUND 16 48 #define VERIFY_CERT_SIGNER_NOT_CA 32 49 #define VERIFY_CERT_INSECURE_ALGORITHM 64 50 #define VERIFY_CERT_NOT_ACTIVATED 128 51 #define VERIFY_CERT_EXPIRED 256 52 #define VERIFY_CERT_WRONG_HOSTNAME 512 42 53 43 54 extern int ssl_errno; 44 55 45 56 /* This is what your callback function should look like. */ 46 typedef gboolean (*ssl_input_function)(gpointer, void*, b_input_condition);57 typedef gboolean (*ssl_input_function)(gpointer, int, void*, b_input_condition); 47 58 48 59 … … 53 64 ready to be used for SSL traffic. This is all done asynchronously, no 54 65 blocking I/O! (Except for the DNS lookups, for now...) */ 55 G_MODULE_EXPORT void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data );66 G_MODULE_EXPORT void *ssl_connect( char *host, int port, gboolean verify, ssl_input_function func, gpointer data ); 56 67 57 68 /* Start an SSL session on an existing fd. Useful for STARTTLS functionality, 58 69 for example in Jabber. */ 59 G_MODULE_EXPORT void *ssl_starttls( int fd, ssl_input_function func, gpointer data );70 G_MODULE_EXPORT void *ssl_starttls( int fd, char *hostname, gboolean verify, ssl_input_function func, gpointer data ); 60 71 61 72 /* Obviously you need special read/write functions to read data. */ … … 90 101 G_MODULE_EXPORT b_input_condition ssl_getdirection( void *conn ); 91 102 103 /* Converts a verification bitfield passed to ssl_input_function into 104 a more useful string. Or NULL if it had no useful bits set. */ 105 G_MODULE_EXPORT char *ssl_verify_strerror( int code ); 106 92 107 G_MODULE_EXPORT size_t ssl_des3_encrypt(const unsigned char *key, size_t key_len, const unsigned char *input, size_t input_len, const unsigned char *iv, unsigned char **res); -
lib/ssl_gnutls.c
r2d93a51e r792a93b 25 25 26 26 #include <gnutls/gnutls.h> 27 #include <gnutls/x509.h> 27 28 #include <gcrypt.h> 28 29 #include <fcntl.h> … … 32 33 #include "sock.h" 33 34 #include "stdlib.h" 35 #include "bitlbee.h" 34 36 35 37 int ssl_errno = 0; … … 54 56 gboolean established; 55 57 int inpa; 58 char *hostname; 59 gboolean verify; 56 60 57 61 gnutls_session session; … … 74 78 } 75 79 76 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )80 void *ssl_connect( char *host, int port, gboolean verify, ssl_input_function func, gpointer data ) 77 81 { 78 82 struct scd *conn = g_new0( struct scd, 1 ); … … 82 86 conn->data = data; 83 87 conn->inpa = -1; 88 conn->hostname = g_strdup( host ); 89 conn->verify = verify && global.conf->cafile; 84 90 85 91 if( conn->fd < 0 ) … … 92 98 } 93 99 94 void *ssl_starttls( int fd, ssl_input_function func, gpointer data )100 void *ssl_starttls( int fd, char *hostname, gboolean verify, ssl_input_function func, gpointer data ) 95 101 { 96 102 struct scd *conn = g_new0( struct scd, 1 ); … … 100 106 conn->data = data; 101 107 conn->inpa = -1; 108 conn->hostname = hostname; 109 110 /* For now, SSL verification is globally enabled by setting the cafile 111 setting in bitlbee.conf. Commented out by default because probably 112 not everyone has this file in the same place and plenty of folks 113 may not have the cert of their private Jabber server in it. */ 114 conn->verify = verify && global.conf->cafile; 102 115 103 116 /* This function should be called via a (short) timeout instead of … … 122 135 } 123 136 137 static int verify_certificate_callback( gnutls_session_t session ) 138 { 139 unsigned int status; 140 const gnutls_datum_t *cert_list; 141 unsigned int cert_list_size; 142 int gnutlsret; 143 int verifyret = 0; 144 gnutls_x509_crt_t cert; 145 const char *hostname; 146 147 hostname = gnutls_session_get_ptr(session ); 148 149 gnutlsret = gnutls_certificate_verify_peers2( session, &status ); 150 if( gnutlsret < 0 ) 151 return VERIFY_CERT_ERROR; 152 153 if( status & GNUTLS_CERT_INVALID ) 154 verifyret |= VERIFY_CERT_INVALID; 155 156 if( status & GNUTLS_CERT_REVOKED ) 157 verifyret |= VERIFY_CERT_REVOKED; 158 159 if( status & GNUTLS_CERT_SIGNER_NOT_FOUND ) 160 verifyret |= VERIFY_CERT_SIGNER_NOT_FOUND; 161 162 if( status & GNUTLS_CERT_SIGNER_NOT_CA ) 163 verifyret |= VERIFY_CERT_SIGNER_NOT_CA; 164 165 if( status & GNUTLS_CERT_INSECURE_ALGORITHM ) 166 verifyret |= VERIFY_CERT_INSECURE_ALGORITHM; 167 168 if( status & GNUTLS_CERT_NOT_ACTIVATED ) 169 verifyret |= VERIFY_CERT_NOT_ACTIVATED; 170 171 if( status & GNUTLS_CERT_EXPIRED ) 172 verifyret |= VERIFY_CERT_EXPIRED; 173 174 /* The following check is already performed inside 175 * gnutls_certificate_verify_peers2, so we don't need it. 176 177 * if( gnutls_certificate_type_get( session ) != GNUTLS_CRT_X509 ) 178 * return GNUTLS_E_CERTIFICATE_ERROR; 179 */ 180 181 if( gnutls_x509_crt_init( &cert ) < 0 ) 182 return VERIFY_CERT_ERROR; 183 184 cert_list = gnutls_certificate_get_peers( session, &cert_list_size ); 185 if( cert_list == NULL || gnutls_x509_crt_import( cert, &cert_list[0], GNUTLS_X509_FMT_DER ) < 0 ) 186 return VERIFY_CERT_ERROR; 187 188 if( !gnutls_x509_crt_check_hostname( cert, hostname ) ) 189 { 190 verifyret |= VERIFY_CERT_INVALID; 191 verifyret |= VERIFY_CERT_WRONG_HOSTNAME; 192 } 193 194 gnutls_x509_crt_deinit( cert ); 195 196 return verifyret; 197 } 198 199 char *ssl_verify_strerror( int code ) 200 { 201 GString *ret = g_string_new( "" ); 202 203 if( code & VERIFY_CERT_REVOKED ) 204 g_string_append( ret, "certificate has been revoked, " ); 205 if( code & VERIFY_CERT_SIGNER_NOT_FOUND ) 206 g_string_append( ret, "certificate hasn't got a known issuer, " ); 207 if( code & VERIFY_CERT_SIGNER_NOT_CA ) 208 g_string_append( ret, "certificate's issuer is not a CA, " ); 209 if( code & VERIFY_CERT_INSECURE_ALGORITHM ) 210 g_string_append( ret, "certificate uses an insecure algorithm, " ); 211 if( code & VERIFY_CERT_NOT_ACTIVATED ) 212 g_string_append( ret, "certificate has not been activated, " ); 213 if( code & VERIFY_CERT_EXPIRED ) 214 g_string_append( ret, "certificate has expired, " ); 215 if( code & VERIFY_CERT_WRONG_HOSTNAME ) 216 g_string_append( ret, "certificate hostname mismatch, " ); 217 218 if( ret->len == 0 ) 219 { 220 g_string_free( ret, TRUE ); 221 return NULL; 222 } 223 else 224 { 225 g_string_truncate( ret, ret->len - 2 ); 226 return g_string_free( ret, FALSE ); 227 } 228 } 229 124 230 static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond ) 125 231 { … … 128 234 if( source == -1 ) 129 235 { 130 conn->func( conn->data, NULL, cond );236 conn->func( conn->data, 0, NULL, cond ); 131 237 g_free( conn ); 132 238 return FALSE; … … 136 242 137 243 gnutls_certificate_allocate_credentials( &conn->xcred ); 244 if( conn->verify && global.conf->cafile ) 245 { 246 gnutls_certificate_set_x509_trust_file( conn->xcred, global.conf->cafile, GNUTLS_X509_FMT_PEM ); 247 gnutls_certificate_set_verify_flags( conn->xcred, GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT ); 248 } 249 138 250 gnutls_init( &conn->session, GNUTLS_CLIENT ); 251 if( conn->verify ) 252 gnutls_session_set_ptr( conn->session, (void *) conn->hostname ); 139 253 #if GNUTLS_VERSION_NUMBER < 0x020c00 140 254 gnutls_transport_set_lowat( conn->session, 0 ); … … 152 266 { 153 267 struct scd *conn = data; 154 int st ;268 int st, stver; 155 269 156 270 if( ( st = gnutls_handshake( conn->session ) ) < 0 ) … … 163 277 else 164 278 { 165 conn->func( conn->data, NULL, cond );279 conn->func( conn->data, 0, NULL, cond ); 166 280 167 281 gnutls_deinit( conn->session ); … … 174 288 else 175 289 { 176 /* For now we can't handle non-blocking perfectly everywhere... */ 177 sock_make_blocking( conn->fd ); 290 if( conn->verify && ( stver = verify_certificate_callback( conn->session ) ) != 0 ) 291 { 292 conn->func( conn->data, stver, NULL, cond ); 293 294 gnutls_deinit( conn->session ); 295 gnutls_certificate_free_credentials( conn->xcred ); 296 closesocket( conn->fd ); 297 298 g_free( conn ); 299 } 300 else 301 { 302 /* For now we can't handle non-blocking perfectly everywhere... */ 303 sock_make_blocking( conn->fd ); 178 304 179 conn->established = TRUE; 180 conn->func( conn->data, conn, cond ); 305 conn->established = TRUE; 306 conn->func( conn->data, 0, conn, cond ); 307 } 181 308 } 182 309 -
lib/ssl_nss.c
r2d93a51e r792a93b 52 52 PRFileDesc *prfd; 53 53 gboolean established; 54 gboolean verify; 54 55 }; 55 56 … … 102 103 } 103 104 104 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )105 void *ssl_connect( char *host, int port, gboolean verify, ssl_input_function func, gpointer data ) 105 106 { 106 107 struct scd *conn = g_new0( struct scd, 1 ); … … 132 133 } 133 134 134 void *ssl_starttls( int fd, ssl_input_function func, gpointer data )135 void *ssl_starttls( int fd, char *hostname, gboolean verify, ssl_input_function func, gpointer data ) 135 136 { 136 137 struct scd *conn = g_new0( struct scd, 1 ); … … 139 140 conn->func = func; 140 141 conn->data = data; 142 conn->verify = verify; 141 143 142 144 /* This function should be called via a (short) timeout instead of … … 157 159 { 158 160 struct scd *conn = data; 161 162 /* Right now we don't have any verification functionality for nss so we 163 fail in case verification has been requested by the user. */ 164 165 if( conn->verify ) 166 { 167 conn->func( conn->data, NSS_VERIFY_ERROR, NULL, cond ); 168 if( source >= 0 ) closesocket( source ); 169 g_free( conn ); 170 171 return FALSE; 172 } 159 173 160 174 if( source == -1 ) … … 177 191 178 192 conn->established = TRUE; 179 conn->func( conn->data, conn, cond );193 conn->func( conn->data, 0, conn, cond ); 180 194 return FALSE; 181 195 182 196 ssl_connected_failure: 183 197 184 conn->func( conn->data, NULL, cond );198 conn->func( conn->data, 0, NULL, cond ); 185 199 186 200 PR_Close( conn -> prfd ); … … 238 252 return B_EV_IO_READ; 239 253 } 254 255 char *ssl_verify_strerror( int code ) 256 { 257 return g_strdup( "SSL certificate verification not supported by BitlBee NSS code." ); 258 } -
lib/ssl_openssl.c
r2d93a51e r792a93b 45 45 int fd; 46 46 gboolean established; 47 gboolean verify; 47 48 48 49 int inpa; … … 64 65 } 65 66 66 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )67 void *ssl_connect( char *host, int port, gboolean verify, ssl_input_function func, gpointer data ) 67 68 { 68 69 struct scd *conn = g_new0( struct scd, 1 ); … … 82 83 } 83 84 84 void *ssl_starttls( int fd, ssl_input_function func, gpointer data )85 void *ssl_starttls( int fd, char *hostname, gboolean verify, ssl_input_function func, gpointer data ) 85 86 { 86 87 struct scd *conn = g_new0( struct scd, 1 ); … … 90 91 conn->data = data; 91 92 conn->inpa = -1; 93 conn->verify = verify; 92 94 93 95 /* This function should be called via a (short) timeout instead of … … 117 119 SSL_METHOD *meth; 118 120 121 /* Right now we don't have any verification functionality for openssl so we 122 fail in case verification has been requested by the user. */ 123 124 if( conn->verify ) 125 { 126 conn->func( conn->data, OPENSSL_VERIFY_ERROR, NULL, cond ); 127 if( source >= 0 ) closesocket( source ); 128 g_free( conn ); 129 130 return FALSE; 131 } 132 119 133 if( source == -1 ) 120 134 goto ssl_connected_failure; … … 141 155 142 156 ssl_connected_failure: 143 conn->func( conn->data, NULL, cond );157 conn->func( conn->data, 0, NULL, cond ); 144 158 145 159 if( conn->ssl ) … … 169 183 if( conn->lasterr != SSL_ERROR_WANT_READ && conn->lasterr != SSL_ERROR_WANT_WRITE ) 170 184 { 171 conn->func( conn->data, NULL, cond );185 conn->func( conn->data, 0, NULL, cond ); 172 186 173 187 SSL_shutdown( conn->ssl ); … … 187 201 conn->established = TRUE; 188 202 sock_make_blocking( conn->fd ); /* For now... */ 189 conn->func( conn->data, conn, cond );203 conn->func( conn->data, 0, conn, cond ); 190 204 return FALSE; 191 205 } … … 272 286 { 273 287 return( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ? B_EV_IO_WRITE : B_EV_IO_READ ); 288 } 289 290 char *ssl_verify_strerror( int code ) 291 { 292 return g_strdup( "SSL certificate verification not supported by BitlBee OpenSSL code." ); 274 293 } 275 294 -
protocols/jabber/io.c
r2d93a51e r792a93b 279 279 } 280 280 281 gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition cond )281 gboolean jabber_connected_ssl( gpointer data, int returncode, void *source, b_input_condition cond ) 282 282 { 283 283 struct im_connection *ic = data; … … 295 295 jd->ssl = NULL; 296 296 297 imcb_error( ic, "Could not connect to server" ); 298 imc_logout( ic, TRUE ); 297 if( returncode != 0 ) 298 { 299 char *err = ssl_verify_strerror( returncode ); 300 imcb_error( ic, "Certificate verification problem 0x%x: %s", 301 returncode, err ? err : "Unknown" ); 302 g_free( err ); 303 imc_logout( ic, FALSE ); 304 } 305 else 306 { 307 imcb_error( ic, "Could not connect to server" ); 308 imc_logout( ic, TRUE ); 309 } 310 299 311 return FALSE; 300 312 } … … 400 412 struct im_connection *ic = data; 401 413 struct jabber_data *jd = ic->proto_data; 402 char *xmlns ;414 char *xmlns, *tlsname; 403 415 404 416 xmlns = xt_find_attr( node, "xmlns" ); … … 426 438 427 439 jd->flags |= JFLAG_STARTTLS_DONE; 428 jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); 440 441 /* If the user specified a server for the account, use this server as the 442 * hostname in the certificate verification. Else we use the domain from 443 * the username. */ 444 if( ic->acc->server && *ic->acc->server ) 445 tlsname = ic->acc->server; 446 else 447 tlsname = jd->server; 448 449 jd->ssl = ssl_starttls( jd->fd, tlsname, set_getbool( &ic->acc->set, "tls_verify" ), 450 jabber_connected_ssl, ic ); 429 451 430 452 return XT_HANDLED; -
protocols/jabber/jabber.c
r2d93a51e r792a93b 80 80 81 81 s = set_add( &acc->set, "tls", "try", set_eval_tls, acc ); 82 s->flags |= ACC_SET_OFFLINE_ONLY; 83 84 s = set_add( &acc->set, "tls_verify", "true", set_eval_bool, acc ); 82 85 s->flags |= ACC_SET_OFFLINE_ONLY; 83 86 … … 233 236 if( set_getbool( &acc->set, "ssl" ) ) 234 237 { 235 jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), jabber_connected_ssl, ic );238 jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), FALSE, jabber_connected_ssl, ic ); 236 239 jd->fd = jd->ssl ? ssl_getfd( jd->ssl ) : -1; 237 240 } -
protocols/jabber/jabber.h
r2d93a51e r792a93b 309 309 int jabber_write( struct im_connection *ic, char *buf, int len ); 310 310 gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond ); 311 gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition cond );311 gboolean jabber_connected_ssl( gpointer data, int returncode, void *source, b_input_condition cond ); 312 312 gboolean jabber_start_stream( struct im_connection *ic ); 313 313 void jabber_end_stream( struct im_connection *ic ); -
protocols/msn/soap.c
r2d93a51e r792a93b 60 60 struct im_connection *ic; 61 61 int ttl; 62 char *error; 62 63 63 64 char *url, *action, *payload; … … 158 159 } 159 160 161 if( http_req->status_code != 200 ) 162 soap_req->error = g_strdup( http_req->status_string ); 163 160 164 st = soap_req->handle_response( soap_req ); 161 165 … … 164 168 g_free( soap_req->action ); 165 169 g_free( soap_req->payload ); 166 soap_req->url = soap_req->action = soap_req->payload = NULL; 170 g_free( soap_req->error ); 171 soap_req->url = soap_req->action = soap_req->payload = soap_req->error = NULL; 167 172 168 173 if( st == MSN_SOAP_RETRY && --soap_req->ttl ) … … 253 258 g_free( soap_req->action ); 254 259 g_free( soap_req->payload ); 260 g_free( soap_req->error ); 255 261 g_free( soap_req ); 256 262 } … … 410 416 if( sd->secret == NULL ) 411 417 { 412 msn_auth_got_passport_token( ic, NULL, sd->error );418 msn_auth_got_passport_token( ic, NULL, sd->error ? sd->error : soap_req->error ); 413 419 return MSN_SOAP_OK; 414 420 } -
protocols/skype/skype.c
r2d93a51e r792a93b 1157 1157 } 1158 1158 1159 gboolean skype_connected(gpointer data, void *source, b_input_condition cond)1159 gboolean skype_connected(gpointer data, int returncode, void *source, b_input_condition cond) 1160 1160 { 1161 1161 struct im_connection *ic = data; … … 1185 1185 imcb_log(ic, "Connecting"); 1186 1186 sd->ssl = ssl_connect(set_getstr(&acc->set, "server"), 1187 set_getint(&acc->set, "port"), skype_connected, ic);1187 set_getint(&acc->set, "port"), FALSE, skype_connected, ic); 1188 1188 sd->fd = sd->ssl ? ssl_getfd(sd->ssl) : -1; 1189 1189 sd->username = g_strdup(acc->user);
Note: See TracChangeset
for help on using the changeset viewer.