Git Product home page Git Product logo

Comments (5)

davidben avatar davidben commented on May 25, 2024 1

This kind of issue, combined with observing the original API did not work when upgrading TLS 1.2 to TLS 1.3, was why we removed the custom extensions API in BoringSSL. (BoringSSL does not use custom extensions to implement its QUIC API. We just taught the library how to handle the various QUIC extensions.)

While it's handy to allow callers to add extensions without the TLS library supporting them, it conflicts with wanting to be able to evolve the TLS library backwards-compatibly. We prefer APIs with semantics that can survive the TLS library moving to new versions or adopting new features.

from openssl.

nhorman avatar nhorman commented on May 25, 2024

I'm not sure I completely follow here:

  1. To the question of who wins when custom extensions are registered twice, ossl_tls_add_custom_ext_intern checks for internal support prior to allowing the registration of an extension, so in that case OpenSSL wins, and, as you note, we are left with the unforseen potential change in behavior from end users. However, it would seem to me that custom extensions are only added when ratified by a standards document so (in an ideal world) the behavior should match, or at least be in compliance with whatever standard its added against. I understand that may not always occur

  2. As for why quic implements a custom extension (I assume you're referring to the SSL_EXT_TLS1_3_ENCRYPTED_EXTENSION), I would guess that we weren't in a position to support that extension in TCP TLS or DTLS, but I'm unsure.

Ostensibly, if you were backporting borinssl implementations of QUIC to openssl 3.3, that should be done with openssls quic support disabled (but I'm just guessing there)

@hlandau @mattcaswell can you please comment here?

from openssl.

wbl avatar wbl commented on May 25, 2024

With 1 there's a problem where the extension communicates additional data that the application provides or vice versa. Whatever mechanism was used in the custom handler is not available to openssl, so the behavior will not match. I think we need to consider having custom handlers take priority if we want to really have compatibility.

With 2: why not use the boringssl api and build the openssl quic on top if this layering is an issue? Applications have two different nonconflicting paths to set up an SSL object: for the Boring API they call a specific function, for the OpenSSL one they inject a specific SSL method. I wouldn't be surprised if there are some rough edges, but it's conceptually doable.

Forcing a choice here means that administrators and vendors of shared libraries have to pick one or the other, with consequences for shipping applications today that use QUIC that we need to support, and for further applications that have to decide what QUIC stack to support. I suspect that particularly for servers the existing, deployed today server side stacks would win out over future unproven work.

from openssl.

mattcaswell avatar mattcaswell commented on May 25, 2024

As for why quic implements a custom extension (I assume you're referring to the SSL_EXT_TLS1_3_ENCRYPTED_EXTENSION), I would guess that we weren't in a position to support that extension in TCP TLS or DTLS, but I'm unsure

I assume @wbl is referring to this code:

openssl/ssl/quic/quic_tls.c

Lines 758 to 768 in 067fbc0

if (!ossl_tls_add_custom_ext_intern(NULL, &sc->cert->custext,
qtls->args.is_server ? ENDPOINT_SERVER
: ENDPOINT_CLIENT,
TLSEXT_TYPE_quic_transport_parameters,
SSL_EXT_TLS1_3_ONLY
| SSL_EXT_CLIENT_HELLO
| SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS,
add_transport_params_cb,
free_transport_params_cb, qtls,
parse_transport_params_cb, qtls))
return RAISE_INTERNAL_ERROR(qtls);

At the time of writing that code I was seeking to keep the changes required to support QUIC in the core TLS code to an absolute minimum. I had refactored the record layer to enable the setting of a custom record layer. That enabled the QUIC code to set its own record layer without introducing knowledge of QUIC into the core TLS code. By the same thinking, this extension was something only useful for QUIC so I was seeking to keep it within the QUIC code, and so chose to use a custom extension to do that. It is certainly a valid alternative design to implement the extension in the normal way - but that would require the core TLS extensions code to be modified in some way to know only to use the extension in QUIC (probably with some extra "context" flag, e.g. SSL_EXT_QUIC_ONLY)

from openssl.

hlandau avatar hlandau commented on May 25, 2024

@wbl To be clear — the custom extension (QUIC Transport Parameters) is only added by the QUIC code. So if you aren't using the OpenSSL QUIC stack, it shouldn't be causing any problems if you are trying to add QUIC Transport Parameters as a custom extension itself (even if OpenSSL is compiled with QUIC support enabled).

I'm not sure if that answers your question — let me know.

from openssl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.