RFC 9191

Handling Large Certificates and Long Certificate Chains in TLS-Based EAP Methods

๐Ÿ“… published February 2022, from ietf

๐Ÿ“œ RFC 9191: Handling Large Certificates and Long Certificate Chains in TLS-Based EAP Methods ๐ŸŽ€

Okay bestie, this one is from the IETF ๐ŸŒธ and the authors are M. Sethi, J. PreuรŸ Mattsson (at Ericsson โœจ), and S. Turner (at sn3rd ๐Ÿ’œ). It's dated February 2022 ๐Ÿฆ‹ and its category is Informational ๐Ÿ’…, so it's a "here's what you should know" doc and not a Standards Track spec. Its ISSN is 2070-1721 ๐Ÿงš. The title block doesn't say it obsoletes or updates anything, so there's nothing to track there ๐Ÿ™ˆ.


Abstract โœจ

Okay so the Extensible Authentication Protocol (EAP), which is defined in RFC 3748, gives us a standard way to support lots of different authentication methods ๐Ÿ”ฅ. EAP-TLS and other TLS-based EAP methods are everywhere and do network access authentication, and they're iconic for it ๐Ÿ’…. The problem is that big certificates plus long certificate chains, combined with authenticators that drop an EAP session after only 40 - 50 round trips, is a seriously major deployment problem ๐Ÿ’€. This document dives deep into that problem and walks through the solutions that are available ๐Ÿซถ.

Status of This Memo โœจ

This document is not an Internet Standards Track specification ๐Ÿ™ˆ. It's published just for informational purposes ๐ŸŒˆ.

This document is a product of the Internet Engineering Task Force (IETF) ๐Ÿ‘‘. It represents the consensus of the IETF community, it went through public review, and the Internet Engineering Steering Group (IESG) approved it for publication ๐Ÿ’–. Not every IESG-approved document is a candidate for any level of Internet Standard, so check Section 2 of RFC 7841 if you want the details ๐Ÿ”.

For info on the current status of this document, any errata, and how to send feedback, head to https://www.rfc-editor.org/info/rfc9191 ๐Ÿฆ‹.

