Using Raw Public Keys in Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)Red Hatpaul@nohats.caCambridgeCBI 9NJUKHannes.Tschofenig@gmx.nethttp://www.tschofenig.priv.atPO Box 170608San FranciscoCalifornia94117USA+1 415 221 6524gnu@toad.comhttps://www.toad.com/SPARTA, Inc.7110 Samuel Morse DriveColumbia, Maryland21046USweiler@tislabs.comAuthenTecEerikinkatu 28HELSINKIFI-00180FIkivinen@iki.fi
Security
TLSTLSDNSSECDANERaw Public Key This document specifies a new certificate type and two TLS extensions for exchanging raw
public keys in Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS).
The new certificate type allows raw public keys to be used for authentication.
Traditionally, TLS client and server public keys are obtained in PKIX containers
in-band as part of the TLS handshake procedure and are validated using trust anchors
based on a certification authority (CA). This
method can add a complicated trust relationship that is difficult
to validate. Examples of such complexity can be seen in
. TLS is, however, also commonly used with self-signed
certificates in smaller deployments where the self-signed certificates are distributed
to all involved protocol end points out-of-band. This practice does, however, still
requires the overhead of the certificate generation even though none of the information
found in the certificate is actually used.Alternative methods are available that allow a TLS client/server
to obtain the TLS server/client public key:
The TLS client can obtain the TLS server public key from a
DNSSEC secured resource records using DANE .The TLS client or server public key is obtained from a
certificate chain from an Lightweight Directory
Access Protocol (LDAP) server or web page.The TLS client and server public key is provisioned into
the operating system firmware image, and updated via
software updates. For example:
Some smart objects use the UDP-based Constrained
Application Protocol (CoAP) to
interact with a Web server to upload sensor data at
a regular intervals, such as temperature readings.
CoAP can utilize DTLS for securing
the client-to-server communication. As part of the
manufacturing process, the embedded device may be
configured with the address and the public key of
a dedicated CoAP server, as well as a public/private key pair for
the client itself.This document introduces the use of raw public keys in TLS/DTLS. With
raw public keys, only a subset of the information found in typical
certificates is utilized: namely, the SubjectPublicKeyInfo structure
of a PKIX certificates that carries the parameters necessary to
describe the public key. Other parameters found in PKIX certificates
are omitted. By omitting various certificate-related structures, the
resulting raw public key is kept fairly small in comparison to the
original certificate, and the code to process the keys requires only a
minimalistic ASN.1 parser, no code for certificate path validation,
and other PKIX related processing tasks are also omitted. Note, however,
the SubjectPublicKeyInfo structure is still in an ASN.1 format.
To further reduce the size of the exchanged information this specification can be combined with the TLS Cached Info extension , which enables TLS peers to just exchange fingerprints of their public keys.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. defines the structure of the two new TLS extensions "client_certificate_type" and
"server_certificate_type", which can be used as part of an extended TLS handshake when raw public keys are to be used.
defines the behavior of the TLS client and the TLS server. Example exchanges are described in .
describes security considerations with this approach.
Finally, in this document also registers a new value to the IANA certificate
types registry for the support of raw public keys.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.We use the terms 'TLS server' and 'server' as well as 'TLS client' and 'client' interchangable.This section defines the two TLS extensions 'client_certificate_type' and 'server_certificate_type', which can be used as part of an extended TLS handshake when raw public keys are used. defines the behavior of the TLS client and the TLS server using this extension.This specification uses raw public keys whereby the already available encoding used in a PKIX certificate in the form of a SubjectPublicKeyInfo structure is reused. To carry the raw public key within the TLS handshake the Certificate payload is used as a container, as shown in . The shown Certificate structure is an adaptation of its original form .The SubjectPublicKeyInfo structure is defined in Section 4.1 of RFC 5280 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 SubjectPublicKeyInfo value in the Certificate payload MUST contain the DER encoding of the SubjectPublicKeyInfo. The structure, as shown in , therefore also contains length information as well. An example is provided in .The algorithm identifiers are Object Identifiers (OIDs). RFC 3279 and , for example, define the following OIDs shown in . Note that this list is not exhaustive and more OIDs may be defined in future RFCs. RFC 5480 also defines a number of OIDs.The extension format for extended client and server hellos, which uses the "extension_data" field, is used to carry the ClientCertTypeExtension and the ServerCertTypeExtension structures. These two structures are shown in . The CertificateType structure is an enum with values taken from the 'TLS Certificate Type' registry . This specification extends the ClientHello and the ServerHello messages, according to the extension procedures defined in . It does not extend or modify any other TLS message.Note: 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.The high-level message exchange in shows the 'client_certificate_type' and 'server_certificate_type' extensions added to the client and server hello messages.
In order to indicate the support of raw public keys,
clients include the 'client_certificate_type' and/or the 'server_certificate_type' extensions in an extended
client hello message. The hello extension mechanism is described in Section 7.4.1.4 of TLS 1.2 .
The 'client_certificate_type' in the client hello indicates the certificate types the client is able to provide to the server, when requested using a certificate_request message.The 'server_certificate_type' in the client hello indicates the types of certificates the client is able to process when provided by the server in a subsequent certificate payload.The 'client_certificate_type' and 'server_certificate_type' sent in the client hello may carry a list of supported certificate types, sorted by client preference. It is a list in the case where the client supports multiple certificate types. The TLS client MUST omit the 'client_certificate_type' extension in the client hello if it does not possess a raw public key/certificate that it can provide to the server when requested using a certificate_request message or is not configured to use one with the given TLS server. The TLS client MUST omit the 'server_certificate_type' extension in the client hello if it is unable to process raw public keys or other certificate types introduced via this extension.If the server receives a client hello that contains the 'client_certificate_type' extension and/or the 'server_certificate_type'
extension then three outcomes are possible:
The server does not support the extension defined in this document. In this case the server returns the server hello
without the extensions defined in this document.The server supports the extension defined in this document but it does not have any certificate type in common with the client. Then, the server terminates the session with a fatal alert of type "unsupported_certificate".The server supports the extensions defined in this document and has at least one certificate type in common with the client.
In this case the processing rules described below are followed.
The 'client_certificate_type' in the client hello indicates the certificate types the client is able to provide to the server, when requested using a certificate_request message. If the TLS server wants to request a certificate from the client (via the certificate_request message) it MUST include the 'client_certificate_type' extension in the server hello. This 'client_certificate_type' in the server hello then indicates the type of certificates the client is requested to provide in a subsequent certificate payload. The value conveyed in the 'client_certificate_type' MUST be selected from one of the values provided in the 'client_certificate_type' extension sent in the client hello. The server MUST also include a certificate_request payload in the server hello message.If the server does not send a certificate_request payload (for example, because client authentication happens at the application layer or no client authentication is required) or none of the certificates supported by the client (as indicated in the 'client_certificate_type' in the client hello) match the server-supported certificate types then the 'client_certificate_type' payload in the server hello MUST be omitted.The 'server_certificate_type' in the client hello indicates the types of certificates the client is able to process when provided by the server in a subsequent certificate payload. If the client hello indicates support of raw public keys in the
'server_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. With the 'server_certificate_type' in the server hello the TLS server indicates the certificate type carried in the Certificate payload. This additional indication allows to avoid parsing ambiguities since the Certificate payload may contain either the X.509 certificate or a SubjectPublicKeyInfo structure. Note that only a single value is permitted in the 'server_certificate_type' extension when carried in the server hello.Authentication of the TLS client to the TLS server is supported only through
authentication of the received client SubjectPublicKeyInfo via an
out-of-band method., , and illustrate example exchanges. Note that TLS ciphersuites using a Diffie-Hellman exchange offering forward secrecy can be used with raw public keys although we do not show the information exchange at that level with the subsequent message flows.This section shows an example 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 to the server and therefore omits the 'client_certificate_type' extension. Hence, the client only populates the 'server_certificate_type' extension with the raw public key type, as shown in [1].When the TLS server receives the client hello it
processes the extension. Since it 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 together with an out-of-band validation technique,
such as DANE, to verify it.This section shows an example where the TLS client as well as the TLS server use raw public keys. This is one of the 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 [2], 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 [5] 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 [6] to the server.This section shows an example combining raw public keys and X.509 certificates. The client uses a raw public key
for client authentication and the server provides an X.509 certificate. This exchange starts with the client indicating its ability to process X.509 certificates and raw public keys, if provided by the server. Additionally, the client indicates that is has a raw public key for client-side authentication (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.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 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 identifier and key, the protocol will be vulnerable to man-in-the-middle attacks. This document assumes that such
binding can be made out-of-band and we list a few examples in .
DANE offers one such approach.
In order to address these vulnerabilities, specifications that make use of the extension need to specify how the identifier and public key are bound. In addition to ensuring the binding is done out-of-band an implementation also needs to check the status of that binding.
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. An attacker might try to influence the handshake exchange to make the
parties select different certificate types than they would
normally choose.For this attack, an attacker must actively change one or more
handshake messages. If this occurs, the client and server will
compute different values for the handshake message hashes. As a
result, the parties will not accept each others' Finished messages.
Without the master_secret, the attacker cannot repair the Finished
messages, so the attack will be discovered.IANA is asked to register a new value in the "TLS Certificate Types"
registry of Transport Layer Security (TLS) Extensions ,
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 .
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 . 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 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, Hauke Mehrtens, Alexey Melnikov, Stephen Farrell, Richard Barnes, 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.Christer Holmberg provided the General Area (Gen-Art) review, Yaron Sheffer provided the Security Directorate (SecDir) review, Bert Greevenbosch provided the Applications Area Directorate review, and Linda Dunbar provided the Operations Directorate review.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.TLS Certificate Types RegistryInternet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) ProfileInformation technology - ASN.1 encoding rules:
> Specification of Basic Encoding Rules (BER), Canonical
> Encoding Rules (CER) and Distinguished Encoding Rules
> (DER).Lightweight Directory Access Protocol (LDAP): The ProtocolNew Tricks for Defeating SSL in PracticeASN.1 Object Dump ProgramFor example, the hex sequence shown in describes a SubjectPublicKeyInfo structure inside the certificate payload.The decoded byte-sequence shown in (for example using Peter's ASN.1 decoder ) illustrates the structure, as shown in .