Skip to content

Regression: Tor's use of SSL_export_keying_material() broken with TLS 1.3 in Openssl 1.1.1a #7712

Closed

Description

@nmathewson

Hello! Commit ec0c5f5, "Reduce stack usage in tls13_hkdf_expand", breaks TLS1.3 when used with Tor.

The idea behind this commit, if I understand correctly, was to save stack space in tls13_hkdf_expand by lowering TLS13_MAX_LABEL_LEN, on the theory that TLS itself never uses any labels longer than 12 characters.

But the problem here is that the tls13_hkdf_expand function is also reachable from SSL_export_keying_material(), which is a public API. As part of its handshake, Tor invokes this function with a 44-byte label. This is no longer supported by OpenSSL 1.1.1a.

If we were to change Tor to use a shorter label, we'd break backward compatibility.

The simplest solution here would be to revert ec0c5f5.

References:

#7297 is the original PR that introduced this problem for us.

https://trac.torproject.org/projects/tor/ticket/28616 is the Tor bug.

Activity

  1. mattcaswell commented on Nov 27, 2018

    @mattcaswell
    Member

    Darn. Yes that does seem to be a sensible solution. Ping @bernd-edlinger.

  2. bernd-edlinger commented on Nov 28, 2018

    @bernd-edlinger
    Member

    Agreed, maybe leave the "static" labelprefix in place.
    Bit I wonder how the caller should know of the 248 byte limit then....
    @mattcaswell could you please take care of this, thanks!

  3. added a commit that references this issue on Dec 4, 2018
    cbad0a6
  4. mattcaswell commented on Dec 4, 2018

    @mattcaswell
    Member

    Fix in #7755

  5. added a commit that references this issue on Dec 5, 2018
    56e0f12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions