Changeset 164352e for lib/ssl_nss.c
- Timestamp:
- 2011-12-24T18:02:39Z (13 years ago)
- Branches:
- master
- Children:
- 34ded90
- Parents:
- e306fbf (diff), 96f954d (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/ssl_nss.c
re306fbf r164352e 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 && global.conf->cafile; 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. */ 163 164 if( conn->verify ) 165 { 166 conn->func( conn->data, 1, NULL, cond ); 167 if( source >= 0 ) closesocket( source ); 168 g_free( conn ); 169 170 return FALSE; 171 } 159 172 160 173 if( source == -1 ) … … 177 190 178 191 conn->established = TRUE; 179 conn->func( conn->data, conn, cond );192 conn->func( conn->data, 0, conn, cond ); 180 193 return FALSE; 181 194 182 195 ssl_connected_failure: 183 196 184 conn->func( conn->data, NULL, cond );197 conn->func( conn->data, 0, NULL, cond ); 185 198 186 199 PR_Close( conn -> prfd ); … … 238 251 return B_EV_IO_READ; 239 252 } 253 254 char *ssl_verify_strerror( int code ) 255 { 256 return g_strdup( "SSL certificate verification not supported by BitlBee NSS code." ); 257 }
Note: See TracChangeset
for help on using the changeset viewer.