tls: Add support for copying session data
authorRoss Lagerwall <rosslagerwall@gmail.com>
Thu, 26 Feb 2015 22:24:36 +0000 (22:24 +0000)
committerRoss Lagerwall <rosslagerwall@gmail.com>
Mon, 6 Apr 2015 13:54:12 +0000 (14:54 +0100)
commit95d300eac58e6e6a7d57ce50896a7c656ebe78cf
tree70e8fcd689868d03212b7b571be06f5ee38bcf0b
parenteac975c68225e3c7d5ae21dbf382d6e5b6b02824
tls: Add support for copying session data

Add support for copying session data between client connections.
This is needed for implementing FTP over SSL. Most servers use a separate
session for each control connection and enforce sharing of each control
connection's session between the related data connection.

Copying session data between two connections is needed for two reasons:
1) The data connection runs on a separate port and so has a different
server_identity which means it would not normally share the session with
the control connection using the session caching currently implemented.
2) It is typical to have multiple control connections, each of which
uses a different session with the same server_identity, so only one of
these sessions gets stored in the cache. If a data connection is opened,
(ignoring the port issue) it may try and reuse the wrong control
connection's session, and fail.

This operation is conceptually the same as OpenSSL's SSL_copy_session_id
operation.

https://bugzilla.gnome.org/show_bug.cgi?id=745255
gio/gtlsclientconnection.c
gio/gtlsclientconnection.h