RFC 9162

Certificate Transparency Version 2.0

๐Ÿ“… published December 2021, from ietf

Certificate Transparency Version 2.0 ๐Ÿฆ‹

okay bestie, let's start with the title block tea โ˜•๐Ÿ’–

  • RFC number: 9162 โœจ
  • Stream: Internet Engineering Task Force (IETF) ๐ŸŒธ
  • Authors: B. Laurie (Google), E. Messeri (Google), and R. Stradling (Sectigo) ๐Ÿ‘‘
  • Category: Experimental ๐Ÿงช
  • ISSN: 2070-1721
  • Date: December 2021 ๐Ÿ“…
  • Obsoletes: RFC 6962 ๐Ÿซถ

This one obsoletes RFC 6962, so that's the old version it replaces. It's giving "the sequel everybody was waiting for" ๐Ÿ’…

Abstract ๐Ÿ“œ

Okay so this doc describes version 2.0 of the Certificate Transparency (CT) protocol ๐Ÿฆ‹. The whole point is publicly logging the existence of Transport Layer Security (TLS) server certificates as they get issued or observed. The best part? Anyone can audit certification authority (CA) activity, spot suspect certificates when they show up, and audit the certificate logs themselves ๐Ÿ•ต๏ธโ€โ™€๏ธโœจ

The big dream is that eventually clients would refuse to honor certificates that don't appear in a log. That would effectively force CAs to add every issued certificate to the logs. Iconic behaviour, no cap ๐Ÿ”ฅ

This document also specifies a brand new TLS extension that's used to send various CT log artifacts ๐ŸŽ€. And logs themselves are network services that implement the protocol operations for submissions and queries defined in this document ๐Ÿงš

Status of This Memo ๐Ÿ“œ

Real talk, this document is not an Internet Standards Track specification. It's being published for examination, experimental implementation, and evaluation ๐Ÿงช๐Ÿ’œ

It defines an Experimental Protocol for the Internet community. It's a product of the IETF and represents the consensus of the IETF community ๐ŸŒˆ It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not every document the IESG approves is a candidate for any level of Internet Standard, so see Section 2 of RFC 7841 for that ๐Ÿ™ˆ

For the current status, any errata, and how to give feedback, check https://www.rfc-editor.org/info/rfc9162 ๐Ÿ“

Copyright (c) 2021 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) in effect on the date of publication. Please review those carefully, because they describe your rights and restrictions with respect to this document โญ

Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions, and they're provided without warranty as described in the Revised BSD License. So if you lift code out of here, bring the license with you ๐Ÿซถ

Table of Contents ๐Ÿ“š

1.  Introduction
  1.1.  Requirements Language
  1.2.  Data Structures
  1.3.  Major Differences from CT 1.0
2.  Cryptographic Components
  2.1.  Merkle Trees
    2.1.1.  Definition of the Merkle Tree
    2.1.2.  Verifying a Tree Head Given Entries
    2.1.3.  Merkle Inclusion Proofs
    2.1.4.  Merkle Consistency Proofs
    2.1.5.  Example
  2.2.  Signatures
3.  Submitters
  3.1.  Certificates
  3.2.  Precertificates
    3.2.1.  Binding Intent to Issue
4.  Log Format and Operation
  4.1.  Log Parameters
  4.2.  Evaluating Submissions
    4.2.1.  Minimum Acceptance Criteria
    4.2.2.  Discretionary Acceptance Criteria
  4.3.  Log Entries
  4.4.  Log ID
  4.5.  TransItem Structure
  4.6.  Log Artifact Extensions
  4.7.  Merkle Tree Leaves
  4.8.  Signed Certificate Timestamp (SCT)
  4.9.  Merkle Tree Head
  4.10. Signed Tree Head (STH)
  4.11. Merkle Consistency Proofs
  4.12. Merkle Inclusion Proofs
  4.13. Shutting Down a Log
5.  Log Client Messages
  5.1.  Submit Entry to Log
  5.2.  Retrieve Latest STH
  5.3.  Retrieve Merkle Consistency Proof between Two STHs
  5.4.  Retrieve Merkle Inclusion Proof from Log by Leaf Hash
  5.5.  Retrieve Merkle Inclusion Proof, STH, and Consistency Proof
        by Leaf Hash
  5.6.  Retrieve Entries and STH from Log
  5.7.  Retrieve Accepted Trust Anchors
6.  TLS Servers
  6.1.  TLS Client Authentication
  6.2.  Multiple SCTs
  6.3.  TransItemList Structure
  6.4.  Presenting SCTs, Inclusions Proofs, and STHs
  6.5.  transparency_info TLS Extension
7.  Certification Authorities
  7.1.  Transparency Information X.509v3 Extension
    7.1.1.  OCSP Response Extension
    7.1.2.  Certificate Extension
  7.2.  TLS Feature X.509v3 Extension
8.  Clients
  8.1.  TLS Client
    8.1.1.  Receiving SCTs and Inclusion Proofs
    8.1.2.  Reconstructing the TBSCertificate
    8.1.3.  Validating SCTs
    8.1.4.  Fetching Inclusion Proofs
    8.1.5.  Validating Inclusion Proofs
    8.1.6.  Evaluating Compliance
  8.2.  Monitor
  8.3.  Auditing
9.  Algorithm Agility
10. IANA Considerations
  10.1.  Additions to Existing Registries
    10.1.1.  New Entry to the TLS ExtensionType Registry
    10.1.2.  URN Sub-namespace for TRANS (urn:ietf:params:trans)
  10.2.  New CT-Related Registries
    10.2.1.  Hash Algorithms
    10.2.2.  Signature Algorithms
    10.2.3.  VersionedTransTypes
    10.2.4.  Log Artifact Extensions
    10.2.5.  Log IDs
    10.2.6.  Error Types
  10.3.  OID Assignment
11. Security Considerations
  11.1.  Misissued Certificates
  11.2.  Detection of Misissue
  11.3.  Misbehaving Logs
  11.4.  Multiple SCTs
  11.5.  Leakage of DNS Information
12. References
  12.1.  Normative References
  12.2.  Informative References
Appendix A.  Supporting v1 and v2 Simultaneously (Informative)
Appendix B.  An ASN.1 Module (Informative)
Acknowledgements
Authors' Addresses

1. Introduction ๐ŸŒธ

Certificate Transparency is all about mitigating misissued certificates by providing append-only logs of issued certificates ๐Ÿ” The logs don't prevent misissuance on their own. What they do is make sure interested parties (especially the ones named in certificates) can detect it ๐Ÿ‘€

Note that this is a general mechanism that could be used for transparently logging any form of binary data, as long as there's some kind of inclusion criteria. In this document though, we only describe its use for public TLS server certificates, where the inclusion criteria is a valid certificate issued by a public certification authority (CA). A typical definition of "public" can be found in [CABBR] ๐Ÿง 

Each log contains certificate chains, and anyone can submit them ๐Ÿ’… It's expected that public CAs will contribute all their newly issued certificates to one or more logs. But certificate holders can also contribute their own chains, and so can third parties โœจ Now, to keep logs from getting useless with a flood of spurious certificates, it is required that each chain ends with a trust anchor that is accepted by the log. A log may also limit how long a chain it's willing to accept, and those chains must also end with an acceptable trust anchor ๐Ÿ›ก๏ธ

When a chain gets accepted, the log returns a signed timestamp. That timestamp can later be used to show TLS clients that the chain was submitted ๐Ÿงพ So TLS clients can require that every certificate they accept as valid comes with signed timestamps. Main character energy for sure ๐Ÿ‘‘

Folks who are worried about misissuance can monitor the logs by asking them regularly for all new entries. That way they can check whether domains they're responsible for have had certificates issued that they didn't expect ๐Ÿ”Ž What they do next, especially once they find a misissuance, is beyond the scope of this document. Broadly speaking though, they can use existing business mechanisms for dealing with misissued certificates, like working with the CA to get the certificate revoked, or working with maintainers of trust anchor lists to get the CA removed ๐Ÿ™…โ€โ™€๏ธ And of course, anyone who wants to can monitor the logs and, if they believe a certificate was incorrectly issued, take action as they see fit ๐Ÿ’ช

Similarly, anyone who has seen signed timestamps from a particular log can later demand a proof of inclusion from that log. If the log can't provide one (or if the corresponding certificate is absent from monitors' copies of that log), that's evidence of the log operating incorrectly ๐Ÿšจ The checking is asynchronous, so clients can keep going without delay, even with stuff like network connectivity issues and the vagaries of firewalls ๐Ÿงš

The append-only property of each log is achieved with Merkle Trees ๐ŸŒณ They can efficiently prove that any particular instance of the log is a superset of any particular previous instance, and they can efficiently detect various misbehaviors of the log. For example, a log issuing a signed timestamp for a certificate that never gets logged afterwards ๐Ÿ‘ป

Here's the catch though: the log auditing mechanisms in this document can be circumvented by a misbehaving log that shows different, inconsistent views of itself to different clients ๐Ÿ˜ญ That's why it's necessary to treat each log as a trusted third party. Mechanisms are being developed to address these shortcomings and avoid the need to blindly trust logs, but those are outside the scope of this document ๐Ÿซถ

1.1. Requirements Language ๐ŸŽ€

Okay, the key words here are the official BCP 14 vibes. 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 ๐Ÿ’–

1.2. Data Structures ๐Ÿงฉ

Data structures are defined and encoded according to the conventions laid out in Section 3 of [RFC8446] โœจ

This document uses object identifiers (OIDs) for a few things: identifying Log IDs (see Section 4.4), the precertificate Cryptographic Message Syntax (CMS) eContentType (see Section 3.2), X.509v3 extensions in certificates (see Section 7.1.2), and Online Certificate Status Protocol (OCSP) responses (see Section 7.1.1). The OIDs are defined in an arc that was selected because of its short encoding ๐Ÿฆ‹

1.3. Major Differences from CT 1.0 ๐ŸŒธ

okay so this doc is the glow-up of CT 1.0 [RFC6962] ๐Ÿ’… it's built on what people learned from actually running CT 1.0 out in the wild, plus a ton of community feedback. ngl the list is long and it's giving full rebrand. here's the tea:

  • Hash and signature algorithm agility โœจ: Permitted algorithms are now specified in IANA registries.
  • Precertificate format ๐ŸŽ€: Precertificates are now CMS objects rather than X.509 certificates, which avoids violating the certificate serial number uniqueness requirement in Section 4.1.2.2 of [RFC5280].
  • Removal of precertificate signing certificates and the precertificate poison extension ๐Ÿ’€: The change of precertificate format means that these are no longer needed.
  • Logs IDs ๐Ÿฆ‹: Each log is now identified by an OID rather than by the hash of its public key. OID allocations are available from an IANA registry.
  • TransItem structure ๐Ÿงš: This new data structure is used to encapsulate most types of CT data. A TransItemList, consisting of one or more TransItem structures, can be used anywhere that SignedCertificateTimestampList was used in [RFC6962].
  • Merkle Tree leaves ๐Ÿ“: The MerkleTreeLeaf structure has been replaced by the TransItem structure, which eases extensibility and simplifies the leaf structure by removing one layer of abstraction.
  • Unified leaf format ๐Ÿ’œ: The structure for both certificate and precertificate entries now includes only the TBSCertificate (whereas certificate entries in [RFC6962] included the entire certificate).
  • Log artifact extensions ๐ŸŒˆ: These are now typed and managed by an IANA registry, and they can now appear not only in Signed Certificate Timestamps (SCTs) but also in Signed Tree Heads (STHs).
  • API outputs ๐Ÿ‘‘: Complete TransItem structures are returned rather than the constituent parts of each structure.
  • get-all-by-hash โœจ: This is a new client API for obtaining an inclusion proof and the corresponding consistency proof at the same time.
  • submit-entry ๐Ÿ”ฅ: This is a new client API, replacing add-chain and add-pre-chain.
  • Presenting SCTs with proofs ๐Ÿซถ: TLS servers may present SCTs together with the corresponding inclusion proofs, using any of the mechanisms that [RFC6962] defined for presenting SCTs only. (Presenting SCTs only is still supported).
  • CT TLS extension ๐ŸŒธ: The signed_certificate_timestamp TLS extension has been replaced by the transparency_info TLS extension.
  • Verification algorithms ๐Ÿ”: Detailed algorithms for verifying inclusion proofs, for verifying consistency between two STHs, and for verifying a root hash given a complete list of the relevant leaf input entries have been added.
  • Extensive clarifications and editorial work ๐Ÿ’…: literally so much polish.

2. Cryptographic Components ๐Ÿ’–

2.1. Merkle Trees

okay so a full deep dive on Merkle Trees is out of scope here ๐Ÿ™ˆ the quick version: it's a binary tree where each non-leaf node is a hash of its children. for CT, a node has at most two children. if you want more, check the Introduction and Reference sections of [RFC8391].

2.1.1. Definition of the Merkle Tree ๐ŸŒณ

the log uses a binary Merkle Tree for efficient auditing โœจ the hash algorithm is one of the log's parameters (see Section 4.1), and this document sets up a registry of acceptable hash algorithms (see Section 10.2.1). throughout the doc, the hash algorithm in use is called HASH and the size of its output in bytes is called HASH_SIZE. the input is a list of data entries, and those entries get hashed to form the leaves of the tree. the output is a single HASH_SIZE Merkle Tree Hash. so for an ordered list of n inputs, D_n = {d[0], d[1], ..., d[n-1]}, the Merkle Tree Hash (MTH) works like this:

the hash of an empty list is the hash of an empty string ๐Ÿซง

MTH({}) = HASH()

the hash of a list with one entry (also known as a leaf hash) is:

MTH({d[0]}) = HASH(0x00 || d[0])

