draft-ietf-tls-ctls-02.txt   draft-ietf-tls-ctls-03.txt 
TLS Working Group E. Rescorla TLS Working Group E. Rescorla
Internet-Draft Mozilla Internet-Draft Mozilla
Intended status: Informational R. Barnes Intended status: Standards Track R. Barnes
Expires: 6 November 2021 Cisco Expires: January 13, 2022 Cisco
H. Tschofenig H. Tschofenig
Arm Limited Arm Limited
5 May 2021 July 12, 2021
Compact TLS 1.3 Compact TLS 1.3
draft-ietf-tls-ctls-02 draft-ietf-tls-ctls-03
Abstract Abstract
This document specifies a "compact" version of TLS 1.3. It is This document specifies a "compact" version of TLS 1.3. It is
isomorphic to TLS 1.3 but saves space by trimming obsolete material, isomorphic to TLS 1.3 but saves space by trimming obsolete material,
tighter encoding, and a template-based specialization technique. cTLS tighter encoding, and a template-based specialization technique. cTLS
is not directly interoperable with TLS 1.3, but it should eventually is not directly interoperable with TLS 1.3, but it should eventually
be possible for a cTLS/TLS 1.3 server to exist and successfully be possible for a cTLS/TLS 1.3 server to exist and successfully
interoperate. interoperate.
skipping to change at page 1, line 38 skipping to change at page 1, line 38
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 6 November 2021. This Internet-Draft will expire on January 13, 2022.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents
license-info) in effect on the date of publication of this document. (https://trustee.ietf.org/license-info) in effect on the date of
Please review these documents carefully, as they describe your rights publication of this document. Please review these documents
and restrictions with respect to this document. Code Components carefully, as they describe your rights and restrictions with respect
extracted from this document must include Simplified BSD License text to this document. Code Components extracted from this document must
as described in Section 4.e of the Trust Legal Provisions and are include Simplified BSD License text as described in Section 4.e of
provided without warranty as described in the Simplified BSD License. the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Conventions and Definitions . . . . . . . . . . . . . . . . . 3 2. Conventions and Definitions . . . . . . . . . . . . . . . . . 3
3. Common Primitives . . . . . . . . . . . . . . . . . . . . . . 3 3. Common Primitives . . . . . . . . . . . . . . . . . . . . . . 3
3.1. Varints . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.1. Varints . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2. Record Layer . . . . . . . . . . . . . . . . . . . . . . 4 3.2. Template-based Specialization . . . . . . . . . . . . . . 4
3.3. Handshake Layer . . . . . . . . . . . . . . . . . . . . . 6 3.2.1. Requirements on TLS Implementations . . . . . . . . . 8
4. Handshake Messages . . . . . . . . . . . . . . . . . . . . . 7 3.2.2. Predefined Extensions . . . . . . . . . . . . . . . . 8
4.1. ClientHello . . . . . . . . . . . . . . . . . . . . . . . 7 3.2.3. Known Certificates . . . . . . . . . . . . . . . . . 9
4.2. ServerHello . . . . . . . . . . . . . . . . . . . . . . . 7 3.3. Record Layer . . . . . . . . . . . . . . . . . . . . . . 10
4.3. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 7 3.4. Handshake Layer . . . . . . . . . . . . . . . . . . . . . 11
5. Template-Based Specialization . . . . . . . . . . . . . . . . 8 4. Handshake Messages . . . . . . . . . . . . . . . . . . . . . 12
5.1. Specifying a Specialization . . . . . . . . . . . . . . . 8 4.1. ClientHello . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.1. Requirements on the TLS Implementation . . . . . . . 10 4.2. ServerHello . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2. Predefined Extensions . . . . . . . . . . . . . . . . 11 4.3. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 13
5.1.3. Known Certificates . . . . . . . . . . . . . . . . . 12 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6. Security Considerations . . . . . . . . . . . . . . . . . . . 13
7. Security Considerations . . . . . . . . . . . . . . . . . . . 13 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 8. Normative References . . . . . . . . . . . . . . . . . . . . 14
9. Normative References . . . . . . . . . . . . . . . . . . . . 14 Appendix A. Example Exchange . . . . . . . . . . . . . . . . . . 14
Appendix A. Sample Transcripts . . . . . . . . . . . . . . . . . 15 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 17
A.1. ECDHE and Mutual Certificate-based Authentication . . . . 15 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17
A.2. PSK . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 18
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 19
1. Introduction 1. Introduction
DISCLAIMER: This is a work-in-progress draft of cTLS and has not yet DISCLAIMER: This is a work-in-progress draft of cTLS and has not yet
seen significant security analysis, so could contain major errors. seen significant security analysis, so could contain major errors.
It should not be used as a basis for building production systems. It should not be used as a basis for building production systems.
This document specifies a "compact" version of TLS 1.3 [RFC8446]. It This document specifies a "compact" version of TLS 1.3 [RFC8446]. It
is isomorphic to TLS 1.3 but designed to take up minimal bandwidth. is isomorphic to TLS 1.3 but designed to take up minimal bandwidth.
The space reduction is achieved by four basic techniques: The space reduction is achieved by four basic techniques:
* Omitting unnecessary values that are a holdover from previous o Omitting unnecessary values that are a holdover from previous
versions of TLS. versions of TLS.
* Omitting the fields and handshake messages required for preserving o Omitting the fields and handshake messages required for preserving
backwards-compatibility with earlier TLS versions. backwards-compatibility with earlier TLS versions.
* More compact encodings, omitting unnecessary values. o More compact encodings.
* A template-based specialization mechanism that allows for the o A template-based specialization mechanism that allows pre-
creation of application specific versions of TLS that omit populating information at both endpoints without the need for
unnecessary values. negotiation.
For the common (EC)DHE handshake with pre-established certificates, For the common (EC)DHE handshake with pre-established certificates,
cTLS achieves an overhead of 45 bytes over the minimum required by cTLS achieves an overhead of 45 bytes over the minimum required by
the cryptovariables. For a PSK handshake, the overhead is 21 bytes. the cryptovariables. For a PSK handshake, the overhead is 21 bytes.
Annotated handshake transcripts for these cases can be found in Annotated handshake transcripts for these cases can be found in
Appendix A. Appendix A.
Because cTLS is semantically equivalent to TLS, it can be viewed Because cTLS is semantically equivalent to TLS, it can be viewed
either as a related protocol or as a compression mechanism. either as a related protocol or as a compression mechanism.
Specifically, it can be implemented by a layer between the TLS Specifically, it can be implemented by a layer between the TLS
skipping to change at page 4, line 5 skipping to change at page 4, line 5
3. Common Primitives 3. Common Primitives
3.1. Varints 3.1. Varints
cTLS makes use of variable-length integers in order to allow a wide cTLS makes use of variable-length integers in order to allow a wide
integer range while still providing for a minimal encoding. The integer range while still providing for a minimal encoding. The
width of the integer is encoded in the first two bits of the field as width of the integer is encoded in the first two bits of the field as
follows, with xs indicating bits that form part of the integer. follows, with xs indicating bits that form part of the integer.
+============================+================+
| Bit pattern | Length (bytes) |
+============================+================+
| 0xxxxxxx | 1 |
+----------------------------+----------------+ +----------------------------+----------------+
| Bit pattern | Length (bytes) |
+----------------------------+----------------+ +----------------------------+----------------+
| 0xxxxxxx | 1 |
| | |
| | |
| | |
| 10xxxxxx xxxxxxxx | 2 | | 10xxxxxx xxxxxxxx | 2 |
+----------------------------+----------------+ | | |
+----------------------------+----------------+ | | |
| | |
| 11xxxxxx xxxxxxxx xxxxxxxx | 3 | | 11xxxxxx xxxxxxxx xxxxxxxx | 3 |
+----------------------------+----------------+ +----------------------------+----------------+
Table 1
Thus, one byte can be used to carry values up to 127. Thus, one byte can be used to carry values up to 127.
In the TLS syntax variable integers are denoted as "varint" and a In the TLS syntax variable integers are denoted as "varint" and a
vector with a top range of a varint is denoted as: vector with a top range of a varint is denoted as:
opaque foo<1..V>; opaque foo<1..V>;
cTLS uses the varint encoding for all multi-byte integers in TLS, cTLS uses the varint encoding for all multi-byte integers in TLS,
including: including:
* Values of type uint16, uint24, uint32, uint64 o Values of type uint16, uint24, uint32, uint64
* Array and vector entries of these types o Array and vector entries of these types
* Encoded lengths for vectors that allow more than 255 entries o Encoded lengths for vectors that allow more than 255 entries
* Enums that allow more than 255 entries o Enums that allow more than 255 entries
Values of type uint8, opaque values, and one-byte enums are not Values of type uint8, opaque values, and one-byte enums are not
affected. We do not show the structures which only change in this affected. We do not show the structures which only change in this
way. way.
3.2. Record Layer 3.2. Template-based Specialization
The only cTLS records that are sent in plaintext are handshake
records (ClientHello and ServerHello/HRR). The content type is
therefore constant (it is always "handshake"), so we instead set the
"content_type" field to a fixed cTLS-specific value to distinguish
cTLS plaintext records from encrypted records, TLS/DTLS records, and
other protocols using the same 5-tuple.
The "profile_id" field allows the client and server to agree on which
compression profile should be used for this session (see Section 5).
This field MUST be set to zero if and only if no compression profile
is used. Non-zero values are negotiated out of band between the
client and server, as part of the specification of the compression
profile.
struct {
ContentType content_type = ctls_handshake;
varint profile_id;
opaque fragment<0..V>;
} CTLSPlaintext;
[[OPEN ISSUE: The profile_id is needed in the ClientHello to inform
the server what compression profile to use. For a ServerHello this
field is not required. Should we make this field optional?]]
Encrypted records use DTLS 1.3 record framing, comprising a
configuration octet followed by optional connection ID, sequence
number, and length fields.
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|0|0|1|C|S|L|E E|
+-+-+-+-+-+-+-+-+
| Connection ID | Legend:
| (if any, |
/ length as / C - Connection ID (CID) present
| negotiated) | S - Sequence number length
+-+-+-+-+-+-+-+-+ L - Length present
| 8 or 16 bit | E - Epoch
|Sequence Number|
| (if present) |
+-+-+-+-+-+-+-+-+
| 16 bit Length |
| (if present) |
+-+-+-+-+-+-+-+-+
struct {
opaque unified_hdr[variable];
opaque encrypted_record[length];
} CTLSCiphertext;
The presence and size of the connection ID field is negotiated as in
DTLS.
As with DTLS, the length field MAY be omitted by clearing the L bit,
which means that the record consumes the entire rest of the data in
the lower level transport. In this case it is not possible to have
multiple DTLSCiphertext format records without length fields in the
same datagram. In stream-oriented transports (e.g., TCP), the length
field MUST be present. For use over other transports length
information may be inferred from the underlying layer.
Normal DTLS does not provide a mechanism for suppressing the sequence
number field entirely. In cases where a sequence number is not
required (e.g., when a reliable transport is in use), a cTLS
implementation may suppress it by setting the
"suppressSequenceNumber" flag in the compression profile being used
(see Section 5.1). When this flag is enabled, the S bit in the
configuration octet MUST be cleared.
3.3. Handshake Layer
The cTLS handshake framing is same as the TLS 1.3 handshake framing,
except for two changes:
1. The length field is omitted
2. The HelloRetryRequest message is a true handshake message instead
of a specialization of ServerHello.
struct {
HandshakeType msg_type; /* handshake type */
select (Handshake.msg_type) {
case client_hello: ClientHello;
case server_hello: ServerHello;
case hello_retry_request: HelloRetryRequest;
case end_of_early_data: EndOfEarlyData;
case encrypted_extensions: EncryptedExtensions;
case certificate_request: CertificateRequest;
case certificate: Certificate;
case certificate_verify: CertificateVerify;
case finished: Finished;
case new_session_ticket: NewSessionTicket;
case key_update: KeyUpdate;
};
} Handshake;
4. Handshake Messages
In general, we retain the basic structure of each individual TLS
handshake message. However, the following handshake messages have
been modified for space reduction and cleaned up to remove pre TLS
1.3 baggage.
4.1. ClientHello
The cTLS ClientHello is as follows.
opaque Random[RandomLength]; // variable length
struct {
Random random;
CipherSuite cipher_suites<1..V>;
Extension extensions<1..V>;
} ClientHello;
4.2. ServerHello
We redefine ServerHello in a similar way:
struct {
Random random;
CipherSuite cipher_suite;
Extension extensions<1..V>;
} ServerHello;
4.3. HelloRetryRequest
The HelloRetryRequest has the following format:
struct {
CipherSuite cipher_suite;
Extension extensions<2..V>;
} HelloRetryRequest;
It is the same as the ServerHello above but without the unnecessary
sentinel Random value.
5. Template-Based Specialization The transmission overhead in TLS 1.3 is largely contributed to by two
factors, : - the negotiation of algorithm parameters, and extensions,
as well as - the exchange of certificates.
The protocol in the previous section is fully general and isomorphic TLS 1.3 supports different credential types and modes that are
to TLS 1.3; effectively it's just a small cleanup of the wire impacted differently by a compression scheme. For example, TLS
encoding to match what we might have done starting from scratch. It supports certificate-based authentication, raw public key-based
achieves some compaction, but only a modest amount. cTLS also authentication as well as pre-shared key (PSK)-based authentication.
includes a mechanism for achieving very high compaction using PSK-based authentication can be used with externally configured PSKs
template-based specialization. or with PSKs established through tickets.
The basic idea is that we start with the basic TLS 1.3 handshake, The basic idea of template-based specialization is that we start with
which is fully general and then remove degrees of freedom, eliding the basic TLS 1.3 handshake, which is fully general and then remove
parts of the handshake which are used to express those degrees of degrees of freedom, eliding parts of the handshake which are used to
freedom. For example, if we only support one version of TLS, then it express those degrees of freedom. For example, if we only support
is not necessary to have version negotiation and the one version of TLS, then it is not necessary to have version
supported_versions extension can be omitted. negotiation and the supported_versions extension can be omitted.
Importantly, this process is performed only for the wire encoding but Importantly, this process is performed only for the wire encoding but
not for the handshake transcript. The result is that the transcript not for the handshake transcript. The result is that the transcript
for a specialized cTLS handshake is the same as the transcript for a for a specialized cTLS handshake is the same as the transcript for a
TLS 1.3 handshake with the same features used. TLS 1.3 handshake with the same features used.
One way of thinking of this is as if specialization is a stateful One way of thinking of this is as if specialization is a stateful
compression layer between the handshake and the record layer: compression layer between the handshake and the record layer:
+---------------+---------------+---------------+ +---------------+---------------+---------------+
| Handshake | Application | Alert | | Handshake | Application | Alert |
+---------------+---------------+---------------+ +---------+ +---------------+---------------+---------------+ +---------+
| cTLS Compression Layer |<---| Profile | | cTLS Compression Layer |<---| Profile |
+---------------+---------------+---------------+ +---------+ +---------------+---------------+---------------+ +---------+
| cTLS Record Layer / Application | | cTLS Record Layer / Application |
+---------------+---------------+---------------+ +---------------+---------------+---------------+
Specializations are defined by a "compression profile" that specifies By assuming that out-of-band agreements took place already prior to
what features are to be optimized out of the handshake. In the the start of the cTLS protocol exchange, the amount of data exchanged
following subsections, we define the structure of these profiles, and can be radically reduced. Because different clients may use
how they are used in compressing and decompressing handshake different compression templates and because multiple compression
messages. templates may be available for use in different deployment
environments, a client needs to inform the server about the profile
it is planning to use. The profile field in the ClientHello serves
this purpose.
5.1. Specifying a Specialization Although the template-based specialization mechanisms described here
are general, we also include specific mechanism for certificate-based
exchanges because those are where the most complexity and size
reduction can be obtained. Most of the other exchanges in TLS 1.3
are highly optimized and do not require compression to be used.
A compression profile defining of a specialized version of TLS is The compression profile defining the use of algorithms, algorithm
defined using a JSON dictionary. Each axis of specialization is a parameters, and extensions is specified via a JSON dictionary.
key in the dictionary. [[OPEN ISSUE: If we ever want to serialize
this, we'll want to use a list instead.]].
For example, the following specialization describes a protocol with a For example, the following specialization describes a protocol with a
single fixed version (TLS 1.3) and a single fixed cipher suite single fixed version (TLS 1.3) and a single fixed cipher suite
(TLS_AES_128_GCM_SHA256). On the wire, ClientHello.cipher_suites, (TLS_AES_128_GCM_SHA256). On the wire, ClientHello.cipher_suites,
ServerHello.cipher_suites, and the supported_versions extensions in ServerHello.cipher_suites, and the supported_versions extensions in
the ClientHello and ServerHello would be omitted. the ClientHello and ServerHello would be omitted.
{ {
"profileID": 33,
"version" : 772, "version" : 772,
"cipherSuite" : "TLS_AES_128_GCM_SHA256" "cipherSuite" : "TLS_AES_128_GCM_SHA256"
} }
cTLS allows specialization along the following axes: The following elements are defined:
profileID (integer): The identifier for this profile, to be sent in
the "profile_id" field of CTLSPlaintext records. This value MUST
NOT be zero. If this value is not present, the default
"profile_id" is 1.
suppressSequenceNumber (boolean): If present and set to true, the profile (integer): identifies the profile being defined.
sequence number field is omitted from encrypted record headers.
version (integer): indicates that both sides agree to the single TLS version (integer): indicates that both sides agree to the single TLS
version specified by the given integer value (772 == 0x0304 for version specified by the given integer value (772 == 0x0304 for
TLS 1.3). The supported_versions extension is omitted from TLS 1.3). The supported_versions extension is omitted from
ClientHello.extensions and reconstructed in the transcript as a ClientHello.extensions and reconstructed in the transcript as a
single-valued list with the specified value. The single-valued list with the specified value. The
supported_versions extension is omitted from supported_versions extension is omitted from
ClientHello.extensions and reconstructed in the transcript with ClientHello.extensions and reconstructed in the transcript with
the specified value. the specified value.
cipherSuite (string): indicates that both sides agree to the single cipherSuite (string): indicates that both sides agree to the single
named cipher suite, using the "TLS_AEAD_HASH" syntax defined in named cipher suite, using the "TLS_AEAD_HASH" syntax defined in
[RFC8446], Section 8.4. The ClientHello.cipher_suites field is [RFC8446], Section 8.4. The ClientHello.cipher_suites field is
omitted and reconstructed in the transcript as a single-valued omitted and reconstructed in the transcript as a single-valued
list with the specified value. The server_hello.cipher_suite list with the specified value. The server_hello.cipher_suite
field is omitted and reconstructed in the transcript as the field is omitted and reconstructed in the transcript as the
specified value. specified value.
dhGroup (string): specifies a single DH group to use for key dhGroup (string): specifies a single DH group to use for key
establishment. The group is listed by the code point name in establishment. The group is listed by the code point name in
[RFC8446], Section 4.2.7. (e.g., x25519). This implies a literal [RFC8446], Section 4.2.7. (e.g., x25519). This implies a literal
"supported_groups" extension consisting solely of this group. "supported_groups" extension consisting solely of this group.
signatureAlgorithm (string): specifies a single signature scheme to signatureAlgorithm (string): specifies a single signature scheme to
use for authentication. The group is listed by the code point use for authentication. The group is listed by the code point
name in [RFC8446], Section 4.2.7. (e.g., ed25519). This implies a name in [RFC8446], Section 4.2.7. (e.g., ed25519). This implies
literal "signature_algorithms" extension consisting solely of this a literal "signature_algorithms" extension consisting solely of
group. this group.
randomSize (integer): indicates that the ClientHello.Random and random (integer): indicates that the ClientHello.Random and
ServerHello.Random values are truncated to the given values. When ServerHello.Random values are truncated to the given length. When
the transcript is reconstructed, the Random is padded to the right the transcript is reconstructed, the Random is padded to the right
with 0s and the anti-downgrade mechanism in {{RFC8446)}, with 0s and the anti-downgrade mechanism in [RFC8446],
Section 4.1.3 is disabled. IMPORTANT: Using short Random values Section 4.1.3 is disabled. IMPORTANT: Using short Random values
can lead to potential attacks. When Random values are shorter can lead to potential attacks. The Random length MUST be less
than 8 bytes, PSK-only modes MUST NOT be used, and each side MUST than or equal to 32 bytes.
use fresh DH ephemerals. The Random length MUST be less than or
equal to 32 bytes. [[Open Issue: Karthik Bhargavan suggested the idea of hashing
ephemeral public keys and to use the result (truncated to 32 bytes)
as random values. Such a change would require a security analysis.
]]
mutualAuth (boolean): if set to true, indicates that the client must
authenticate with a certificate by sending Certificate and a
CertificateVerify message. The server MUST omit the
CertificateRequest message, as its contents are redundant. [[OPEN
ISSUE: We don't actually say that you can omit empty messages, so
we need to add that somewhere.]]
extension_order: indicates in what order extensions appear in
respective messages. This allows to omit sending the type. If
there is only a single extension to be transmitted, then the
extension length field can also be omitted. For example, imagine
that only the KeyShare extension needs to be sent in the
ClientHello as the only extension. Then, the following structure
28 // Extensions.length
33 26 // KeyShare
0024 // client_shares.length
001d // KeyShareEntry.group
0020 a690...af948 // KeyShareEntry.key_exchange
is compressed down to (assuming the KeyShare group has been pre-
agreed)
0020 a690...af948 // KeyShareEntry.key_exchange
clientHelloExtensions (predefined extensions): Predefined clientHelloExtensions (predefined extensions): Predefined
ClientHello extensions, see {predefined-extensions} ClientHello extensions, see {predefined-extensions}
serverHelloExtensions (predefined extensions): Predefined serverHelloExtensions (predefined extensions): Predefined
ServerHello extensions, see {predefined-extensions} ServerHello extensions, see {predefined-extensions}
encryptedExtensions (predefined extensions): Predefined encryptedExtensions (predefined extensions): Predefined
EncryptedExtensions extensions, see {predefined-extensions} EncryptedExtensions extensions, see {predefined-extensions}
certRequestExtensions (predefined extensions): Predefined certRequestExtensions (predefined extensions): Predefined
CertificateRequest extensions, see {predefined-extensions} CertificateRequest extensions, see {predefined-extensions}
knownCertificates (known certificates): A compression dictionary for knownCertificates (known certificates): A compression dictionary for
the Certificate message, see {known-certs} the Certificate message, see {known-certs}
finishedSize (integer): indicates that the Finished value is to be finishedSize (integer): indicates that the Finished value is to be
truncated to the given length. When the transcript is truncated to the given length. When the transcript is
reconstructed, the remainder of the Finished value is filled in by reconstructed, the remainder of the Finished value is filled in by
the receiving side. [[OPEN ISSUE: How short should we allow this the receiving side.
to be? TLS 1.3 uses the native hash and TLS 1.2 used 12 bytes.
More analysis is needed to know the minimum safe Finished size.
See [RFC8446]; Section E.1 for more on this, as well as
https://mailarchive.ietf.org/arch/msg/tls/
TugB5ddJu3nYg7chcyeIyUqWSbA.]]
5.1.1. Requirements on the TLS Implementation [[OPEN ISSUE: How short should we allow this to be? TLS 1.3 uses the
native hash and TLS 1.2 used 12 bytes. More analysis is needed to
know the minimum safe Finished size. See [RFC8446]; Section E.1 for
more on this, as well as https://mailarchive.ietf.org/arch/msg/tls/
TugB5ddJu3nYg7chcyeIyUqWSbA.]]
3.2.1. Requirements on TLS Implementations
To be compatible with the specializations described in this section, To be compatible with the specializations described in this section,
a TLS stack needs to provide two key features: a TLS stack needs to provide the following features:
If specialization of extensions is to be used, then the TLS stack o If specialization of extensions is to be used, then the TLS stack
MUST order each vector of Extension values in ascending order MUST order each vector of Extension values in ascending order
according to the ExtensionType. This allows for a deterministic according to the ExtensionType. This allows for a deterministic
reconstruction of the extension list. reconstruction of the extension list.
If truncated Random values are to be used, then the TLS stack MUST be o If truncated Random values are to be used, then the TLS stack MUST
configurable to set the remaining bytes of the random values to zero. be configurable to set the remaining bytes of the random values to
This ensures that the reconstructed, padded random value matches the zero. This ensures that the reconstructed, padded random value
original. matches the original.
If truncated Finished values are to be used, then the TLS stack MUST o If truncated Finished values are to be used, then the TLS stack
be configurable so that only the provided bytes of the Finished are MUST be configurable so that only the provided bytes of the
verified, or so that the expected remaining values can be computed. Finished are verified, or so that the expected remaining values
can be computed.
5.1.2. Predefined Extensions 3.2.2. Predefined Extensions
Extensions used in the ClientHello, ServerHello, EncryptedExtensions, Extensions used in the ClientHello, ServerHello, EncryptedExtensions,
and CertificateRequest messages can be "predefined" in a compression and CertificateRequest messages can be "predefined" in a compression
profile, so that they do not have to be sent on the wire. A profile, so that they do not have to be sent on the wire. A
predefined extensions object is a dictionary whose keys are extension predefined extensions object is a dictionary whose keys are extension
names specified in the TLS ExtensionTypeRegistry specified in names specified in the TLS ExtensionTypeRegistry specified in
[RFC8446]. The corresponding value is a hex-encoded value for the [RFC8446]. The corresponding value is a hex-encoded value for the
ExtensionData field of the extension. ExtensionData field of the extension.
When compressing a handshake message, the sender compares the When compressing a handshake message, the sender compares the
extensions in the message being compressed to the predefined extensions in the message being compressed to the predefined
extensions object, applying the following rules: extensions object, applying the following rules:
* If the extensions list in the message is not sorted in ascending o If the extensions list in the message is not sorted in ascending
order by extension type, it is an error, because the decompressed order by extension type, it is an error, because the decompressed
message will not match. message will not match.
* If there is no entry in the predefined extensions object for the o If there is no entry in the predefined extensions object for the
type of the extension, then the extension is included in the type of the extension, then the extension is included in the
compressed message compressed message
* If there is an entry: o If there is an entry:
- If the ExtensionData of the extension does not match the value * If the ExtensionData of the extension does not match the value
in the dictionary, it is an error, because decompression will in the dictionary, it is an error, because decompression will
not produce the correct result. not produce the correct result.
- If the ExtensionData matches, then the extension is removed, * If the ExtensionData matches, then the extension is removed,
and not included in the compressed message. and not included in the compressed message.
When decompressing a handshake message the receiver reconstitutes the When decompressing a handshake message the receiver reconstitutes the
original extensions list using the predefined extensions: original extensions list using the predefined extensions:
* If there is an extension in the compressed message with a type o If there is an extension in the compressed message with a type
that exists in the predefined extensions object, it is an error, that exists in the predefined extensions object, it is an error,
because such an extension would not have been sent by a sender because such an extension would not have been sent by a sender
with a compatible compression profile. with a compatible compression profile.
* For each entry in the predefined extensions dictionary, an o For each entry in the predefined extensions dictionary, an
extension is added to the decompressed message with the specified extension is added to the decompressed message with the specified
type and value. type and value.
* The resulting vector of extensions MUST be sorted in ascending o The resulting vector of extensions MUST be sorted in ascending
order by extension type. order by extension type.
Note that the "version", "dhGroup", and "signatureAlgorithm" fields Note that the "version", "dhGroup", and "signatureAlgorithm" fields
in the compression profile are specific instances of this algorithm in the compression profile are specific instances of this algorithm
for the corresponding extensions. for the corresponding extensions.
[[OPEN ISSUE: Are there other extensions that would benefit from [[OPEN ISSUE: Are there other extensions that would benefit from
special treatment, as opposed to hex values.]] special treatment, as opposed to hex values.]]
5.1.3. Known Certificates 3.2.3. Known Certificates
Certificates are a major contributor to the size of a TLS handshake. Certificates are a major contributor to the size of a TLS handshake.
In order to avoid this overhead when the parties to a handshake have In order to avoid this overhead when the parties to a handshake have
already exchanged certificates, a compression profile can specify a already exchanged certificates, a compression profile can specify a
dictionary of "known certificates" that effectively acts as a dictionary of "known certificates" that effectively acts as a
compression dictionary on certificates. compression dictionary on certificates.
A known certificates object is a JSON dictionary whose keys are A known certificates object is a JSON dictionary whose keys are
strings containing hex-encoded compressed values. The corresponding strings containing hex-encoded compressed values. The corresponding
values are hex-encoded strings representing the uncompressed values. values are hex-encoded strings representing the uncompressed values.
skipping to change at page 13, line 13 skipping to change at page 10, line 18
opposite way, replacing keys with values. opposite way, replacing keys with values.
Note that in this scheme, there is no signaling on the wire for Note that in this scheme, there is no signaling on the wire for
whether a given cert_data value is compressed or uncompressed. Known whether a given cert_data value is compressed or uncompressed. Known
certificates objects SHOULD be constructed in such a way as to avoid certificates objects SHOULD be constructed in such a way as to avoid
a uncompressed object being mistaken for compressed one and a uncompressed object being mistaken for compressed one and
erroneously decompressed. For X.509, it is sufficient for the first erroneously decompressed. For X.509, it is sufficient for the first
byte of the compressed value (key) to have a value other than 0x30, byte of the compressed value (key) to have a value other than 0x30,
since every X.509 certificate starts with this byte. since every X.509 certificate starts with this byte.
6. Examples 3.3. Record Layer
The following section provides some example specializations. The only cTLS records that are sent in plaintext are handshake
records (ClientHello and ServerHello/HRR). The content type is
therefore constant (it is always "handshake"), so we instead set the
"content_type" field to a fixed cTLS-specific value to distinguish
cTLS plaintext records from encrypted records, TLS/DTLS records, and
other protocols using the same 5-tuple.
TLS 1.3 only: The "profile_id" field allows the client and server to agree on which
compression profile should be used for this session (see
Section 3.2). This field MUST be set to zero if and only if no
compression profile is used. Non-zero values are negotiated out of
band between the client and server, as part of the specification of
the compression profile.
{ struct {
"version" : 0x0304 ContentType content_type = ctls_handshake;
} varint profile_id;
opaque fragment<0..V>;
} CTLSPlaintext;
TLS 1.3 with AES_GCM and X25519 and ALPN h2, short random values, and [[OPEN ISSUE: The profile_id is needed in the ClientHello to inform
everything else is ordinary TLS 1.3. the server what compression profile to use. For a ServerHello this
field is not required. Should we make this field optional?]]
Encrypted records use DTLS 1.3 record framing, comprising a
configuration octet followed by optional connection ID, sequence
number, and length fields.
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|0|0|1|C|S|L|E E|
+-+-+-+-+-+-+-+-+
| Connection ID | Legend:
| (if any, |
/ length as / C - Connection ID (CID) present
| negotiated) | S - Sequence number length
+-+-+-+-+-+-+-+-+ L - Length present
| 8 or 16 bit | E - Epoch
|Sequence Number|
| (if present) |
+-+-+-+-+-+-+-+-+
| 16 bit Length |
| (if present) |
+-+-+-+-+-+-+-+-+
struct {
opaque unified_hdr[variable];
opaque encrypted_record[length];
} CTLSCiphertext;
The presence and size of the connection ID field is negotiated as in
DTLS.
As with DTLS, the length field MAY be omitted by clearing the L bit,
which means that the record consumes the entire rest of the data in
the lower level transport. In this case it is not possible to have
multiple DTLSCiphertext format records without length fields in the
same datagram. In stream-oriented transports (e.g., TCP), the length
field MUST be present. For use over other transports length
information may be inferred from the underlying layer.
Normal DTLS does not provide a mechanism for suppressing the sequence
number field entirely. In cases where a sequence number is not
required (e.g., when a reliable transport is in use), a cTLS
implementation may suppress it by setting the
"suppressSequenceNumber" flag in the compression profile being used
(see Section 3.2). When this flag is enabled, the S bit in the
configuration octet MUST be cleared.
3.4. Handshake Layer
The cTLS handshake framing is same as the TLS 1.3 handshake framing,
except for two changes:
o The length field is omitted.
o The HelloRetryRequest message is a true handshake message instead
of a specialization of ServerHello.
struct {
HandshakeType msg_type; /* handshake type */
select (Handshake.msg_type) {
case client_hello: ClientHello;
case server_hello: ServerHello;
case hello_retry_request: HelloRetryRequest;
case end_of_early_data: EndOfEarlyData;
case encrypted_extensions: EncryptedExtensions;
case certificate_request: CertificateRequest;
case certificate: Certificate;
case certificate_verify: CertificateVerify;
case finished: Finished;
case new_session_ticket: NewSessionTicket;
case key_update: KeyUpdate;
};
} Handshake;
4. Handshake Messages
In general, we retain the basic structure of each individual TLS
handshake message. However, the following handshake messages have
been modified for space reduction and cleaned up to remove pre-TLS
1.3 baggage.
4.1. ClientHello
The cTLS ClientHello is defined as follows.
opaque Random[RandomLength]; // variable length
struct {
Random random;
CipherSuite cipher_suites<1..V>;
Extension extensions<1..V>;
} ClientHello;
4.2. ServerHello
We redefine ServerHello in the following way.
struct {
Random random;
CipherSuite cipher_suite;
Extension extensions<1..V>;
} ServerHello;
4.3. HelloRetryRequest
The HelloRetryRequest has the following format.
struct {
CipherSuite cipher_suite;
Extension extensions<2..V>;
} HelloRetryRequest;
The HelloRetryRequest is the same as the ServerHello above but
without the unnecessary sentinel Random value.
5. Examples
This section provides some example specializations.
For this example we use TLS 1.3 only with AES_GCM, X25519, ALPN h2,
short random values, and everything else is ordinary TLS 1.3.
{ {
"version" : 772, "Version" : 0x0304
"randomSize": 16, "Profile" : 1,
"cipherSuite" : "TLS_AES_128_GCM_SHA256", "Version" : 772,
"dhGroup": "X25519", "Random": 16,
"clientHelloExtensions": { "CipherSuite" : "TLS_AES_128_GCM_SHA256",
"DHGroup": "X25519",
"Extensions": {
"named_groups": 29, "named_groups": 29,
"application_layer_protocol_negotiation" : "030016832", "application_layer_protocol_negotiation" : "030016832",
"..." : null "..." : null
} }
} }
Version 772 corresponds to the hex representation 0x0304, named group Version 772 corresponds to the hex representation 0x0304, named group
"29" (0x001D) represents X25519. "29" (0x001D) represents X25519.
[[OPEN ISSUE: Should we have a registry of well-known profiles?]] [[OPEN ISSUE: Should we have a registry of well-known profiles?]]
7. Security Considerations 6. Security Considerations
WARNING: This document is effectively brand new and has seen no WARNING: This document is effectively brand new and has seen no
analysis. The idea here is that cTLS is isomorphic to TLS 1.3, and analysis. The idea here is that cTLS is isomorphic to TLS 1.3, and
therefore should provide equivalent security guarantees. therefore should provide equivalent security guarantees.
The use of key ids is a new feature introduced in this document, The use of key ids is a new feature introduced in this document,
which requires some analysis, especially as it looks like a potential which requires some analysis, especially as it looks like a potential
source of identity misbinding. This is, however, entirely separable source of identity misbinding. This is, however, entirely separable
from the rest of the specification. from the rest of the specification.
Transcript expansion also needs some analysis and we need to Transcript expansion also needs some analysis and we need to
determine whether we need an extension to indicate that cTLS is in determine whether we need an extension to indicate that cTLS is in
use and with which profile. use and with which profile.
8. IANA Considerations 7. IANA Considerations
This document requests that a code point be allocated from the "TLS This document requests that a code point be allocated from the "TLS
ContentType registry. This value must be in the range 0-31 ContentType registry. This value must be in the range 0-31
(inclusive). The row to be added in the registry has the following (inclusive). The row to be added in the registry has the following
form: form:
+=======+=============+=========+===========+ +-------+-------------+---------+-----------+
| Value | Description | DTLS-OK | Reference | | Value | Description | DTLS-OK | Reference |
+=======+=============+=========+===========+ +-------+-------------+---------+-----------+
| TBD | ctls | N | RFCXXXX | | TBD | ctls | N | RFCXXXX |
+-------+-------------+---------+-----------+ +-------+-------------+---------+-----------+
Table 2
[[ RFC EDITOR: Please replace the value TBD with the value assigned [[ RFC EDITOR: Please replace the value TBD with the value assigned
by IANA, and the value XXXX to the RFC number assigned for this by IANA, and the value XXXX to the RFC number assigned for this
document. ]] document. ]]
[[OPEN ISSUE: Should we require standards action for all profile IDs [[OPEN ISSUE: Should we require standards action for all profile IDs
that would fit in 2 octets.]] that would fit in 2 octets.]]
9. Normative References 8. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
<https://www.rfc-editor.org/info/rfc8446>. <https://www.rfc-editor.org/info/rfc8446>.
Appendix A. Sample Transcripts Appendix A. Example Exchange
In this section, we provide annotated example transcripts generated
using a draft implementation of this specification in the mint TLS
library. The transcripts shown are with the revised message formats
defined above, as well as specialization to the indicated cases,
using the aggressive compression profiles noted below. The resulting
byte counts are as follows:
ECDHE PSK
------------------ ------------------
TLS CTLS Overhead TLS CTLS Overhead
--- ---- -------- --- ---- --------
ClientHello 132 50 10 147 67 15
ServerHello 90 48 8 56 18 2
ServerFlight 478 104 16 42 12 3
ClientFlight 458 100 11 36 10 1
=====================================================
Total 1158 302 45 280 107 21
To increase legibility, we show the plaintext bytes of handshake
messages that would be encrypted and shorten some of the
cryptographic values (shown with "..."). The totals above include 9
bytes of encryption overhead for the client and server flights, which
would otherwise be encrypted (with a one-byte content type and an
8-byte tag).
Obviously, these figures are very provisional, and as noted at The follow exchange illustrates a complete cTLS-based exchange
several points above, there are additional opportunities to reduce supporting mutual authentication using certificates. The digital
overhead. signatures use ECDSA with SHA256 and NIST P256r1. The ephemeral
Diffie-Hellman uses the FX25519 curve and the exchange negotiates
TLS-AES-128-CCM8-SHA256. The certificates are exchanged using
certificate identifiers.
[[NOTE: We are using a shortened Finished message here. See The resulting byte counts are as follows:
Section 5.1 for notes on Finished size. However, the overhead is
constant for all reasonable Finished sizes.]]
A.1. ECDHE and Mutual Certificate-based Authentication ECDHE
------------------
TLS CTLS Overhead
--- ---- --------
ClientHello 132 36 4
ServerHello 90 36 4
ServerFlight 478 80 7
ClientFlight 458 80 7
==================================
Total 1158 232 22
Compression Profile: The following compression profile was used in this example:
{ {
"profile": 1,
"version": 772, "version": 772,
"cipherSuite": "TLS_AES_128_CCM_8_SHA256", "cipherSuite": "TLS_AES_128_CCM_8_SHA256",
"dhGroup": "X25519", "dhGroup": "X25519",
"signatureAlgorithm": "ECDSA_P256_SHA256", "signatureAlgorithm": "ECDSA_P256_SHA256",
"randomSize": 8,
"finishedSize": 8, "finishedSize": 8,
"clientHelloExtensions": { "clientHelloExtensions": {
"server_name": "000e00000b6578616d706c652e636f6d", "server_name": "000e00000b6578616d706c652e636f6d",
}, },
"certificateRequestExtensions": { "certificateRequestExtensions": {
"certificate_request_context": 0,
"signature_algorithms": "00020403" "signature_algorithms": "00020403"
}, },
"mutualAuth": true,
"extension-order": {
"clientHelloExtensions": {
Key_share
},
"ServerHelloExtensions": {
Key_share
},
},
"knownCertificates": { "knownCertificates": {
"61": "3082...", "61": "3082...",
"62": "3082..." "62": "3082...",
"63": "...",
"64": "...",
...
} }
} }
ClientHello: 36 bytes = DH(32) + Overhead(4)
ClientHello: 50 bytes = RANDOM(8) + DH(32) + Overhead(10)
01 // ClientHello 01 // ClientHello
2ef16120dd84a721 // Random 01 // Profile ID
28 // Extensions.length 0020 a690...af948 // KeyShareEntry.key_exchange
33 26 // KeyShare
0024 // client_shares.length
001d // KeyShareEntry.group
0020 a690...af948 // KeyShareEntry.key_exchange
ServerHello: 48 = RANDOM(8) + DH(32) + Overhead(8) ServerHello: 36 = DH(32) + Overhead(4)
02 // ServerHello 02 // ServerHello
962547bba5e00973 // Random
26 // Extensions.length 26 // Extensions.length
33 24 // KeyShare 0020 9fbc...0f49 // KeyShareEntry.key_exchange
001d // KeyShareEntry.group
0020 9fbc...0f49 // KeyShareEntry.key_exchange Server Flight: 80 = SIG(64) + MAC(8) + CERTID(1) + Overhead(7)
The EncryptedExtensions, and the CertificateRequest messages are
omitted because they are empty.
Server Flight: 96 = SIG(71) + MAC(8) + CERTID(1) + Overhead(16)
08 // EncryptedExtensions
00 // Extensions.length
0d // CertificateRequest
00 // CertificateRequestContext.length
00 // Extensions.length
0b // Certificate 0b // Certificate
00 // CertificateRequestContext
03 // CertificateList 03 // CertificateList
01 // CertData.length 01 // CertData.length
61 // CertData = 'a' 61 // CertData = 'a'
00 // Extensions.length
0f // CertificateVerify 0f // CertificateVerify
0403 // SignatureAlgorithm 4064 // Signature.length
4047 // Signature.length 3045...10ce // Signature
3045...f60e // Signature
14 // Finished 14 // Finished
bfc9d66715bb2b04 // VerifyData bfc9d66715bb2b04 // VerifyData
Client Flight: 91 bytes = SIG(71) + MAC(8) + CERTID(1) + Overhead(11) Client Flight: 80 bytes = SIG(64) + MAC(8) + CERTID(1) + Overhead(7)
0b // Certificate 0b // Certificate
00 // CertificateRequestContext
03 // CertificateList 03 // CertificateList
01 // CertData.length 01 // CertData.length
62 // CertData = 'b' 62 // CertData = 'b'
00 // Extensions.length
0f // CertificateVerify 0f // CertificateVerify
0403 // SignatureAlgorithm 4064 // Signature.length
4047 // Signature.length 3045...f60e // Signature
3045...f60e // Signature
14 // Finished 14 // Finished
35e9c34eec2c5dc1 // VerifyData 35e9c34eec2c5dc1 // VerifyData
A.2. PSK
Compression Profile:
{
"version": 772,
"cipherSuite": "TLS_AES_128_CCM_8_SHA256",
"signatureAlgorithm": "ECDSA_P256_SHA256",
"randomSize": 16,
"finishedSize": 0,
"clientHelloExtensions": {
"server_name": "000e00000b6578616d706c652e636f6d",
"psk_key_exchange_modes": "0100"
},
"serverHelloExtensions": {
"pre_shared_key": "0000"
}
}
ClientHello: 67 bytes = RANDOM(16) + PSKID(4) + BINDER(32) +
Overhead(15)
01 // ClientHello
e230115e62d9a3b58f73e0f2896b2e35 // Random
2d // Extensions.length
29 2b // PreSharedKey
000a // identities.length
0004 00010203 // identity
7bd05af6 // obfuscated_ticket_age
0021 // binders.length
20 2428...bb3f // binder
ServerHello: 18 bytes = RANDOM(16) + 2
02 // ServerHello
7232e2d3e61e476b844d9c1f6a4c868f // Random
00 // Extensions.length
Server Flight: 3 bytes = Overhead(3)
08 // EncryptedExtensions
00 // Extensions.length
14 // Finished
Client Flight: 1 byte = Overhead(3)
14 // Finished
Acknowledgments Acknowledgments
We would like to thank Karthikeyan Bhargavan, Owen Friel, Sean We would like to thank Karthikeyan Bhargavan, Owen Friel, Sean
Turner, Martin Thomson and Chris Wood. Turner, Martin Thomson and Chris Wood.
Authors' Addresses Authors' Addresses
Eric Rescorla Eric Rescorla
Mozilla Mozilla
 End of changes. 86 change blocks. 
394 lines changed or deleted 358 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/