RFC 8649

Hash Of Root Key Certificate Extension

πŸ“… published August 2019, from ietf

Hash Of Root Key Certificate Extension ✨

  • Document: RFC 8649 πŸ’–
  • Title: Hash Of Root Key Certificate Extension
  • Author: R. Housley, Vigil Security πŸŽ€
  • Category: Informational πŸ“š
  • Date: August 2019 πŸ¦‹
  • Stream: Internet Engineering Task Force (IETF) 🌸
  • ISSN: 2070-1721
  • Obsoletes / Updates: neither line appears in its title block, so this doc doesn't list any RFCs it replaces or changes 🫢

Abstract

okay so this doc is all about the Hash Of Root Key certificate extension πŸ’… it lives in the self-signed certificate for a trust anchor, aka a Root Certification Authority (CA) certificate πŸ‘‘. the extension basically says "hey, here's exactly which public key is coming next to replace me as the Root CA certificate" πŸ”₯ it's giving planned succession, no drama 😭

Status of This Memo

this document is not an Internet Standards Track spec πŸ™ˆ it's published just for info πŸ’œ

this one is a product of the Internet Engineering Task Force (IETF) ✨ it represents the consensus of the IETF community, got public review, and was approved for publication by the Internet Engineering Steering Group (IESG) πŸŽ€ not every doc the IESG approves is a candidate for any level of Internet Standard, so check Section 2 of RFC 7841 for the deets 🧚

if you want the current status, any errata, or a way to send feedback, go to https://www.rfc-editor.org/info/rfc8649 🌈

Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. πŸ¦‹

this doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as of the publication date πŸ“œ please actually read those, because they spell out your rights and restrictions for this doc 🫢 any Code Components pulled out of this doc have to include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as the Simplified BSD License describes πŸ’€

Table of Contents

   1. Introduction ....................................................2
      1.1. Terminology ................................................2
      1.2. ASN.1 ......................................................3
   2. Overview ........................................................3
   3. Hash Of Root Key Certificate Extension ..........................4
   4. IANA Considerations .............................................4
   5. Operational Considerations ......................................4
   6. Security Considerations .........................................6
   7. References ......................................................7
      7.1. Normative References .......................................7
      7.2. Informative References .....................................8
   Appendix A.  ASN.1 Module ..........................................9
   Acknowledgements ..................................................10
   Author's Address ..................................................10

1. Introduction ✨

so this doc specifies the Hash Of Root Key X.509 version 3 certificate extension 🌸 it's an optional add-on to the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile [RFC5280] πŸ’… its whole job is making the jump from one Root CA public key to the next way smoother πŸ¦‹ how? the current self-signed cert publishes the hash of the next-gen public key πŸ”₯ that hash is a commitment to one specific public key sitting in the next-gen self-signed cert πŸŽ€

the commitment lets a relying party recognize the next-gen self-signed cert the moment it shows up, install it in the trust anchor store, and eventually drop the old one from that store πŸ‘‘ main character energy for key rollovers, honestly 😭

A Root CA certificate MAY include the Hash Of Root Key certificate extension to provide the hash value of the next public key that will be used by the Root CA. 🧚

1.1. Terminology

here's the key words stuff πŸ€“ "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be read as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they show up in all capitals, exactly like this πŸ’œ (lowercase ones are just regular words, bestie πŸ™ˆ)

1.2. ASN.1

certs [RFC5280] use ASN.1 [X680] πŸ“ and Distinguished Encoding Rules (DER) [X690] are REQUIRED for certificate signing and validation ✨ no DER, no party πŸ₯²

2. Overview πŸ¦‹

before the Root CA gets deployed for the first time, these get generated:

      R1 = The initial Root key pair
      R2 = The second-generation Root key pair
      H2 = Thumbprint (hash) of the public key of R2
      C1 = Self-signed certificate for R1, which also contains H2

C1 is a self-signed certificate, and it has H2 tucked inside the HashOfRootKey extension πŸŽ€ C1 ships as part of the initial system deployment πŸš€ the HashOfRootKey certificate extension gets the full breakdown in Section 3 🧚

when it's time to replace the initial Root CA certificate, R1, these get generated:

      R3 = The third-generation Root key pair
      H3 = Thumbprint (hash) the public key of R3
      C2 = Self-signed certificate for R2, which contains H3

this is an iterative process, so R4 and H4 are made when it's time for C3 to replace C2, and so on πŸ” it's a whole chain of hugs 🫢

the successor to the Root CA self-signed certificate can be delivered by any means πŸ“¦ whenever a new one is received, the recipient can verify that the potential Root CA certificate links back to a previously authenticated Root CA certificate through the HashOfRootKey extension πŸ”— so the recipient checks the signature on the self-signed certificate and checks that the hash of the DER-encoded SubjectPublicKeyInfo from the potential Root CA certificate matches the value in the HashOfRootKey extension of the current Root CA certificate πŸ’…

why both checks? the signature check makes sure the cert has the subject name, public key algorithm identifier, and public key algorithm parameters the key owner intended πŸ‘‘ those matter a lot for certification path validation, which Section 6 of [RFC5280] defines ✨ the hash check makes sure the cert has the intended public key 🎯

if either check fails, the potential Root CA certificate is not a valid replacement, and the recipient keeps using the current Root CA certificate πŸ™…β€β™€οΈ if both checks pass, the recipient adds the potential Root CA certificate to the trust anchor store 🌈 as Section 5 discusses, the recipient can remove the current Root CA certificate right away in some situations πŸ¦‹ in other situations, the recipient waits an appropriate amount of time so existing certification paths keep validating 🫧

3. Hash Of Root Key Certificate Extension πŸ’Ž

the HashOfRootKey certificate extension MUST NOT be critical. 🚨 it has to stay non-critical, no exceptions, period πŸ™…β€β™€οΈ

the following ASN.1 [X680] [X690] syntax defines the HashOfRootKey certificate extension 🧩

   ext-HashOfRootKey EXTENSION ::= {    -- Only in Root CA certificates
      SYNTAX         HashedRootKey
      IDENTIFIED BY  id-ce-hashOfRootKey
      CRITICALITY    {FALSE} }

   HashedRootKey ::= SEQUENCE {
      hashAlg        HashAlgorithm,        -- Hash algorithm used
      hashValue      OCTET STRING }        -- Hash of DER-encoded
                                           --   SubjectPublicKeyInfo

   id-ce-hashOfRootKey  ::=  OBJECT IDENTIFIER { 1 3 6 1 4 1 51483 2 1 }

the definitions of EXTENSION and HashAlgorithm live in [RFC5912] πŸ“–

hashAlg says which one-way hash algorithm was used to compute the hash value πŸ”

hashValue holds the hash value computed from the next-generation public key πŸ’œ that public key is the DER-encoded SubjectPublicKeyInfo as defined in [RFC5280] ✨

4. IANA Considerations 🌷

this document has no IANA actions 🌸

5. Operational Considerations 🧚✨

Okay bestie, let's talk about swapping root keys πŸ”‘πŸ’–. Guidance for this transition lives in Section 4.4 of [RFC4210]. Quick reminder that a root key is also known as a trust anchor 🫢. The oldWithNew and newWithOld advice is the real MVP here because it means relying parties can keep validating certificates issued under the current Root CA certificate and the next-generation Root CA certificate the whole way through the transition πŸ’…. The notAfter field in the oldWithNew certificate MUST cover the validity period of all unexpired certificates issued under the old Root CA private key. This advice SHOULD be followed by Root CAs too, so everyone doesn't have to make the switch at the exact same moment 😭🌈

After issuing the newWithOld certificate, the Root CA MUST stop using the old private key to sign certificates. No sneaky late signings, periodt πŸ™…β€β™€οΈπŸ’œ

Some enterprise and application-specific environments have a directory service or certificate repository that makes certificates and CRLs available to relying parties πŸ—‚οΈ. Section 3 in [RFC5280] describes a certificate repository. When one is available, the oldWithNew and newWithOld certificates SHOULD be published before the successor to the current Root CA self-signed certificate is released πŸŽ€. Recipients that can obtain the oldWithNew certificate SHOULD immediately remove the old Root CA self-signed certificate from the trust anchor store. Main character energy, the old cert gets retired πŸ‘‘

In environments without a directory service or repository, like the Web PKI, recipients need another way to get the oldWithNew and newWithOld certificates 🌐. The Root CA SHOULD include the subject information access extension [RFC5280] with the accessMethod set to id-ad-caRepository and the assessLocation set to the HTTP URL that can be used to fetch a DER-encoded "certs-only" (simple PKI response) message as specified in [RFC5272], in all of its self-signed certificates πŸ¦‹. The Root CA SHOULD publish the "certs-only" message with the oldWithNew certificate and the newWithOld certificate before the subsequent Root CA self-signed certificate is released. The "certs-only" message format lets certificates get added and removed from the bag of certificates over time, so the same HTTP URL can be used for the entire lifetime of the Root CA. Iconic, no notes πŸ“