for n > 1, let k be the largest power of two smaller than n (i.e., k < n <= 2k). the Merkle Tree Hash of an n-element list D_n is then defined recursively as:

MTH(D_n) = HASH(0x01 || MTH(D[0:k]) || MTH(D[k:n]))

where:

  • || denotes concatenation
  • : denotes concatenation of lists
  • D[k1:k2] = D'_(k2-k1) denotes the list {d'[0] = d[k1], d'[1] = d[k1+1], ..., d'[k2-k1-1] = d[k2-1]} of length (k2 - k1).
โš ๏ธ heads up bestie: the hash calculations for leaves and nodes differ. this domain separation is required to give second preimage resistance ๐Ÿ”

note that we do not require the length of the input list to be a power of two ๐ŸŒˆ the resulting Merkle Tree may not be balanced, but its shape is uniquely determined by the number of leaves. (Note: This Merkle Tree is essentially the same as the history tree proposed by [CrosbyWallach], except our definition handles non-full trees differently.)

2.1.2. Verifying a Tree Head Given Entries ๐Ÿ”

so when a client has a complete list of entries from 0 up to tree_size - 1 and wants to check that list against a tree head root_hash the log returned for the same tree_size, this algorithm may be used:

  1. Set stack to an empty stack.
  2. For each i from 0 up to tree_size - 1:
    • a. Push HASH(0x00 || entries[i]) to stack.
    • b. Set merge_count to the lowest value (0 included) such that LSB(i >> merge_count) is not set, where LSB means the least significant bit. In other words, set merge_count to the number of consecutive 1s found starting at the least significant bit of i.
    • c. Repeat merge_count times:
      • i. Pop right from stack.
      • ii. Pop left from stack.
      • iii. Push HASH(0x01 || left || right) to stack.
  3. If there is more than one element in the stack, repeat the same merge procedure (the sub-items of Step 2(c) above) until only a single element remains.
  4. The remaining element in stack is the Merkle Tree Hash for the given tree_size and should be compared by equality against the supplied root_hash.

2.1.3. Merkle Inclusion Proofs ๐Ÿฆ‹

a Merkle inclusion proof for a leaf is the shortest list of extra nodes in the tree needed to compute the Merkle Tree Hash for that tree โœจ every node is either a leaf or is computed from the two nodes right below it (i.e., towards the leaves). at each step up the tree (towards the root), a node from the inclusion proof gets combined with the node computed so far. basically, the inclusion proof is the list of missing nodes needed to compute the nodes leading from a leaf to the root. if the root computed from the inclusion proof matches the true root, then the inclusion proof proves that the leaf exists in the tree ๐Ÿ™Œ

2.1.3.1. Generating an Inclusion Proof

given an ordered list of n inputs, D_n = {d[0], d[1], ..., d[n-1]}, the Merkle inclusion proof PATH(m, D_n) for the (m+1)th input d[m], 0 <= m < n, is defined as follows:

the proof for the single leaf in a tree with a one-element input list D[1] = {d[0]} is empty:

PATH(0, {d[0]}) = {}

for n > 1, let k be the largest power of two smaller than n. the proof for the (m+1)th element d[m] in a list of n > m elements is then defined recursively as:

PATH(m, D_n) = PATH(m, D[0:k]) : MTH(D[k:n]) for m < k; and

PATH(m, D_n) = PATH(m - k, D[k:n]) : MTH(D[0:k]) for m >= k,

the : operator and D[k1:k2] are defined the same as in Section 2.1.1 ๐ŸŽ€

2.1.3.2. Verifying an Inclusion Proof

when a client has received an inclusion proof (e.g., in a TransItem of type inclusion_proof_v2) and wants to verify inclusion of an input hash for a given tree_size and root_hash, this algorithm may be used to prove the hash was included in the root_hash ๐Ÿง 

  1. Compare leaf_index from the inclusion_proof_v2 structure against tree_size. If leaf_index is greater than or equal to tree_size, then fail the proof verification.
  2. Set fn to leaf_index and sn to tree_size - 1.
  3. Set r to hash.
  4. For each value p in the inclusion_path array:
    • a. If sn is 0, then stop the iteration and fail the proof verification.
    • b. If LSB(fn) is set, or if fn is equal to sn, then:
      • i. Set r to HASH(0x01 || p || r).
      • ii. If LSB(fn) is not set, then right-shift both fn and sn equally until either LSB(fn) is set or fn is 0.
      • Otherwise:
        • i. Set r to HASH(0x01 || r || p).
    • c. Finally, right-shift both fn and sn one time.
  5. Compare sn to 0. Compare r against the root_hash. If sn is equal to 0 and r and the root_hash are equal, then the log has proven the inclusion of hash. Otherwise, fail the proof verification.

2.1.4. Merkle Consistency Proofs ๐ŸŒธ

Merkle consistency proofs prove the append-only property of the tree ๐Ÿ’œ a Merkle consistency proof for a Merkle Tree Hash MTH(D_n) and a previously advertised hash MTH(D[0:m]) of the first m leaves, m <= n, is the list of nodes in the tree needed to verify that the first m inputs D[0:m] are equal in both trees. so a consistency proof must contain a set of intermediate nodes (i.e., commitments to inputs) that's enough to verify MTH(D_n), such that (a subset of) the same nodes can be used to verify MTH(D[0:m]). we define an algorithm that outputs the (unique) minimal consistency proof โœจ

2.1.4.1. Generating a Consistency Proof

given an ordered list of n inputs, D_n = {d[0], d[1], ..., d[n-1]}, the Merkle consistency proof PROOF(m, D_n) for a previous Merkle Tree Hash MTH(D[0:m]), 0 < m < n, is defined as:

PROOF(m, D_n) = SUBPROOF(m, D_n, true)

in SUBPROOF, the boolean value represents whether the subtree created from D[0:m] is a complete subtree of the Merkle Tree created from D_n and, as a result, whether the subtree Merkle Tree Hash MTH(D[0:m]) is known. the initial call to SUBPROOF sets this to be true, and SUBPROOF is then defined as follows ๐Ÿง

the subproof for m = n is empty if m is the value for which PROOF was originally requested (meaning that the subtree created from D[0:m] is a complete subtree of the Merkle Tree created from the original D_n for which PROOF was requested and the subtree Merkle Tree Hash MTH(D[0:m]) is known):

SUBPROOF(m, D_m, true) = {}

otherwise, the subproof for m = n is the Merkle Tree Hash committing inputs D[0:m]:

SUBPROOF(m, D_m, false) = {MTH(D_m)}

for m < n, let k be the largest power of two smaller than n. the subproof is then defined recursively, using the appropriate step below ๐Ÿ”ฅ

if m <= k, the right subtree entries D[k:n] only exist in the current tree. we prove that the left subtree entries D[0:k] are consistent and add a commitment to D[k:n]:

SUBPROOF(m, D_n, b) = SUBPROOF(m, D[0:k], b) : MTH(D[k:n])

if m > k, the left subtree entries D[0:k] are identical in both trees. we prove that the right subtree entries D[k:n] are consistent and add a commitment to D[0:k]:

SUBPROOF(m, D_n, b) = SUBPROOF(m - k, D[k:n], false) : MTH(D[0:k])

the number of nodes in the resulting proof is bounded above by ceil(log2(n)) + 1 ๐Ÿฆ‹

the : operator and D[k1:k2] are defined the same as in Section 2.1.1 ๐Ÿ’–

2.1.4.2. Verifying Consistency between Two Tree Heads

okay so this is the part where the client checks that two snapshots of the log are actually related, no cap ๐Ÿ”โœจ bestie, we're talking the consistency proof algorithm, and it's giving precision energy ๐Ÿ’…

When a client has a tree head first_hash for tree size first, has a tree head second_hash for tree size second where 0 < first < second, and has received a consistency proof between the two (e.g., in a TransItem of type consistency_proof_v2) ๐ŸŽ€, the following algorithm may be used to verify the consistency proof ๐Ÿฆ‹:

  1. If consistency_path is an empty array, stop and fail the proof verification ๐Ÿ’€.
  2. If first is an exact power of 2, then prepend first_hash to the consistency_path array ๐ŸŒธ.
  3. Set fn to first - 1 and sn to second - 1 ๐Ÿงš.
  4. If LSB(fn) is set, then right-shift both fn and sn equally until LSB(fn) is not set ๐Ÿ’œ.
  5. Set both fr and sr to the first value in the consistency_path array ๐Ÿ“.
  6. For each subsequent value c in the consistency_path array:

a. If sn is 0, then stop the iteration and fail the proof verification ๐Ÿ˜ญ.

b. If LSB(fn) is set, or if fn is equal to sn, then:

i. Set fr to HASH(0x01 || c || fr).

ii. Set sr to HASH(0x01 || c || sr).

iii. If LSB(fn) is not set, then right-shift both fn and sn equally until either LSB(fn) is set or fn is 0.

Otherwise:

i. Set sr to HASH(0x01 || sr || c).

c. Finally, right-shift both fn and sn one time.

  1. After completing iterating through the consistency_path array as described above, verify that the fr calculated is equal to the first_hash supplied, that the sr calculated is equal to the second_hash supplied, and that sn is 0 โœจ.

2.1.5. Example

okay now the fun part, we're doing a worked example with a binary Merkle Tree that has 7 leaves ๐ŸŒˆ๐Ÿ‘‘

            hash
           /    \
          /      \
         /        \
        /          \
       /            \
      k              l
     / \            / \
    /   \          /   \
   /     \        /     \
  g       h      i      j
 / \     / \    / \     |
 a b     c d    e f     d6
 | |     | |    | |
d0 d1   d2 d3  d4 d5

The inclusion proof for d0 is [b, h, l] ๐Ÿฆ‹.

The inclusion proof for d3 is [c, g, l] ๐Ÿฆ‹.

The inclusion proof for d4 is [f, j, k] ๐Ÿฆ‹.

The inclusion proof for d6 is [i, k] ๐Ÿฆ‹.

and then the same tree gets built incrementally in four steps ๐Ÿงฉ, watch this glow-up:

    hash0          hash1=k
    / \              /  \
   /   \            /    \
  /     \          /      \
  g      c         g       h
 / \     |        / \     / \
 a b     d2       a b     c d
 | |              | |     | |
d0 d1            d0 d1   d2 d3

          hash2                    hash
          /  \                    /    \
         /    \                  /      \
        /      \                /        \
       /        \              /          \
      /          \            /            \
     k            i          k              l
    / \          / \        / \            / \
   /   \         e f       /   \          /   \
  /     \        | |      /     \        /     \
 g       h      d4 d5    g       h      i      j
/ \     / \             / \     / \    / \     |
a b     c d             a b     c d    e f     d6
| |     | |             | |     | |    | |
d0 d1   d2 d3           d0 d1   d2 d3  d4 d5

The consistency proof between hash0 and hash is PROOF(3, D[7]) = [c, d, g, l]. Non-leaf nodes c, g are used to verify hash0, and non-leaf nodes d, l are additionally used to show hash is consistent with hash0 ๐ŸŒธ.

The consistency proof between hash1 and hash is PROOF(4, D[7]) = [l]. hash can be verified using hash1=k and l ๐Ÿ’–.

The consistency proof between hash2 and hash is PROOF(6, D[7]) = [i, j, k]. Non-leaf nodes k, i are used to verify hash2, and non-leaf node j is additionally used to show hash is consistent with hash2 ๐Ÿซถ.

2.2. Signatures

okay so signing is where the log gets serious ๐Ÿ”. When signing data structures, a log MUST use one of the signature algorithms from the IANA "Signature Algorithms" registry, described in Section 10.2.2 ๐Ÿ’….

3. Submitters โœจ

Submitters are the people who send certificates or preannouncements of certificates (precertificates) to logs ๐ŸŽ€ before issuance, so the whole world can audit them ๐Ÿ‘€. This is described below. To enable attribution of each logged certificate or precertificate to its issuer ๐Ÿฆ‹, each submission MUST be accompanied by all additional certificates required to verify the chain up to an accepted trust anchor (Section 5.7). The trust anchor (a root or intermediate CA certificate) MAY be omitted from the submission ๐ŸŒˆ.

If a log accepts a submission, it will return a Signed Certificate Timestamp (SCT) (see Section 4.8) ๐Ÿ’œ. The submitter SHOULD validate the returned SCT, as described in Section 8.1, if they understand its format and they intend to use it directly in a TLS handshake or to construct a certificate ๐Ÿซถ. If the submitter does not need the SCT (for example, the certificate is being submitted simply to make it available in the log), it MAY validate the SCT ๐Ÿงš.

3.1. Certificates

any entity can submit a certificate (Section 5.1) to a log ๐Ÿ’–. Since it is anticipated that TLS clients will reject certificates that are not logged, issuers and subjects are going to be strongly motivated to submit them ๐Ÿ”ฅ.

3.2. Precertificates

CAs may preannounce a certificate prior to issuance by submitting a precertificate (Section 5.1) that the log can use to create an entry that will be valid against the issued certificate ๐Ÿ“. The CA MAY incorporate the returned SCT in the issued certificate โœจ. One example of where the returned SCT is not incorporated in the issued certificate is when a CA sends the precertificate to multiple logs but only incorporates the SCTs that are returned first ๐Ÿ’….

A precertificate is a CMS [RFC5652] signed-data object that conforms to the following profile ๐ŸŽ€:

  • It MUST be DER encoded, as described in [X690].
  • SignedData.version MUST be v3(3).
  • SignedData.digestAlgorithms MUST be the same as the SignerInfo.digestAlgorithm OID value (see below).
  • SignedData.encapContentInfo:
    • eContentType MUST be the OID 1.3.101.78.
    • eContent MUST contain a TBSCertificate [RFC5280] that will be identical to the TBSCertificate in the issued certificate, except that the Transparency Information (Section 7.1) extension MUST be omitted.
  • SignedData.certificates MUST be omitted.
  • SignedData.crls MUST be omitted.
  • SignedData.signerInfos MUST contain one SignerInfo:
    • version MUST be v3(3).
    • sid MUST use the subjectKeyIdentifier option.
    • digestAlgorithm MUST be one of the hash algorithm OIDs listed in the IANA "Hash Algorithms" registry, described in Section 10.2.1.
    • signedAttrs MUST be present and MUST contain two attributes:

o a content-type attribute whose value is the same as SignedData.encapContentInfo.eContentType and

o a message-digest attribute whose value is the message digest of SignedData.encapContentInfo.eContent.

  • signatureAlgorithm MUST be the same OID as TBSCertificate.signature.
  • signature MUST be from the same (root or intermediate) CA that intends to issue the corresponding certificate (see Section 3.2.1).
  • unsignedAttrs MUST be omitted.

SignerInfo.signedAttrs is included in the message digest calculation process (see Section 5.4 of [RFC5652]), which ensures that the SignerInfo.signature value will not be a valid X.509v3 signature that could be used in conjunction with the TBSCertificate (from SignedData.encapContentInfo.eContent) to construct a valid certificate ๐Ÿ”’.

3.2.1. Binding Intent to Issue

under normal circumstances, there will be a short delay between precertificate submission and issuance of the corresponding certificate โณ. Longer delays are to be expected occasionally (e.g., due to log server downtime); in some cases, the CA might not actually issue the corresponding certificate ๐Ÿ™ˆ. Nevertheless, a precertificate's signature indicates the CA's binding intent to issue the corresponding certificate, which means that:

  • Misissuance of a precertificate is considered equivalent to misissuance of the corresponding certificate. The CA should expect to be held accountable, even if the corresponding certificate has not actually been issued ๐Ÿ˜ฌ.
  • Upon observing a precertificate, a client can reasonably presume that the corresponding certificate has been issued. A client may wish to obtain status information (e.g., by using the Online Certificate Status Protocol [RFC6960] or by checking a Certificate Revocation List [RFC5280]) about a certificate that is presumed to exist, especially if there is evidence or suspicion that the corresponding precertificate was misissued ๐Ÿ•ต๏ธโ€โ™€๏ธ.
  • TLS clients may have policies that require CAs to be able to revoke and to provide certificate status services for each certificate that is presumed to exist based on the existence of a corresponding precertificate ๐Ÿ’–.

4. Log Format and Operation โœจ

okay so a log is a single, append-only Merkle Tree of submitted certificate and precertificate entries ๐ŸŒณ.

When it receives and accepts a valid submission, the log MUST return an SCT that corresponds to the submitted certificate or precertificate ๐ŸŽ€. If the log has previously seen this valid submission, it SHOULD return the same SCT as it returned before, as discussed in Section 11.3 ๐Ÿ’…. If different SCTs are produced for the same submission, multiple log entries will have to be created, one for each SCT (as the timestamp is a part of the leaf structure) ๐Ÿงฉ. Note that if a certificate was previously logged as a precertificate, then the precertificate's SCT of type precert_sct_v2 would not be appropriate; instead, a fresh SCT of type x509_sct_v2 should be generated ๐Ÿฆ‹.

An SCT is the log's promise to append to its Merkle Tree an entry for the accepted submission ๐Ÿค. Upon producing an SCT, the log MUST fulfill this promise by performing the following actions within a fixed amount of time known as the Maximum Merge Delay (MMD), which is one of the log's parameters (see Section 4.1) โฐ:

  • Allocate a tree index to the entry representing the accepted submission.
  • Calculate the root of the tree.
  • Sign the root of the tree (see Section 4.10).

The log may append multiple entries before signing the root of the tree ๐ŸŒธ.

Log operators SHOULD NOT impose any conditions on retrieving or sharing data from the log ๐Ÿซถ.

4.1. Log Parameters โœจ

okay bestie, so a log is basically defined by a bundle of immutable parameters ๐ŸŽ€ clients use these to talk to the log and to check the log's receipts. Except for the Final STH, every single one of these MUST be set up before the log operator starts running the log ๐Ÿ’…

Base URL ๐Ÿ”—: this is the prefix used to build URLs [RFC3986] for client messages (see Section 5). The base URL MUST be an "https" URL, it MAY have a port, and it MAY have a path with any number of path segments, BUT it MUST NOT have a query string, a fragment, or a trailing "/". Example: https://ct.example.org/blue ๐Ÿฆ‹

Hash Algorithm ๐Ÿงฎ: the hash algorithm used for the Merkle Tree (see Section 10.2.1) ๐ŸŒธ

Signature Algorithm โœ๏ธ: the signature algorithm used (see Section 2.2) ๐Ÿ’œ

Public Key ๐Ÿ”‘: the public key used to verify signatures generated by the log. A log MUST NOT use the same keypair as any other log. no sharing keys, periodt ๐Ÿ™…โ€โ™€๏ธ

Log ID ๐Ÿชช: the OID that uniquely identifies the log โœจ

Maximum Merge Delay โณ: the MMD the log has committed to. This document deliberately does not specify any limits on the value to allow for experimentation ๐Ÿงช

Version ๐ŸŽ€: the version of the protocol the log supports (currently 1 or 2) ๐ŸŒˆ

Maximum Chain Length ๐Ÿ”—: the longest certificate chain submission the log is willing to accept, if the log imposes any limit ๐Ÿ™ˆ

STH Frequency Count ๐Ÿ“Š: the maximum number of STHs the log may produce in any period equal to the Maximum Merge Delay (see Section 4.10) ๐Ÿ’–

Final STH ๐Ÿชฆ: so if a log has been closed down (aka it no longer accepts new entries), existing entries might still be valid. In that case the client should know the final valid STH in the log, so that no new entries can be added without getting caught ๐Ÿ˜ญ This value MUST be provided in the form of a TransItem of type signed_tree_head_v2. If a log is still accepting entries, this value should not be provided ๐Ÿซถ

[JSON.Metadata] is an example of a metadata format that includes all of the elements above ๐Ÿ“


4.2. Evaluating Submissions ๐Ÿ”

okay so a log decides whether to accept or reject a submission by checking it against the minimum acceptance criteria (see Section 4.2.1) AND the log's discretionary acceptance criteria (see Section 4.2.2) ๐Ÿ’…

If the acceptance criteria are met, the log SHOULD accept the submission. (A log may decide, for example, to temporarily reject acceptable submissions to protect itself against denial-of-service attacks ๐Ÿ›ก๏ธ)

The log SHALL allow retrieval of its list of accepted trust anchors (see Section 5.7), and each one is a root or intermediate CA certificate ๐ŸŒณ This list might usefully be the union of root certificates trusted by major browser vendors ๐ŸŒ

4.2.1. Minimum Acceptance Criteria ๐Ÿšฆ

so this is the no-nonsense checklist ๐Ÿ“‹ It exists so that logged certificates and precertificates can be traced back to an accepted trust anchor, so monitors know what they'll actually find in the log, and so the log doesn't get flooded by invalid submissions ๐Ÿ˜ค The log MUST reject a submission if any of the following conditions are not met:

  • The submission, type, and chain inputs MUST be set as described in Section 5.1. The log MUST NOT accommodate misordered CA certificates, or use any other source of intermediate CA certificates to try and build a certification path ๐Ÿ™…โ€โ™€๏ธ
  • Each of the zero or more intermediate CA certificates in the chain MUST have one or both of the following features:
    • The Basic Constraints extension with the cA boolean asserted.
    • The Key Usage extension with the keyCertSign bit asserted.
  • Each certificate in the chain MUST fall within the limits imposed by the zero or more Basic Constraints pathLenConstraint values found higher up the chain ๐Ÿ“
  • Precertificate submissions MUST conform to all of the requirements in Section 3.2 ๐ŸŽ€

4.2.2. Discretionary Acceptance Criteria ๐ŸŽฒ

okay so if the minimum criteria are met but the submission isn't fully valid under [RFC5280] verification rules (like the certificate or precertificate has expired, isn't valid yet, has been revoked, or has ASN.1 DER encoding errors but the log can still parse it, etc.), then whether to accept it is up to the log's discretion ๐Ÿคทโ€โ™€๏ธ It's actually useful for logs to accept these anyway, to deal with quirks in CA issuing software and to help monitor CA compliance with policies and technical standards ๐Ÿ“ˆ However, it is impractical for this document to list, and for logs to consider, every way a submission could fail to comply with [RFC5280] ๐Ÿซ 

Logs SHOULD limit the length of chain they will accept. The maximum chain length is one of the log's parameters (see Section 4.1) โ›“๏ธ


4.3. Log Entries ๐Ÿ“š

so if a submission is accepted and an SCT is issued, the accepting log MUST store the entire chain used for verification ๐Ÿ—„๏ธ That chain MUST include the certificate or precertificate itself, the zero or more intermediate CA certificates the submitter provided, and the trust anchor used to verify the chain (even if it was left out of the submission). The log MUST provide this chain for auditing upon request (see Section 5.6), so the CA can't dodge blame by logging a partial or empty chain ๐Ÿ™…โ€โ™€๏ธ Each log entry is a TransItem structure of type x509_entry_v2 or precert_entry_v2. However, a log may store its entries in any format ๐Ÿคช If a log does not store this TransItem in full, it must store the timestamp and sct_extensions of the corresponding TimestampedCertificateEntryDataV2 structure. The TransItem can then be rebuilt from those fields and the entire chain the log used to verify the submission ๐Ÿงฉ


4.4. Log ID ๐Ÿชช

each log is identified by an OID, which is one of the log's parameters (see Section 4.1), and that OID MUST NOT be used to identify any other log ๐Ÿšซ A log's operator MUST either allocate the OID themselves or request one from the Log ID registry (see Section 10.2.5) ๐ŸŒธ One way to get an OID arc, which OIDs can then be allocated from, is to request a Private Enterprise Number from IANA by filling in the registration form (https://pen.iana.org/pen/PenApplication.page) ๐Ÿ“ The only advantage of the registry is that the DER encoding can be small ๐Ÿฃ (Recall that OID allocations don't need a central registration, although logs will most likely want to make themselves known to potential clients through out-of-band means ๐Ÿ“ฃ) Various data structures include the DER encoding of this OID, excluding the ASN.1 tag and length bytes, in an opaque vector:

opaque LogID<2..127>;

Note that the ASN.1 length and the opaque vector length are identical in size (1 byte) and value, so the full DER encoding (including the tag and length) of the OID can be rebuilt simply by prepending an OBJECT IDENTIFIER tag (0x06) to the opaque vector length and contents ๐Ÿง โœจ

The OID used to identify a log is limited such that the DER encoding of its value, excluding the tag and length, MUST be no longer than 127 octets ๐Ÿ“


4.5. TransItem Structure ๐Ÿงธ

so various data structures get wrapped up inside the TransItem structure, so that the type and version of each one is identified in one consistent way ๐ŸŽ

enum {
    x509_entry_v2(0x0100), precert_entry_v2(0x0101),
    x509_sct_v2(0x0102), precert_sct_v2(0x0103),
    signed_tree_head_v2(0x0104), consistency_proof_v2(0x0105),
    inclusion_proof_v2(0x0106),

    /* Reserved Code Points */
    reserved_rfc6962(0x0000..0x00FF),
    reserved_experimentaluse(0xE000..0xEFFF),
    reserved_privateuse(0xF000..0xFFFF),
    (0xFFFF)
} VersionedTransType;

struct {
    VersionedTransType versioned_type;
    select (versioned_type) {
        case x509_entry_v2: TimestampedCertificateEntryDataV2;
        case precert_entry_v2: TimestampedCertificateEntryDataV2;
        case x509_sct_v2: SignedCertificateTimestampDataV2;
        case precert_sct_v2: SignedCertificateTimestampDataV2;
        case signed_tree_head_v2: SignedTreeHeadDataV2;
        case consistency_proof_v2: ConsistencyProofDataV2;
        case inclusion_proof_v2: InclusionProofDataV2;
    } data;
} TransItem;

versioned_type is a value from the IANA registry in Section 10.2.3 that identifies the type of the encapsulated data structure AND the earliest version of this protocol it conforms to. This document is v2 ๐ŸŽ€

data is the encapsulated data structure. The various structures with the DataV2 suffix are defined in later sections of this document ๐Ÿ“–

Note that VersionedTransType combines the v1 type enumerations Version, LogEntryType, SignatureType, and MerkleLeafType [RFC6962] ๐Ÿงฉ Note also that v1 did not define TransItem, but this document provides guidelines (see Appendix A) on how v2 implementations can coexist with v1 implementations ๐Ÿค

Future versions of this protocol MAY reuse VersionedTransType values defined in this document as long as the corresponding data structures are not modified, and MAY add new VersionedTransType values for new or modified data structures ๐Ÿ”ฎ


4.6. Log Artifact Extensions ๐Ÿงฉ

enum {
    reserved(65535)
} ExtensionType;

struct {
    ExtensionType extension_type;
    opaque extension_data<0..2^16-1>;
} Extension;

okay so the Extension structure gives log artifacts generic extensibility, including SCTs (Section 4.8) and STHs (Section 4.10) ๐Ÿ’ซ The interpretation of the extension_data field is determined solely by the value of the extension_type field ๐Ÿ”‘

This document does not define any extensions, but it DOES establish a registry for future ExtensionType values (see Section 10.2.4) ๐Ÿ—‚๏ธ Each document that registers a new ExtensionType MUST specify the context in which it may be used (e.g., SCT, STH, or both) and describe how to interpret the corresponding extension_data ๐ŸŒˆ

4.7. Merkle Tree Leaves ๐Ÿƒ

okay so the leaves of a log's Merkle Tree line up with the log's entries (see Section 4.3) ๐ŸŒณ each leaf is the leaf hash (Section 2.1) of a TransItem structure of type x509_entry_v2 or precert_entry_v2, and that TransItem wraps a TimestampedCertificateEntryDataV2 structure. the leaf hash is HASH(0x00 || TransItem), and the hash algorithm is one of the log's parameters ๐Ÿ’…

opaque TBSCertificate<1..2^24-1>;

struct {
    uint64 timestamp;
    opaque issuer_key_hash<32..2^8-1>;
    TBSCertificate tbs_certificate;
    Extension sct_extensions<0..2^16-1>;
} TimestampedCertificateEntryDataV2;

the timestamp is the date and time the certificate or precertificate got accepted by the log ๐Ÿ•ฐ๏ธ it's a 64-bit unsigned number of milliseconds since the Unix Epoch (1 January 1970 00:00:00 UTC -- see [UNIXTIME]), leap seconds get ignored, and it's in network byte order ๐ŸŒ also, the leaves are not required to be in strict chronological order, so don't panic if they're a little out of sequence ๐Ÿ™ˆ

issuer_key_hash is the HASH of the public key of the CA that issued the certificate or precertificate ๐Ÿ” it's calculated over the DER encoding of the key, represented as SubjectPublicKeyInfo [RFC5280]. this is the glue that binds the CA to the certificate or precertificate, which makes it impossible for the matching SCT to be valid for any other certificate or precertificate whose TBSCertificate matches tbs_certificate ๐Ÿซถ the length of the issuer_key_hash MUST match HASH_SIZE.

tbs_certificate is the DER-encoded TBSCertificate from the submission โœจ (fun fact: a precertificate's TBSCertificate can be rebuilt from the corresponding certificate, as described in Section 8.1.2).

sct_extensions is byte-for-byte identical to the SCT extensions of the corresponding SCT ๐ŸŽ€

the type of the TransItem matches the value of the type parameter supplied in the Section 5.1 call ๐Ÿฆ‹


4.8. Signed Certificate Timestamp (SCT) ๐Ÿ’Œ

an SCT is a TransItem structure of type x509_sct_v2 or precert_sct_v2, and it wraps a SignedCertificateTimestampDataV2 structure:

struct {
    LogID log_id;
    uint64 timestamp;
    Extension sct_extensions<0..2^16-1>;
    opaque signature<1..2^16-1>;
} SignedCertificateTimestampDataV2;

log_id is this log's unique ID, encoded in an opaque vector, as described in Section 4.4 ๐Ÿ†”

timestamp is equal to the timestamp from the corresponding TimestampedCertificateEntryDataV2 structure โฐ

sct_extensions is a vector of 0 or more SCT extensions ๐Ÿงฉ this vector MUST NOT include more than one extension with the same extension_type. the extensions in the vector MUST be ordered by the value of the extension_type field, smallest value first ๐Ÿ“‹ all SCT extensions act similarly to noncritical X.509v3 extensions (aka the mustUnderstand field is not set), and a recipient SHOULD ignore any extension it does not understand. on top of that, an implementation MAY choose to ignore any extension(s) that it does understand ๐Ÿ™ƒ

signature is computed over a TransItem structure of type x509_entry_v2 or precert_entry_v2 (see Section 4.7), using the signature algorithm declared in the log's parameters (see Section 4.1) โœ๏ธ


4.9. Merkle Tree Head ๐ŸŒฒ

the log stores info about its Merkle Tree in a TreeHeadDataV2 ๐Ÿ—‚๏ธ

opaque NodeHash<32..2^8-1>;

struct {
    uint64 timestamp;
    uint64 tree_size;
    NodeHash root_hash;
    Extension sth_extensions<0..2^16-1>;
} TreeHeadDataV2;

the length of NodeHash MUST match HASH_SIZE of the log ๐Ÿ“

timestamp is the current date and time, using the format defined in Section 4.7 โฑ๏ธ

tree_size is the number of entries currently in the log's Merkle Tree ๐Ÿ”ข

root_hash is the root of the Merkle Tree ๐ŸŒณ

sth_extensions is a vector of 0 or more STH extensions ๐Ÿงฉ this vector MUST NOT include more than one extension with the same extension_type. the extensions in the vector MUST be ordered by the value of the extension_type field, smallest value first. if an implementation sees an extension it doesn't understand, it SHOULD ignore that extension. and once again, an implementation MAY choose to ignore any extension(s) that it does understand ๐Ÿ’œ


4.10. Signed Tree Head (STH) โœ๏ธ๐ŸŒธ

periodically, each log SHOULD sign its current tree head info (see Section 4.9) to produce an STH ๐Ÿ“ฃ when a client asks for a log's latest STH (see Section 5.2), the log MUST return an STH that is no older than the log's MMD. BUT, since STHs could be used to single out individual clients (by making a fresh STH for every query), a log MUST NOT produce STHs more often than its parameters declare (see Section 4.1). generally there's no need to make a new STH unless there are new entries in the log ๐Ÿ™…โ€โ™€๏ธ however, if a log doesn't accept any submissions during an MMD period, the log MUST sign the same Merkle Tree Hash with a fresh timestamp ๐Ÿ•ฐ๏ธโœจ

an STH is a TransItem structure of type signed_tree_head_v2, and it wraps a SignedTreeHeadDataV2 structure:

struct {
    LogID log_id;
    TreeHeadDataV2 tree_head;
    opaque signature<1..2^16-1>;
} SignedTreeHeadDataV2;

log_id is this log's unique ID, encoded in an opaque vector, as described in Section 4.4 ๐Ÿ†”

the timestamp in tree_head MUST be at least as recent as the most recent SCT timestamp in the tree ๐Ÿซฃ and each subsequent timestamp MUST be more recent than the timestamp of the previous update ๐Ÿ“ˆ

tree_head contains the latest tree head info (see Section 4.9) ๐ŸŒณ

signature is computed over the tree_head field, using the signature algorithm declared in the log's parameters (see Section 4.1) โœ๏ธ


4.11. Merkle Consistency Proofs ๐Ÿ”

to prep a Merkle consistency proof for distribution to clients, the log makes a TransItem structure of type consistency_proof_v2, which wraps a ConsistencyProofDataV2 structure ๐ŸŽ

struct {
    LogID log_id;
    uint64 tree_size_1;
    uint64 tree_size_2;
    NodeHash consistency_path<0..2^16-1>;
} ConsistencyProofDataV2;

log_id is this log's unique ID, encoded in an opaque vector, as described in Section 4.4 ๐Ÿ†”

tree_size_1 is the size of the older tree ๐Ÿ‘ต

tree_size_2 is the size of the newer tree ๐Ÿ‘ถ

consistency_path is a vector of Merkle Tree nodes proving the consistency of two STHs, as described in Section 2.1.4 ๐Ÿงต


4.12. Merkle Inclusion Proofs ๐Ÿงพ

to prep a Merkle inclusion proof for distribution to clients, the log makes a TransItem structure of type inclusion_proof_v2, which wraps an InclusionProofDataV2 structure ๐Ÿ“ฆ

struct {
    LogID log_id;
    uint64 tree_size;
    uint64 leaf_index;
    NodeHash inclusion_path<0..2^16-1>;
} InclusionProofDataV2;

log_id is this log's unique ID, encoded in an opaque vector, as described in Section 4.4 ๐Ÿ†”

tree_size is the size of the tree this inclusion proof is based on ๐ŸŒฒ

leaf_index is the 0-based index of the log entry that matches this inclusion proof ๐ŸŽฏ

inclusion_path is a vector of Merkle Tree nodes proving the inclusion of the chosen certificate or precertificate, as described in Section 2.1.3 ๐Ÿ›ค๏ธ


4.13. Shutting Down a Log ๐Ÿชฆ๐Ÿ’€

log operators might decide to shut down a log for various reasons, like deprecating a signature algorithm ๐Ÿ˜ค if there are entries in the log for certificates that haven't expired yet, then simply making TLS clients stop recognizing that log will invalidate the SCTs from that log ๐Ÿ˜ฑ to avoid that drama, the following actions SHOULD be taken:

  • Make it known to clients and monitors that the log will be frozen. this isn't part of the API, so it has to happen via a relevant out-of-band mechanism ๐Ÿ“ฃ
  • Stop accepting new submissions (the error code "shutdown" should be returned for such requests) ๐Ÿšซ
  • Once MMD from the last accepted submission has passed and all pending submissions are incorporated, issue a final STH and publish it as one of the log's parameters. having an STH with a timestamp that's after the MMD has passed since the last SCT issuance lets clients audit this log regularly without any special handling for the final STH ๐Ÿง at this point, the log's private key isn't needed anymore and can be destroyed ๐Ÿ”‘๐Ÿ’ฅ
  • Keep the log running until the certificates in all of its entries have expired or exist in other logs (this can be determined by scanning other logs or connecting to domains mentioned in the certificates and inspecting the SCTs served) ๐Ÿ‘€๐Ÿ’–

5. Log Client Messages โœจ

Okay so, every message is an HTTPS GET or POST request ๐Ÿ’Œ. Parameters for POSTs and all responses are JSON objects [RFC8259] ๐ŸŽ€. Parameters for GETs are key/value URL parameters that can come in any order ๐Ÿฆ‹ and use the "application/x-www-form-urlencoded" format from the "HTML 4.01 Specification" [HTML401]. Binary data gets base64 encoded following Section 4 of [RFC4648], and each message spells out where that applies ๐Ÿงš.

Clients are configured with a log's base URL, which is one of the log's parameters ๐ŸŒธ. They build request URLs by tacking suffixes onto that base URL. This setup puts some limits on how log operators can deploy these services, as [RFC8820] points out. But real-world experience with version 1 of this protocol hasn't shown these limits to be a problem ๐Ÿ’….

Heads up: JSON objects and URL parameters can carry extra fields that aren't in this spec, so people can experiment ๐Ÿงช. Any field that isn't understood should be ignored. (SHOULD, bestie ๐Ÿ’–)

Here's the tea ๐Ÿต: a log might run multiple front-end machines. Keeping them perfectly in sync is basically impossible, so skew between machines can cause errors ๐Ÿ˜ญ. When that happens, the front end gives back extra info (more on that below) so clients can keep going, if going is possible at all โœจ. Front ends MUST only serve data that is free of gaps. For example, a front end won't respond with an STH unless it can also prove consistency from all the log entries logged within that STH ๐Ÿ”ฅ.

Let's say a client asks for a consistency proof between two STHs. The front end it hits might not know about one or both of them yet ๐Ÿ™ˆ. If it knows neither, it returns the latest STH it knows about. If it knows the first but not the second, it returns the latest STH it knows about plus a consistency proof from the first STH to that returned STH. The case where it knows the second but not the first shouldn't come up, thanks to the "no gaps" requirement from above ๐Ÿซถ.

If the log can't process a client's request, it MUST return an HTTP response code of 4xx/5xx (see [RFC7231]) ๐Ÿšซ. Instead of the responses described in the subsections below, the body SHOULD be a JSON problem details object (see Section 3 of [RFC7807]) with these two fields:

  • type: A URN reference that identifies the problem. To make automated error handling easier, this document defines a set of standard tokens for the type field, all inside the URN namespace urn:ietf:params:trans:error: ๐Ÿค–.
  • detail: A human-readable string explaining the error that stopped the log from processing the request. Ideally it has enough detail for the error to actually get fixed ๐Ÿ› ๏ธ.

Here's an example. If someone requests <Base URL>/ct/v2/get-entries?start=100&end=99, the log returns a 400 Bad Request with a body that looks something like this ๐Ÿ‘€:

{
    "type": "urn:ietf:params:trans:error:endBeforeStart",
    "detail": "'start' cannot be greater than 'end'"
}

Most error types are specific to their request type and get defined in the subsections below. The one exception is the "malformed" type, which means the log server couldn't parse the client's request because it didn't follow this document ๐Ÿฅฒ:

+===========+==================================+
| type      | detail                           |
+===========+==================================+
| malformed | The request could not be parsed. |
+-----------+----------------------------------+

                     Table 1

Clients SHOULD treat 500 Internal Server Error and 503 Service Unavailable responses as transient failures ๐ŸŒค๏ธ. They MAY retry the exact same request later without changing it. For a 503, the log MAY include a Retry-After header field per [RFC7231] to say how long the client should wait before retrying ๐Ÿ•ฐ๏ธ. If that header isn't there, this document doesn't set a minimum wait time.

Clients SHOULD treat any 4xx error as a problem with the request itself, so don't resubmit it without changing something first ๐Ÿ™…โ€โ™€๏ธ. The full status code MAY give extra details ๐Ÿ’œ.

This document deliberately doesn't give more specific guidance on using HTTP status codes. Not me being vague, it's intentional ๐Ÿ’โ€โ™€๏ธ.


5.1. Submit Entry to Log

POST <Base URL>/ct/v2/submit-entry

Inputs:

  • submission: The base64-encoded certificate or precertificate ๐Ÿ“œ.
  • type: The VersionedTransType integer that says what kind of submission this is: 1 for x509_entry_v2 or 2 for precert_entry_v2 ๐Ÿ”ข.
  • chain: An array of zero or more JSON strings, where each string is a base64-encoded CA certificate ๐Ÿ”—. The first element is the certifier of the submission, the second certifies the first, and so on. The last element of chain (or, if chain is an empty array, the submission itself) is certified by an accepted trust anchor ๐Ÿ‘‘.

Outputs:

  • sct: A base64-encoded TransItem of type x509_sct_v2 or precert_sct_v2, signed by this log, that matches the submission โœ๏ธ.

If the submitted entry is immediately appended to this log's tree (or already exists in it), then the log SHOULD also output these:

  • sth: A base64-encoded TransItem of type signed_tree_head_v2, signed by this log ๐ŸŒณ.
  • inclusion: A base64-encoded TransItem of type inclusion_proof_v2 whose inclusion_path array of Merkle Tree nodes proves the submission is included in the returned sth ๐Ÿงฉ.

Error codes:

+================+===============================================+
| type           | detail                                        |
+================+===============================================+
| badSubmission  | submission is neither a valid certificate nor |
|                | a valid precertificate.                       |
+----------------+-----------------------------------------------+
| badType        | type is neither 1 nor 2.                      |
+----------------+-----------------------------------------------+
| badChain       | The first element of chain is not the         |
|                | certifier of the submission, or the second    |
|                | element does not certify the first, etc.      |
+----------------+-----------------------------------------------+
| badCertificate | One or more certificates in chain are not     |
|                | valid (e.g., not properly encoded).           |
+----------------+-----------------------------------------------+
| unknownAnchor  | The last element of chain (or, if chain is an |
|                | empty array, the submission) is not, nor is   |
|                | it certified by, an accepted trust anchor.    |
+----------------+-----------------------------------------------+
| shutdown       | The log is no longer accepting submissions.   |
+----------------+-----------------------------------------------+

                     Table 2

Now the fun bit ๐ŸŽข. If the version of sct isn't v2, a v2 client may be unable to verify the signature. It MUST NOT treat this as an error ๐Ÿ™Œ. That way, compliant v2 clients that don't use the returned SCTs don't get forced into an upgrade.

If a log spots bad encoding in a chain that otherwise verifies correctly, it MUST either log the certificate or return the "badCertificate" error ๐Ÿ”. And if it logs the certificate, it MUST issue an SCT ๐Ÿ“. Logging the certificate is useful, because monitors (Section 8.2) can then detect these encoding errors, which some TLS clients might still accept ๐Ÿ‘€.

If the submission is an accepted trust anchor whose certifier is neither an accepted trust anchor nor the first element of chain, the log MUST return the "unknownAnchor" error ๐Ÿšง. A log can't generate an SCT for a submission if it doesn't have access to the issuer's public key ๐Ÿ”‘.

If the returned sct is meant to go to TLS clients, then sth and inclusion (if returned) SHOULD also be given to TLS clients ๐ŸŽ. For example, if type was 2 (indicating precert_sct_v2), then all three TransItems could be embedded in the certificate ๐Ÿ’–.


5.2. Retrieve Latest STH

GET <Base URL>/ct/v2/get-sth

No inputs ๐Ÿ™….

Outputs:

  • sth: A base64-encoded TransItem of type signed_tree_head_v2, signed by this log, that is no older than the log's MMD โฐ.

5.3. Retrieve Merkle Consistency Proof between Two STHs

GET <Base URL>/ct/v2/get-sth-consistency

Inputs:

  • first: The tree_size of the older tree, in decimal ๐ŸŒฑ.
  • second: The tree_size of the newer tree, in decimal (optional) ๐ŸŒฟ.

Both tree sizes have to come from existing v2 STHs. But because of skew, the receiving front end might not know one or both of those STHs ๐ŸŒ€. If it knows both, only the consistency output is returned. If it knows the first but not the second (or the second was left out), then the latest known STH is returned, along with a consistency proof between the first STH and that latest one. If it knows neither, the latest known STH is returned with no consistency proof ๐Ÿคทโ€โ™€๏ธ.

Outputs:

  • consistency: A base64-encoded TransItem of type consistency_proof_v2 whose tree_size_1 MUST match the first input ๐Ÿ“. If the sth output is left out, then tree_size_2 MUST match the second input. If first and second are equal and correspond to a known STH, the returned consistency proof MUST be empty (a consistency_path array with zero elements) ๐Ÿซง.
  • sth: A base64-encoded TransItem of type signed_tree_head_v2, signed by this log ๐Ÿ–‹๏ธ.

Note that no signature is required for the consistency output, since it's used to verify consistency between two signed STHs ๐Ÿ’œ.

Error codes:

+===================+======================================+
| type              | detail                               |
+===================+======================================+
| firstUnknown      | first is before the latest known STH |
|                   | but is not from an existing STH.     |
+-------------------+--------------------------------------+
| secondUnknown     | second is before the latest known    |
|                   | STH but is not from an existing STH. |
+-------------------+--------------------------------------+
| secondBeforeFirst | second is smaller than first.        |
+-------------------+--------------------------------------+

                     Table 3

For how to actually use the consistency output, check out Section 2.1.4.2 ๐Ÿฆ‹.

5.4. Retrieve Merkle Inclusion Proof from Log by Leaf Hash ๐ŸŽ€

okay so this one is the "hey, is this cert in your log??" endpoint ๐Ÿฆ‹ you send a hash and the log hands back proof that it's in there. bestie, the vibes are immaculate

GET <Base URL>/ct/v2/get-proof-by-hash

Inputs: hash: A base64-encoded v2 leaf hash.

tree_size: The tree_size of the tree the proof is based on, in decimal.

The hash MUST be calculated as defined in Section 4.7. Wait, let me say that properly: the hash must be calculated as defined in Section 4.7, and a v2 STH must exist for the tree_size. ๐Ÿ’… Because of skew, the front end might not know the requested tree head. In that case it returns the latest STH it knows, plus an inclusion proof to that STH. If the front end DOES know the requested tree head, then only inclusion is returned. ๐Ÿซถ

Outputs: inclusion: A base64-encoded TransItem of type inclusion_proof_v2 whose inclusion_path array of Merkle Tree nodes proves the inclusion of the certificate (as specified by the hash parameter) in the selected STH.

sth: A base64-encoded TransItem of type signed_tree_head_v2, signed by this log.

Note that no signature is required for the inclusion output, as it is used to verify inclusion in the selected STH, which is signed. ๐ŸŒธ

Error codes:

+=================+=====================================+
| type            | detail                              |
+=================+=====================================+
| hashUnknown     | hash is not the hash of a known     |
|                 | leaf (may be caused by skew or by a |
|                 | known certificate not yet merged).  |
+-----------------+-------------------------------------+
| treeSizeUnknown | hash is before the latest known STH |
|                 | but is not from an existing STH.    |
+-----------------+-------------------------------------+

                          Table 4

See Section 2.1.3.2 for an outline of how to use the inclusion output. ๐Ÿงš

5.5. Retrieve Merkle Inclusion Proof, STH, and Consistency Proof by Leaf Hash โœจ

ngl this one is the all-in-one combo meal ๐Ÿ“ same deal, but you get the inclusion proof, the STH, AND the consistency proof in one go. iconic

GET <Base URL>/ct/v2/get-all-by-hash

Inputs: hash: A base64-encoded v2 leaf hash.

tree_size: The tree_size of the tree the proofs are based on, in decimal.

The hash must be calculated as defined in Section 4.7. A v2 STH must exist for the tree_size.

Because of skew, the front end might not know the requested tree head or the requested hash, which leads to a few cases ๐Ÿ‘‘:

+=====================+=====================================+
| Case                | Response                            |
+=====================+=====================================+
| latest STH <        | Return latest STH.                  |
| requested tree head |                                     |
+---------------------+-------------------------------------+
| latest STH >        | Return latest STH and a consistency |
| requested tree head | proof between it and the requested  |
|                     | tree head (see Section 5.3).        |
+---------------------+-------------------------------------+
| index of requested  | Return inclusion.                   |
| hash < latest STH   |                                     |
+---------------------+-------------------------------------+

                          Table 5

Note that more than one case can be true, and then the returned data is their union ๐ŸŒˆ. It's also possible for none of them to be true, and in that case the front end MUST return an empty response. ๐Ÿ’€

Outputs: inclusion: A base64-encoded TransItem of type inclusion_proof_v2 whose inclusion_path array of Merkle Tree nodes proves the inclusion of the certificate (as specified by the hash parameter) in the selected STH.

sth: A base64-encoded TransItem of type signed_tree_head_v2, signed by this log.

consistency: A base64-encoded TransItem of type consistency_proof_v2 that proves the consistency of the requested tree head and the returned STH.

Note that no signature is required for the inclusion or consistency outputs, as they are used to verify inclusion in and consistency of signed STHs. ๐Ÿฆ‹

Errors are the same as in Section 5.4.

See Section 2.1.3.2 for an outline of how to use the inclusion output, and see Section 2.1.4.2 for an outline of how to use the consistency output. ๐Ÿ’œ

5.6. Retrieve Entries and STH from Log ๐ŸŒธ

okay this is the "give me the actual entries" endpoint, and it's giving main character ๐ŸŽฌ

GET <Base URL>/ct/v2/get-entries

Inputs: start: 0-based index of first entry to retrieve, in decimal.

end: 0-based index of last entry to retrieve, in decimal.

Outputs: entries: An array of objects, each consisting of:

log_entry: The base64-encoded TransItem structure of type x509_entry_v2 or precert_entry_v2 (see Section 4.3).

submitted_entry: JSON object equivalent to inputs that were submitted to submit-entry, with the addition of the trust anchor to the chain field if the submission did not include it.

sct: The base64-encoded TransItem of type x509_sct_v2 or precert_sct_v2, corresponding to this log entry.

sth: A base64-encoded TransItem of type signed_tree_head_v2, signed by this log.

Note that this message is not signed. The entries data can be verified by constructing the Merkle Tree Hash corresponding to a retrieved STH ๐Ÿ”. All leaves MUST be v2. However, a compliant v2 client MUST NOT construe an unrecognized TransItem type as an error. This means it may be unable to parse some entries, but each client can inspect the entries it does recognize, as well as verify the integrity of the data by treating unrecognized leaves as opaque input to the tree. ๐Ÿซถ

The start and end parameters SHOULD be within the range 0 <= x < tree_size, as returned by get-sth in Section 5.2. ๐Ÿงš

The start parameter MUST be less than or equal to the end parameter. ๐Ÿ’…

Each submitted_entry output parameter MUST include the trust anchor that the log used to verify the submission, even if that trust anchor was not provided to submit-entry (see Section 5.1). If the submission does not certify itself, then the first element of chain MUST be present and MUST certify the submission. ๐Ÿ”ฅ

Log servers MUST honor requests where 0 <= start < tree_size and end >= tree_size by returning a partial response covering only the valid entries in the specified range. end >= tree_size could be caused by skew. Note that the following restriction may also apply:

Logs MAY restrict the number of entries that can be retrieved per get-entries request. If a client requests more than the permitted number of entries, the log SHALL return the maximum number of entries permissible. These entries SHALL be sequential beginning with the entry specified by start. Note that a limit on the number of entries is not immutable, so the restriction may be changed or lifted at any time, and it is not listed with the other Log Parameters in Section 4.1. ๐ŸŒˆ

Because of skew, it is possible the log server will not have any entries between start and end. In this case, it MUST return an empty entries array. ๐Ÿ™ˆ

In any case, the log server MUST return the latest STH it knows about. โญ

See Section 2.1.2 for an outline of how to use a complete list of log_entry entries to verify the root_hash. ๐ŸŽ€

Error codes:

+================+==================================+
| type           | detail                           |
+================+==================================+
| startUnknown   | start is greater than the number |
|                | of entries in the Merkle Tree.   |
+----------------+----------------------------------+
| endBeforeStart | start cannot be greater than     |
|                | end.                             |
+----------------+----------------------------------+

                          Table 6

5.7. Retrieve Accepted Trust Anchors ๐Ÿ“

last one in this section and it's a chill vibe โœจ this is where you ask the log which CA certs it's cool with

GET <Base URL>/ct/v2/get-anchors

No inputs.

Outputs: certificates: An array of JSON strings, each of which is a base64-encoded CA certificate that is acceptable to the log.

max_chain_length: If the server has chosen to limit the length of chains it accepts, this is the maximum number of certificates in the chain, in decimal. If there is no limit, this is omitted.

This data is not signed, so the protocol depends on the security guarantees of TLS to ensure correctness. ๐Ÿ”

6. TLS Servers ๐Ÿฆ‹

okay bestie, this is the part where the TLS server has to actually deliver the SCTs to the client ๐Ÿซถ and there are a few ways to do it ๐ŸŒธ

CT-using TLS servers MUST use at least one of the mechanisms described below to present one or more SCTs from one or more logs to each TLS client during full TLS handshakes, when requested by the client, where each SCT corresponds to the server certificate. (Of course, a server can only send a TLS extension if the client has specified it first.) Servers SHOULD also present corresponding inclusion proofs and STHs. ๐Ÿ‘‘

A server can provide SCTs using a TLS 1.3 extension (Section 4.2 of [RFC8446]) with type transparency_info (see Section 6.5). This mechanism lets TLS servers take part in CT without the cooperation of CAs, unlike the other two mechanisms. It also lets SCTs and inclusion proofs get updated on the fly. โšก

The server may also use an Online Certificate Status Protocol (OCSP) [RFC6960] response extension (see Section 7.1.1), providing the OCSP response as part of the TLS handshake. Providing a response during a TLS handshake is popularly known as "OCSP stapling" ๐Ÿ™ˆ. For TLS 1.3, the information is encoded as an extension in the status_request extension data; see Section 4.4.2.1 of [RFC8446]. For TLS 1.2 [RFC5246], the information is encoded in the CertificateStatus message; see Section 8 of [RFC6066]. Using stapling also lets SCTs and inclusion proofs get updated on the fly. ๐Ÿ’œ

CT information can also be encoded as an extension in the X.509v3 certificate (see Section 7.1.2). This mechanism allows the use of unmodified TLS servers, but the SCTs and inclusion proofs cannot be updated on the fly. Since the logs the SCTs and inclusion proofs came from won't necessarily be accepted by TLS clients for the full lifetime of the certificate, there is a risk that TLS clients may later consider the certificate to be noncompliant. In that event, one of the other two mechanisms will need to be used to deliver CT information or, if that's not possible, the certificate will need to be reissued. ๐Ÿฅบ

6.1. TLS Client Authentication ๐ŸŒˆ

this one's a little "not meโ€ฆ" ๐Ÿ™ˆ the spec doesn't describe how a TLS server can use CT for TLS client certificates. It might be useful someday, but it isn't documented here, for these reasons:

  • The greater security exposure is for clients to end up interacting with an illegitimate server. ๐Ÿ’€
  • In general, TLS client certificates are not expected to be submitted to CT logs, particularly those intended for general public use. ๐Ÿซฃ

A future version could include such information. โœจ

6.2. Multiple SCTs โœจ

okay bestie, CT-using TLS servers SHOULD send SCTs from multiple logs, and the reasons are sooo good ๐Ÿ’…

  • The list of trusted logs is not one universal list ๐ŸŒˆ Every TLS client vendor can keep its own list of logs it trusts, and that list changes over time. New logs can become trusted and current logs can get dropped. Client discovery, trust, and distrust of logs are expected to be handled out of band, which is outside the scope of this document.
  • Hiding misissuance gets harder ๐Ÿ•ต๏ธโ€โ™€๏ธ If a CA and a log collude, they could temporarily hide misissuance from clients. When a TLS client requires SCTs from multiple logs, pulling that off is much harder.
  • Backup plans for misbehaving logs ๐Ÿซถ If a log misbehaves or has a key compromise, clients might stop trusting it. An SCT can stick around for a long time (several years is common when it's embedded in a certificate), so having SCTs from multiple logs lowers the chance that clients reject the certificate.
  • Some clients require it ๐Ÿ‘‘ TLS clients may have policies that ask TLS servers to present multiple SCTs for these reasons. For example, at the time of writing, Chromium [Chromium.Log.Policy] requires multiple SCTs with Extended Validation (EV) certificates before it shows the EV indicator.

To pick which logs to get SCTs from, a TLS server can, for example, look at the set of logs that popular TLS clients accept and recognize ๐Ÿฆ‹

6.3. TransItemList Structure ๐Ÿงš

Multiple SCTs, inclusion proofs, and really any type of TransItem structure get bundled into a list like this:

opaque SerializedTransItem<1..2^16-1>;

struct {
    SerializedTransItem trans_item_list<1..2^16-1>;
} TransItemList;

Here, SerializedTransItem is an opaque byte string holding the serialized TransItem structure. This encoding is genius because TLS clients can decode each TransItem on its own. So if there's a version upgrade, older clients can still parse the old TransItem structures and just skip the new ones whose versions they don't understand ๐ŸŒธ

6.4. Presenting SCTs, Inclusions Proofs, and STHs ๐ŸŽ€

In every TransItemList sent during a TLS handshake, the TLS server MUST include a TransItem structure of type x509_sct_v2 or precert_sct_v2.

Presenting inclusion proofs and STHs during the handshake helps protect the client's privacy (see Section 8.1.4) and takes some load off the log servers. So if the TLS server can get them, it SHOULD also include TransItems of type inclusion_proof_v2 and signed_tree_head_v2 in the TransItemList ๐Ÿ’œ

6.5. transparency_info TLS Extension ๐Ÿ’–

As long as a TLS client puts the transparency_info extension type in its ClientHello, and the TLS server supports the transparency_info extension:

  • The TLS server MUST verify that the received extension_data is empty.
  • The TLS server MUST construct a TransItemList of relevant TransItems (see Section 6.4), and it SHOULD leave out any TransItems that are already embedded in the server certificate or the stapled OCSP response (see Section 7.1). If the TransItemList it builds isn't empty, the TLS server MUST include the transparency_info extension with the extension_data set to this TransItemList. If the list is empty, the server SHOULD omit the extension_data element, but it MAY send it with an empty array.

TLS servers MUST only include this extension in these messages:

  • the ServerHello message (for TLS 1.2 or earlier)
  • the Certificate or CertificateRequest message (for TLS 1.3)

TLS servers MUST NOT process or include this extension when a TLS session is resumed, because session resumption uses the original session information ๐Ÿ™…โ€โ™€๏ธ

7. Certification Authorities ๐Ÿ‘‘

7.1. Transparency Information X.509v3 Extension ๐Ÿ”ฅ

The Transparency Information X.509v3 extension has OID 1.3.101.75 and SHOULD be noncritical. It holds one or more TransItem structures in a TransItemList. It MAY be included in OCSP responses (see Section 7.1.1) and in certificates (see Section 7.1.2). Here's the catch: [RFC5280] requires the extnValue field (an OCTET STRING) of each X.509v3 extension to hold the DER encoding of an ASN.1 value, so a TransItemList MUST NOT be included directly ๐Ÿ˜ญ Instead, it MUST be wrapped inside an additional OCTET STRING, and that OCTET STRING goes into the extnValue field:

TransparencyInformationSyntax ::= OCTET STRING

TransparencyInformationSyntax contains a TransItemList.

7.1.1. OCSP Response Extension ๐ŸŒˆ

A certification authority MAY include a Transparency Information X.509v3 extension in the singleExtensions of a SingleResponse in an OCSP response. Every SCT and inclusion proof included has to be for the certificate identified by the certID of that SingleResponse, or for a precertificate that corresponds to that certificate.

7.1.2. Certificate Extension ๐Ÿฆ‹

A certification authority MAY include a Transparency Information X.509v3 extension in a certificate. Every SCT and inclusion proof included MUST be for a precertificate that corresponds to this certificate.

7.2. TLS Feature X.509v3 Extension โญ

A certification authority SHOULD NOT issue any certificate that lists the transparency_info TLS extension in a TLS feature extension [RFC7633]. The reason is that TLS servers are not required to support the transparency_info TLS extension in order to take part in CT (see Section 6).

8. Clients ๐Ÿงšโ€โ™€๏ธ

There are a bunch of different functions that clients of logs might perform, so we're going to walk through some typical clients and how they should work. Any inconsistency may be used as evidence that a log hasn't behaved correctly, and the signatures on the data structures stop the log from denying that misbehavior. Main character log energy ๐ŸŽฌ

All clients need certain parameters to talk to logs and check their responses. Those parameters are described in Section 4.1, but this document doesn't say how the parameters get obtained, since that's implementation dependent (for example, see [Chromium.Policy]) ๐Ÿ“

8.1. TLS Client ๐Ÿ’…

8.1.1. Receiving SCTs and Inclusion Proofs ๐Ÿซถ

TLS clients receive SCTs and inclusion proofs alongside, or inside, certificates. CT-using TLS clients MUST implement all three mechanisms that TLS servers can use to present SCTs (see Section 6).

TLS clients that support the transparency_info TLS extension (see Section 6.5) SHOULD include it in ClientHello messages, with empty extension_data. If a TLS server includes the transparency_info TLS extension when resuming a TLS session, the TLS client MUST abort the handshake ๐Ÿšซ

8.1.2. Reconstructing the TBSCertificate ๐Ÿ”ง

Validating an SCT for a certificate (where the TransItem type is x509_sct_v2) uses the unmodified TBSCertificate component of the certificate.

Before an SCT for a precertificate (where the TransItem type is precert_sct_v2) can be validated, the TBSCertificate component of the precertificate has to be rebuilt from the TBSCertificate component of the certificate, like this:

  • Remove the Transparency Information extension (see Section 7.1).
  • Remove embedded v1 SCTs, which are identified by OID 1.3.6.1.4.1.11129.2.4.2 (see Section 3.3 of [RFC6962]). This lets embedded v1 and v2 SCTs live side by side in a certificate (see Appendix A) โœจ

8.1.3. Validating SCTs ๐Ÿ”

To make use of a received SCT, the TLS client MUST first validate it like this:

  • Compute the signature input by constructing a TransItem of type x509_entry_v2 or precert_entry_v2, depending on the SCT's TransItem type. The TimestampedCertificateEntryDataV2 structure gets built like this:
    • timestamp is copied from the SCT.
    • tbs_certificate is the rebuilt TBSCertificate portion of the server certificate, as described in Section 8.1.2.
    • issuer_key_hash is computed as described in Section 4.7.
    • sct_extensions is copied from the SCT.
  • Verify the SCT's signature against the computed signature input, using the public key of the corresponding log, which is identified by the log_id. The required signature algorithm is one of the log's parameters.

If the TLS client doesn't have the corresponding log's parameters, it can't attempt to validate the SCT. When evaluating compliance (see Section 8.1.6), the TLS client only considers the SCTs it was able to validate.

Note that SCT validation is not a substitute for normal validation of the server certificate and its chain ๐Ÿ’–

8.1.4. Fetching Inclusion Proofs ๐ŸŒธ

When a TLS client has validated a received SCT but doesn't have a matching inclusion proof yet, the TLS client MAY ask a log for the inclusion proof directly, using get-proof-by-hash (Section 5.4) or get-all-by-hash (Section 5.5).

Heads up: fetching inclusion proofs straight from a log tells the log which TLS server the client has been talking to. That can be seen as a serious privacy concern, so it's better for the TLS server to send the inclusion proofs itself (see Section 6.4) ๐Ÿ™ˆ

8.1.5. Validating Inclusion Proofs ๐Ÿง

When a TLS client has received or fetched an inclusion proof (and an STH), it SHOULD go ahead and verify the inclusion proof against the provided STH. The TLS client SHOULD also verify consistency between the provided STH and an STH it already knows about.

If the TLS client holds an STH that is older than the SCT, it MAY, while auditing, request a new STH from the log (Section 5.2) and then verify it by requesting a consistency proof (Section 5.3). Note that if the TLS client uses get-all-by-hash, it will already have the new STH ๐ŸŽ‰

8.1.6. Evaluating Compliance ๐Ÿ’œ

It's up to a client's local policy to decide how much evidence (SCTs, inclusion proofs, or a mix) is needed for compliance, and how to handle noncompliance ๐Ÿ‘‘

A TLS client can only evaluate compliance if it gave the TLS server a chance to send SCTs and inclusion proofs through any of the three mechanisms that CT-using TLS clients must implement (see Section 8.1.1). So a TLS client MUST NOT evaluate compliance if it didn't include both the transparency_info and status_request TLS extensions in the ClientHello ๐Ÿ™…โ€โ™€๏ธ๐Ÿซถ

8.2. Monitor ๐Ÿ‘€

okay so monitors are the watchers ๐Ÿง of the log world. They check that a log is behaving correctly, keep an eye out for certificates of interest, or do both. For example, a monitor could be set up to report every certificate that applies to a specific domain name while it's fetching new entries for consistency validation ๐Ÿ’…

A monitor MUST at least inspect every new entry in every log it watches, and it MAY also choose to keep copies of entire logs. ๐Ÿซถ

To inspect all of the existing entries, the monitor SHOULD follow these steps once for each log:

  1. Fetch the current STH (Section 5.2).
  2. Verify the STH signature.
  3. Fetch all the entries in the tree corresponding to the STH (Section 5.6).
  4. If applicable, check each entry to see if it's a certificate of interest.
  5. Confirm that the tree made from the fetched entries produces the same hash as that in the STH.

To inspect new entries, the monitor SHOULD follow these steps repeatedly for each log:

  1. Fetch the current STH (Section 5.2). Repeat until the STH changes. To allow for experimentation, this document does not specify the polling frequency. ๐Ÿงช
  2. Verify the STH signature.
  3. Fetch all the new entries in the tree corresponding to the STH (Section 5.6). If they remain unavailable for an extended period, then this should be viewed as misbehavior on the part of the log. that's a whole red flag ๐Ÿšฉ
  4. If applicable, check each entry to see if it's a certificate of interest.
  5. Either:
    • a. Verify that the updated list of all entries generates a tree with the same hash as the new STH.

Or, if it is not keeping all log entries:

  • a. Fetch a consistency proof for the new STH with the previous STH (Section 5.3).
  • b. Verify the consistency proof.
  • c. Verify that the new entries generate the corresponding elements in the consistency proof.
  1. Repeat from Step 1. ๐Ÿ”

8.3. Auditing ๐Ÿ”

Auditing makes sure that the current published state of a log can be reached from previously published states that are known to be good, and that the promises the log made in the form of SCTs have actually been kept ๐Ÿคž Audits are performed by monitors or TLS clients.

In particular, there are four properties of log behavior that should be checked:

  • the Maximum Merge Delay (MMD)
  • the STH Frequency Count
  • the append-only property
  • the consistency of the log view presented to all query sources

A benign, conformant log publishes a series of STHs over time, each derived from the previous STH and the submitted entries incorporated into the log since publication of the previous STH. This can be proven through auditing of STHs. SCTs returned to TLS clients can be audited by verifying against the accompanying certificate and using Merkle inclusion proofs against the log's Merkle Tree. โœจ

The action taken by the auditor, if an audit fails, is not specified, but note that in general, if an audit fails, the auditor is in possession of signed proof of the log's misbehavior. receipts, bestie ๐Ÿงพ๐Ÿ’€

A monitor (Section 8.2) can audit by verifying the consistency of STHs it receives, ensuring that each entry can be fetched and that the STH is indeed the result of making a tree from all fetched entries. ๐Ÿ•ต๏ธโ€โ™€๏ธ

A TLS client (Section 8.1) can audit by verifying an SCT against any STH dated after the SCT timestamp + the Maximum Merge Delay by requesting a Merkle inclusion proof (Section 5.4). It can also verify that the SCT corresponds to the server certificate it arrived with (i.e., the log entry is that certificate or is a precertificate corresponding to that certificate). ๐ŸŽ€

Checking of the consistency of the log view presented to all entities is more difficult to perform because it requires a way to share log responses among a set of CT-using entities and is discussed in Section 11.3. It's a whole other mood ๐Ÿ˜ญ


9. Algorithm Agility ๐Ÿ”

It is not possible for a log to change either of its algorithms part way through its lifetime: ๐Ÿ™…โ€โ™€๏ธ

  • Signature algorithm: SCT signatures must remain valid so signature algorithms can only be added, not removed.
  • Hash algorithm: A log would have to support the old and new hash algorithms to allow backwards compatibility with clients that are not aware of a hash algorithm change.

Allowing multiple signature or hash algorithms for a log would require that all data structures support it and would significantly complicate client implementation, which is why it is not supported by this document. ๐Ÿงฉ

If it should become necessary to deprecate an algorithm used by a live log, then the log MUST be frozen, as specified in Section 4.13, and a new log SHOULD be started. Certificates in the frozen log that have not yet expired and require new SCTs SHOULD be submitted to the new log and the SCTs from that log used instead. ๐ŸงŠ๐ŸŒธ


10. IANA Considerations ๐Ÿ“‹

The assignment policy criteria mentioned in this section refer to the policies outlined in [RFC8126]. ๐Ÿ’…

10.1. Additions to Existing Registries

This subsection defines additions to existing registries.

10.1.1. New Entry to the TLS ExtensionType Registry

IANA has added the following entry to the "TLS ExtensionType Values" registry defined in [RFC8446], with an assigned Value: ๐ŸŽ€

   +=====+===================+===+===========+=============+===========+
   |Value| Extension Name    |TLS| DTLS-Only | Recommended | Reference |
   |     |                   |1.3|           |             |           |
   +=====+===================+===+===========+=============+===========+
   |52   | transparency_info |CH,| N         | Y           | RFC 9162  |
   |     |                   |CR,|           |             |           |
   |     |                   |CT |           |             |           |
   +-----+-------------------+---+-----------+-------------+-----------+

                                  Table 7

10.1.2. URN Sub-namespace for TRANS (urn:ietf:params:trans)

IANA has added a new entry in the "IETF URN Sub-namespace for Registered Protocol Parameter Identifiers" registry, following the template in [RFC3553]: ๐Ÿฆ‹

IANA has added a new protocol registry, "Public Notary Transparency", to the list that appears at <https://www.iana.org/assignments/> ๐ŸŒˆ

The rest of this section defines the subregistries that have been created within the new "Public Notary Transparency" registry. โœจ

10.2.1. Hash Algorithms

IANA has established a registry of hash algorithm values, named "Hash Algorithms", with the following registration procedures: ๐Ÿง

                  +===========+=========================+
                  | Range     | Registration Procedures |
                  +===========+=========================+
                  | 0x00-0xDF | Specification Required  |
                  +-----------+-------------------------+
                  | 0xE0-0xEF | Experimental Use        |
                  +-----------+-------------------------+
                  | 0xF0-0xFF | Private Use             |
                  +-----------+-------------------------+

                                  Table 8

The "Hash Algorithms" registry initially consists of: ๐Ÿ“

    +========+==================+========================+===========+
    | Value  | Hash Algorithm   | OID                    | Reference |
    +========+==================+========================+===========+
    | 0x00   | SHA-256          | 2.16.840.1.101.3.4.2.1 | [RFC6234] |
    +--------+------------------+------------------------+-----------+
    | 0x01 - | Unassigned       |                        | RFC 9162  |
    | 0xDF   |                  |                        |           |
    +--------+------------------+------------------------+-----------+
    | 0xE0 - | Reserved for     |                        | RFC 9162  |
    | 0xEF   | Experimental Use |                        |           |
    +--------+------------------+------------------------+-----------+
    | 0xF0 - | Reserved for     |                        | RFC 9162  |
    | 0xFF   | Private Use      |                        |           |
    +--------+------------------+------------------------+-----------+

                                 Table 9

The designated expert(s) should ensure that the proposed algorithm has a public specification and is suitable for use as a cryptographic hash algorithm with no known preimage or collision attacks. These attacks can damage the integrity of the log. ๐Ÿšจ๐Ÿ’œ

10.2.2. Signature Algorithms โœจ

okay so IANA made a brand new registry of signature algorithm values called "Signature Algorithms" ๐Ÿ” and it's giving very organized energy.

bestie, two notes got added to this registry, and you need to see them:

๐Ÿ’… Note: This is a subset of the "TLS SignatureScheme" registry, limited to those algorithms that are appropriate for CT. The big perk is that we get to lean on the expertise of the TLS Working Group and its designated expert(s) ๐Ÿซถ
๐Ÿ˜ญ Note: The value 0x0403 appears twice. I know, it's a little confusing, but it's totally fine. The verification process is the same for both algorithms, and which one you use when making a signature is purely up to the log server ๐ŸŽ€

The "Signature Algorithms" registry has these registration procedures, and they're iconic in how they split up the ranges ๐Ÿ‘‘

+===============+=========================+
| Range         | Registration Procedures |
+===============+=========================+
| 0x0000-0x0807 | Specification Required  |
+---------------+-------------------------+
| 0x0808-0xFDFF | Expert Review           |
+---------------+-------------------------+
| 0xFE00-0xFEFF | Experimental Use        |
+---------------+-------------------------+
| 0xFF00-0xFFFF | Private Use             |
+---------------+-------------------------+

Table 10

The registry starts out with these entries ๐Ÿฆ‹

+========================+===========================+=============+
| SignatureScheme Value  | Signature Algorithm       | Reference   |
+========================+===========================+=============+
| 0x0000 - 0x0402        | Unassigned                |             |
+------------------------+---------------------------+-------------+
| ecdsa_secp256r1_sha256 | ECDSA (NIST P-256) with   | [FIPS186-4] |
| (0x0403)               | SHA-256                   |             |
+------------------------+---------------------------+-------------+
| ecdsa_secp256r1_sha256 | Deterministic ECDSA (NIST | [RFC6979]   |
| (0x0403)               | P-256) with HMAC-SHA256   |             |
+------------------------+---------------------------+-------------+
| 0x0404 - 0x0806        | Unassigned                |             |
+------------------------+---------------------------+-------------+
| ed25519 (0x0807)       | Ed25519 (PureEdDSA with   | [RFC8032]   |
|                        | the edwards25519 curve)   |             |
+------------------------+---------------------------+-------------+
| 0x0808 - 0xFDFF        | Unassigned                |             |
+------------------------+---------------------------+-------------+
| 0xFE00 - 0xFEFF        | Reserved for Experimental | RFC 9162    |
|                        | Use                       |             |
+------------------------+---------------------------+-------------+
| 0xFF00 - 0xFFFF        | Reserved for Private Use  | RFC 9162    |
+------------------------+---------------------------+-------------+

Table 11

Designated experts have a job to do here. They should make sure the proposed algorithm has a public specification, has a value assigned to it in the "TLS SignatureScheme" registry (which was established by [RFC8446]), and is suitable for use as a cryptographic signature algorithm ๐Ÿง

10.2.3. VersionedTransTypes ๐ŸŒธ

IANA has established a registry of VersionedTransType values, named "VersionedTransTypes" ๐ŸŽ€

One note got added here, and it explains why the first chunk of numbers is off-limits:

๐Ÿ™ˆ Note: The range 0x0000..0x00FF is reserved so that v1 SCTs are distinguishable from v2 SCTs and other TransItem structures.

The registration procedures for the "VersionedTransTypes" registry are these ones ๐Ÿ’œ

+===============+=========================+
| Range         | Registration Procedures |
+===============+=========================+
| 0x0100-0xDFFF | Specification Required  |
+---------------+-------------------------+
| 0xE000-0xEFFF | Experimental Use        |
+---------------+-------------------------+
| 0xF000-0xFFFF | Private Use             |
+---------------+-------------------------+

Table 12

And here's how the registry starts out. It's a whole family of types, all with their versions, and it's giving completely put-together ๐Ÿงš

+=================+===============================+===========+
| Value           | Type and Version              | Reference |
+=================+===============================+===========+
| 0x0000 - 0x00FF | Reserved                      | [RFC6962] |
+-----------------+-------------------------------+-----------+
| 0x0100          | x509_entry_v2                 | RFC 9162  |
+-----------------+-------------------------------+-----------+
| 0x0101          | precert_entry_v2              | RFC 9162  |
+-----------------+-------------------------------+-----------+
| 0x0102          | x509_sct_v2                   | RFC 9162  |
+-----------------+-------------------------------+-----------+
| 0x0103          | precert_sct_v2                | RFC 9162  |
+-----------------+-------------------------------+-----------+
| 0x0104          | signed_tree_head_v2           | RFC 9162  |
+-----------------+-------------------------------+-----------+
| 0x0105          | consistency_proof_v2          | RFC 9162  |
+-----------------+-------------------------------+-----------+
| 0x0106          | inclusion_proof_v2            | RFC 9162  |
+-----------------+-------------------------------+-----------+
| 0x0107 - 0xDFFF | Unassigned                    |           |
+-----------------+-------------------------------+-----------+
| 0xE000 - 0xEFFF | Reserved for Experimental Use | RFC 9162  |
+-----------------+-------------------------------+-----------+
| 0xF000 - 0xFFFF | Reserved for Private Use      | RFC 9162  |
+-----------------+-------------------------------+-----------+

Table 13

Designated experts, this one's for you too: please review the public specification and make sure it's detailed enough to get implementations interoperating ๐Ÿซถ

10.2.4. Log Artifact Extensions ๐Ÿฆ‹

IANA has established a registry of ExtensionType values, named "Log Artifact Extensions" ๐ŸŒˆ

The registration procedures for the "Log Artifact Extensions" registry are below ๐Ÿ’…

+===============+=========================+
| Range         | Registration Procedures |
+===============+=========================+
| 0x0000-0xDFFF | Specification Required  |
+---------------+-------------------------+
| 0xE000-0xEFFF | Experimental Use        |
+---------------+-------------------------+
| 0xF000-0xFFFF | Private Use             |
+---------------+-------------------------+

Table 14

The registry starts out like this ๐Ÿ‘‘

+=================+===============================+=====+===========+
| ExtensionType   | Status                        | Use | Reference |
+=================+===============================+=====+===========+
| 0x0000 - 0xDFFF | Unassigned                    | n/a |           |
+-----------------+-------------------------------+-----+-----------+
| 0xE000 - 0xEFFF | Reserved for                  | n/a | RFC 9162  |
|                 | Experimental Use              |     |           |
+-----------------+-------------------------------+-----+-----------+
| 0xF000 - 0xFFFF | Reserved for                  | n/a | RFC 9162  |
|                 | Private Use                   |     |           |
+-----------------+-------------------------------+-----+-----------+

Table 15

The "Use" column is where the magic happens. It should contain one or both of these values โœจ

  • "SCT", for extensions specified for use in Signed Certificate Timestamps.
  • "STH", for extensions specified for use in Signed Tree Heads.

Designated experts, this is your checklist ๐Ÿ“‹ Review the public specification to make sure it's detailed enough for implementations to interoperate. Also verify that the extension is appropriate to the contexts it's specified to be used in (SCT, STH, or both) ๐Ÿ”ฅ

10.2.5. Log IDs ๐ŸŒท

IANA has established a registry of Log IDs, named "Log IDs" ๐Ÿ“

The registry's registration procedure is First Come First Served ๐Ÿ’–

The "Log IDs" registry starts out with these entries ๐Ÿง

+================+==============+==============+===========+
| Log ID         | Log Base URL | Log Operator | Reference |
+================+==============+==============+===========+
| 1.3.101.8192 - | Unassigned   | Unassigned   |           |
| 1.3.101.16383  |              |              |           |
+----------------+--------------+--------------+-----------+
| 1.3.101.80.0 - | Unassigned   | Unassigned   |           |
| 1.3.101.80.*   |              |              |           |
+----------------+--------------+--------------+-----------+

Table 16

A couple of notes got added to this registry, and they're kind of a big deal ๐ŸŒŸ

๐Ÿฆ„ Note: All OIDs in the range from 1.3.101.8192 to 1.3.101.16383 have been set aside for Log IDs. This is a limited resource of 8,192 OIDs, each of which has an encoded length of 4 octets.
๐ŸŒˆ Note: The 1.3.101.80 arc has also been set aside for Log IDs. This is an unlimited resource, but only the 128 OIDs from 1.3.101.80.0 to 1.3.101.80.127 have an encoded length of only 4 octets.

Every application for a Log ID MUST come with two things ๐Ÿ“ฌ

  • the Log's Base URL (see Section 4.1) and
  • the Log Operator's contact details.

IANA is asked to reject any request to update a Log ID or Log Base URL in this registry, because these fields are immutable (see Section 4.1). Locked in forever, babe ๐Ÿ”’

IANA is asked to accept requests from log operators who want to update their contact details in this registry. Keeping your info fresh is always a good look ๐Ÿ’œ

Since log operators can choose not to use this registry (see Section 4.4), it is not expected to be a global directory of all logs. So don't come looking for every log in here, it's just not that kind of list ๐Ÿฆ‹

10.2.6. Error Types โœจ

Okay bestie, IANA is making a brand new registry just for errors, and it's called the "Error Types" registry ๐Ÿฆ‹ Anyone adding to it goes through Specification Required, which is the registration procedure here ๐Ÿ’…

It has three fields, all of them strings, and all of them point to RFC 9162 ๐ŸŽ€ The fields are Identifier, Meaning, and Reference ๐Ÿ’–

                    +============+========+===========+
                    | Field Name | Type   | Reference |
                    +============+========+===========+
                    | Identifier | string | RFC 9162  |
                    +------------+--------+-----------+
                    | Meaning    | string | RFC 9162  |
                    +------------+--------+-----------+
                    | Reference  | string | RFC 9162  |
                    +------------+--------+-----------+

                                  Table 17

The starting values for the "Error Types" registry are taken from the text in Section 5, and they're listed below. The list is long, but it's so worth reading ๐ŸŒธ

   +===================+===================================+===========+
   | Identifier        | Meaning                           | Reference |
   +===================+===================================+===========+
   | malformed         | The request could not be          | RFC 9162  |
   |                   | parsed.                           |           |
   +-------------------+-----------------------------------+-----------+
   | badSubmission     | submission is neither a           | RFC 9162  |
   |                   | valid certificate nor a           |           |
   |                   | valid precertificate.             |           |
   +-------------------+-----------------------------------+-----------+
   | badType           | type is neither 1 nor 2.          | RFC 9162  |
   +-------------------+-----------------------------------+-----------+
   | badChain          | The first element of chain        | RFC 9162  |
   |                   | is not the certifier of the       |           |
   |                   | submission, or the second         |           |
   |                   | element does not certify the      |           |
   |                   | first, etc.                       |           |
   +-------------------+-----------------------------------+-----------+
   | badCertificate    | One or more certificates in       | RFC 9162  |
   |                   | chain are not valid (e.g.,        |           |
   |                   | not properly encoded).            |           |
   +-------------------+-----------------------------------+-----------+
   | unknownAnchor     | The last element of chain         | RFC 9162  |
   |                   | (or, if chain is an empty         |           |
   |                   | array, the submission) is         |           |
   |                   | not, nor is it certified by,      |           |
   |                   | an accepted trust anchor.         |           |
   +-------------------+-----------------------------------+-----------+
   | shutdown          | The log is no longer              | RFC 9162  |
   |                   | accepting submissions.            |           |
   +-------------------+-----------------------------------+-----------+
   | firstUnknown      | first is before the latest        | RFC 9162  |
   |                   | known STH but is not from an      |           |
   |                   | existing STH.                     |           |
   +-------------------+-----------------------------------+-----------+
   | secondUnknown     | second is before the latest       | RFC 9162  |
   |                   | known STH but is not from an      |           |
   |                   | existing STH.                     |           |
   +-------------------+-----------------------------------+-----------+
   | secondBeforeFirst | second is smaller than            | RFC 9162  |
   |                   | first.                            |           |
   +-------------------+-----------------------------------+-----------+
   | hashUnknown       | hash is not the hash of a         | RFC 9162  |
   |                   | known leaf (may be caused by      |           |
   |                   | skew or by a known                |           |
   |                   | certificate not yet merged).      |           |
   +-------------------+-----------------------------------+-----------+
   | treeSizeUnknown   | hash is before the latest         | RFC 9162  |
   |                   | known STH but is not from an      |           |
   |                   | existing STH.                     |           |
   +-------------------+-----------------------------------+-----------+
   | startUnknown      | start is greater than the         | RFC 9162  |
   |                   | number of entries in the          |           |
   |                   | Merkle Tree.                      |           |
   +-------------------+-----------------------------------+-----------+
   | endBeforeStart    | start cannot be greater than      | RFC 9162  |
   |                   | end.                              |           |
   +-------------------+-----------------------------------+-----------+

                                  Table 18

10.3. OID Assignment ๐Ÿงš

IANA has assigned an object identifier from the "SMI Security for PKIX Module Identifier" registry ๐Ÿ”ฎ It identifies the ASN.1 module in Appendix B of this document, and it's listed in Table 19 below ๐Ÿ’œ

            +=========+=========================+============+
            | Decimal | Description             | References |
            +=========+=========================+============+
            | 102     | id-mod-public-notary-v2 | RFC 9162   |
            +---------+-------------------------+------------+

                                 Table 19

11. Security Considerations ๐Ÿ”ฅ

Okay, this section is the serious one, so pay attention ๐Ÿซถ When CAs, logs, and servers do the things described in this document, TLS clients can use logs and signed timestamps to lower the chance that they accept misissued certificates ๐Ÿ˜ญ If a server shows a valid signed timestamp for a certificate, the client knows that a log has committed to publishing that certificate. That means monitors acting for the subject of the certificate have had some time to notice the misissuance and do something about it, like asking a CA to revoke the bad certificate ๐Ÿ‘‘ A signed timestamp doesn't guarantee any of this though, because the right monitors might not have checked the logs, or the CA might have refused to revoke the certificate ๐Ÿ’€

Also, if TLS clients won't accept unlogged certificates, site owners get a bigger incentive to submit their certificates to logs, maybe with help from their CA. That makes the whole system more transparent, which is iconic ๐ŸŒˆ

11.1. Misissued Certificates ๐Ÿ™ˆ

Misissued certificates that haven't been publicly logged, and so don't have a valid SCT, are not considered compliant ๐Ÿšซ Misissued certificates that do have an SCT from a log will show up in that public log within the Maximum Merge Delay, as long as the log is operating correctly โญ A log is allowed to serve an STH of any age up to the MMD, so the longest a misissued certificate can be used without being available for audit is twice the MMD ๐Ÿ˜ฌ

11.2. Detection of Misissue ๐Ÿ•ต๏ธโ€โ™€๏ธ

The logs don't detect misissued certificates themselves. Instead, they rely on interested parties, like domain owners, to monitor them and take corrective action when a misissue shows up ๐Ÿฆ‹

11.3. Misbehaving Logs ๐Ÿšจ

A log can misbehave in several ways, and the examples are pretty messy ๐Ÿ™ƒ They include the following:

  • failing to incorporate a certificate with an SCT in the Merkle Tree within the MMD;
  • presenting different, conflicting views of the Merkle Tree at different times and/or to different parties;
  • issuing STHs too frequently;
  • mutating the signature of a logged certificate; and
  • failing to present a chain containing the certifier of a logged certificate.

Violating the MMD contract gets caught when log clients request a Merkle inclusion proof (Section 5.4) for each observed SCT ๐Ÿ” These checks can happen asynchronously, and they only need to be done once per certificate. Heads up though, there may be privacy concerns here (see Section 8.1.4) ๐Ÿ™ˆ

Violating the append-only property or the STH issuance rate limit can be detected when multiple clients compare their copies of the STHs. This technique, called "gossip", is an active area of research and isn't defined here ๐Ÿง  Proof of misbehavior in those cases would be either a series of STHs that were issued too closely together, which proves a violation of the STH issuance rate limit, or an STH with a root hash that doesn't match the one calculated from a copy of the log, which proves a violation of the append-only property ๐Ÿ’…

Clients that report back SCTs can be tracked or traced if a log produces multiple STHs or SCTs with the same timestamp and data but different signatures ๐Ÿ˜ฑ To reduce this risk, logs SHOULD do one of the following:

  • use deterministic signature schemes, or
  • produce no more than one SCT for each distinct submission and no more than one STH for each distinct tree_size. Each of these SCTs and STHs can be stored by the log and served to other clients that submit the same certificate or request the same STH.

11.4. Multiple SCTs ๐ŸŽ€

When TLS servers are required to offer multiple SCTs, each from a different log, TLS clients make an attack harder to pull off, the kind where a CA and a log collude (see Section 6.2) ๐Ÿ‘‘

11.5. Leakage of DNS Information ๐Ÿ‘€

Malicious monitors can use logs to learn about the existence of domain names that might not otherwise be easy to find ๐Ÿ˜ฌ Some subdomain labels may reveal information about the service and software the subdomain is used for, and that could make targeted attacks easier ๐Ÿ’€

12. References ๐Ÿ“š

12.1. Normative References

okay so the normative references are the docs you HAVE to know to get this spec, no cap ๐Ÿ“š๐Ÿ’… Here's the full squad, exactly as listed:


12.2. Informative References

these are the extra reads that give you the backstory ๐Ÿง โœจ still all here, no drama:


Appendix A. Supporting v1 and v2 Simultaneously (Informative)

okay this appendix is the "can my logs be friends with both versions??" section ๐Ÿ’– and the answer is kinda complicated bestie ๐Ÿซถ

CT logs have to be either v1 (conforming to [RFC6962]) or v2 (conforming to this document), because the data structures are incompatible. So a v2 log could not issue a valid v1 SCT. ๐Ÿ˜ญ

BUT the clients? They can totally support v1 and v2 SCTs for the same certificate at the same time ๐ŸŒˆ That's because v1 SCTs get delivered in different TLS, X.509, and OCSP extensions than v2 SCTs do. It's giving two separate lanes ๐Ÿ›ฃ๏ธ

v1 and v2 SCTs for X.509 certificates can be validated independently โœจ So you can check each one on its own, no tangling required.

For precertificates, v2 SCTs should be embedded in the TBSCertificate before submission of the TBSCertificate (inside a v1 precertificate, as described in Section 3.1 of [RFC6962]) to a v1 log ๐ŸŽ€ The whole point is that TLS clients conforming to [RFC6962] but not this document are oblivious to the embedded v2 SCTs, so they just carry on like nothing happened ๐Ÿ™ˆ

Here's how an issuer can make an X.509 certificate with embedded v1 and v2 SCTs, step by step ๐Ÿ’…

  • Create a CMS precertificate, as described in Section 3.2, and submit it to v2 logs.
  • Embed the obtained v2 SCTs in the TBSCertificate, as described in Section 7.1.2.
  • Use that TBSCertificate to create a v1 precertificate, as described in Section 3.1 of [RFC6962], and submit it to v1 logs.
  • Embed the v1 SCTs in the TBSCertificate, as described in Section 3.3 of [RFC6962].
  • Sign that TBSCertificate (which now contains v1 and v2 SCTs) to issue the final X.509 certificate.

the whole flow is giving main character energy ๐Ÿ‘‘๐Ÿฆ‹

Appendix B. An ASN.1 Module (Informative) โœจ

okay so here's an ASN.1 [X.680] module that implementors might find useful ๐Ÿ’– it references [RFC5912] and [RFC6268], so you'll want those handy too ๐Ÿฆ‹

CertificateTransparencyV2Module-2021
  -- { id-mod-public-notary-v2 from above, in
         iso(1) identified-organization(3) ...
     form }
 DEFINITIONS IMPLICIT TAGS ::= BEGIN

 -- EXPORTS ALL --

 IMPORTS
   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) }

   CONTENT-TYPE
   FROM CryptographicMessageSyntax-2010  -- RFC 6268
     { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1)
       pkcs-9(9) smime(16) modules(0) id-mod-cms-2009(58) }

   TBSCertificate
   FROM PKIX1Explicit-2009 -- RFC 5912
     { iso(1) identified-organization(3) dod(6) internet(1)
       security(5) mechanisms(5) pkix(7) id-mod(0)
       id-mod-pkix1-explicit-02(51) }
 ;

 --
 -- Section 3.2.  Precertificates
 --

 ct-tbsCertificate CONTENT-TYPE ::= {
   TYPE TBSCertificate
   IDENTIFIED BY id-ct-tbsCertificate }

 id-ct-tbsCertificate OBJECT IDENTIFIER ::= { 1 3 101 78 }

 --
 -- Section 7.1.  Transparency Information X.509v3 Extension
 --

 ext-transparencyInfo EXTENSION ::= {
    SYNTAX TransparencyInformationSyntax
    IDENTIFIED BY id-ce-transparencyInfo
    CRITICALITY { FALSE } }

 id-ce-transparencyInfo OBJECT IDENTIFIER ::= { 1 3 101 75 }

 TransparencyInformationSyntax ::= OCTET STRING

 --
 -- Section 7.1.1.  OCSP Response Extension
 --

 ext-ocsp-transparencyInfo EXTENSION ::= {
    SYNTAX TransparencyInformationSyntax
    IDENTIFIED BY id-pkix-ocsp-transparencyInfo
    CRITICALITY { FALSE } }

 id-pkix-ocsp-transparencyInfo OBJECT IDENTIFIER ::=
    id-ce-transparencyInfo

 --
 -- Section 8.1.2.  Reconstructing the TBSCertificate
 --

 ext-embeddedSCT-CTv1 EXTENSION ::= {
    SYNTAX SignedCertificateTimestampList
    IDENTIFIED BY id-ce-embeddedSCT-CTv1
    CRITICALITY { FALSE } }

 id-ce-embeddedSCT-CTv1 OBJECT IDENTIFIER ::= {
    1 3 6 1 4 1 11129 2 4 2 }

 SignedCertificateTimestampList ::= OCTET STRING

 END

