@@ -46,14 +46,9 @@ typedef struct _GTlsClientConnectionOpensslPrivate
4646 GTlsCertificateFlags validation_flags ;
4747 GSocketConnectable * server_identity ;
4848 gboolean use_ssl3 ;
49- gboolean session_data_override ;
50-
51- GBytes * session_id ;
52- GBytes * session_data ;
5349
5450 STACK_OF (X509_NAME ) * ca_list ;
5551
56- SSL_SESSION * session ;
5752 SSL * ssl ;
5853 SSL_CTX * ssl_ctx ;
5954} GTlsClientConnectionOpensslPrivate ;
@@ -89,8 +84,6 @@ g_tls_client_connection_openssl_finalize (GObject *object)
8984 priv = g_tls_client_connection_openssl_get_instance_private (openssl );
9085
9186 g_clear_object (& priv -> server_identity );
92- g_clear_pointer (& priv -> session_id , g_bytes_unref );
93- g_clear_pointer (& priv -> session_data , g_bytes_unref );
9487
9588 SSL_free (priv -> ssl );
9689 SSL_CTX_free (priv -> ssl_ctx );
@@ -204,53 +197,6 @@ g_tls_client_connection_openssl_set_property (GObject *object,
204197 }
205198}
206199
207- static void
208- g_tls_client_connection_openssl_constructed (GObject * object )
209- {
210- GTlsClientConnectionOpenssl * openssl = G_TLS_CLIENT_CONNECTION_OPENSSL (object );
211- GTlsClientConnectionOpensslPrivate * priv ;
212- GSocketConnection * base_conn ;
213- GSocketAddress * remote_addr ;
214- GInetAddress * iaddr ;
215- guint port ;
216-
217- priv = g_tls_client_connection_openssl_get_instance_private (openssl );
218-
219- /* Create a TLS session ID. We base it on the IP address since
220- * different hosts serving the same hostname/service will probably
221- * not share the same session cache. We base it on the
222- * server-identity because at least some servers will fail (rather
223- * than just failing to resume the session) if we don't.
224- * (https://bugs.launchpad.net/bugs/823325)
225- */
226- g_object_get (G_OBJECT (openssl ), "base-io-stream" , & base_conn , NULL );
227- if (G_IS_SOCKET_CONNECTION (base_conn ))
228- {
229- remote_addr = g_socket_connection_get_remote_address (base_conn , NULL );
230- if (G_IS_INET_SOCKET_ADDRESS (remote_addr ))
231- {
232- GInetSocketAddress * isaddr = G_INET_SOCKET_ADDRESS (remote_addr );
233- const gchar * server_hostname ;
234- gchar * addrstr , * session_id ;
235-
236- iaddr = g_inet_socket_address_get_address (isaddr );
237- port = g_inet_socket_address_get_port (isaddr );
238-
239- addrstr = g_inet_address_to_string (iaddr );
240- server_hostname = get_server_identity (openssl );
241- session_id = g_strdup_printf ("%s/%s/%d" , addrstr ,
242- server_hostname ? server_hostname : "" ,
243- port );
244- priv -> session_id = g_bytes_new_take (session_id , strlen (session_id ));
245- g_free (addrstr );
246- }
247- g_object_unref (remote_addr );
248- }
249- g_object_unref (base_conn );
250-
251- G_OBJECT_CLASS (g_tls_client_connection_openssl_parent_class )-> constructed (object );
252- }
253-
254200static GTlsConnectionBaseStatus
255201g_tls_client_connection_openssl_handshake (GTlsConnectionBase * tls ,
256202 GCancellable * cancellable ,
@@ -304,7 +250,6 @@ g_tls_client_connection_openssl_class_init (GTlsClientConnectionOpensslClass *kl
304250 gobject_class -> finalize = g_tls_client_connection_openssl_finalize ;
305251 gobject_class -> get_property = g_tls_client_connection_openssl_get_property ;
306252 gobject_class -> set_property = g_tls_client_connection_openssl_set_property ;
307- gobject_class -> constructed = g_tls_client_connection_openssl_constructed ;
308253
309254 base_class -> handshake = g_tls_client_connection_openssl_handshake ;
310255 base_class -> complete_handshake = g_tls_client_connection_openssl_complete_handshake ;
@@ -391,24 +336,6 @@ retrieve_certificate (SSL *ssl,
391336 return 0 ;
392337}
393338
394- static int
395- generate_session_id (const SSL * ssl ,
396- unsigned char * id ,
397- unsigned int * id_len )
398- {
399- GTlsClientConnectionOpenssl * client ;
400- GTlsClientConnectionOpensslPrivate * priv ;
401- int len ;
402-
403- client = SSL_get_ex_data (ssl , data_index );
404- priv = g_tls_client_connection_openssl_get_instance_private (client );
405-
406- len = MIN (* id_len , g_bytes_get_size (priv -> session_id ));
407- memcpy (id , g_bytes_get_data (priv -> session_id , NULL ), len );
408-
409- return 1 ;
410- }
411-
412339static gboolean
413340g_tls_client_connection_openssl_initable_init (GInitable * initable ,
414341 GCancellable * cancellable ,
@@ -420,8 +347,6 @@ g_tls_client_connection_openssl_initable_init (GInitable *initable,
420347
421348 priv = g_tls_client_connection_openssl_get_instance_private (client );
422349
423- priv -> session = SSL_SESSION_new ();
424-
425350 priv -> ssl_ctx = SSL_CTX_new (SSLv23_client_method ());
426351 if (priv -> ssl_ctx == NULL )
427352 {
@@ -453,9 +378,6 @@ g_tls_client_connection_openssl_initable_init (GInitable *initable,
453378 }
454379#endif
455380
456- SSL_CTX_set_generate_session_id (priv -> ssl_ctx , generate_session_id );
457- SSL_CTX_add_session (priv -> ssl_ctx , priv -> session );
458-
459381 SSL_CTX_set_client_cert_cb (priv -> ssl_ctx , retrieve_certificate );
460382
461383 SSL_CTX_set_cipher_list (priv -> ssl_ctx , "HIGH:!DSS:!aNULL@STRENGTH" );
0 commit comments