Copyright (c) 2022 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 (https://trustee.ietf.org/license-info) as they're in effect on the date this document was published ๐Ÿ“œ. Please read these carefully, because they spell out your rights and restrictions for this document ๐Ÿซถ. Code Components pulled out of this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as described in the Revised BSD License ๐ŸŒธ.

Table of Contents ๐Ÿงš

1.  Introduction
2.  Terminology
3.  Experience with Deployments
4.  Handling of Large Certificates and Long Certificate Chains
  4.1.  Updating Certificates and Certificate Chains
    4.1.1.  Guidelines for Certificates
    4.1.2.  Pre-distributing and Omitting CA Certificates
    4.1.3.  Using Fewer Intermediate Certificates
  4.2.  Updating TLS and EAP-TLS Code
    4.2.1.  URLs for Client Certificates
    4.2.2.  Caching Certificates
    4.2.3.  Compressing Certificates
    4.2.4.  Compact TLS 1.3
    4.2.5.  Suppressing Intermediate Certificates
    4.2.6.  Raw Public Keys
    4.2.7.  New Certificate Types and Compression Algorithms
  4.3.  Updating Authenticators
5.  IANA Considerations
6.  Security Considerations
7.  References
  7.1.  Normative References
  7.2.  Informative References
Acknowledgements
Authors' Addresses

1. Introduction ๐ŸŒธ

Okay, so the Extensible Authentication Protocol (EAP), defined in [RFC3748], gives us a standard mechanism for supporting multiple authentication methods ๐Ÿ’–. EAP-TLS [RFC5216] [RFC9190] leans on TLS [RFC8446] for strong mutual authentication with certificates [RFC5280], and it's widely deployed and often used for network access authentication ๐Ÿ”. There are also lots of other standardized TLS-based EAP methods, like Flexible Authentication via Secure Tunneling (EAP-FAST) [RFC4851], Tunneled Transport Layer Security (EAP-TTLS) [RFC5281], and the Tunnel Extensible Authentication Protocol (TEAP) [RFC7170] ๐Ÿฆ‹. Then there are several vendor-specific EAP methods, like the Protected Extensible Authentication Protocol (PEAP) [PEAP] ๐Ÿ’….

Certificates in EAP deployments can be pretty big, and the certificate chains can be long ๐Ÿ˜ญ. Unlike TLS on the web, where usually only the TLS server gets authenticated, EAP-TLS deployments usually authenticate both the EAP peer and the EAP server ๐Ÿซถ. From deployment experience, EAP peers also tend to have longer certificate chains than servers ๐ŸŒˆ. That's because EAP peers often follow organizational hierarchies and end up with lots of intermediate certificates ๐Ÿ‘‘. So EAP-TLS authentication usually involves way more octets than TLS used as part of HTTPS ๐Ÿ”ฅ.

Section 3.1 of [RFC3748] says EAP implementations can assume a Maximum Transmission Unit (MTU) of at least 1020 octets from the lower layers ๐Ÿงš. In typical deployments, the EAP fragment size is just 1020 - 1500 octets, since the maximum Ethernet frame size is ~ 1500 bytes ๐Ÿ“. So EAP-TLS authentication has to get fragmented into lots of smaller packets to travel over the lower layers ๐Ÿ’€. That fragmentation doesn't just hurt latency, it also causes other headaches ๐Ÿ˜ฉ. For example, some EAP authenticator (e.g., an access point) implementations will drop an EAP session if it hasn't finished after 40 - 50 round trips ๐Ÿ™ˆ. This is a major problem, because in lots of situations the EAP peer can't do network access authentication even though both sides have valid credentials for successful authentication and key derivation ๐Ÿ˜ญ.

Not every EAP deployment is limited by the MTU of the lower layer ๐ŸŒธ. For example, some implementations support EAP over Ethernet "jumbo" frames, which can easily allow very large EAP packets โœจ. Bigger packets naturally help cut down the number of round trips needed for successful EAP-TLS authentication ๐Ÿ’–. But deployment experience has shown that these jumbo frames aren't always implemented correctly ๐Ÿซ . On top of that, the EAP fragment size is also restricted by protocols like RADIUS [RFC2865], which carry EAP messages between an authenticator and an EAP server ๐Ÿ”. RADIUS can generally carry only about 4000 octets of EAP in a single message, since the maximum length of a RADIUS packet is restricted to 4096 octets in [RFC2865] ๐Ÿ“ฆ.

This document looks at related work and potential tools for overcoming the deployment challenges caused by large certificates and long certificate chains ๐Ÿ”. Then it talks through the solutions available to beat these challenges ๐Ÿ†. Many of the solutions need TLS 1.3 [RFC8446] ๐Ÿงš. The IETF has standardized EAP-TLS 1.3 [RFC9190], and it's working on specs like [TLS-EAP-TYPES] to describe how other TLS-based EAP methods use TLS 1.3 ๐Ÿ’œ.

2. Terminology ๐Ÿ“–

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here ๐ŸŽ€.

Readers are expected to already know the terms and concepts used in EAP [RFC3748], EAP-TLS [RFC5216], and TLS [RFC8446] ๐Ÿค“. In particular, this document often uses the following terms, as they're defined in [RFC5216] ๐Ÿ’…:

  • Authenticator: The entity that starts EAP authentication ๐Ÿšช. It's typically built into a network switch or a wireless access point ๐Ÿ“ก.
  • EAP peer: The entity that responds to the authenticator ๐Ÿ™‹. In [IEEE-802.1X], this entity is called the supplicant ๐ŸŒธ. In EAP-TLS, the EAP peer plays the TLS client role ๐Ÿ’–.
  • EAP server: The entity that ends the EAP authentication method with the peer ๐Ÿ. If there's no backend authentication server, the EAP server is part of the authenticator ๐Ÿงฉ. If the authenticator runs in pass-through mode, the EAP server lives on the backend authentication server ๐Ÿ”. In EAP-TLS, the EAP server plays the TLS server role ๐Ÿ‘‘.

The document also uses the terms "trust anchor" and "certification path", which are defined in [RFC5280] ๐Ÿฆ‹.

3. Experience with Deployments ๐ŸŒˆ

As we said earlier, the EAP fragment size in typical deployments is just 1020 - 1500 octets ๐Ÿ“. A certificate can still be large for a bunch of reasons, though ๐Ÿ˜ณ:

  • It can have a long Subject Alternative Name field ๐Ÿ“›.
  • It can have long Public Key and Signature fields ๐Ÿ”‘.
  • It can contain multiple object identifiers (OIDs) that show the permitted uses of the certificate, as noted in Section 5.3 of [RFC5216] ๐Ÿท๏ธ. Most implementations check that these OIDs are present for successful authentication ๐Ÿ‘€.
  • It can contain multiple organization naming fields to show a user's multiple group memberships (in a client certificate) ๐Ÿ‘ฏ.

A certificate chain (called a certification path in [RFC5280]) in EAP-TLS can commonly have 2 - 6 intermediate certificates between the end-entity certificate and the trust anchor ๐Ÿ”—.

The size of certificates (and certificate chains) may also grow manyfold in the future, thanks to post-quantum cryptography ๐Ÿš€. For example, lattice-based cryptography would have public keys of approximately 1000 bytes and signatures of approximately 2000 bytes ๐Ÿง .

Heads up, bestie: many access point implementations drop EAP sessions that don't finish within 40 - 50 round trips. So if the chain is larger than ~ 60 kilobytes, EAP-TLS authentication can't complete successfully in most deployments ๐Ÿ˜ฑ.

4. Handling of Large Certificates and Long Certificate Chains ๐Ÿ› ๏ธ

Okay so this section talks through some possible options for beating the challenge of large certificates and long certificate chains in EAP-TLS authentication ๐Ÿ’ช. Section 4.1 covers recommendations that need an update to the certificates or certificate chains used for EAP-TLS authentication, but they don't need changes to the existing EAP-TLS code base ๐Ÿ“. It also gives some guidelines that should be followed when issuing certificates for use with EAP-TLS ๐ŸŽ€. Section 4.2 covers recommendations that rely on updates to EAP-TLS implementations, and they can be deployed with existing certificates ๐Ÿงฉ. Finally, Section 4.3 briefly covers what could be done to update or reconfigure authenticators when it's not feasible to replace deployed components ๐Ÿ”ง. That gives a solution you can deploy without changing existing certificates or code ๐ŸŒŸ.


to be continued in part 2 ๐Ÿ’–โœจ

4.1. Updating Certificates and Certificate Chains

Okay so, a lot of IETF protocols now use elliptic curve cryptography (ECC) [RFC6090] for their crypto math, and it's giving smaller certificates and signatures โœจ. At a 128-bit security level, a public key with traditional RSA is about 384 bytes, but an ECC public key is only 32-64 bytes ๐Ÿฆ‹. Signatures are the same vibe: 384 bytes with RSA, but only 64 bytes with the elliptic curve digital signature algorithm (ECDSA) and the Edwards-curve digital signature algorithm (EdDSA) [RFC8032] ๐Ÿ’…. Using ECC certificates can cut the number of messages in EAP-TLS authentication, which helps with the problem of authenticators dropping an EAP session because there were too many round trips ๐Ÿ™ˆ. Unless a standard application profile says otherwise, TLS 1.3 [RFC8446] requires implementations to support ECC ๐Ÿ”ฅ. New ECC cipher suites are also specified for TLS 1.2 [RFC8422] ๐ŸŒธ. Honestly, switching existing code over to ECC-based cipher suites can significantly reduce the number of messages in a single EAP session ๐Ÿ˜ญ.

4.1.1. Guidelines for Certificates

The big-picture guideline is to keep certificates small by not stuffing fields with excessive info. That helps avert failed EAP-TLS authentication ๐ŸŽ€. Here are some more specific tips for certificates used with EAP-TLS:

  • Object Identifier (OID) is an ASN.1 data type that defines unique identifiers for objects ๐Ÿงš. The OID's ASN.1 value is a string of integers, and that value is used to name the objects it relates to. The Distinguished Encoding Rules (DER) say the first two integers always occupy one octet, and subsequent integers are base-128 encoded in the fewest possible octets ๐Ÿค“. OIDs are used everywhere in X.509 certificates [RFC5280]. Not all of them can be avoided (think OIDs for extensions, or for algorithms and their associated parameters), but some are totally within the certificate issuer's control ๐Ÿ’œ:
    • Each naming attribute in a DN (Distinguished Name) has one ๐Ÿท๏ธ. DNs show up in the issuer and subject fields, plus lots of extensions. A shallower name will be smaller. For example, C=FI, O=Example, SN=B0A123499EFC is way slimmer than C=FI, O=Example, OU=Division 1, SOPN=Southern Finland, CN=Coolest IoT Gadget Ever, and SN=B0A123499EFC. Main character energy is keeping it short ๐Ÿ‘‘.
    • Every certificate policy (and qualifier), plus any mappings to another policy, uses identifiers. Think carefully about which policies actually apply ๐Ÿง.
  • DirectoryString and GeneralName types are used a lot to name things ๐Ÿ“. For instance, the DN naming attribute O= (the organizational naming attribute) DirectoryString includes "Example" for the Example organization. A uniformResourceIdentifier can point to the location of the Certificate Revocation List (CRL) in the CRL Distribution Point extension, like http://crl.example.com/sfig2s1-128.crl. In these examples, each character is a single byte. Some non-ASCII strings use several bytes per character ๐ŸŒˆ. The names do need to be unique, but there's more than one way to do that without long strings, and that's especially true when the names aren't meant to be meaningful to users ๐Ÿซถ.
  • Extensions are necessary to comply with [RFC5280], but the vast majority of them are optional. Only include the ones you actually need to operate โœจ.
  • As mentioned earlier, the certificate chains of the EAP peer often follow organizational hierarchies ๐Ÿข. In that case, info in intermediate certificates (like postal addresses) doesn't add any extra value, so it can be shortened. For example, you could just include the department name instead of the full postal address ๐Ÿ“ฎ.

4.1.2. Pre-distributing and Omitting CA Certificates

The TLS Certificate message carries the sending endpoint's certificate chain ๐Ÿ“œ. TLS lets endpoints shrink that message by leaving out certificates the other endpoint is already known to have ๐Ÿฆ‹. With TLS 1.3, any certificate that specifies a trust anchor known by the other endpoint may be omitted (see Section 4.4.2 of [RFC8446]) ๐Ÿ’–. With TLS 1.2 or earlier, only the self-signed certificate that specifies the root certificate authority may be omitted (see Section 7.4.2 of [RFC5246]) ๐Ÿฅบ. So updating TLS implementations to version 1.3 can really help cut down the number of messages exchanged for EAP-TLS authentication ๐Ÿš€. The omitted certificates need to be pre-distributed independently of TLS, and the TLS implementations need to be configured to omit those pre-distributed certificates ๐Ÿงฉ.

4.1.3. Using Fewer Intermediate Certificates

The EAP peer certificate chain doesn't have to mirror the organizational hierarchy ๐Ÿ™…โ€โ™€๏ธ. For successful EAP-TLS authentication, certificate chains SHOULD NOT contain more than 4 intermediate certificates ๐Ÿ›‘.

Admins running TLS-based EAP methods can look at the certificate chains and make rough calculations for how many round trips authentication will take ๐Ÿงฎ. For example, divide the total size of all the certificates in the peer and server certificate chain (in bytes) by 1020 bytes. That gives you the number of round trips required. If that number goes over 50, admins can expect failures with many common authenticator implementations ๐Ÿ’€.

4.2. Updating TLS and EAP-TLS Code

Here we talk about how the fragmentation problem can be dodged by updating the underlying TLS or EAP-TLS implementation ๐Ÿ”ง. Heads up: in some cases the new feature might already be implemented in the underlying library and just needs to be turned on ๐Ÿ’…โœจ.

4.2.1. URLs for Client Certificates

[RFC6066] defines the client_certificate_url extension, which lets TLS clients send a sequence of Uniform Resource Locators (URLs) instead of the client certificate chain ๐Ÿ”—. URLs can point to a single certificate or to a whole certificate chain. Using this extension can curtail the amount of fragmentation in EAP deployments, which lets EAP sessions actually complete ๐ŸŽ‰.

4.2.2. Caching Certificates

The TLS Cached Information Extension [RFC7924] specifies an extension where a server can skip sending certificate info that was cached in an earlier TLS handshake ๐Ÿ’พ. Here's how it goes: the client and server first run a full TLS handshake, and then the client caches the certificate the server gave it. Later, when that TLS client connects to the same server without using session resumption, it can attach the cached_info extension to the ClientHello message ๐Ÿฆ‹. That tells the server the client has cached the certificate. The client also includes a fingerprint of the server certificate chain. If the server's certificate hasn't changed, the server doesn't need to send its certificate and the corresponding certificate chain again ๐Ÿ™Œ. If the info has changed (the client can tell from the fingerprint), the certificate payload is sent over so the client can update its cache ๐Ÿ”„.

There's a catch though ๐Ÿ™ˆ: the extension needs a successful full handshake before any caching can happen. This can be super useful when, for example, an EAP peer and EAP server already authenticated successfully on the home network ๐Ÿ . If the authenticators in a roaming network are stricter about dropping long EAP sessions, an EAP peer can use the Cached Information Extension to cut down the total number of messages ๐Ÿ“‰.

But here's the tricky part ๐Ÿ˜ฉ: if all authenticators drop the EAP session for a given EAP peer and EAP server combo, a successful full handshake isn't possible. One option for that situation would be to cache validated certificate chains even when the EAP-TLS exchange fails. Such caching is currently not specified in [RFC7924] ๐Ÿฅฒ.

4.2.3. Compressing Certificates

The TLS Working Group has standardized an extension for TLS 1.3 [RFC8879] that lets you compress certificates and certificate chains during full handshakes ๐Ÿ—œ๏ธ. A client can signal support for compressed server certificates by including this extension in its ClientHello message. Similarly, a server can signal support for compressing client certificates by including the extension in its CertificateRequest message ๐Ÿค. This can totally help with excessive fragmentation in EAP-TLS, but it can only be used with TLS version 1.3 and higher. Deployments relying on older versions of TLS can't benefit from it ๐Ÿ˜ค.

4.2.4. Compact TLS 1.3

[cTLS] defines a "compact" version of TLS 1.3 that reduces the message size by removing obsolete material and using more efficient encoding ๐Ÿชถ. It also defines a compression profile where either side can define a dictionary of "known certificates" ๐Ÿ“š. So cTLS could be another way for EAP-TLS deployments to shrink their messages and avoid excessive fragmentation ๐Ÿ’œ.

4.2.5. Suppressing Intermediate Certificates

If a client already has all the intermediate certificates in its certificate chain, having the server send intermediates during the TLS handshake just makes the handshake bigger for no reason ๐Ÿ™ƒ. [TLS-SIC] proposes an extension for TLS 1.3 that lets a TLS client with access to the complete set of published intermediate certificates tell servers so. Then the server can skip sending intermediates, which shrinks the TLS handshake ๐ŸŒท. This mechanism is meant to be complementary with certificate compression ๐Ÿซถ.

The Authority Information Access (AIA) extension in [RFC5280] can be used with end-entity and CA certificates to access info about the issuer of the certificate the extension appears in ๐Ÿ”. For example, it can give you the address of the Online Certificate Status Protocol (OCSP) responder, which is where you check the revocation status of that certificate. It can also be used to get the issuer certificate itself ๐Ÿ“œ. So the AIA extension can shrink the certificate chain by including just a pointer to the issuer certificate instead of the entire thing โœจ. The catch is that the side receiving the certificate with the extension needs network connectivity (unless the info is already cached locally) ๐Ÿ“ก. And this kind of indirection can't be used for the server certificate ๐Ÿ˜ญ, since EAP peers in most deployments don't have network connectivity before authentication and typically don't keep an up-to-date local cache of issuer certificates ๐Ÿ™…โ€โ™€๏ธ.

4.2.6. Raw Public Keys ๐Ÿ”‘โœจ

[RFC7250] defines a new certificate type and TLS extensions so you can use raw public keys for authentication. okay so raw public keys only carry a subset of what a typical certificate has, which makes them way smaller ๐Ÿฆ‹. The catch is that they need an out-of-band mechanism to bind the public key to the entity presenting it, so you can't just wing it ๐Ÿ’…. Using raw public keys will obviously dodge the fragmentation problems that come with large certificates and long certificate chains ๐Ÿ˜ญ. Deployments can consider them as long as an appropriate out-of-band mechanism for binding public keys with identifiers is in place. And ngl, deployments will also have to deal with the challenges of revocation and key rotation when using raw public keys ๐Ÿ’€.

4.2.7. New Certificate Types and Compression Algorithms ๐Ÿงš

There's ongoing work on new certificate types that are smaller than traditional X.509 certificates. For example, [CBOR-CERT] defines a Concise Binary Object Representation (CBOR) [RFC8949] encoding of X.509 Certificates. The CBOR encoding can be used to compress existing X.509 certificates or for natively signed CBOR certificates. [TLS-CWT] registers a new TLS Certificate type that would let TLS implementations use CBOR Web Tokens (CWTs) [RFC8392] as certificates. These are early initiatives, but future EAP-TLS deployments can consider these new certificate types and compression algorithms to avoid large message sizes ๐ŸŒˆ.

4.3. Updating Authenticators ๐Ÿšช

There are several legit reasons authenticators may want to limit the number of packets / octets / round trips that can be sent. The big one has been working around issues where the EAP peer and EAP server end up in an infinite loop ACKing their messages ๐Ÿ™ˆ. Another reason is that unlimited communication from an unauthenticated device using EAP could be a channel for inappropriate bulk data transfer. A third reason is preventing denial-of-service attacks ๐Ÿšจ.

Updating the millions of already deployed access points and switches is in many cases not realistic. Vendors may be out of business or no longer supporting the products, and admins may have lost the login info to the devices. For practical purposes, the EAP infrastructure is ossified for the time being ๐Ÿชจ.

Vendors making new authenticators should consider increasing the number of round trips allowed to 100 before denying the EAP authentication to complete. Based on the size of the certificates and certificate chains currently deployed, such an increase would likely ensure that peers and servers can complete EAP-TLS authentication. At the same time, administrators responsible for EAP deployments should ensure that this 100 round-trip limit is not exceeded in practice ๐Ÿ‘‘.

5. IANA Considerations ๐Ÿ“‹

This document has no IANA actions ๐Ÿซถ.

6. Security Considerations ๐Ÿšจ

Updating implementations to TLS version 1.3 allows omitting all certificates with a trust anchor known by the other endpoint. TLS 1.3 additionally provides improved security, privacy, and reduced latency for EAP-TLS [RFC9190] ๐Ÿ’œ.

Security considerations when compressing certificates are specified in [RFC8879].

Specific security considerations of the referenced documents apply when they are taken into use. โš ๏ธ Read them before you ship anything, bestie ๐Ÿ˜ญ.

7. References ๐Ÿ“š

7.1. Normative References

7.2. Informative References

Acknowledgements ๐Ÿซถ

This document is a result of several useful discussions with Alan DeKok, Bernard Aboba, Jari Arkko, Jouni Malinen, Darshak Thakore, and Hannes Tschofening ๐Ÿ’–.

Authors' Addresses ๐ŸŒธ

Mohit Sethi
Ericsson
FI-02420 Jorvas
Finland

Email: mohit@iki.fi


John PreuรŸ Mattsson
Ericsson
Kista
Sweden

Email: john.mattsson@ericsson.com


Sean Turner
sn3rd

Email: sean@sn3rd.com

And that's the whole spec, bestie ๐ŸŒˆโœจ๐Ÿ‘‘ you did it!!

๐Ÿ“ฆ where this page comes from