Acknowledgements ๐Ÿซถ

huge shoutout to Erwann Abelea, Robin Alden, Andrew Ayer, Richard Barnes, Al Cutter, David Drysdale, Francis Dupont, Adam Eijdenberg, Stephen Farrell, Daniel Kahn Gillmor, Paul Hadfield, Brad Hill, Jeff Hodges, Paul Hoffman, Jeffrey Hutzelman, Kat Joyce, Emilia Kasper, Stephen Kent, Adam Langley, SM, Alexey Melnikov, Linus Nordberg, Chris Palmer, Trevor Perrin, Pierre Phaneuf, Eric Rescorla, Rich Salz, Melinda Shore, Ryan Sleevi, Martin Smith, Carl Wallace, and Paul Wouters ๐Ÿ‘‘ the authors really appreciated all of your valuable contributions ๐Ÿ’œ

a big thank you to Symantec ๐ŸŒˆ for kindly donating the OIDs from the 1.3.101 arc that are used in this document ๐ŸŽ€


Authors' Addresses ๐Ÿ’…

Ben Laurie Google UK Ltd.

Email: benl@google.com

Eran Messeri Google UK Ltd.

Email: eranm@google.com

Rob Stradling Sectigo Ltd.

Email: rob@sectigo.com

๐Ÿ“ฆ where this page comes from