TLS P.WoutersWouters, Ed. Internet-Draft Red Hat Intended status: Standards TrackJ. GilmoreH. Tschofenig, Ed. Expires:January 17,April 25, 2013 Nokia Siemens Networks J. Gilmore S. Weiler SPARTA, Inc. T. Kivinen AuthenTecH. Tschofenig Nokia Siemens Networks July 16,October 22, 2012 Out-of-Band Public Key Validation for Transport Layer Securitydraft-ietf-tls-oob-pubkey-04.txt(TLS) draft-ietf-tls-oob-pubkey-05.txt Abstract This document specifies a new certificate type 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. Currently, TLS authentication can only occur via X.509-based Public Key Infrastructure (PKI) or OpenPGP certificates. By specifying a minimum resource for raw public key exchange, implementations can use alternative public key validation methods. One such alternative public key valiation method is offered by the DNS-Based Authentication of Named Entities (DANE) together with DNS Security. Another alternative is to utilize pre-configured keys, as is the case with sensors and other embedded devices. The usage of raw public keys, instead of X.509-based certificates, leads to a smaller code footprint. This document introduces the support for raw public keys in TLS. Status of this Memo 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 onJanuary 17,April 25, 2013. Copyright Notice Copyright (c) 2012 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. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. New TLSExtensionsExtension . . . . . . . . . . . . . . . . . . . . . . 4 4. TLS Handshake Extension . . . . . . . . . . . . . . . . . . .57 4.1. Client Hello . . . . . . . . . . . . . . . . . . . . . . .57 4.2. Server Hello . . . . . . . . . . . . . . . . . . . . . . .67 4.3. Certificate Request . . . . . . . . . . . . . . . . . . .68 4.4.Certificate Payload . .Other Handshake Messages . . . . . . . . . . . . . . . . .68 4.5.Other TLS Messages . .Client authentication . . . . . . . . . . . . . . . . . .68 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . .68 6. Security Considerations . . . . . . . . . . . . . . . . . . .911 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . .1012 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . .1012 9. References . . . . . . . . . . . . . . . . . . . . . . . . . .1113 9.1. Normative References . . . . . . . . . . . . . . . . . . .1113 9.2. Informative References . . . . . . . . . . . . . . . . . .1113 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . .1214 1. Introduction Traditionally, TLS 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 client to obtain the TLS server public key: o The TLS server public key is obtained from a DNSSEC secured resource records using DANE[I-D.ietf-dane-protocol].[RFC6698]. o The TLS server public key is obtained from a [PKIX] certificate chain from an Lightweight Directory Access Protocol (LDAP) [LDAP] server. o The TLS client and server public key is provisioned into the operating system firmware image, and updated via software updates. Some smart objects use the UDP-based Constrained Application Protocol (CoAP) [I-D.ietf-core-coap] to interact with a Web server to upload sensor data at a regular intervals, such as temperature readings. CoAP [I-D.ietf-core-coap] can utilize DTLS for securing the client- to-server communication. As part of the manufacturing process, the embeded device may be configured with the address and the public key of a dedicated CoAP server, as well as a public key for the client itself. The usage of X.509-based PKIX certificates [PKIX]doesmay not suit all smart object deployments and would therefore be an unneccesarry burden. The Transport Layer Security (TLS) Protocol Version 1.2 [RFC5246] provides a framework for extensions to TLS as well as guidelines for designing such extensions. This document defines an extension to indicate the support for raw public keys. 2. Terminology 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]. 3. New TLSExtensions In orderExtension This section describes the changes toindicatethesupport for multiple certificate types two new extensionsTLS handshake message contents when raw public key certificates aredefined by this specification withto be used. Figure 3 illustrates thefollowing semantic: cert-send:exchange of messages as described in the sub-sections below. Thecertificate payloadclient and the server exchange the newly defined certificate_type extension to indicate their ability and desire to exchange raw public keys. These raw public keys, inthis message containsthe form of a SubjectPublicKeyInfo structure, are then carried inside the certificate payload. The SubjectPublicKeyInfo structure is defined in Section 4.1 ofthe type indicated by this extension. cert-receive: By including this extension an entity indicatesRFC 5280. Note thatit is able to recievethe SubjectPublicKeyInfo block does not only contain the raw keys, such as the public exponent andprocesstheindicated certificate types. This listmodulus of an RSA public key, but also an algorithm identifier. The structure, as shown in Figure 1, issorted by preference. enumencoded in an ASN.1 format and therefore contains length information as well. SubjectPublicKeyInfo ::= SEQUENCE {X.509(0), RawPublicKey(1), (255)algorithm AlgorithmIdentifier, subjectPublicKey BIT STRING }CertType; CertType cert-receive <1..2^8-1>; CertType cert-send;Figure 1:New TLS Extension Structures No new cipher suitesSubjectPublicKeyInfo ASN.1 Structure. The algorithm identifiers arerequiredObject Identifiers (OIDs). RFC 3279 [RFC3279], foruse with raw public keys. All existing cipher suites that support a key exchange method compatible with the key inexample, defines thecertificate can be usedfollowing OIDs shown incombination with raw public key certificate types. 4.Figure 2. 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 3279 | 1.2.840.10045.2.1 -----------------------+----------------------------+------------------- Figure 2: Example Algorithm Identifiers. client_hello, certificate_type -> <- server_hello, 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 3: Basic Raw Public Key TLSHandshake Extension This section describes the semanticExchange. The "certificate_type" TLS extension carries a list of supported certificate types the'cert-send'client can send andthe 'cert- receive' extensionsreceive, sorted by client preference. Two values are defined forthe different handshake messages. 4.1. Client Hello To alloweach certificate types to differentiate whether aTLSclientto indicate that itor a server is able toreceiveprocess a certificate of a specific typeit MAY include the 'cert-receive'or can also send it. This extensioninMUST be omitted if the clienthello message. To indicate the ability to processonly supports X.509 certificates. The "extension_data" field of this extension contains araw public key byCertTypeExtension structure. Note that theserverCertTypeExtension structure is being used both by theTLSclientMUST include the 'cert-receive' withand thevalue one (1) (indicating "RawPublicKey") inserver, even though thelist of supported certificate types. If a TLS clientstructure is onlysupports X.509 certificates it MAY includespecified once in thisextension to indicate support for it. Future documents may define additional certificate types that require addition values to be registered. Note:document. The structure of the CertTypeExtension is defined as follows: enum { client, server } ClientOrServerExtension; enum { X.509-Accept (0), X.509-Offer (1), RawPublicKey-Accept (2), RawPublicKey-Offer (3), (255) } CertificateType; struct { select(ClientOrServerExtension) case client: CertificateType certificate_types<1..2^8-1>; case server: CertificateType certificate_type; } } CertTypeExtension; Figure 4: 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. 4. TLS Handshake Extension 4.1. Client Hello In order to indicate the support of out-of-band raw public keys, clients MUST include an extension of type "certificate_type" to the extended client hello message. The "certificate_type" TLS extension is assigned the value of [TBD] from the TLS ExtensionType registry. This value is used as the extension number for the extensions in both the client hello message and the server hello message. The hello extension mechanism is described in TLS 1.2 [RFC5246]. 4.2. Server Hello If the server receives a client hello that contains the'cert- receive'"certificate_type" extension and chooses a cipher suite then two outcomes are possible. The server MUST either select a certificate type fromclient-provided listthe CertificateType field in the extended client hello or terminate the session with a fatal alert of type "unsupported_certificate".In the former case the procedure in Section 4.4 MUST be followed. 4.3. Certificate RequestTheCertificate Request payload sent by the TLS server to the TLS client MUST be accompanied by a 'cert-receive' extension, which indicates to the TLS client thecertificate type selected by the serversupports. 4.4. Certificate Payload Certificate payloads MUST be accompanied byis encoded in a'cert-send' extension,CertTypeExtension structure, whichindicates the certificate format foundis included in theCertificate payload itself. The listextended server hello message using an extension ofsupported certificate types to choose from MUST have been obtained via the 'cert-receive' extension. This ensures that a Certificate payload only contains a certificatetype "certificate_type". Servers thatis also supported byonly support X.509 certificates MAY omit including therecipient. When"certificate_type" extension in the'RawPublicKey' certificate typeextended server hello. If the client supports the receiption of raw public keys and the server isselectedable to provide such a raw public key then the TLS server MUST place the SubjectPublicKeyInfo structureMUST be placedinto the Certificate payload. Thetype of the asymmetricpublic key MUST match the selected key exchange algorithm.4.5. Other4.3. Certificate Request The semantics of this message remain the same as in the TLS specification. 4.4. Other Handshake Messages All the other handshake messages are identical to the TLS specification. 4.5. Client authentication Client authentication by the TLS server is supported only through authentication of the received client SubjectPublicKeyInfo via an out-of-band method 5. Examples Figure2,5, Figure3,6, and Figure47 illustrate example message exchanges. The first example shows an exchange where the TLS client indicates its ability to process two certificate types, namely raw public keys and X.509 certificates via the'cert-receive''certificate_type' extension(see [1]).in [1]. When the TLS server receives the client hello it processes thecert- receivecertificate_type extension and since it also has a raw public key it indicates in [2] that it had choosen to place the SubjectPublicKeyInfo structure into the Certificate payload (see [3]). The client uses this raw public key in the TLS handshake and an out-of-band technique, such as DANE, to verify its validatity. client_hello,cert-receive=(RawPublicKey, X.509)certificate_type=(RawPublicKey-Accept) -> // [1] <- server_hello,cert-send=RawPublicKey,certificate_type=(RawPublicKey-Offer), // [2] certificate, // [3] server_key_exchange, server_hello_done client_key_exchange, change_cipher_spec, finished -> <- change_cipher_spec, finished Application Data <-------> Application Data Figure2:5: Example with Raw Public Key provided by the TLS Server In our second example both the TLS client and 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 only supports raw public keys and therefore it indicates this capability via the'cert-receive''certificate_type' extension in [1]. As in the previously shown example the server fulfills the client's request and provides a raw public key into the Certificate payload back to the client (see[2] and[3]). The TLS server, however, demands client authentication andfor this reasontherefore aCertificate_Request payloadcertificate_request is added[4], which comes with an indication of[4]. The certificate_type payload indicates the TLS server supported certificatetypestypes, see [2], and particularly that the TLS server is also able to process raw public keys sent by theserver, see [5].client. The TLS client, who has a raw public key pre-provisioned, returns it in the Certificate payload[7][5] to theserver with the indication about its content [6].server. client_hello,cert-receive=(RawPublicKey)certificate_type=(RawPublicKey-Offer, RawPublicKey-Accept) -> // [1] <- server_hello,cert-send=RawPublicKey,//certificate_type=(RawPublicKey-Offer, RawPublicKey-Accept) // [2] certificate, // [3] certificate_request, // [4]cert-receive=(RawPublicKey, X.509) // [5]server_key_exchange, server_hello_donecert-send=RawPublicKey, // [6]certificate, //[7][5] client_key_exchange, change_cipher_spec, finished -> <- change_cipher_spec, finished Application Data <-------> Application Data Figure3:6: 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.509certificates.certificates provided by the server, and the ability to send raw public keys. The server provides the X.509 certificate using that format in [3] with the indication present in [2]. For client authentication, however, the server indicates in[5][2] that it is able to support raw publickeys as well as X.509 certificates.keys. The TLS client provides a raw public key in[7][5] after receiving and processing theindication in [6].TLS server hello message. client_hello,cert-receive=(X.509)certificate_type=(X.509 Receive, RawPublicKey-Offer) -> // [1] <- server_hello,cert-send=X.509,//certificate_type=(X.509 Send, RawPublicKey-Accept), // [2] certificate, // [3] certificate_request, // [4]cert-receive=(RawPublicKey, X.509) // [5]server_key_exchange, server_hello_donecert-send=RawPublicKey, // [6]certificate, //[7][5] client_key_exchange, change_cipher_spec, finished -> <- change_cipher_spec, finished Application Data <-------> Application Data Figure4:7: Hybrid Certificate Example 6. Security Considerations 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 codesize point of view for parsing and processing these keys. The crytographic procedures for assocating 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. This information will be needed to make authorization decisions. Without a secure binding, man-in-the-middle attacks may be the consequence. This document assumes that such binding can be made out-of-band and we list a few examples in Section 1. DANE[I-D.ietf-dane-protocol][RFC6698] offers one such approach. 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. 7. IANA Considerations This document definestwoa new TLS extension,'cert-send' and 'cert- receive', and their values need to be added to"certificate_type", assigned a value of [TBD] from the TLS ExtensionType registrycreated by RFC 5246defined in [RFC5246].The valuesThis value is used as the extension number for the extensions intheseboth the client hello message and the server hello message. The newextensionsextension type is used for certificate type negotiation. The "certificate_type" extension contains an 8-bit CertificateType field, for which a new registry, named"Certificate"TLS Certificate Types", is established in this document, to be maintained by IANA. The registry is segmented in the following way: 1. Thevalue (0) isvalues 0 - 3 are defined inthis document.Figure 4. 2. Values from23 through 223 decimal inclusive are assignedusing the 'Specification Required' policy defined in RFC 5226via IETF Consensus [RFC5226]. 3. Values from 224 decimal through 255 decimal inclusive are reserved for'Private Use', seePrivate Use [RFC5226]. 8. Acknowledgements 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 and the feedback from Eric Rescorla. 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, Paul Hoffman, Robert Cragie, Nikos Mavrogiannopoulos, Phil Hunt, John Bradley, Klaus Hartke, Stefan Jucker, and James Manger. 9. References 9.1. Normative References [PKIX] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, August 2008. 9.2. Informative References [Defeating-SSL] Marlinspike, M., "New Tricks for Defeating SSL in Practice", February 2009, <http://www.blackhat.com/ presentations/bh-dc-09/Marlinspike/ BlackHat-DC-09-Marlinspike-Defeating-SSL.pdf>. [I-D.ietf-core-coap] Shelby, Z., Hartke, K., Bormann, C., and B. Frank, "Constrained Application Protocol (CoAP)",draft-ietf-core-coap-10 (work in progress), June 2012. [I-D.ietf-dane-protocol] Hoffman, P. and J. Schlyter, "The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA", draft-ietf-dane-protocol-23draft-ietf-core-coap-12 (work in progress),JuneOctober 2012. [I-D.ietf-tls-cached-info] Santesson, S. and H. Tschofenig, "Transport Layer Security (TLS) Cached Information Extension",draft-ietf-tls-cached-info-11draft-ietf-tls-cached-info-13 (work in progress),December 2011.September 2012. [LDAP] Sermersheim, J., "Lightweight Directory Access Protocol (LDAP): The Protocol", RFC 4511, June 2006. [RFC3279] Bassham, L., Polk, W., and R. Housley, "Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 3279, April 2002. [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008.[RFC6091] Mavrogiannopoulos, N.[RFC6698] Hoffman, P. andD. Gillmor, "Using OpenPGP Keys forJ. Schlyter, "The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS)Authentication",Protocol: TLSA", RFC6091, February 2011.6698, August 2012. Authors' Addresses Paul Wouters (editor) Red Hat Email: paul@nohats.ca Hannes Tschofenig (editor) Nokia Siemens Networks Linnoitustie 6 Espoo 02600 Finland Phone: +358 (50) 4871445 Email: Hannes.Tschofenig@gmx.net URI: http://www.tschofenig.priv.at John Gilmore PO Box 170608 San Francisco, California 94117 USA Phone: +1 415 221 6524 Email: gnu@toad.com URI: https://www.toad.com/ Samuel Weiler SPARTA, Inc. 7110 Samuel Morse Drive Columbia, Maryland 21046 US Email: weiler@tislabs.com Tero Kivinen AuthenTec Eerikinkatu 28 HELSINKI FI-00180 FI Email: kivinen@iki.fiHannes Tschofenig Nokia Siemens Networks Linnoitustie 6 Espoo 02600 Finland Phone: +358 (50) 4871445 Email: Hannes.Tschofenig@gmx.net URI: http://www.tschofenig.priv.at