TLS | P. Wouters, Ed. |
Internet-Draft | Red Hat |
Intended status: Standards Track | H. Tschofenig, Ed. |
Expires: January 16, 2014 | Nokia Siemens Networks |
J. Gilmore | |
S. Weiler | |
SPARTA, Inc. | |
T. Kivinen | |
AuthenTec | |
July 15, 2013 |
Out-of-Band Public Key Validation for Transport Layer Security (TLS)
draft-ietf-tls-oob-pubkey-08.txt
This document specifies a new certificate type and two TLS extensions, one for the client and one for the server, for exchanging raw public keys in Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) for use with out-of-band public key validation.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 16, 2014.
Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Traditionally, TLS client and server public keys are obtained in PKIX containers in-band using the TLS handshake and validated using trust anchors based on a [PKIX] certification authority (CA). This method can add a complicated trust relationship that is difficult to validate. Examples of such complexity can be seen in [Defeating-SSL].
Alternative methods are available that allow a TLS clients/servers to obtain the TLS servers/client public key:
The mechanism defined herein only provides authentication when an out-of-band mechanism is also used to bind the public key to the entity presenting the key.
This document registers a new value to the IANA certificate types registry for the support of raw public keys. It also defines two new TLS extensions, "client_certificate_type" and "server_certificate_type".
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
This section describes the changes to the TLS handshake message contents when raw public keys are to be used. Figure 4 illustrates the exchange of messages as described in the sub-sections below. The client and the server exchange make use of two new TLS extensions, namely 'client_certificate_type' and 'server_certificate_type', and an already available IANA TLS Certificate Type registry [TLS-Certificate-Types-Registry] to indicate their ability and desire to exchange raw public keys. These raw public keys, in the form of a SubjectPublicKeyInfo structure, are then carried inside the Certificate payload. The Certificate and the SubjectPublicKeyInfo structure is shown in Figure 1.
opaque ASN.1Cert<1..2^24-1>; struct { select(certificate_type){ // certificate type defined in this document. case RawPublicKey: opaque ASN.1_subjectPublicKeyInfo<1..2^24-1>; // X.509 certificate defined in RFC 5246 case X.509: ASN.1Cert certificate_list<0..2^24-1>; // Additional certificate type based on TLS // Certificate Type Registry }; } Certificate;
Figure 1: TLS Certificate Structure.
The SubjectPublicKeyInfo structure is defined in Section 4.1 of RFC 5280 [PKIX] and does not only contain the raw keys, such as the public exponent and the modulus of an RSA public key, but also an algorithm identifier. The algorithm identifier can also include parameters. The structure, as shown in Figure 2, is encoded in an DER encoded ASN.1 format [X.690] and therefore contains length information as well. An example is provided in Appendix A.
SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, subjectPublicKey BIT STRING } AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL }
Figure 2: SubjectPublicKeyInfo ASN.1 Structure.
The algorithm identifiers are Object Identifiers (OIDs). RFC 3279 [RFC3279] and [RFC5480] define the following OIDs shown in Figure 3.
Key Type | Document | OID -----------------------+----------------------------+------------------- RSA | Section 2.3.1 of RFC 3279 | 1.2.840.113549.1.1 .......................|............................|................... Digital Signature | | Algorithm (DSS) | Section 2.3.2 of RFC 3279 | 1.2.840.10040.4.1 .......................|............................|................... Elliptic Curve | | Digital Signature | | Algorithm (ECDSA) | Section 2.3.5 of RFC 5480 | 1.2.840.10045.2.1 -----------------------+----------------------------+-------------------
Figure 3: Example Algorithm Object Identifiers.
client_hello, client_certificate_type server_certificate_type -> <- server_hello, client_certificate_type, server_certificate_type, certificate, server_key_exchange, certificate_request, server_hello_done certificate, client_key_exchange, certificate_verify, change_cipher_spec, finished -> <- change_cipher_spec, finished Application Data <-------> Application Data
Figure 4: Basic Raw Public Key TLS Exchange.
The message exchange in Figure 4 shows the 'client_certificate_type' and 'server_certificate_type' extensions added to the client and server hello messages.
The semantic of the two extensions is defined as follows:
The "extension_data" field of this extension contains the ClientCertTypeExtension or the ServerCertTypeExtension structure, as shown in Figure 5. The CertificateType structure is an enum with with values from TLS Certificate Type Registry.
struct { select(ClientOrServerExtension) case client: CertificateType client_certificate_types<1..2^8-1>; case server: CertificateType client_certificate_type; } } ClientCertTypeExtension; struct { select(ClientOrServerExtension) case client: CertificateType server_certificate_types<1..2^8-1>; case server: CertificateType server_certificate_type; } } ServerCertTypeExtension;
Figure 5: CertTypeExtension Structure.
No new cipher suites are required to use raw public keys. All existing cipher suites that support a key exchange method compatible with the defined extension can be used.
In order to indicate the support of out-of-band raw public keys, clients MUST include the 'client_certificate_type' and 'server_certificate_type' extensions in an extended client hello message. The hello extension mechanism is described in TLS 1.2 [RFC5246].
If the server receives a client hello that contains the 'client_certificate_type' and 'server_certificate_type' extensions and chooses a cipher suite then three outcomes are possible:
If the TLS server also requests a certificate from the client (via the certificate_request) it MUST include the 'client_certificate_type' extension with a value chosen from the list of client-supported certificates types (as provided in the 'client_certificate_type' of the client hello).
If the client hello indicates support of raw public keys in the 'client_certificate_type' extension and the server chooses to use raw public keys then the TLS server MUST place the SubjectPublicKeyInfo structure into the Certificate payload.
The semantics of this message remain the same as in the TLS specification.
All the other handshake messages are identical to the TLS specification.
Client authentication by the TLS server is supported only through authentication of the received client SubjectPublicKeyInfo via an out-of-band method.
Figure 6, Figure 7, and Figure 8 illustrate example exchanges.
The first example shows an exchange where the TLS client indicates its ability to receive and validate raw public keys from the server. In our example the client is quite restricted since it is unable to process other certificate types sent by the server. It also does not have credentials (at the TLS layer) it could send. The 'client_certificate_type' extension indicates this in [1]. When the TLS server receives the client hello it processes the 'client_certificate_type' extension. Since it also has a raw public key it indicates in [2] that it had chosen to place the SubjectPublicKeyInfo structure into the Certificate payload [3]. The client uses this raw public key in the TLS handshake and an out-of-band technique, such as DANE, to verify its validity.
client_hello, server_certificate_type=(RawPublicKey) -> // [1] <- server_hello, server_certificate_type=(RawPublicKey), // [2] certificate, // [3] server_key_exchange, server_hello_done client_key_exchange, change_cipher_spec, finished -> <- change_cipher_spec, finished Application Data <-------> Application Data
Figure 6: Example with Raw Public Key provided by the TLS Server
In our second example the TLS client as well as the TLS server use raw public keys. This is a use case envisioned for smart object networking. The TLS client in this case is an embedded device that is configured with a raw public key for use with TLS and is also able to process raw public keys sent by the server. Therefore, it indicates these capabilities in [1]. As in the previously shown example the server fulfills the client's request, indicates this via the "RawPublicKey" value in the server_certificate_type payload, and provides a raw public key into the Certificate payload back to the client (see [3]). The TLS server, however, demands client authentication and therefore a certificate_request is added [4]. The certificate_type payload in [2] indicates that the TLS server accepts raw public keys. The TLS client, who has a raw public key pre-provisioned, returns it in the Certificate payload [5] to the server.
client_hello, client_certificate_type=(RawPublicKey) // [1] server_certificate_type=(RawPublicKey) // [1] -> <- server_hello, server_certificate_type=(RawPublicKey)//[2] certificate, // [3] client_certificate_type=(RawPublicKey)//[4] certificate_request, // [4] server_key_exchange, server_hello_done certificate, // [5] client_key_exchange, change_cipher_spec, finished -> <- change_cipher_spec, finished Application Data <-------> Application Data
Figure 7: Example with Raw Public Key provided by the TLS Server and the Client
In our last example we illustrate a combination of raw public key and X.509 usage. The client uses a raw public key for client authentication but the server provides an X.509 certificate. This exchange starts with the client indicating its ability to process X.509 certificates provided by the server, and the ability to send raw public keys (see [1]). The server provides the X.509 certificate in [3] with the indication present in [2]. For client authentication the server indicates in [4] that it selected the raw public key format and requests a certificate from the client in [5]. The TLS client provides a raw public key in [6] after receiving and processing the TLS server hello message.
client_hello, server_certificate_type=(X.509) client_certificate_type=(RawPublicKey) // [1] -> <- server_hello, server_certificate_type=(X.509)//[2] certificate, // [3] client_certificate_type=(RawPublicKey)//[4] certificate_request, // [5] server_key_exchange, server_hello_done certificate, // [6] client_key_exchange, change_cipher_spec, finished -> <- change_cipher_spec, finished Application Data <-------> Application Data
Figure 8: Hybrid Certificate Example
The transmission of raw public keys, as described in this document, provides benefits by lowering the over-the-air transmission overhead since raw public keys are quite naturally smaller than an entire certificate. There are also advantages from a code size point of view for parsing and processing these keys. The cryptographic procedures for associating the public key with the possession of a private key also follows standard procedures.
The main security challenge is, however, how to associate the public key with a specific entity. Without a secure binding between identity and key the protocol will be vulnerable to masquerade and man-in-the-middle attacks. This document assumes that such binding can be made out-of-band and we list a few examples in Section 1. DANE [RFC6698] offers one such approach. In order to address these vulnerabilities, specifications that make use of the extension MUST specify how the identity and public key are bound. If public keys are obtained using DANE, these public keys are authenticated via DNSSEC. Pre-configured keys is another out of band method for authenticating raw public keys. While pre-configured keys are not suitable for a generic Web-based e-commerce environment such keys are a reasonable approach for many smart object deployments where there is a close relationship between the software running on the device and the server-side communication endpoint. Regardless of the chosen mechanism for out-of-band public key validation an assessment of the most suitable approach has to be made prior to the start of a deployment to ensure the security of the system.
Value: 2 Description: Raw Public Key Reference: [[THIS RFC]]
IANA is asked to register a new value in the "TLS Certificate Types" registry of Transport Layer Security (TLS) Extensions [TLS-Certificate-Types-Registry], as follows:
This document asks IANA to allocate two new TLS extensions, "client_certificate_type" and "server_certificate_type", from the TLS ExtensionType registry defined in [RFC5246]. These extensions are used in both the client hello message and the server hello message. The new extension type is used for certificate type negotiation. The values carried in these extensions are taken from the TLS Certificate Types registry [TLS-Certificate-Types-Registry].
The feedback from the TLS working group meeting at IETF#81 has substantially shaped the document and we would like to thank the meeting participants for their input. The support for hashes of public keys has been moved to [I-D.ietf-tls-cached-info] after the discussions at the IETF#82 meeting.
We would like to thank the following persons for their review comments: Martin Rex, Bill Frantz, Zach Shelby, Carsten Bormann, Cullen Jennings, Rene Struik, Alper Yegin, Jim Schaad, Barry Leiba, Paul Hoffman, Robert Cragie, Nikos Mavrogiannopoulos, Phil Hunt, John Bradley, Klaus Hartke, Stefan Jucker, Kovatsch Matthias, Daniel Kahn Gillmor, Peter Sylvester, and James Manger. Nikos Mavrogiannopoulos contributed the design for re-using the certificate type registry. Barry Leiba contributed guidance for the IANA consideration text. Stefan Jucker, Kovatsch Matthias, and Klaus Hartke provided implementation feedback regarding the SubjectPublicKeyInfo structure.
We would like to thank our TLS working group chairs, Eric Rescorla and Joe Salowey, for their guidance and support. Finally, we would like to thank Sean Turner, who is the responsible security area director for this work for his review comments and suggestions.
[RFC6698] | Hoffman, P. and J. Schlyter, "The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA", RFC 6698, August 2012. |
[I-D.ietf-core-coap] | Shelby, Z., Hartke, K. and C. Bormann, "Constrained Application Protocol (CoAP)", Internet-Draft draft-ietf-core-coap-14, March 2013. |
[I-D.ietf-tls-cached-info] | Santesson, S. and H. Tschofenig, "Transport Layer Security (TLS) Cached Information Extension", Internet-Draft draft-ietf-tls-cached-info-14, March 2013. |
[LDAP] | Sermersheim, J., "Lightweight Directory Access Protocol (LDAP): The Protocol", RFC 4511, June 2006. |
[Defeating-SSL] | Marlinspike, M., "New Tricks for Defeating SSL in Practice", February 2009. |
[ASN.1-Dump] | Gutmann, P., "ASN.1 Object Dump Program", February 2013. |
0 1 2 3 4 5 6 7 8 9 ---+------+-----+-----+-----+-----+-----+-----+-----+-----+----- 1 | 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 2 | 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 3 | 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xcd, 4 | 0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, 0x76, 0xd4, 0x13, 5 | 0x30, 0x0e, 0xbf, 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 6 | 0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, 0x6d, 0x3f, 0x3e, 0x6c, 7 | 0x2f, 0x90, 0x80, 0xa1, 0x71, 0xdf, 0xbe, 0x38, 0xc5, 0xcb, 8 | 0xa9, 0x9a, 0x40, 0x14, 0x90, 0x0a, 0xf9, 0xb7, 0x07, 0x0b, 9 | 0xe1, 0xda, 0xe7, 0x09, 0xbf, 0x0d, 0x57, 0x41, 0x86, 0x60, 10 | 0xa1, 0xc1, 0x27, 0x91, 0x5b, 0x0a, 0x98, 0x46, 0x1b, 0xf6, 11 | 0xa2, 0x84, 0xf8, 0x65, 0xc7, 0xce, 0x2d, 0x96, 0x17, 0xaa, 12 | 0x91, 0xf8, 0x61, 0x04, 0x50, 0x70, 0xeb, 0xb4, 0x43, 0xb7, 13 | 0xdc, 0x9a, 0xcc, 0x31, 0x01, 0x14, 0xd4, 0xcd, 0xcc, 0xc2, 14 | 0x37, 0x6d, 0x69, 0x82, 0xd6, 0xc6, 0xc4, 0xbe, 0xf2, 0x34, 15 | 0xa5, 0xc9, 0xa6, 0x19, 0x53, 0x32, 0x7a, 0x86, 0x0e, 0x91, 16 | 0x82, 0x0f, 0xa1, 0x42, 0x54, 0xaa, 0x01, 0x02, 0x03, 0x01, 17 | 0x00, 0x01
Figure 9: Example SubjectPublicKeyInfo Structure Byte Sequence.
For example, the following hex sequence describes a SubjectPublicKeyInfo structure inside the certificate payload:
Offset Length Description ------------------------------------------------------------------- 0 3+159: SEQUENCE { 3 2+13: SEQUENCE { 5 2+9: OBJECT IDENTIFIER Value (1 2 840 113549 1 1 1) : PKCS #1, rsaEncryption 16 2+0: NULL : } 18 3+141: BIT STRING, encapsulates { 22 3+137: SEQUENCE { 25 3+129: INTEGER Value (1024 bit) 157 2+3: INTEGER Value (65537) : } : } : }
Figure 10: Decoding of Example SubjectPublicKeyInfo Structure.
The decoded byte-sequence shown in Figure 9 (for example using Peter's ASN.1 decoder [ASN.1-Dump]) illustrates the structure, as shown in Figure 10.