Changeset 486ddb5 for lib/ssl_openssl.c
- Timestamp:
- 2011-12-19T14:50:58Z (13 years ago)
- Branches:
- master
- Children:
- 78b8401
- Parents:
- 5a48afd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/ssl_openssl.c
r5a48afd r486ddb5 45 45 int fd; 46 46 gboolean established; 47 gboolean verify; 47 48 48 49 int inpa; … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.