RFC 3546
Transport Layer Security (TLS) Extensions
RFC 3546: Transport Layer Security (TLS) Extensions ๐
okay bestie, this is RFC 3546 and it's giving official ๐ . It's from the Network Working Group, dated June 2003, and it's on the Standards Track, so it's a real spec people actually implement โจ. The authors are S. Blake-Wilson (BCI), M. Nystrom (RSA Security), D. Hopwood (Independent Consultant), J. Mikkelsen (Transactionware), and T. Wright (Vodafone) ๐. It updates RFC 2246 ๐ฆ.
Status of this Memo ๐
okay so this doc specifies an Internet standards track protocol for the Internet community, and it's literally asking for discussion and suggestions for improvements ๐. For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited ๐ซถ.
Copyright Notice ยฉ๏ธ
Copyright (C) The Internet Society (2003). All Rights Reserved.
Abstract ๐ธ
This doc describes extensions that may be used to add functionality to Transport Layer Security (TLS). It gives you generic extension mechanisms for the TLS handshake client and server hellos, plus specific extensions that use those generic mechanisms โจ.
The extensions may be used by TLS clients and servers. They're backwards compatible, which is so iconic: TLS 1.0 clients that support the extensions can talk to TLS 1.0 servers that don't, and vice versa ๐ฅ.
Conventions used in this Document ๐
okay so the capitalised key words in this doc are the official ones from BCP 14, RFC 2119 [KEYWORDS]. They are "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL", and they're meant to be read exactly as described in BCP 14, RFC 2119 [KEYWORDS] ๐.
Table of Contents ๐บ๏ธ
1. Introduction ............................................. 2
2. General Extension Mechanisms ............................. 4
2.1. Extended Client Hello ............................... 5
2.2. Extended Server Hello ............................... 5
2.3. Hello Extensions .................................... 6
2.4. Extensions to the handshake protocol ................ 7
3. Specific Extensions ...................................... 8
3.1. Server Name Indication .............................. 8
3.2. Maximum Fragment Length Negotiation ................. 10
3.3. Client Certificate URLs ............................. 11
3.4. Trusted CA Indication ............................... 14
3.5. Truncated HMAC ...................................... 15
3.6. Certificate Status Request........................... 16
4. Error alerts .............................................. 18
5. Procedure for Defining New Extensions...................... 20
6. Security Considerations .................................. 21
6.1. Security of server_name ............................. 21
6.2. Security of max_fragment_length ..................... 21
6.3. Security of client_certificate_url .................. 22
6.4. Security of trusted_ca_keys ......................... 23
6.5. Security of truncated_hmac .......................... 23
6.6. Security of status_request .......................... 24
7. Internationalization Considerations ...................... 24
8. IANA Considerations ...................................... 24
9. Intellectual Property Rights ............................. 26
10. Acknowledgments .......................................... 26
11. Normative References ..................................... 27
12. Informative References ................................... 28
13. Authors' Addresses ....................................... 28
14. Full Copyright Statement ................................. 29
1. Introduction ๐ธ
This doc describes extensions that may be used to add functionality to Transport Layer Security (TLS). It gives you generic extension mechanisms for the TLS handshake client and server hellos, plus specific extensions that use those generic mechanisms โจ.
TLS is now used in an increasing variety of operational environments, and a lot of them weren't imagined when the original design criteria for TLS were decided ๐. The extensions in this doc are designed to help TLS work as well as possible in new environments like wireless networks ๐ฑ.
Wireless environments often deal with constraints that wired ones usually don't. These can include bandwidth limitations, computational power limitations, memory limitations, and battery life limitations ๐.
The extensions here focus on extending what the TLS protocol message formats can do. Other stuff, like adding new cipher suites, is deferred ๐ซ .
So, the extensions in this doc are designed to:
- allow TLS clients to give the TLS server the name of the server they're contacting. This is desirable for making secure connections to servers that host multiple 'virtual' servers at one underlying network address ๐ .
- allow TLS clients and servers to negotiate the maximum fragment length to be sent. This is desirable because some clients have memory constraints and some access networks have bandwidth constraints ๐ฆ.
- allow TLS clients and servers to negotiate the use of client certificate URLs. This is desirable so constrained clients can conserve memory ๐ง .
- allow TLS clients to tell TLS servers which CA root keys they have. This is desirable so you don't get multiple handshake failures from clients that can only store a small number of CA root keys because of memory limits ๐.
- allow TLS clients and servers to negotiate the use of truncated MACs. This is desirable for conserving bandwidth in constrained access networks ๐ธ.
- allow TLS clients and servers to negotiate that the server sends the client certificate status information (for example, an Online Certificate Status Protocol (OCSP) [OCSP] response) during a TLS handshake. This is desirable so you don't have to send a Certificate Revocation List (CRL) over a constrained access network, which saves bandwidth ๐ฅน.
To support the extensions above, general extension mechanisms for the client hello message and the server hello message are introduced ๐งฉ.
The extensions in this doc may be used by TLS 1.0 clients and TLS 1.0 servers. They're designed to be backwards compatible, meaning TLS 1.0 clients that support the extensions can talk to TLS 1.0 servers that don't, and vice versa ๐.
Backwards compatibility is mostly achieved through two things:
- Clients usually ask for extensions using the extended client hello message described in Section 2.1. TLS 1.0 [TLS] requires servers to accept extended client hello messages, even if the server doesn't "understand" the extension ๐.
- For the specific extensions here, no mandatory server response is required when clients ask for extended functionality ๐ซถ.
Note, though, that even with backwards compatibility, some constrained clients may be forced to reject communication with servers that don't support the extensions, because those clients just don't have the capabilities ๐ฌ.
The rest of this doc is laid out like this. Section 2 covers general extension mechanisms for the client hello and server hello handshake messages. Section 3 covers specific extensions to TLS 1.0. Section 4 covers new error alerts for use with the TLS extensions. The final sections address IPR, security considerations, registration of the application/pkix-pkipath MIME type, acknowledgements, and references ๐.
2. General Extension Mechanisms โจ
This section presents general extension mechanisms for the TLS handshake client hello and server hello messages ๐ง.
These general mechanisms are needed so clients and servers can negotiate whether to use specific extensions, and how to use them. The extension formats described here are based on [MAILING LIST] ๐.
Section 2.1 specifies the extended client hello message format, Section 2.2 specifies the extended server hello message format, and Section 2.3 describes the actual extension format used with the extended client and server hellos ๐๏ธ.
2.1. Extended Client Hello ๐
Clients MAY request extended functionality from servers by sending the extended client hello message format in place of the client hello message format. The extended client hello message format is:
struct {
ProtocolVersion client_version;
Random random;
SessionID session_id;
CipherSuite cipher_suites<2..2^16-1>;
CompressionMethod compression_methods<1..2^8-1>;
Extension client_hello_extension_list<0..2^16-1>;
} ClientHello;
Here the new client_hello_extension_list field holds a list of extensions. The actual Extension format is defined in Section 2.3 ๐.
If a client asks for extra functionality using the extended client hello, and the server doesn't provide it, the client MAY abort the handshake ๐.
Note that [TLS], Section 7.4.1.2, allows additional information to be added to the client hello message. So using the extended client hello defined above should not "break" existing TLS 1.0 servers ๐ซง.
A server that supports the extensions mechanism MUST accept only client hello messages in either the original or extended ClientHello format. It (as for all other messages) MUST check that the amount of data in the message precisely matches one of these formats. If it doesn't, it MUST send a fatal decode_error alert. This overrides the "Forward compatibility note" in [TLS]. ๐จ
2.2. Extended Server Hello ๐ฆ
The extended server hello message format MAY be sent in place of the server hello message when the client has asked for extended functionality via the extended client hello message specified in Section 2.1. The extended server hello message format is:
struct {
ProtocolVersion server_version;
Random random;
SessionID session_id;
CipherSuite cipher_suite;
CompressionMethod compression_method;
Extension server_hello_extension_list<0..2^16-1>;
} ServerHello;
Here the new server_hello_extension_list field holds a list of extensions. The actual Extension format is defined in Section 2.3 ๐.
Note that the extended server hello message is only sent in response to an extended client hello message. That's what stops the extended server hello from possibly "breaking" existing TLS 1.0 clients ๐ก๏ธ.
2.3. Hello Extensions โจ
okay so the extension format for extended client hellos and extended server hellos looks like this ๐
struct {
ExtensionType extension_type;
opaque extension_data<0..2^16-1>;
} Extension;
Here's the breakdown ๐ง
extension_typeidentifies the particular extension type.extension_datacontains information specific to the particular extension type.
The extension types defined in this document are ๐
enum {
server_name(0), max_fragment_length(1),
client_certificate_url(2), trusted_ca_keys(3),
truncated_hmac(4), status_request(5), (65535)
} ExtensionType;
Now the important bit ๐จ For all extension types (including ones defined in future), the extension type MUST NOT appear in the extended server hello unless the same extension type appeared in the corresponding client hello. So clients MUST abort the handshake if they get an extension type in the extended server hello that they did not request in the associated (extended) client hello. No surprise guests allowed ๐
Nonetheless, "server initiated" extensions may be provided in the future within this framework by requiring the client to first send an empty extension to indicate that it supports a particular extension. Very clever, ngl ๐ง
Also, when multiple extensions of different types are present in the extended client hello or the extended server hello, the extensions may appear in any order. There MUST NOT be more than one extension of the same type. One of each, bestie ๐ธ
Finally, all the extensions defined in this document are relevant only when a session is initiated. However, a client that requests resumption of a session does not in general know whether the server will accept this request, so it SHOULD send an extended client hello if it would normally do so for a new session. If the resumption request is denied, then a new set of extensions will be negotiated as normal. If, on the other hand, the older session is resumed, then the server MUST ignore extensions appearing in the client hello, and send a server hello containing no extensions. In this case, the extension functionality negotiated during the original session initiation is applied to the resumed session. Plot twist energy ๐ฆ
2.4. Extensions to the handshake protocol ๐
This document suggests the use of two new handshake messages, "CertificateURL" and "CertificateStatus". These messages are described in Section 3.3 and Section 3.6, respectively. So the new handshake message structure becomes ๐
enum {
hello_request(0), client_hello(1), server_hello(2),
certificate(11), server_key_exchange (12),
certificate_request(13), server_hello_done(14),
certificate_verify(15), client_key_exchange(16),
finished(20), certificate_url(21), certificate_status(22),
(255)
} HandshakeType;
struct {
HandshakeType msg_type; /* handshake type */
uint24 length; /* bytes in message */
select (HandshakeType) {
case hello_request: HelloRequest;
case client_hello: ClientHello;
case server_hello: ServerHello;
case certificate: Certificate;
case server_key_exchange: ServerKeyExchange;
case certificate_request: CertificateRequest;
case server_hello_done: ServerHelloDone;
case certificate_verify: CertificateVerify;
case client_key_exchange: ClientKeyExchange;
case finished: Finished;
case certificate_url: CertificateURL;
case certificate_status: CertificateStatus;
} body;
} Handshake;
3. Specific Extensions ๐
This section describes the specific TLS extensions specified in this document. Let's get into it ๐
Quick heads up: any messages associated with these extensions that are sent during the TLS handshake MUST be included in the hash calculations involved in "Finished" messages. Not optional, babe ๐ญ
Section 3.1 describes the extension of TLS that lets a client indicate which server it is contacting. Section 3.2 describes the extension for maximum fragment length negotiation. Section 3.3 describes the extension that allows client certificate URLs. Section 3.4 describes the extension that lets a client indicate which CA root keys it possesses. Section 3.5 describes the extension that allows the use of truncated HMAC. Section 3.6 describes the extension that supports integrating certificate status information messages into TLS handshakes. So many features, so little time ๐
3.1. Server Name Indication ๐ฆ
[TLS] does not provide a mechanism for a client to tell a server the name of the server it is contacting. This is lowkey a big deal, because it may be desirable for clients to provide this information to facilitate secure connections to servers that host multiple 'virtual' servers at a single underlying network address. Virtual hosting, iykyk ๐
In order to provide the server name, clients MAY include an extension of type "server_name" in the (extended) client hello. The "extension_data" field of this extension SHALL contain "ServerNameList", where:
struct {
NameType name_type;
select (name_type) {
case host_name: HostName;
} name;
} ServerName;
enum {
host_name(0), (255)
} NameType;
opaque HostName<1..2^16-1>;
struct {
ServerName server_name_list<1..2^16-1>
} ServerNameList;
Currently the only server names supported are DNS hostnames. However, this does not imply any dependency of TLS on DNS, and other name types may be added in the future (by an RFC that Updates this document). TLS MAY treat provided server names as opaque data and pass the names and types to the application. Data is data, periodt ๐ง
"HostName" contains the fully qualified DNS hostname of the server, as understood by the client. The hostname is represented as a byte string using UTF-8 encoding [UTF8], without a trailing dot. No trailing dot, no drama ๐
If the hostname labels contain only US-ASCII characters, then the client MUST ensure that labels are separated only by the byte 0x2E, representing the dot character U+002E (requirement 1 in section 3.1 of [IDNA] notwithstanding). If the server needs to match the HostName against names that contain non-US-ASCII characters, it MUST perform the conversion operation described in section 4 of [IDNA], treating the HostName as a "query string" (i.e. the AllowUnassigned flag MUST be set). Note that IDNA allows labels to be separated by any of the Unicode characters U+002E, U+3002, U+FF0E, and U+FF61, so servers MUST accept any of these characters as a label separator. If the server only needs to match the HostName against names containing exclusively ASCII characters, it MUST compare ASCII names case-insensitively. Lots of rules, but they're giving precision โจ
Literal IPv4 and IPv6 addresses are not permitted in "HostName". Sorry, IP addresses, not this time ๐
It is RECOMMENDED that clients include an extension of type "server_name" in the client hello whenever they locate a server by a supported name type. Strong recommendation, very main character ๐
A server that receives a client hello containing the "server_name" extension MAY use the information contained in the extension to guide its selection of an appropriate certificate to return to the client, and/or other aspects of security policy. In this event, the server SHALL include an extension of type "server_name" in the (extended) server hello. The "extension_data" field of this extension SHALL be empty. Empty but still present, a whole mood ๐ซถ
If the server understood the client hello extension but does not recognize the server name, it SHOULD send an "unrecognized_name" alert (which MAY be fatal).
If an application negotiates a server name using an application protocol, then upgrades to TLS, and a server_name extension is sent, then the extension SHOULD contain the same name that was negotiated in the application protocol. If the server_name is established in the TLS session handshake, the client SHOULD NOT attempt to request a different server name at the application layer. Consistency is iconic ๐
3.2. Maximum Fragment Length Negotiation ๐ธ
[TLS] specifies a fixed maximum plaintext fragment length of 2^14 bytes. It may be desirable for constrained clients to negotiate a smaller maximum fragment length due to memory limitations or bandwidth limitations. Small devices, big feelings ๐ฅบ
In order to negotiate smaller maximum fragment lengths, clients MAY include an extension of type "max_fragment_length" in the (extended) client hello. The "extension_data" field of this extension SHALL contain ๐
enum{
2^9(1), 2^10(2), 2^11(3), 2^12(4), (255)
} MaxFragmentLength;
whose value is the desired maximum fragment length. The allowed values for this field are: 2^9, 2^10, 2^11, and 2^12.
Servers that receive an extended client hello containing a "max_fragment_length" extension MAY accept the requested maximum fragment length by including an extension of type "max_fragment_length" in the (extended) server hello. The "extension_data" field of this extension SHALL contain "MaxFragmentLength", whose value is the same as the requested maximum fragment length. Matching energy โจ
If a server receives a maximum fragment length negotiation request for a value other than the allowed values, it MUST abort the handshake with an "illegal_parameter" alert. Similarly, if a client receives a maximum fragment length negotiation response that differs from the length it requested, it MUST also abort the handshake with an "illegal_parameter" alert. No sus answers allowed ๐
Once a maximum fragment length other than 2^14 has been successfully negotiated, the client and server MUST immediately begin fragmenting messages (including handshake messages), to ensure that no fragment larger than the negotiated length is sent. Note that TLS already requires clients and servers to support fragmentation of handshake messages. So it's not a brand new skill, just a must-do now ๐
The negotiated length applies for the duration of the session, including session resumptions. Forever and always ๐
The negotiated length limits the input that the record layer may process without fragmentation (that is, the maximum value of TLSPlaintext.length; see [TLS] section 6.2.1). Note that the output of the record layer may be larger. For example, if the negotiated length is 2^9=512, then for currently defined cipher suites (those defined in [TLS], [KERB], and [AESSUITES]), and when null compression is used, the record layer output can be at most 793 bytes: 5 bytes of headers, 512 bytes of application data, 256 bytes of padding, and 20 bytes of MAC. That means that in this event, a TLS record layer peer receiving a TLS record layer message larger than 793 bytes may discard the message and send a "record_overflow" alert, without decrypting the message. Math check passed, we're thriving ๐งฎ๐ฆ
3.3. Client Certificate URLs ๐ฆ
okay bestie, so [TLS] says that when client authentication happens, clients send their certificates to the server during the TLS handshake. ๐ญ But constrained clients (the little devices with not much memory) don't always want to store every cert, so they can send certificate URLs instead and save memory. it's giving smart resource management ๐
To get this going, clients MAY include an extension of type client_certificate_url in the (extended) client hello. The extension_data field of this extension SHALL be empty. ๐
(Note that it is necessary to negotiate use of client certificate URLs in order to avoid "breaking" existing TLS 1.0 servers. ๐)
Servers that get an extended client hello with a client_certificate_url extension MAY say they're cool with certificate URLs by including an extension of type client_certificate_url in the (extended) server hello. The extension_data field of this extension SHALL be empty. ๐ซถ
Once the negotiation is done (both sides have exchanged hellos with client_certificate_url extensions), clients MAY send a CertificateURL message in place of a Certificate message:
enum {
individual_certs(0), pkipath(1), (255)
} CertChainType;
enum {
false(0), true(1)
} Boolean;
struct {
CertChainType type;
URLAndOptionalHash url_and_hash_list<1..2^16-1>;
} CertificateURL;
struct {
opaque url<1..2^16-1>;
Boolean hash_present;
select (hash_present) {
case false: struct {};
case true: SHA1Hash;
} hash;
} URLAndOptionalHash;
opaque SHA1Hash[20];
So url_and_hash_list is basically a list of URLs with optional hashes. ๐ธ
When X.509 certs are involved, there are two possibilities:
- if
CertificateURL.typeisindividual_certs, each URL points to a single DER-encoded X.509v3 certificate, with the URL for the client's certificate first, or - if
CertificateURL.typeispkipath, the list has a single URL pointing to a DER-encoded certificate chain, using the type PkiPath described in Section 8. ๐ง
When any other certificate format is used, the spec that describes using that format in TLS should define how the certificates or chains get encoded, and any rules about their ordering. ๐
Each URL can optionally come with a hash, at the client's discretion. If there is one, it's the SHA-1 hash of the certificate or certificate chain (for X.509, that's the DER-encoded certificate or the DER-encoded PkiPath). ๐ฅ
Heads up on ordering: when you use a list of URLs for X.509 certs, the URL order matches the TLS Certificate message (see [TLS] Section 7.4.2), but it's the opposite of the order certs get encoded in PkiPath. โจ Either way, the self-signed root certificate MAY be left out of the chain, since the server must already have it to validate anything. ๐
Servers that receive CertificateURL SHALL try to fetch the client's certificate chain from the URLs, then process the chain as usual. ๐ A cached copy of any URL's content MAY be used, as long as a SHA-1 hash is present for that URL and it matches the hash of the cached copy. ๐
Servers that support this extension MUST support the http: URL scheme for certificate URLs, and MAY support other schemes. ๐
If the protocol used to fetch certificates returns a MIME formatted response (like HTTP does), then these MIME Content-Types SHALL be used: a single X.509v3 certificate gets application/pkix-cert [PKIOP], and a chain of X.509v3 certificates gets application/pkix-pkipath (see Section 8). ๐
If a SHA-1 hash is present for a URL, the server MUST check that the SHA-1 hash of the object it retrieved from that URL (after decoding any MIME Content-Transfer-Encoding) matches the given hash. If any retrieved object doesn't have the right SHA-1 hash, the server MUST abort the handshake with a bad_certificate_hash_value alert. ๐จ๐ฑ
Clients may choose to send either Certificate or CertificateURL after successfully negotiating the option to send certificate URLs. The option to send a certificate is there so clients with multiple certificates have flexibility. ๐ฆ
If a server runs into an unreasonable delay getting certificates from a given CertificateURL, it SHOULD time out and signal a certificate_unobtainable error alert. โฐ
3.4. Trusted CA Indication ๐
Constrained clients have limited memory, so they may only hold a small number of CA root keys. They might want to tell servers which root keys they have, to avoid repeated handshake failures. ๐ฅบ
To indicate which CA root keys they possess, clients MAY include an extension of type trusted_ca_keys in the (extended) client hello. The extension_data field of this extension SHALL contain TrustedAuthorities, where:
struct {
TrustedAuthority trusted_authorities_list<0..2^16-1>;
} TrustedAuthorities;
struct {
IdentifierType identifier_type;
select (identifier_type) {
case pre_agreed: struct {};
case key_sha1_hash: SHA1Hash;
case x509_name: DistinguishedName;
case cert_sha1_hash: SHA1Hash;
} identifier;
} TrustedAuthority;
enum {
pre_agreed(0), key_sha1_hash(1), x509_name(2),
cert_sha1_hash(3), (255)
} IdentifierType;
opaque DistinguishedName<1..2^16-1>;
So TrustedAuthorities is a list of CA root key identifiers that the client has. Each CA root key is identified in one of these ways: ๐
pre_agreed- no CA root key identity supplied. ๐คทโโ๏ธkey_sha1_hash- contains the SHA-1 hash of the CA root key. For DSA and ECDSA keys, this is the hash of thesubjectPublicKeyvalue. For RSA keys, the hash is of the big-endian byte string representation of the modulus without any initial 0-valued bytes. (This copies the key hash formats deployed in other environments.) ๐x509_name- contains the DER-encoded X.509 DistinguishedName of the CA. ๐ท๏ธcert_sha1_hash- contains the SHA-1 hash of a DER-encoded Certificate containing the CA root key. ๐ชช
Clients can include none, some, or all of the CA root keys they have in this extension. ๐
Also, a key hash or a Distinguished Name alone might not uniquely identify a certificate issuer. For example, a CA could have multiple key pairs. But here we assume that's the case, following how TLS already uses Distinguished Names to identify certificate issuers. ๐ค
The option to include no CA root keys exists so the client can indicate it has some pre-defined set of CA root keys. ๐ธ
Servers that receive a client hello containing the trusted_ca_keys extension MAY use that info to guide their choice of an appropriate certificate chain to send back. If they do, the server SHALL include an extension of type trusted_ca_keys in the (extended) server hello. The extension_data field of this extension SHALL be empty. ๐งโจ
3.5. Truncated HMAC ๐
Currently defined TLS cipher suites use the MAC construction HMAC with either MD5 or SHA-1 [HMAC] to authenticate record layer communications. In TLS, the entire output of the hash function is used as the MAC tag. But in constrained environments, it might be nice to save bandwidth by truncating the hash output to 80 bits when forming MAC tags. ๐ฆ๐ซ
To negotiate 80-bit truncated HMAC, clients MAY include an extension of type truncated_hmac in the extended client hello. The extension_data field of this extension SHALL be empty. ๐
Servers that receive an extended hello containing a truncated_hmac extension MAY agree to use a truncated HMAC by including an extension of type truncated_hmac, with empty extension_data, in the extended server hello. ๐ซถ
Note that if new cipher suites are added that don't use HMAC, and the session negotiates one of them, this extension will have no effect. It is strongly recommended that any new cipher suites using other MACs consider the MAC size as an integral part of the cipher suite definition, taking into account both security and bandwidth considerations. ๐
If HMAC truncation has been successfully negotiated during a TLS handshake, and the negotiated cipher suite uses HMAC, both the client and the server pass this fact to the TLS record layer along with the other negotiated security parameters. After that, during the session, clients and servers MUST use truncated HMACs, calculated as specified in [HMAC]. That means CipherSpec.hash_size is 10 bytes, and only the first 10 bytes of the HMAC output are transmitted and checked. Note that this extension does not affect the calculation of the PRF as part of handshaking or key derivation. ๐ฅ
The negotiated HMAC truncation size applies for the duration of the session, including session resumptions. ๐๐
3.6. Certificate Status Request โจ
okay so constrained clients are kinda the underdogs here ๐ฅบ they might want to use a certificate-status protocol like OCSP [OCSP] to check whether server certificates are still valid. that way they don't have to download CRLs, which saves bandwidth on tight networks ๐ฆ this extension lets that status info ride along inside the TLS handshake itself, so you save roundtrips and resources. iconic, honestly ๐
so to say "hey, I want certificate status info," clients MAY include an extension of type "status_request" in the (extended) client hello ๐ its "extension_data" field SHALL contain "CertificateStatusRequest", which looks like this:
struct {
CertificateStatusType status_type;
select (status_type) {
case ocsp: OCSPStatusRequest;
} request;
} CertificateStatusRequest;
enum { ocsp(1), (255) } CertificateStatusType;
struct {
ResponderID responder_id_list<0..2^16-1>;
Extensions request_extensions;
} OCSPStatusRequest;
opaque ResponderID<1..2^16-1>;
opaque Extensions<0..2^16-1>;
in the OCSPStatusRequest, the "ResponderIDs" is basically a list of OCSP responders the client trusts ๐ง a zero-length "responder_id_list" is special: it means the responders are implicitly known to the server, like through a prior arrangement (e.g., ๐ค). and "Extensions" is a DER encoding of OCSP request extensions.
both "ResponderID" and "Extensions" are DER-encoded ASN.1 types as defined in [OCSP], and "Extensions" is imported from [PKIX]. a zero-length "request_extensions" value means there are no extensions ๐ธ this is different from a zero-length ASN.1 SEQUENCE, which is NOT valid for the "Extensions" type. so don't mix those up, bestie ๐
now the nonce drama ๐ญ [OCSP] is kinda unclear about the encoding of the "id-pkix-ocsp-nonce" OCSP extension. so for clarification, the nonce MUST be a DER-encoded OCTET STRING, which then gets wrapped in another OCTET STRING. heads up: implementations based on an existing OCSP client will need to be checked for conformance with this, so go check yours ๐
on the server side, servers that receive a client hello with the "status_request" extension MAY return a suitable certificate status response along with their certificate ๐ if OCSP was requested, they SHOULD use the info in the extension when picking an OCSP responder, and they SHOULD include request_extensions in the OCSP request.
servers send that response by sending a "CertificateStatus" message immediately after the "Certificate" message, and before any "ServerKeyExchange" or "CertificateRequest" messages โจ and here's the rule: if a server returns a "CertificateStatus" message, then the server MUST have included an extension of type "status_request" with empty "extension_data" in the extended server hello. no freeloading ๐ โโ๏ธ
struct {
CertificateStatusType status_type;
select (status_type) {
case ocsp: OCSPResponse;
} response;
} CertificateStatus;
opaque OCSPResponse<1..2^24-1>;
an "ocsp_response" is a complete, DER-encoded OCSP response (using the ASN.1 type OCSPResponse from [OCSP]). just a heads up, only one OCSP response may be sent ๐
the "CertificateStatus" message gets sent using the handshake message type "certificate_status" ๐ง
a few more spicy notes: a server MAY also choose NOT to send a "CertificateStatus" message, even if it got a "status_request" extension in the client hello ๐คทโโ๏ธ but servers MUST NOT send the "CertificateStatus" message unless they actually received a "status_request" extension in the client hello. no sneaky surprises.
and clients who requested an OCSP response, and then received one in a "CertificateStatus" message, MUST check that OCSP response. if it isn't satisfactory, they MUST abort the handshake ๐จ
4. Error Alerts ๐จ
this section defines new error alerts for use with the TLS extensions in this document ๐
the following new error alerts are defined. to avoid "breaking" existing clients and servers, these alerts MUST NOT be sent unless the sending party has received an extended hello message from the party they're talking to. ngl, that's a super respectful move ๐ซถ
- "unsupported_extension" - this alert is sent by clients that receive an extended server hello containing an extension they did NOT put in the matching client hello (see Section 2.3). this one is always fatal ๐
- "unrecognized_name" - this alert is sent by servers that receive a server_name extension request but don't recognize the server name. this message MAY be fatal ๐
- "certificate_unobtainable" - this alert is sent by servers who can't retrieve a certificate chain from the URL the client supplied (see Section 3.3). this message MAY be fatal. for example, if the server requires client authentication for the handshake to continue and it can't retrieve the certificate chain, it may send a fatal alert ๐ญ
- "bad_certificate_status_response" - this alert is sent by clients that receive an invalid certificate status response (see Section 3.6). this one is always fatal ๐
- "bad_certificate_hash_value" - this alert is sent by servers when a certificate hash doesn't match a client-provided certificate_hash. this one is always fatal too ๐
these error alerts get conveyed using the following syntax:
enum {
close_notify(0),
unexpected_message(10),
bad_record_mac(20),
decryption_failed(21),
record_overflow(22),
decompression_failure(30),
handshake_failure(40),
/* 41 is not defined, for historical reasons */
bad_certificate(42),
unsupported_certificate(43),
certificate_revoked(44),
certificate_expired(45),
certificate_unknown(46),
illegal_parameter(47),
unknown_ca(48),
access_denied(49),
decode_error(50),
decrypt_error(51),
export_restriction(60),
protocol_version(70),
insufficient_security(71),
internal_error(80),
user_canceled(90),
no_renegotiation(100),
unsupported_extension(110), /* new */
certificate_unobtainable(111), /* new */
unrecognized_name(112), /* new */
bad_certificate_status_response(113), /* new */
bad_certificate_hash_value(114), /* new */
(255)
} AlertDescription;
5. Procedure for Defining New Extensions ๐ฆ
okay, the tea โ traditionally, the Internet Assigned Numbers Authority (IANA) handles allocating new values for future expansion, and RFCs usually define the procedure IANA uses. BUT there are subtle (and not so subtle) interactions that can happen in this protocol between new features and existing ones, and those can seriously reduce overall security ๐ฌ
so requests to define new extensions (including assigning extension and error alert numbers) must be approved by IETF Standards Action. no shortcuts, babe ๐ฅ
when you're designing new extensions, keep these in mind โจ
- all of the extensions defined in this document follow the same convention: for each extension a client requests and the server understands, the server replies with an extension of the same type ๐
- some cases where a server doesn't agree to an extension are error conditions, and some are just a refusal to support a feature. in general, error alerts should be used for the former, and a field in the server extension response for the latter ๐
- extensions should, as far as possible, be designed to prevent any attack that forces use (or non-use) of a particular feature by manipulating handshake messages ๐ก๏ธ this applies whether or not the feature is believed to cause a security problem, so no exceptions, pls.
often the fact that the extension fields are included in the inputs to the Finished message hashes will be enough. but extreme care is needed when the extension changes the meaning of messages sent during the handshake phase ๐ designers and implementors should be aware that until the handshake has been authenticated, active attackers can modify messages and insert, remove, or replace extensions. scary, I know ๐ญ
- it would be technically possible to use extensions to change major aspects of TLS's design, like cipher suite negotiation. this is NOT recommended ๐ โโ๏ธ it would be more appropriate to define a new version of TLS. the TLS handshake has specific protection against version rollback attacks based on the version number, and the possibility of version rollback should be a big consideration in any major design change ๐
6. Security Considerations ๐
babe, this part is serious, so I'm keeping the full vibe ๐ซถ security considerations for the extension mechanism in general, and for designing new extensions, are in the previous section. a security analysis of each extension defined in this document is below.
in general, implementers should keep up with the state of the art and address any weaknesses that get identified ๐
extra security considerations are described in the TLS 1.0 RFC [TLS] ๐
6.1. Security of server_name ๐ธ
if a single server hosts several domains, then it's obviously necessary for each domain's owner to make sure it meets their security needs ๐ apart from that, server_name doesn't seem to introduce any significant security issues.
implementations MUST ensure that a buffer overflow does not occur, no matter what the values of the length fields in server_name are. this is a must-not-skip, so please, please, please ๐ญ๐
although this document specifies an encoding for internationalized hostnames in the server_name extension, it does NOT address the security issues that come with using internationalized hostnames in TLS ๐ especially the consequences of "spoofed" names that look identical to another name when displayed or printed. it is recommended that server certificates not be issued for internationalized hostnames unless there are procedures in place to mitigate the risk of spoofed hostnames ๐
6.2. Security of max_fragment_length โจ
the maximum fragment length takes effect immediately, including for handshake messages. however, that doesn't add any security complications that aren't already in TLS, since [TLS] requires implementations to be able to handle fragmented handshake messages ๐งฉ
note that, as described in section 3.2, once a non-null cipher suite has been activated, the effective maximum fragment length depends on the cipher suite and compression method, as well as on the negotiated max_fragment_length. this must be taken into account when sizing buffers and checking for buffer overflow ๐จ no cap, this is the one to remember, bestie ๐
6.3. Security of client_certificate_url ๐
okay so this extension has two major issues and we need to talk about both ๐ญ
The first big one is whether or not clients should include certificate hashes when they send certificate URLs. When client authentication is used without the client_certificate_url extension, the client certificate chain is covered by the Finished message hashes. Including hashes and checking them against the retrieved certificate chain is how we make sure the same property still holds when this extension is used, i.e., that everything in the chain the server retrieved is exactly what the client meant to send. โจ
On the other hand, leaving the hashes out unlocks something really useful. Clients can be issued daily certificates that live at a fixed URL and don't need to be provided to the client ๐ง. But clients that skip the hashes should know about one possible attack: the attacker gets a valid certificate on the client's key that is different from the one the client intended to provide. ๐ Although TLS uses both MD5 and SHA-1 hashes in several other places, this was not believed to be necessary here. The property required of SHA-1 is second pre-image resistance.
The second major issue is that supporting client_certificate_url means the server acts as a client in another URL protocol. So the server picks up many of the same security concerns that clients of that URL scheme deal with, plus an extra worry: the client can try to make the server connect to some possibly weird-looking URL ๐.
In general, this means an attacker might use the server to indirectly attack another host that has some security flaw. It also opens the door to denial of service attacks, where an attacker makes lots of connections to the server and each one makes the server try to connect to the target of the attack ๐ค.
Note that the server may be behind a firewall or otherwise able to reach hosts that aren't directly accessible from the public Internet. That could make the security and denial of service problems above worse, and it could also let someone confirm the existence of internal hosts that would otherwise stay hidden ๐.
The detailed concerns depend on which URL schemes the server supports. For HTTP, the concerns are similar to those for a publicly accessible HTTP proxy server. For HTTPS, loops and deadlocks can be created, and that should be addressed. For FTP, attacks similar to FTP bounce attacks come up ๐.
As a result, it is RECOMMENDED that the client_certificate_url extension should have to be specifically enabled by a server administrator, rather than being enabled by default. It is also RECOMMENDED that URI protocols be enabled by the administrator individually, and that only a minimal set of protocols be enabled. Unusual protocols that offer limited security, or whose security is not well-understood, should be avoided ๐ซถ.
As discussed in [URI], URLs that specify ports other than the default may cause problems, and so may very long URLs (which are more likely to be useful in exploiting buffer overflow bugs) ๐ .
Also, HTTP caching proxies are super common on the Internet, and some of them don't check for the latest version of an object correctly ๐ญ. If a request using HTTP (or another caching protocol) goes through a misconfigured or otherwise broken proxy, the proxy may return an out-of-date response.
6.4. Security of trusted_ca_keys ๐
It is possible that which CA root keys a client possesses could be regarded as confidential information. As a result, the CA root key indication extension should be used with care ๐คซ.
The use of the SHA-1 certificate hash alternative ensures that each certificate is specified unambiguously. As with the previous extension, it was not believed necessary to use both MD5 and SHA-1 hashes.
6.5. Security of truncated_hmac ๐ฆ
It is possible that truncated MACs are weaker than "un-truncated" MACs. However, no significant weaknesses are currently known or expected to exist for HMAC with MD5 or SHA-1, truncated to 80 bits โจ.
Note that the output length of a MAC doesn't need to be as long as a symmetric cipher key, since forging MAC values can't be done off-line. In TLS, a single failed MAC guess causes the immediate termination of the TLS session, which is kind of iconic ๐.
Since the MAC algorithm only takes effect after the handshake messages have been authenticated by the hashes in the Finished messages, an active attacker can't force negotiation of the truncated HMAC extension where it wouldn't otherwise be used (to the extent that the handshake authentication is secure). So if a security problem were ever found with truncated HMAC in the future, and either the client or the server for a given session had been updated to take the problem into account, they would be able to veto use of this extension ๐ก๏ธ.
6.6. Security of status_request ๐
If a client requests an OCSP response, it must take into account that an attacker's server using a compromised key could (and probably would) pretend not to support the extension. A client that requires OCSP validation of certificates SHOULD either contact the OCSP server directly in this case, or abort the handshake ๐จ.
Use of the OCSP nonce request extension (id-pkix-ocsp-nonce) may improve security against attacks that try to replay OCSP responses. See section 4.4.1 of [OCSP] for further details ๐ง .
7. Internationalization Considerations ๐
None of the extensions defined here directly use strings subject to localization. Domain Name System (DNS) hostnames are encoded using UTF-8. If future extensions use text strings, then internationalization should be considered in their design ๐.
8. IANA Considerations ๐
The MIME type "application/pkix-pkipath" has been registered by the IANA with the following template:
To: ietf-types@iana.org Subject: Registration of MIME media type
application/pkix-pkipath
MIME media type name: application
MIME subtype name: pkix-pkipath
Required parameters: none
Optional parameters: version (default value is "1")
Encoding considerations:
This MIME type is a DER encoding of the ASN.1 type PkiPath,
defined as follows:
PkiPath ::= SEQUENCE OF Certificate
PkiPath is used to represent a certification path. Within the
sequence, the order of certificates is such that the subject of
the first certificate is the issuer of the second certificate,
etc.
This is identical to the definition that will be published in
[X509-4th-TC1]; note that it is different from that in [X509-4th].
All Certificates MUST conform to [PKIX]. (This should be
interpreted as a requirement to encode only PKIX-conformant
certificates using this type. It does not necessarily require
that all certificates that are not strictly PKIX-conformant must
be rejected by relying parties, although the security consequences
of accepting any such certificates should be considered
carefully.)
DER (as opposed to BER) encoding MUST be used. If this type is
sent over a 7-bit transport, base64 encoding SHOULD be used.
Security considerations:
The security considerations of [X509-4th] and [PKIX] (or any
updates to them) apply, as well as those of any protocol that uses
this type (e.g., TLS).
Note that this type only specifies a certificate chain that can be
assessed for validity according to the relying party's existing
configuration of trusted CAs; it is not intended to be used to
specify any change to that configuration.
Interoperability considerations:
No specific interoperability problems are known with this type,
but for recommendations relating to X.509 certificates in general,
see [PKIX].
Published specification: this memo, and [PKIX].
Applications which use this media type: TLS. It may also be used by
other protocols, or for general interchange of PKIX certificate
chains.
Additional information:
Magic number(s): DER-encoded ASN.1 can be easily recognized.
Further parsing is required to distinguish from other ASN.1
types.
File extension(s): .pkipath
Macintosh File Type Code(s): not specified
Person & email address to contact for further information:
Magnus Nystrom <magnus@rsasecurity.com>
Intended usage: COMMON
Author/Change controller:
Magnus Nystrom <magnus@rsasecurity.com>
9. Intellectual Property Rights โ๏ธ
The IETF takes no position on the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document, or on the extent to which any license under such rights might or might not be available. It also doesn't represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in RFC 2028. Copies of claims of rights made available for publication, and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the IETF Secretariat.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this document. Please address that information to the IETF Executive Director.
10. Acknowledgments ๐
The authors wish to thank the TLS Working Group and the WAP Security Group. This document is based on discussion within these groups ๐ซถ.
11. Normative References โจ
okay bestie, these are the docs the spec leans on to work, so you need them ๐๐ Here's the full list, copied exactly so nothing gets lost:
[HMAC] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC:
Keyed-hashing for message authentication", RFC 2104,
February 1997.
[HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[IDNA] Faltstrom, P., Hoffman, P. and A. Costello,
"Internationalizing Domain Names in Applications
(IDNA)", RFC 3490, March 2003.
[KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[OCSP] Myers, M., Ankney, R., Malpani, A., Galperin, S. and
C. Adams, "Internet X.509 Public Key Infrastructure:
Online Certificate Status Protocol - OCSP", RFC 2560,
June 1999.
[PKIOP] Housley, R. and P. Hoffman, "Internet X.509 Public Key
Infrastructure - Operation Protocols: FTP and HTTP",
RFC 2585, May 1999.
[PKIX] Housley, R., Polk, W., Ford, W. and D. Solo, "Internet
Public Key Infrastructure - Certificate and
Certificate Revocation List (CRL) Profile", RFC 3280,
April 2002.
[TLS] Dierks, T. and C. Allen, "The TLS Protocol Version
1.0", RFC 2246, January 1999.
[URI] Berners-Lee, T., Fielding, R. and L. Masinter,
"Uniform Resource Identifiers (URI): Generic Syntax",
RFC 2396, August 1998.
[UTF8] Yergeau, F., "UTF-8, a transformation format of ISO
10646", RFC 2279, January 1998.
[X509-4th] ITU-T Recommendation X.509 (2000) | ISO/IEC 9594-
8:2001, "Information Systems - Open Systems
Interconnection - The Directory: Public key and
attribute certificate frameworks."
[X509-4th-TC1] ITU-T Recommendation X.509(2000) Corrigendum 1(2001) |
ISO/IEC 9594-8:2001/Cor.1:2002, Technical Corrigendum
1 to ISO/IEC 9594:8:2001.
12. Informative References ๐ง
these ones are the extra reading ๐ good for background, not required to implement the spec. the full list:
[KERB] Medvinsky, A. and M. Hur, "Addition of Kerberos Cipher
Suites to Transport Layer Security (TLS)", RFC 2712,
October 1999.
[MAILING LIST] J. Mikkelsen, R. Eberhard, and J. Kistler, "General
ClientHello extension mechanism and virtual hosting,"
ietf-tls mailing list posting, August 14, 2000.
[AESSUITES] Chown, P., "Advanced Encryption Standard (AES)
Ciphersuites for Transport Layer Security (TLS)", RFC
3268, June 2002.
13. Authors' Addresses ๐ซถ
these are the people who wrote it, bestie. their contact details, exactly as listed:
Simon Blake-Wilson
BCI
EMail: sblakewilson@bcisse.com
Magnus Nystrom
RSA Security
EMail: magnus@rsasecurity.com
David Hopwood
Independent Consultant
EMail: david.hopwood@zetnet.co.uk
Jan Mikkelsen
Transactionware
EMail: janm@transactionware.com
Tim Wright
Vodafone
EMail: timothy.wright@vodafone.com
14. Full Copyright Statement โ๏ธ
okay so the legal bit, but make it cute ๐ the big vibe is: you can copy this doc and share it, make derivative works that explain or help implement it, and translate it, as long as the copyright notice and this paragraph stay on every copy. the document itself can't be edited, except to develop Internet standards (that goes through the standards process) or to translate it into languages other than English. those permissions are forever and nobody can take them back ๐
Copyright (C) The Internet Society (2003). All Rights Reserved.
the rest of the notice, in full: the document and its translations may be copied and furnished to others. derivative works that comment on or otherwise explain it, or assist in its implementation, may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. however, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards (in which case the procedures for copyrights defined in the Internet Standards process must be followed), or as required to translate it into languages other than English.
the limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
and the disclaimer, which is serious even if I'm being bubbly about it ๐
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement ๐ธ
funding for the RFC Editor function is currently provided by the Internet Society. thank you for keeping the lights on, bestie โจ
๐ฆ where this page comes from
- ietf: rfc3546 2003-06
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms