Skip to content

Commit

Permalink
Update to draft-ietf-tls-esni-13.
Browse files Browse the repository at this point in the history
Later CLs will clean up the ClientHello construction a bit (draft-12
avoids computing ClientHelloOuter twice). I suspect the transcript
handling on the client can also be simpler, but I'll see what's
convenient after I've changed how ClientHelloOuter is constructed.

Changes of note between draft-10 and draft-13:

- There is now an ECH confirmation signal in both HRR and SH. We don't
  actually make much use of this in our client right now, but it
  resolves a bunch of weird issues around HRR, including edge cases if
  HRR applies to one ClientHello but not the other.

- The confirmation signal no longer depends on key_share and PSK, so we
  don't have to work around a weird ordering issue.

- ech_is_inner is now folded into the main encrypted_client_hello code
  point. This works better with some stuff around HRR.

- Padding is moved from the padding extension, computed with
  ClientHelloInner, to something we fill in afterwards. This makes it
  easier to pad up the whole thing to a multiple of 32. I've accordingly
  updated to the latest recommended padding construction, and updated
  the GREASE logic to match.

- ech_outer_extensions is much easier to process because the order is
  required to be consistent. We were doing that anyway, and now a simple
  linear scan works.

- ClientHelloOuterAAD now uses an all zero placeholder payload of the
  same length. This lets us simplify the server code, but, for now, I've
  kept the client code the same. I'll follow this up with a CL to avoid
  computing ClientHelloOuter twice.

- ClientHelloOuterAAD is allowed to contain a placeholder PSK. I haven't
  filled that in and will do it in a follow-up CL.

Bug: 275
Change-Id: I7464345125c53968b2fe692f9268e392120fc2eb
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/48912
Commit-Queue: David Benjamin <[email protected]>
Reviewed-by: Adam Langley <[email protected]>
  • Loading branch information
davidben authored and Boringssl LUCI CQ committed Sep 1, 2021
1 parent 37a3c70 commit 18b6836
Show file tree
Hide file tree
Showing 20 changed files with 1,429 additions and 1,164 deletions.
2 changes: 2 additions & 0 deletions crypto/err/ssl.errordata
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ SSL,155,HTTPS_PROXY_REQUEST
SSL,156,HTTP_REQUEST
SSL,157,INAPPROPRIATE_FALLBACK
SSL,303,INCONSISTENT_CLIENT_HELLO
SSL,321,INCONSISTENT_ECH_NEGOTIATION
SSL,259,INVALID_ALPN_PROTOCOL
SSL,315,INVALID_ALPN_PROTOCOL_LIST
SSL,314,INVALID_CLIENT_HELLO_INNER
Expand Down Expand Up @@ -132,6 +133,7 @@ SSL,289,OCSP_CB_ERROR
SSL,187,OLD_SESSION_CIPHER_NOT_RETURNED
SSL,268,OLD_SESSION_PRF_HASH_MISMATCH
SSL,188,OLD_SESSION_VERSION_NOT_RETURNED
SSL,320,OUTER_EXTENSION_NOT_FOUND
SSL,189,OUTPUT_ALIASES_INPUT
SSL,190,PARSE_TLSEXT
SSL,191,PATH_TOO_LONG
Expand Down
4 changes: 3 additions & 1 deletion include/openssl/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3569,7 +3569,7 @@ OPENSSL_EXPORT const char *SSL_early_data_reason_string(
//
// ECH support in BoringSSL is still experimental and under development.
//
// See https://tools.ietf.org/html/draft-ietf-tls-esni-10.
// See https://tools.ietf.org/html/draft-ietf-tls-esni-13.

// SSL_set_enable_ech_grease configures whether the client will send a GREASE
// ECH extension when no supported ECHConfig is available.
Expand Down Expand Up @@ -5548,6 +5548,8 @@ BSSL_NAMESPACE_END
#define SSL_R_INVALID_ECH_PUBLIC_NAME 317
#define SSL_R_INVALID_ECH_CONFIG_LIST 318
#define SSL_R_ECH_REJECTED 319
#define SSL_R_OUTER_EXTENSION_NOT_FOUND 320
#define SSL_R_INCONSISTENT_ECH_NEGOTIATION 321
#define SSL_R_SSLV3_ALERT_CLOSE_NOTIFY 1000
#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
Expand Down
7 changes: 3 additions & 4 deletions include/openssl/tls1.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ extern "C" {
#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115
#define TLS1_AD_CERTIFICATE_REQUIRED 116
#define TLS1_AD_NO_APPLICATION_PROTOCOL 120
#define TLS1_AD_ECH_REQUIRED 121 // draft-ietf-tls-esni-10
#define TLS1_AD_ECH_REQUIRED 121 // draft-ietf-tls-esni-13

// ExtensionType values from RFC 6066
#define TLSEXT_TYPE_server_name 0
Expand Down Expand Up @@ -246,10 +246,9 @@ extern "C" {
// extension number.
#define TLSEXT_TYPE_application_settings 17513

// ExtensionType values from draft-ietf-tls-esni-10. This is not an IANA defined
// ExtensionType values from draft-ietf-tls-esni-13. This is not an IANA defined
// extension number.
#define TLSEXT_TYPE_encrypted_client_hello 0xfe0a
#define TLSEXT_TYPE_ech_is_inner 0xda09
#define TLSEXT_TYPE_encrypted_client_hello 0xfe0d
#define TLSEXT_TYPE_ech_outer_extensions 0xfd00

// ExtensionType value from RFC 6962
Expand Down
Loading

0 comments on commit 18b6836

Please sign in to comment.