After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745099 - TLS session resume doesn't work properly with TLS Session tickets
TLS session resume doesn't work properly with TLS Session tickets
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
2.43.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 526582 745255
 
 
Reported: 2015-02-24 17:27 UTC by Ross Lagerwall
Modified: 2015-03-10 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tls: Only cache session data if a session was not resumed (2.04 KB, patch)
2015-02-24 17:28 UTC, Ross Lagerwall
none Details | Review
tls: Only cache session data if a session was not resumed (2.10 KB, patch)
2015-02-26 23:30 UTC, Ross Lagerwall
none Details | Review
tls: Only cache session data if a session was not resumed (2.75 KB, patch)
2015-03-08 22:57 UTC, Ross Lagerwall
committed Details | Review

Description Ross Lagerwall 2015-02-24 17:27:30 UTC
From http://lists.gnutls.org/pipermail/gnutls-help/2015-February/003760.html:

glib-networking (which uses gnutls) has a session cache such that after
a connection handshake completes, it uses gnutls_session_get_data2 to
retrieve and keep the session data. When another connection begins, it
uses gnutls_session_set_data to reuse the data.

However, this does not work properly with TLS tickets.  After a session is
resumed, the TLS tickets get stored in "resumed session data" which is
not subsequently packed into the TLS session data again.  Because of
this, the third connection to a particular server is not properly resumed
because the session data is missing the TLS tickets.
Comment 1 Ross Lagerwall 2015-02-24 17:28:18 UTC
Created attachment 297788 [details] [review]
tls: Only cache session data if a session was not resumed

As per the upstream discussion [1], session data should only be
stored when the session is not resumed.

This affects resuming sessions when using TLS tickets, since they
are not stored in the session data after a save/resume cycle.

[1] http://lists.gnutls.org/pipermail/gnutls-help/2015-February/003760.html
Comment 2 Ross Lagerwall 2015-02-26 23:30:46 UTC
Created attachment 298046 [details] [review]
tls: Only cache session data if a session was not resumed

As per the upstream discussion [1], session data should only be
stored when the session is not resumed.

This affects resuming sessions when using TLS tickets, since they
are not stored in the session data after a save/resume cycle.

[1] http://lists.gnutls.org/pipermail/gnutls-help/2015-February/003760.html
Comment 3 Dan Winship 2015-03-03 19:11:55 UTC
Comment on attachment 298046 [details] [review]
tls: Only cache session data if a session was not resumed

It would be better to rearrange the code so that we don't call gnutls_session_get_data2() if the session is resumed (so that we don't then have to call gnutls_free(session_datum.data))
Comment 4 Ross Lagerwall 2015-03-08 22:57:52 UTC
Created attachment 298843 [details] [review]
tls: Only cache session data if a session was not resumed

As per the upstream discussion [1], session data should only be
stored when the session is not resumed.

This affects resuming sessions when using TLS tickets, since they
are not stored in the session data after a save/resume cycle.

[1] http://lists.gnutls.org/pipermail/gnutls-help/2015-February/003760.html
Comment 5 Ross Lagerwall 2015-03-08 22:58:29 UTC
(In reply to Dan Winship from comment #3)
> Comment on attachment 298046 [details] [review] [review]
> tls: Only cache session data if a session was not resumed
> 
> It would be better to rearrange the code so that we don't call
> gnutls_session_get_data2() if the session is resumed (so that we don't then
> have to call gnutls_free(session_datum.data))

OK, done!
Comment 6 Ross Lagerwall 2015-03-10 17:49:55 UTC
Comment on attachment 298843 [details] [review]
tls: Only cache session data if a session was not resumed

Pushed to master as da9c6df0e7c0a9e565b07492ef859be878bae42f. Thanks for the review.