Changeset cc6fdf8 for lib/ssl_gnutls.c
- Timestamp:
- 2012-12-22T00:14:26Z (11 years ago)
- Branches:
- master
- Children:
- 7d5afa6
- Parents:
- 92d3044 (diff), 573e274 (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_gnutls.c
r92d3044 rcc6fdf8 38 38 39 39 static gboolean initialized = FALSE; 40 gnutls_certificate_credentials xcred;40 gnutls_certificate_credentials_t xcred; 41 41 42 42 #include <limits.h> … … 60 60 gboolean verify; 61 61 62 gnutls_session session;62 gnutls_session_t session; 63 63 }; 64 64 … … 134 134 conn->data = data; 135 135 conn->inpa = -1; 136 conn->hostname = hostname;136 conn->hostname = g_strdup( hostname ); 137 137 138 138 /* For now, SSL verification is globally enabled by setting the cafile … … 171 171 int verifyret = 0; 172 172 gnutls_x509_crt_t cert; 173 const char *hostname;174 175 hostname= gnutls_session_get_ptr( session );173 struct scd *conn; 174 175 conn = gnutls_session_get_ptr( session ); 176 176 177 177 gnutlsret = gnutls_certificate_verify_peers2( session, &status ); … … 211 211 return VERIFY_CERT_ERROR; 212 212 213 if( !gnutls_x509_crt_check_hostname( cert, hostname ) )213 if( !gnutls_x509_crt_check_hostname( cert, conn->hostname ) ) 214 214 { 215 215 verifyret |= VERIFY_CERT_INVALID; … … 267 267 268 268 gnutls_init( &conn->session, GNUTLS_CLIENT ); 269 if( conn->verify ) 270 gnutls_session_set_ptr( conn->session, (void *) conn->hostname ); 269 gnutls_session_set_ptr( conn->session, (void *) conn ); 271 270 #if GNUTLS_VERSION_NUMBER < 0x020c00 272 271 gnutls_transport_set_lowat( conn->session, 0 ); … … 276 275 277 276 sock_make_nonblocking( conn->fd ); 278 gnutls_transport_set_ptr( conn->session, (gnutls_transport_ptr ) GNUTLS_STUPID_CAST conn->fd );277 gnutls_transport_set_ptr( conn->session, (gnutls_transport_ptr_t) GNUTLS_STUPID_CAST conn->fd ); 279 278 280 279 return ssl_handshake( data, source, cond ); … … 402 401 if( conn->session ) 403 402 gnutls_deinit( conn->session ); 403 g_free( conn->hostname ); 404 404 g_free( conn ); 405 405 }
Note: See TracChangeset
for help on using the changeset viewer.