Also in those no-repository environments, recipients SHOULD keep both the old and replacement Root CA self-signed certificates in the trust anchor store for some amount of time πŸ•°οΈ. This makes sure every end-entity certificate can be validated until it expires. The recipient MAY keep the old Root CA self-signed certificate until all of the certificates in the local cache that are subordinate to it have expired 🌸

Certification path construction gets more complicated when the trust anchor store has multiple self-signed certificates with the same distinguished name πŸ™ˆ. That's why the replacement Root CA self-signed certificate SHOULD contain a different distinguished name than the one it replaces. One approach is to put a number in the name that goes up with each generation, like "Example CA", "Example CA G2", "Example CA G3", and so on πŸ”’βœ¨

Changing names from one generation to another can cause confusion when someone reviews the history of a trust anchor store πŸ“š. To make that review easier, a recipient MAY create an audit entry that captures the old and replacement self-signed certificates πŸ“

The Root CA MUST securely back up the yet-to-be-deployed key pair πŸ”. If the Root CA keeps that key pair in a hardware security module and that module fails, the Root CA is still committed to a key pair that's no longer available 😭. Its only option is to deploy a new self-signed certificate with a newly generated key pair, the same way as the initial self-signed certificate. That means losing the benefits of the Hash Of Root Key certificate extension altogether πŸ’€

6. Security Considerations πŸ”’πŸ’…

The security considerations from [RFC5280] apply, especially the discussion of self-issued certificates πŸ›‘οΈ.

The Hash Of Root Key certificate extension helps with an orderly transition from one Root CA public key to the next by publishing the hash value of the next-generation public key in the current certificate πŸŽ€. This lets a relying party unambiguously recognize the next-generation public key once it shows up, but the full public key isn't disclosed until the Root CA releases the next-generation certificate. So attackers can't start analyzing the public key before the next-generation Root CA self-signed certificate is released πŸ™…β€β™€οΈβœ¨

The Root CA needs to make sure the public key in the next-generation certificate is as strong as or stronger than the key it's replacing πŸ’ͺ. A significant advance in cryptanalytic capability could break the yet-to-be-deployed key pair, and those advances are rare and hard to predict 😱. If one happens, the Root CA remains committed to the now-broken key. Its only option is to deploy a new self-signed certificate with a newly generated key pair, most likely using a different signature algorithm, in the same manner as the initial self-signed certificate. Again, that means losing the benefits of the Hash Of Root Key certificate extension altogether πŸ’”

The Root CA needs to employ a hash function that is resistant to preimage attacks [RFC4270]. This is a big deal, bestie 🚨

A first-preimage attack against the hash function would let an attacker find another input that results in the hash value of the next-generation public key published in the current certificate πŸ‘€. For that attack to work, the input would have to be a valid SubjectPublicKeyInfo containing a public key that corresponds to a private key the attacker knows. A second-preimage attack becomes possible once the Root CA releases the next-generation public key, since that makes the input to the hash function available to the attacker and everyone else 🌍. Again, the attacker needs a valid SubjectPublicKeyInfo containing a public key that corresponds to a private key they know. If the hash function gets broken after the Root CA publishes the self-signed certificate with the HashOfRootKey certificate extension, an attacker could trick the recipient into installing the incorrect next-generation certificate in the trust anchor store 😭🚫

If an early release of the next-generation public key happens, and the Root CA is worried that attackers got too much lead time to analyze that public key, the Root CA can move to a freshly generated key pair by quickly doing two transitions πŸƒβ€β™€οΈπŸ’¨. After the first transition, the Root CA is using the key pair that suffered the early release, and that transition causes the Root CA to generate the subsequent Root key pair. The second transition happens once the Root CA is confident the population of relying parties has finished the first transition, and it takes the Root CA to the freshly generated key pair. The second transition also causes the Root CA to generate another key pair reserved for future use 🧠. Queries for the CRLs associated with certificates subordinate to the self-signed certificate can give some hint about how many relying parties are still actively using that self-signed certificate πŸ‘€πŸ”

7. References πŸ“šπŸŒ·

7.1. Normative References

[RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
           Requirement Levels", BCP 14, RFC 2119,
           DOI 10.17487/RFC2119, March 1997,
           <https://www.rfc-editor.org/info/rfc2119>.

[RFC4210]  Adams, C., Farrell, S., Kause, T., and T. Mononen,
           "Internet X.509 Public Key Infrastructure Certificate
           Management Protocol (CMP)", RFC 4210,
           DOI 10.17487/RFC4210, September 2005,
           <https://www.rfc-editor.org/info/rfc4210>.

[RFC4270]  Hoffman, P. and B. Schneier, "Attacks on Cryptographic
           Hashes in Internet Protocols", RFC 4270,
           DOI 10.17487/RFC4270, November 2005,
           <https://www.rfc-editor.org/info/rfc4270>.

[RFC5272]  Schaad, J. and M. Myers, "Certificate Management over CMS
           (CMC)", RFC 5272, DOI 10.17487/RFC5272, June 2008,
           <https://www.rfc-editor.org/info/rfc5272>.

[RFC5280]  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, DOI 10.17487/RFC5280, May 2008,
           <https://www.rfc-editor.org/info/rfc5280>.

[RFC5912]  Hoffman, P. and J. Schaad, "New ASN.1 Modules for the
           Public Key Infrastructure Using X.509 (PKIX)", RFC 5912,
           DOI 10.17487/RFC5912, June 2010,
           <https://www.rfc-editor.org/info/rfc5912>.

[RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
           2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
           May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[X680]     ITU-T, "Information technology -- Abstract Syntax Notation
           One (ASN.1): Specification of basic notation",
           ITU-T Recommendation X.680, August 2015.

[X690]     ITU-T, "Information Technology -- ASN.1 encoding rules:
           Specification of Basic Encoding Rules (BER), Canonical
           Encoding Rules (CER) and Distinguished Encoding Rules
           (DER)", ITU-T Recommendation X.690, August 2015.

7.2. Informative References

[SET]      MasterCard and VISA, "SET Secure Electronic Transaction
           Specification -- Book 2: Programmer's Guide, Version 1.0",
           May 1997.

Appendix A. ASN.1 Module πŸŽ€πŸ§š

The following ASN.1 module provides the complete definition of the HashOfRootKey certificate extension πŸ’–.

<CODE BEGINS>

HashedRootKeyCertExtn { 1 3 6 1 4 1 51483 0 1 }

DEFINITIONS IMPLICIT TAGS ::=
BEGIN

-- EXPORTS All

IMPORTS

HashAlgorithm
  FROM PKIX1-PSS-OAEP-Algorithms-2009  -- RFC 5912
       { iso(1) identified-organization(3) dod(6) internet(1)
         security(5) mechanisms(5) pkix(7) id-mod(0)
         id-mod-pkix1-rsa-pkalgs-02(54) }

EXTENSION
  FROM PKIX-CommonTypes-2009  -- RFC 5912
    { iso(1) identified-organization(3) dod(6) internet(1)
      security(5) mechanisms(5) pkix(7) id-mod(0)
      id-mod-pkixCommon-02(57) } ;

--
-- Expand the certificate extensions list in RFC 5912
--

CertExtensions EXTENSION ::= {
   ext-HashOfRootKey, ... }

--
-- HashOfRootKey Certificate Extension
--

ext-HashOfRootKey EXTENSION ::= {    -- Only in Root CA certificates
   SYNTAX         HashedRootKey
   IDENTIFIED BY  id-ce-hashOfRootKey
   CRITICALITY    {FALSE} }

HashedRootKey  ::=  SEQUENCE {
   hashAlg        HashAlgorithm,     -- Hash algorithm used
   hashValue      OCTET STRING }     -- Hash of DER-encoded
                                     --   SubjectPublicKeyInfo

id-ce-hashOfRootKey OBJECT IDENTIFIER  ::=  { 1 3 6 1 4 1 51483 2 1 }

END

<CODE ENDS>

Acknowledgements ✨

okay bestie, so the Secure Electronic Transaction (SET) [SET] spec, published by MasterCard and VISA back in 1997, has a very similar certificate extension πŸ’… the SET one has essentially the same semantics, but the syntax is fairly different πŸŽ€

CTIA - The Wireless Association - is building a public key infrastructure that's going to use the certificate extension in this document πŸ¦‹ the object identifiers in the ASN.1 module were assigned by CTIA 🌸

huge thanks to Stefan Santesson, Jim Schaad, Daniel Kahn Gillmor, Joel Halpern, Paul Hoffman, Rich Salz, and Ben Kaduk 🫢 their reviews and comments made the document so much better, especially the "Operational Considerations" and "Security Considerations" sections 😭πŸ”₯

Author's Address πŸŽ€

Russ Housley
Vigil Security
516 Dranesville Road
Herndon, VA  20170
United States of America

Email: housley@vigilsec.com
πŸ“¦ where this page comes from