idnits 2.17.1 draft-ietf-trans-rfc6962-bis-41.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 7 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (30 July 2021) is 1001 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '0' on line 484 -- Looks like a reference, but probably isn't: '1' on line 484 -- Looks like a reference, but probably isn't: '7' on line 638 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7807 (Obsoleted by RFC 9457) -- Obsolete informational reference (is this intentional?): RFC 6962 (Obsoleted by RFC 9162) Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TRANS (Public Notary Transparency) B. Laurie 3 Internet-Draft A. Langley 4 Obsoletes: 6962 (if approved) E. Kasper 5 Intended status: Experimental E. Messeri 6 Expires: 31 January 2022 Google 7 R. Stradling 8 Sectigo 9 30 July 2021 11 Certificate Transparency Version 2.0 12 draft-ietf-trans-rfc6962-bis-41 14 Abstract 16 This document describes version 2.0 of the Certificate Transparency 17 (CT) protocol for publicly logging the existence of Transport Layer 18 Security (TLS) server certificates as they are issued or observed, in 19 a manner that allows anyone to audit certification authority (CA) 20 activity and notice the issuance of suspect certificates as well as 21 to audit the certificate logs themselves. The intent is that 22 eventually clients would refuse to honor certificates that do not 23 appear in a log, effectively forcing CAs to add all issued 24 certificates to the logs. 26 This document obsoletes RFC 6962. It also specifies a new TLS 27 extension that is used to send various CT log artifacts. 29 Logs are network services that implement the protocol operations for 30 submissions and queries that are defined in this document. 32 [RFC Editor: please update 'RFCXXXX' to refer to this document, once 33 its RFC number is known, through the document. Also, the OID 34 assigned below must also appear in the appendix as indicated. ] 36 Status of This Memo 38 This Internet-Draft is submitted in full conformance with the 39 provisions of BCP 78 and BCP 79. 41 Internet-Drafts are working documents of the Internet Engineering 42 Task Force (IETF). Note that other groups may also distribute 43 working documents as Internet-Drafts. The list of current Internet- 44 Drafts is at https://datatracker.ietf.org/drafts/current/. 46 Internet-Drafts are draft documents valid for a maximum of six months 47 and may be updated, replaced, or obsoleted by other documents at any 48 time. It is inappropriate to use Internet-Drafts as reference 49 material or to cite them other than as "work in progress." 51 This Internet-Draft will expire on 31 January 2022. 53 Copyright Notice 55 Copyright (c) 2021 IETF Trust and the persons identified as the 56 document authors. All rights reserved. 58 This document is subject to BCP 78 and the IETF Trust's Legal 59 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 60 license-info) in effect on the date of publication of this document. 61 Please review these documents carefully, as they describe your rights 62 and restrictions with respect to this document. Code Components 63 extracted from this document must include Simplified BSD License text 64 as described in Section 4.e of the Trust Legal Provisions and are 65 provided without warranty as described in the Simplified BSD License. 67 Table of Contents 69 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 70 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 5 71 1.2. Data Structures . . . . . . . . . . . . . . . . . . . . . 5 72 1.3. Major Differences from CT 1.0 . . . . . . . . . . . . . . 6 73 2. Cryptographic Components . . . . . . . . . . . . . . . . . . 7 74 2.1. Merkle Hash Trees . . . . . . . . . . . . . . . . . . . . 7 75 2.1.1. Definition of the Merkle Tree . . . . . . . . . . . . 7 76 2.1.2. Verifying a Tree Head Given Entries . . . . . . . . . 8 77 2.1.3. Merkle Inclusion Proofs . . . . . . . . . . . . . . . 9 78 2.1.4. Merkle Consistency Proofs . . . . . . . . . . . . . . 11 79 2.1.5. Example . . . . . . . . . . . . . . . . . . . . . . . 13 80 2.2. Signatures . . . . . . . . . . . . . . . . . . . . . . . 14 81 3. Submitters . . . . . . . . . . . . . . . . . . . . . . . . . 15 82 3.1. Certificates . . . . . . . . . . . . . . . . . . . . . . 15 83 3.2. Precertificates . . . . . . . . . . . . . . . . . . . . . 15 84 3.2.1. Binding Intent to Issue . . . . . . . . . . . . . . . 17 85 4. Log Format and Operation . . . . . . . . . . . . . . . . . . 17 86 4.1. Log Parameters . . . . . . . . . . . . . . . . . . . . . 18 87 4.2. Evaluating Submissions . . . . . . . . . . . . . . . . . 19 88 4.2.1. Minimum Acceptance Criteria . . . . . . . . . . . . . 19 89 4.2.2. Discretionary Acceptance Criteria . . . . . . . . . . 20 90 4.3. Log Entries . . . . . . . . . . . . . . . . . . . . . . . 20 91 4.4. Log ID . . . . . . . . . . . . . . . . . . . . . . . . . 21 92 4.5. TransItem Structure . . . . . . . . . . . . . . . . . . . 21 93 4.6. Log Artifact Extensions . . . . . . . . . . . . . . . . . 22 94 4.7. Merkle Tree Leaves . . . . . . . . . . . . . . . . . . . 23 95 4.8. Signed Certificate Timestamp (SCT) . . . . . . . . . . . 24 96 4.9. Merkle Tree Head . . . . . . . . . . . . . . . . . . . . 25 97 4.10. Signed Tree Head (STH) . . . . . . . . . . . . . . . . . 26 98 4.11. Merkle Consistency Proofs . . . . . . . . . . . . . . . . 26 99 4.12. Merkle Inclusion Proofs . . . . . . . . . . . . . . . . . 27 100 4.13. Shutting down a log . . . . . . . . . . . . . . . . . . . 28 101 5. Log Client Messages . . . . . . . . . . . . . . . . . . . . . 28 102 5.1. Submit Entry to Log . . . . . . . . . . . . . . . . . . . 30 103 5.2. Retrieve Latest STH . . . . . . . . . . . . . . . . . . . 32 104 5.3. Retrieve Merkle Consistency Proof between Two STHs . . . 32 105 5.4. Retrieve Merkle Inclusion Proof from Log by Leaf Hash . . 33 106 5.5. Retrieve Merkle Inclusion Proof, STH and Consistency Proof 107 by Leaf Hash . . . . . . . . . . . . . . . . . . . . . . 34 108 5.6. Retrieve Entries and STH from Log . . . . . . . . . . . . 35 109 5.7. Retrieve Accepted Trust Anchors . . . . . . . . . . . . . 37 110 6. TLS Servers . . . . . . . . . . . . . . . . . . . . . . . . . 38 111 6.1. TLS Client Authentication . . . . . . . . . . . . . . . . 38 112 6.2. Multiple SCTs . . . . . . . . . . . . . . . . . . . . . . 39 113 6.3. TransItemList Structure . . . . . . . . . . . . . . . . . 39 114 6.4. Presenting SCTs, inclusions proofs and STHs . . . . . . . 40 115 6.5. transparency_info TLS Extension . . . . . . . . . . . . . 40 116 7. Certification Authorities . . . . . . . . . . . . . . . . . . 41 117 7.1. Transparency Information X.509v3 Extension . . . . . . . 41 118 7.1.1. OCSP Response Extension . . . . . . . . . . . . . . . 41 119 7.1.2. Certificate Extension . . . . . . . . . . . . . . . . 41 120 7.2. TLS Feature X.509v3 Extension . . . . . . . . . . . . . . 41 121 8. Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 122 8.1. TLS Client . . . . . . . . . . . . . . . . . . . . . . . 42 123 8.1.1. Receiving SCTs and inclusion proofs . . . . . . . . . 42 124 8.1.2. Reconstructing the TBSCertificate . . . . . . . . . . 42 125 8.1.3. Validating SCTs . . . . . . . . . . . . . . . . . . . 42 126 8.1.4. Fetching inclusion proofs . . . . . . . . . . . . . . 43 127 8.1.5. Validating inclusion proofs . . . . . . . . . . . . . 43 128 8.1.6. Evaluating compliance . . . . . . . . . . . . . . . . 44 129 8.2. Monitor . . . . . . . . . . . . . . . . . . . . . . . . . 44 130 8.3. Auditing . . . . . . . . . . . . . . . . . . . . . . . . 45 131 9. Algorithm Agility . . . . . . . . . . . . . . . . . . . . . . 46 132 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 133 10.1. Additions to existing registries . . . . . . . . . . . . 47 134 10.1.1. New Entry to the TLS ExtensionType Registry . . . . 47 135 10.1.2. URN Sub-namespace for TRANS errors 136 (urn:ietf:params:trans:error) . . . . . . . . . . . . 47 137 10.2. New CT-Related registries . . . . . . . . . . . . . . . 47 138 10.2.1. Hash Algorithms . . . . . . . . . . . . . . . . . . 48 139 10.2.2. Signature Algorithms . . . . . . . . . . . . . . . . 48 140 10.2.3. VersionedTransTypes . . . . . . . . . . . . . . . . 49 141 10.2.4. Log Artifact Extension Registry . . . . . . . . . . 50 142 10.2.5. Log IDs Registry . . . . . . . . . . . . . . . . . . 51 143 10.2.6. Error Types Registry . . . . . . . . . . . . . . . . 52 144 10.3. OID Assignment . . . . . . . . . . . . . . . . . . . . . 54 145 11. Security Considerations . . . . . . . . . . . . . . . . . . . 54 146 11.1. Misissued Certificates . . . . . . . . . . . . . . . . . 55 147 11.2. Detection of Misissue . . . . . . . . . . . . . . . . . 55 148 11.3. Misbehaving Logs . . . . . . . . . . . . . . . . . . . . 55 149 11.4. Multiple SCTs . . . . . . . . . . . . . . . . . . . . . 56 150 11.5. Leakage of DNS Information . . . . . . . . . . . . . . . 56 151 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 56 152 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 56 153 13.1. Normative References . . . . . . . . . . . . . . . . . . 56 154 13.2. Informative References . . . . . . . . . . . . . . . . . 59 155 Appendix A. Supporting v1 and v2 simultaneously (Informative) . 60 156 Appendix B. An ASN.1 Module (Informative) . . . . . . . . . . . 60 157 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 62 159 1. Introduction 161 Certificate Transparency aims to mitigate the problem of misissued 162 certificates by providing append-only logs of issued certificates. 163 The logs do not themselves prevent misissuance, but they ensure that 164 interested parties (particularly those named in certificates) can 165 detect such misissuance. Note that this is a general mechanism that 166 could be used for transparently logging any form of binary data, 167 subject to some kind of inclusion criteria. In this document, we 168 only describe its use for public TLS server certificates (i.e., where 169 the inclusion criteria is a valid certificate issued by a public 170 certification authority (CA)). A typical definition of "public" can 171 be found in [CABBR]. 173 Each log contains certificate chains, which can be submitted by 174 anyone. It is expected that public CAs will contribute all their 175 newly issued certificates to one or more logs; however, certificate 176 holders can also contribute their own certificate chains, as can 177 third parties. In order to avoid logs being rendered useless by the 178 submission of large numbers of spurious certificates, it is required 179 that each chain ends with a trust anchor that is accepted by the log. 180 A log may also limit the length of the chain it is willing to accept; 181 such chains must also end with an acceptable trust anchor. When a 182 chain is accepted by a log, a signed timestamp is returned, which can 183 later be used to provide evidence to TLS clients that the chain has 184 been submitted. TLS clients can thus require that all certificates 185 they accept as valid are accompanied by signed timestamps. 187 Those who are concerned about misissuance can monitor the logs, 188 asking them regularly for all new entries, and can thus check whether 189 domains for which they are responsible have had certificates issued 190 that they did not expect. What they do with this information, 191 particularly when they find that a misissuance has happened, is 192 beyond the scope of this document. However, broadly speaking, they 193 can invoke existing business mechanisms for dealing with misissued 194 certificates, such as working with the CA to get the certificate 195 revoked, or with maintainers of trust anchor lists to get the CA 196 removed. Of course, anyone who wants can monitor the logs and, if 197 they believe a certificate is incorrectly issued, take action as they 198 see fit. 200 Similarly, those who have seen signed timestamps from a particular 201 log can later demand a proof of inclusion from that log. If the log 202 is unable to provide this (or, indeed, if the corresponding 203 certificate is absent from monitors' copies of that log), that is 204 evidence of the incorrect operation of the log. The checking 205 operation is asynchronous to allow clients to proceed without delay, 206 despite possible issues such as network connectivity and the vagaries 207 of firewalls. 209 The append-only property of each log is achieved using Merkle Trees, 210 which can be used to efficiently prove that any particular instance 211 of the log is a superset of any particular previous instance and to 212 efficiently detect various misbehaviors of the log (e.g., issuing a 213 signed timestamp for a certificate that is not subsequently logged). 215 It is necessary to treat each log as a trusted third party, because 216 the log auditing mechanisms described in this document can be 217 circumvented by a misbehaving log that shows different, inconsistent 218 views of itself to different clients. While mechanisms are being 219 developed to address these shortcomings and thereby avoid the need to 220 blindly trust logs, such mechanisms are outside the scope of this 221 document. 223 1.1. Requirements Language 225 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 226 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 227 "OPTIONAL" in this document are to be interpreted as described in BCP 228 14 [RFC2119] [RFC8174] when, and only when, they appear in all 229 capitals, as shown here. 231 1.2. Data Structures 233 Data structures are defined and encoded according to the conventions 234 laid out in Section 3 of [RFC8446]. 236 This document uses object identifiers (OIDs) to identify Log IDs (see 237 Section 4.4), the precertificate CMS "eContentType" (see 238 Section 3.2), and X.509v3 extensions in certificates (see 239 Section 7.1.2) and OCSP responses (see Section 7.1.1). The OIDs are 240 defined in an arc that was selected due to its short encoding. 242 1.3. Major Differences from CT 1.0 244 This document revises and obsoletes the CT 1.0 [RFC6962] protocol, 245 drawing on insights gained from CT 1.0 deployments and on feedback 246 from the community. The major changes are: 248 * Hash and signature algorithm agility: permitted algorithms are now 249 specified in IANA registries. 251 * Precertificate format: precertificates are now CMS objects rather 252 than X.509 certificates, which avoids violating the certificate 253 serial number uniqueness requirement in Section 4.1.2.2 of 254 [RFC5280]. 256 * Removed precertificate signing certificates and the precertificate 257 poison extension: the change of precertificate format means that 258 these are no longer needed. 260 * Logs IDs: each log is now identified by an OID rather than by the 261 hash of its public key. OID allocations are managed by an IANA 262 registry. 264 * "TransItem" structure: this new data structure is used to 265 encapsulate most types of CT data. A "TransItemList", consisting 266 of one or more "TransItem" structures, can be used anywhere that 267 "SignedCertificateTimestampList" was used in [RFC6962]. 269 * Merkle tree leaves: the "MerkleTreeLeaf" structure has been 270 replaced by the "TransItem" structure, which eases extensibility 271 and simplifies the leaf structure by removing one layer of 272 abstraction. 274 * Unified leaf format: the structure for both certificate and 275 precertificate entries now includes only the TBSCertificate 276 (whereas certificate entries in [RFC6962] included the entire 277 certificate). 279 * Log Artifact Extensions: these are now typed and managed by an 280 IANA registry, and they can now appear not only in SCTs but also 281 in STHs. 283 * API outputs: complete "TransItem" structures are returned, rather 284 than the constituent parts of each structure. 286 * get-all-by-hash: new client API for obtaining an inclusion proof 287 and the corresponding consistency proof at the same time. 289 * submit-entry: new client API, replacing add-chain and add-pre- 290 chain. 292 * Presenting SCTs with proofs: TLS servers may present SCTs together 293 with the corresponding inclusion proofs using any of the 294 mechanisms that [RFC6962] defined for presenting SCTs only. 295 (Presenting SCTs only is still supported). 297 * CT TLS extension: the "signed_certificate_timestamp" TLS extension 298 has been replaced by the "transparency_info" TLS extension. 300 * Verification algorithms: added detailed algorithms for verifying 301 inclusion proofs, for verifying consistency between two STHs, and 302 for verifying a root hash given a complete list of the relevant 303 leaf input entries. 305 * Extensive clarifications and editorial work. 307 2. Cryptographic Components 309 2.1. Merkle Hash Trees 311 A full description of Merkle Hash Tree is beyond the scope of this 312 document. Briefly, it is a binary tree where each non-leaf node is a 313 hash of its children. For CT, the number of children is at most two. 314 Additional information can be found in the Introduction and Reference 315 section of [RFC8391]. 317 2.1.1. Definition of the Merkle Tree 319 The log uses a binary Merkle Hash Tree for efficient auditing. The 320 hash algorithm used is one of the log's parameters (see Section 4.1). 321 This document establishes a registry of acceptable hash algorithms 322 (see Section 10.2.1). Throughout this document, the hash algorithm 323 in use is referred to as HASH and the size of its output in bytes as 324 HASH_SIZE. The input to the Merkle Tree Hash is a list of data 325 entries; these entries will be hashed to form the leaves of the 326 Merkle Hash Tree. The output is a single HASH_SIZE Merkle Tree Hash. 327 Given an ordered list of n inputs, D_n = {d[0], d[1], ..., d[n-1]}, 328 the Merkle Tree Hash (MTH) is thus defined as follows: 330 The hash of an empty list is the hash of an empty string: 332 MTH({}) = HASH(). 334 The hash of a list with one entry (also known as a leaf hash) is: 336 MTH({d[0]}) = HASH(0x00 || d[0]). 338 For n > 1, let k be the largest power of two smaller than n (i.e., k 339 < n <= 2k). The Merkle Tree Hash of an n-element list D_n is then 340 defined recursively as 342 MTH(D_n) = HASH(0x01 || MTH(D[0:k]) || MTH(D[k:n])), 344 where: 346 * || denotes concatenation 348 * : denotes concatenation of lists 350 * D[k1:k2] = D'_(k2-k1) denotes the list {d'[0] = d[k1], d'[1] = 351 d[k1+1], ..., d'[k2-k1-1] = d[k2-1]} of length (k2 - k1). 353 Note that the hash calculations for leaves and nodes differ; this 354 domain separation is required to give second preimage resistance. 356 Note that we do not require the length of the input list to be a 357 power of two. The resulting Merkle Tree may thus not be balanced; 358 however, its shape is uniquely determined by the number of leaves. 359 (Note: This Merkle Tree is essentially the same as the history tree 360 [CrosbyWallach] proposal, except our definition handles non-full 361 trees differently). 363 2.1.2. Verifying a Tree Head Given Entries 365 When a client has a complete list of "entries" from "0" up to 366 "tree_size - 1" and wishes to verify this list against a tree head 367 "root_hash" returned by the log for the same "tree_size", the 368 following algorithm may be used: 370 1. Set "stack" to an empty stack. 372 2. For each "i" from "0" up to "tree_size - 1": 374 1. Push "HASH(0x00 || entries[i])" to "stack". 376 2. Set "merge_count" to the lowest value ("0" included) such 377 that "LSB(i >> merge_count)" is not set, where "LSB" means 378 the least significant bit. In other words, set "merge_count" 379 to the number of consecutive "1"s found starting at the least 380 significant bit of "i". 382 3. Repeat "merge_count" times: 384 1. Pop "right" from "stack". 386 2. Pop "left" from "stack". 388 3. Push "HASH(0x01 || left || right)" to "stack". 390 3. If there is more than one element in the "stack", repeat the same 391 merge procedure (the sub-items of Step 2.3 above) until only a 392 single element remains. 394 4. The remaining element in "stack" is the Merkle Tree hash for the 395 given "tree_size" and should be compared by equality against the 396 supplied "root_hash". 398 2.1.3. Merkle Inclusion Proofs 400 A Merkle inclusion proof for a leaf in a Merkle Hash Tree is the 401 shortest list of additional nodes in the Merkle Tree required to 402 compute the Merkle Tree Hash for that tree. Each node in the tree is 403 either a leaf node or is computed from the two nodes immediately 404 below it (i.e., towards the leaves). At each step up the tree 405 (towards the root), a node from the inclusion proof is combined with 406 the node computed so far. In other words, the inclusion proof 407 consists of the list of missing nodes required to compute the nodes 408 leading from a leaf to the root of the tree. If the root computed 409 from the inclusion proof matches the true root, then the inclusion 410 proof proves that the leaf exists in the tree. 412 2.1.3.1. Generating an Inclusion Proof 414 Given an ordered list of n inputs to the tree, D_n = {d[0], d[1], 415 ..., d[n-1]}, the Merkle inclusion proof PATH(m, D_n) for the (m+1)th 416 input d[m], 0 <= m < n, is defined as follows: 418 The proof for the single leaf in a tree with a one-element input list 419 D[1] = {d[0]} is empty: 421 PATH(0, {d[0]}) = {} 422 For n > 1, let k be the largest power of two smaller than n. The 423 proof for the (m+1)th element d[m] in a list of n > m elements is 424 then defined recursively as 426 PATH(m, D_n) = PATH(m, D[0:k]) : MTH(D[k:n]) for m < k; and 428 PATH(m, D_n) = PATH(m - k, D[k:n]) : MTH(D[0:k]) for m >= k, 430 The : operator and D[k1:k2] are defined the same as in Section 2.1.1. 432 2.1.3.2. Verifying an Inclusion Proof 434 When a client has received an inclusion proof (e.g., in a "TransItem" 435 of type "inclusion_proof_v2") and wishes to verify inclusion of an 436 input "hash" for a given "tree_size" and "root_hash", the following 437 algorithm may be used to prove the "hash" was included in the 438 "root_hash": 440 1. Compare "leaf_index" from the "inclusion_proof_v2" structure 441 against "tree_size". If "leaf_index" is greater than or equal to 442 "tree_size" then fail the proof verification. 444 2. Set "fn" to "leaf_index" and "sn" to "tree_size - 1". 446 3. Set "r" to "hash". 448 4. For each value "p" in the "inclusion_path" array: 450 If "sn" is 0, stop the iteration and fail the proof verification. 452 If "LSB(fn)" is set, or if "fn" is equal to "sn", then: 454 1. Set "r" to "HASH(0x01 || p || r)" 456 2. If "LSB(fn)" is not set, then right-shift both "fn" and "sn" 457 equally until either "LSB(fn)" is set or "fn" is "0". 459 Otherwise: 461 1. Set "r" to "HASH(0x01 || r || p)" 463 Finally, right-shift both "fn" and "sn" one time. 465 5. Compare "sn" to 0. Compare "r" against the "root_hash". If "sn" 466 is equal to 0, and "r" and the "root_hash" are equal, then the 467 log has proven the inclusion of "hash". Otherwise, fail the 468 proof verification. 470 2.1.4. Merkle Consistency Proofs 472 Merkle consistency proofs prove the append-only property of the tree. 473 A Merkle consistency proof for a Merkle Tree Hash MTH(D_n) and a 474 previously advertised hash MTH(D[0:m]) of the first m leaves, m <= n, 475 is the list of nodes in the Merkle Tree required to verify that the 476 first m inputs D[0:m] are equal in both trees. Thus, a consistency 477 proof must contain a set of intermediate nodes (i.e., commitments to 478 inputs) sufficient to verify MTH(D_n), such that (a subset of) the 479 same nodes can be used to verify MTH(D[0:m]). We define an algorithm 480 that outputs the (unique) minimal consistency proof. 482 2.1.4.1. Generating a Consistency Proof 484 Given an ordered list of n inputs to the tree, D_n = {d[0], d[1], 485 ..., d[n-1]}, the Merkle consistency proof PROOF(m, D_n) for a 486 previous Merkle Tree Hash MTH(D[0:m]), 0 < m < n, is defined as: 488 PROOF(m, D_n) = SUBPROOF(m, D_n, true) 490 In SUBPROOF, the boolean value represents whether the subtree created 491 from D[0:m] is a complete subtree of the Merkle Tree created from 492 D_n, and, consequently, whether the subtree Merkle Tree Hash 493 MTH(D[0:m]) is known. The initial call to SUBPROOF sets this to be 494 true, and SUBPROOF is then defined as follows: 496 The subproof for m = n is empty if m is the value for which PROOF was 497 originally requested (meaning that the subtree created from D[0:m] is 498 a complete subtree of the Merkle Tree created from the original D_n 499 for which PROOF was requested, and the subtree Merkle Tree Hash 500 MTH(D[0:m]) is known): 502 SUBPROOF(m, D_m, true) = {} 504 Otherwise, the subproof for m = n is the Merkle Tree Hash committing 505 inputs D[0:m]: 507 SUBPROOF(m, D_m, false) = {MTH(D_m)} 509 For m < n, let k be the largest power of two smaller than n. The 510 subproof is then defined recursively, using the appropriate step 511 below: 513 If m <= k, the right subtree entries D[k:n] only exist in the current 514 tree. We prove that the left subtree entries D[0:k] are consistent 515 and add a commitment to D[k:n]: 517 SUBPROOF(m, D_n, b) = SUBPROOF(m, D[0:k], b) : MTH(D[k:n]) 518 If m > k, the left subtree entries D[0:k] are identical in both 519 trees. We prove that the right subtree entries D[k:n] are consistent 520 and add a commitment to D[0:k]. 522 SUBPROOF(m, D_n, b) = SUBPROOF(m - k, D[k:n], false) : MTH(D[0:k]) 524 The number of nodes in the resulting proof is bounded above by 525 ceil(log2(n)) + 1. 527 The : operator and D[k1:k2] are defined the same as in Section 2.1.1. 529 2.1.4.2. Verifying Consistency between Two Tree Heads 531 When a client has a tree head "first_hash" for tree size "first", a 532 tree head "second_hash" for tree size "second" where "0 < first < 533 second", and has received a consistency proof between the two (e.g., 534 in a "TransItem" of type "consistency_proof_v2"), the following 535 algorithm may be used to verify the consistency proof: 537 1. If "consistency_path" is an empty array, stop and fail the proof 538 verification. 540 2. If "first" is an exact power of 2, then prepend "first_hash" to 541 the "consistency_path" array. 543 3. Set "fn" to "first - 1" and "sn" to "second - 1". 545 4. If "LSB(fn)" is set, then right-shift both "fn" and "sn" equally 546 until "LSB(fn)" is not set. 548 5. Set both "fr" and "sr" to the first value in the 549 "consistency_path" array. 551 6. For each subsequent value "c" in the "consistency_path" array: 553 If "sn" is 0, stop the iteration and fail the proof verification. 555 If "LSB(fn)" is set, or if "fn" is equal to "sn", then: 557 1. Set "fr" to "HASH(0x01 || c || fr)" 559 Set "sr" to "HASH(0x01 || c || sr)" 561 2. If "LSB(fn)" is not set, then right-shift both "fn" and "sn" 562 equally until either "LSB(fn)" is set or "fn" is "0". 564 Otherwise: 566 1. Set "sr" to "HASH(0x01 || sr || c)" 568 Finally, right-shift both "fn" and "sn" one time. 570 7. After completing iterating through the "consistency_path" array 571 as described above, verify that the "fr" calculated is equal to 572 the "first_hash" supplied, that the "sr" calculated is equal to 573 the "second_hash" supplied and that "sn" is 0. 575 2.1.5. Example 577 The binary Merkle Tree with 7 leaves: 579 hash 580 / \ 581 / \ 582 / \ 583 / \ 584 / \ 585 k l 586 / \ / \ 587 / \ / \ 588 / \ / \ 589 g h i j 590 / \ / \ / \ | 591 a b c d e f d6 592 | | | | | | 593 d0 d1 d2 d3 d4 d5 595 The inclusion proof for d0 is [b, h, l]. 597 The inclusion proof for d3 is [c, g, l]. 599 The inclusion proof for d4 is [f, j, k]. 601 The inclusion proof for d6 is [i, k]. 603 The same tree, built incrementally in four steps: 605 hash0 hash1=k 606 / \ / \ 607 / \ / \ 608 / \ / \ 609 g c g h 610 / \ | / \ / \ 611 a b d2 a b c d 612 | | | | | | 613 d0 d1 d0 d1 d2 d3 615 hash2 hash 616 / \ / \ 617 / \ / \ 618 / \ / \ 619 / \ / \ 620 / \ / \ 621 k i k l 622 / \ / \ / \ / \ 623 / \ e f / \ / \ 624 / \ | | / \ / \ 625 g h d4 d5 g h i j 626 / \ / \ / \ / \ / \ | 627 a b c d a b c d e f d6 628 | | | | | | | | | | 629 d0 d1 d2 d3 d0 d1 d2 d3 d4 d5 631 The consistency proof between hash0 and hash is PROOF(3, D[7]) = [c, 632 d, g, l]. c, g are used to verify hash0, and d, l are additionally 633 used to show hash is consistent with hash0. 635 The consistency proof between hash1 and hash is PROOF(4, D[7]) = [l]. 636 hash can be verified using hash1=k and l. 638 The consistency proof between hash2 and hash is PROOF(6, D[7]) = [i, 639 j, k]. k, i are used to verify hash2, and j is additionally used to 640 show hash is consistent with hash2. 642 2.2. Signatures 644 When signing data structures, a log MUST use one of the signature 645 algorithms from the IANA CT Signature Algorithms registry, described 646 in Section 10.2.2. 648 3. Submitters 650 Submitters submit certificates or preannouncements of certificates 651 prior to issuance (precertificates) to logs for public auditing, as 652 described below. In order to enable attribution of each logged 653 certificate or precertificate to its issuer, each submission MUST be 654 accompanied by all additional certificates required to verify the 655 chain up to an accepted trust anchor (Section 5.7). The trust anchor 656 (a root or intermediate CA certificate) MAY be omitted from the 657 submission. 659 If a log accepts a submission, it will return a Signed Certificate 660 Timestamp (SCT) (see Section 4.8). The submitter SHOULD validate the 661 returned SCT as described in Section 8.1 if they understand its 662 format and they intend to use it directly in a TLS handshake or to 663 construct a certificate. If the submitter does not need the SCT (for 664 example, the certificate is being submitted simply to make it 665 available in the log), it MAY validate the SCT. 667 3.1. Certificates 669 Any entity can submit a certificate (Section 5.1) to a log. Since it 670 is anticipated that TLS clients will reject certificates that are not 671 logged, it is expected that certificate issuers and subjects will be 672 strongly motivated to submit them. 674 3.2. Precertificates 676 CAs may preannounce a certificate prior to issuance by submitting a 677 precertificate (Section 5.1) that the log can use to create an entry 678 that will be valid against the issued certificate. The CA MAY 679 incorporate the returned SCT in the issued certificate. One example 680 of where the returned SCT is not incorporated in the issued 681 certificate is when a CA sends the precertificate to multiple logs, 682 but only incorporates the SCTs that are returned first. 684 A precertificate is a CMS [RFC5652] "signed-data" object that 685 conforms to the following profile: 687 * It MUST be DER encoded as described in [X690]. 689 * "SignedData.version" MUST be v3(3). 691 * "SignedData.digestAlgorithms" MUST be the same as the 692 "SignerInfo.digestAlgorithm" OID value (see below). 694 * "SignedData.encapContentInfo": 696 - "eContentType" MUST be the OID 1.3.101.78. 698 - "eContent" MUST contain a TBSCertificate [RFC5280] that will be 699 identical to the TBSCertificate in the issued certificate, 700 except that the Transparency Information (Section 7.1) 701 extension MUST be omitted. 703 * "SignedData.certificates" MUST be omitted. 705 * "SignedData.crls" MUST be omitted. 707 * "SignedData.signerInfos" MUST contain one "SignerInfo": 709 - "version" MUST be v3(3). 711 - "sid" MUST use the "subjectKeyIdentifier" option. 713 - "digestAlgorithm" MUST be one of the hash algorithm OIDs listed 714 in the IANA CT Hash Algorithms Registry, described in 715 Section 10.2.1. 717 - "signedAttrs" MUST be present and MUST contain two attributes: 719 o A content-type attribute whose value is the same as 720 "SignedData.encapContentInfo.eContentType". 722 o A message-digest attribute whose value is the message digest 723 of "SignedData.encapContentInfo.eContent". 725 - "signatureAlgorithm" MUST be the same OID as 726 "TBSCertificate.signature". 728 - "signature" MUST be from the same (root or intermediate) CA 729 that intends to issue the corresponding certificate (see 730 Section 3.2.1). 732 - "unsignedAttrs" MUST be omitted. 734 "SignerInfo.signedAttrs" is included in the message digest 735 calculation process (see Section 5.4 of [RFC5652]), which ensures 736 that the "SignerInfo.signature" value will not be a valid X.509v3 737 signature that could be used in conjunction with the TBSCertificate 738 (from "SignedData.encapContentInfo.eContent") to construct a valid 739 certificate. 741 3.2.1. Binding Intent to Issue 743 Under normal circumstances, there will be a short delay between 744 precertificate submission and issuance of the corresponding 745 certificate. Longer delays are to be expected occasionally (e.g., 746 due to log server downtime), and in some cases the CA might not 747 actually issue the corresponding certificate. Nevertheless, a 748 precertificate's "signature" indicates the CA's binding intent to 749 issue the corresponding certificate, which means that: 751 * Misissuance of a precertificate is considered equivalent to 752 misissuance of the corresponding certificate. The CA should 753 expect to be held to account, even if the corresponding 754 certificate has not actually been issued. 756 * Upon observing a precertificate, a client can reasonably presume 757 that the corresponding certificate has been issued. A client may 758 wish to obtain status information (e.g., by using the Online 759 Certificate Status Protocol [RFC6960] or by checking a Certificate 760 Revocation List [RFC5280]) about a certificate that is presumed to 761 exist, especially if there is evidence or suspicion that the 762 corresponding precertificate was misissued. 764 * TLS clients may have policies that require CAs to be able to 765 revoke, and to provide certificate status services for, each 766 certificate that is presumed to exist based on the existence of a 767 corresponding precertificate. 769 4. Log Format and Operation 771 A log is a single, append-only Merkle Tree of submitted certificate 772 and precertificate entries. 774 When it receives and accepts a valid submission, the log MUST return 775 an SCT that corresponds to the submitted certificate or 776 precertificate. If the log has previously seen this valid 777 submission, it SHOULD return the same SCT as it returned before, as 778 discussed in Section 11.3. If different SCTs are produced for the 779 same submission, multiple log entries will have to be created, one 780 for each SCT (as the timestamp is a part of the leaf structure). 781 Note that if a certificate was previously logged as a precertificate, 782 then the precertificate's SCT of type "precert_sct_v2" would not be 783 appropriate; instead, a fresh SCT of type "x509_sct_v2" should be 784 generated. 786 An SCT is the log's promise to append to its Merkle Tree an entry for 787 the accepted submission. Upon producing an SCT, the log MUST fulfil 788 this promise by performing the following actions within a fixed 789 amount of time known as the Maximum Merge Delay (MMD), which is one 790 of the log's parameters (see Section 4.1): 792 * Allocate a tree index to the entry representing the accepted 793 submission. 795 * Calculate the root of the tree. 797 * Sign the root of the tree (see Section 4.10). 799 The log may append multiple entries before signing the root of the 800 tree. 802 Log operators SHOULD NOT impose any conditions on retrieving or 803 sharing data from the log. 805 4.1. Log Parameters 807 A log is defined by a collection of immutable parameters, which are 808 used by clients to communicate with the log and to verify log 809 artifacts. Except for the Final Signed Tree Head (STH), each of 810 these parameters MUST be established before the log operator begins 811 to operate the log. 813 Base URL: The prefix used to construct URLs ([RFC3986]) for client 814 messages (see Section 5). The base URL MUST be an "https" URL, 815 MAY contain a port, MAY contain a path with any number of path 816 segments, but MUST NOT contain a query string, fragment, or 817 trailing "/". Example: https://ct.example.org/blue 819 Hash Algorithm: The hash algorithm used for the Merkle Tree (see 820 Section 10.2.1). 822 Signature Algorithm: The signature algorithm used (see Section 2.2). 824 Public Key: The public key used to verify signatures generated by 825 the log. A log MUST NOT use the same keypair as any other log. 827 Log ID: The OID that uniquely identifies the log. 829 Maximum Merge Delay: The MMD the log has committed to. This 830 document deliberately does not specify any limits on the value, to 831 allow for experimentation. 833 Version: The version of the protocol supported by the log (currently 834 1 or 2). 836 Maximum Chain Length: The longest certificate chain submission the 837 log is willing to accept, if the log imposes any limit. 839 STH Frequency Count: The maximum number of STHs the log may produce 840 in any period equal to the "Maximum Merge Delay" (see 841 Section 4.10). 843 Final STH: If a log has been closed down (i.e., no longer accepts 844 new entries), existing entries may still be valid. In this case, 845 the client should know the final valid STH in the log to ensure no 846 new entries can be added without detection. This value MUST be 847 provided in the form of a TransItem of type "signed_tree_head_v2". 848 If a log is still accepting entries, this value should not be 849 provided. 851 [JSON.Metadata] is an example of a metadata format which includes the 852 above elements. 854 4.2. Evaluating Submissions 856 A log determines whether to accept or reject a submission by 857 evaluating it against the minimum acceptance criteria (see 858 Section 4.2.1) and against the log's discretionary acceptance 859 criteria (see Section 4.2.2). 861 If the acceptance criteria are met, the log SHOULD accept the 862 submission. (A log may decide, for example, to temporarily reject 863 acceptable submissions to protect itself against denial-of-service 864 attacks). 866 The log SHALL allow retrieval of its list of accepted trust anchors 867 (see Section 5.7), each of which is a root or intermediate CA 868 certificate. This list might usefully be the union of root 869 certificates trusted by major browser vendors. 871 4.2.1. Minimum Acceptance Criteria 873 To ensure that logged certificates and precertificates are 874 attributable to an accepted trust anchor, to set clear expectations 875 for what monitors would find in the log, and to avoid being 876 overloaded by invalid submissions, the log MUST reject a submission 877 if any of the following conditions are not met: 879 * The "submission", "type" and "chain" inputs MUST be set as 880 described in Section 5.1. The log MUST NOT accommodate misordered 881 CA certificates or use any other source of intermediate CA 882 certificates to attempt certification path construction. 884 * Each of the zero or more intermediate CA certificates in the chain 885 MUST have one or both of the following features: 887 - The Basic Constraints extension with the cA boolean asserted. 889 - The Key Usage extension with the keyCertSign bit asserted. 891 * Each certificate in the chain MUST fall within the limits imposed 892 by the zero or more Basic Constraints pathLenConstraint values 893 found higher up the chain. 895 * Precertificate submissions MUST conform to all of the requirements 896 in Section 3.2. 898 4.2.2. Discretionary Acceptance Criteria 900 If the minimum acceptance criteria are met but the submission is not 901 fully valid according to [RFC5280] verification rules (e.g., the 902 certificate or precertificate has expired, is not yet valid, has been 903 revoked, exhibits ASN.1 DER encoding errors but the log can still 904 parse it, etc), then the acceptability of the submission is left to 905 the log's discretion. It is useful for logs to accept such 906 submissions in order to accommodate quirks of CA certificate-issuing 907 software and to facilitate monitoring of CA compliance with 908 applicable policies and technical standards. However, it is 909 impractical for this document to enumerate, and for logs to consider, 910 all of the ways that a submission might fail to comply with 911 [RFC5280]. 913 Logs SHOULD limit the length of chain they will accept. The maximum 914 chain length is one of the log's parameters (see Section 4.1). 916 4.3. Log Entries 918 If a submission is accepted and an SCT issued, the accepting log MUST 919 store the entire chain used for verification. This chain MUST 920 include the certificate or precertificate itself, the zero or more 921 intermediate CA certificates provided by the submitter, and the trust 922 anchor used to verify the chain (even if it was omitted from the 923 submission). The log MUST provide this chain for auditing upon 924 request (see Section 5.6) so that the CA cannot avoid blame by 925 logging a partial or empty chain. Each log entry is a "TransItem" 926 structure of type "x509_entry_v2" or "precert_entry_v2". However, a 927 log may store its entries in any format. If a log does not store 928 this "TransItem" in full, it must store the "timestamp" and 929 "sct_extensions" of the corresponding 930 "TimestampedCertificateEntryDataV2" structure. The "TransItem" can 931 be reconstructed from these fields and the entire chain that the log 932 used to verify the submission. 934 4.4. Log ID 936 Each log is identified by an OID, which is one of the log's 937 parameters (see Section 4.1) and which MUST NOT be used to identify 938 any other log. A log's operator MUST either allocate the OID 939 themselves or request an OID from the Log ID registry (see 940 Section 10.2.5). One way to get an OID arc, from which OIDs can be 941 allocated, is to request a Private Enterprise Number from IANA, by 942 completing the registration form (https://pen.iana.org/pen/ 943 PenApplication.page). The only advantage of the registry is that the 944 DER encoding can be small. (Recall that OID allocations do not 945 require a central registration, although logs will most likely want 946 to make themselves known to potential clients through out of band 947 means.) Various data structures include the DER encoding of this 948 OID, excluding the ASN.1 tag and length bytes, in an opaque vector: 950 opaque LogID<2..127>; 952 Note that the ASN.1 length and the opaque vector length are identical 953 in size (1 byte) and value, so the full DER encoding (including the 954 tag and length) of the OID can be reproduced simply by prepending an 955 OBJECT IDENTIFIER tag (0x06) to the opaque vector length and 956 contents. 958 The OID used to identify a log is limited such that the DER encoding 959 of its value, excluding the tag and length, MUST be no longer than 960 127 octets. 962 4.5. TransItem Structure 964 Various data structures are encapsulated in the "TransItem" structure 965 to ensure that the type and version of each one is identified in a 966 common fashion: 968 enum { 969 reserved(0), 970 x509_entry_v2(1), precert_entry_v2(2), 971 x509_sct_v2(3), precert_sct_v2(4), 972 signed_tree_head_v2(5), consistency_proof_v2(6), 973 inclusion_proof_v2(7), 974 (65535) 975 } VersionedTransType; 977 struct { 978 VersionedTransType versioned_type; 979 select (versioned_type) { 980 case x509_entry_v2: TimestampedCertificateEntryDataV2; 981 case precert_entry_v2: TimestampedCertificateEntryDataV2; 982 case x509_sct_v2: SignedCertificateTimestampDataV2; 983 case precert_sct_v2: SignedCertificateTimestampDataV2; 984 case signed_tree_head_v2: SignedTreeHeadDataV2; 985 case consistency_proof_v2: ConsistencyProofDataV2; 986 case inclusion_proof_v2: InclusionProofDataV2; 987 } data; 988 } TransItem; 990 "versioned_type" is a value from the IANA registry in Section 10.2.3 991 that identifies the type of the encapsulated data structure and the 992 earliest version of this protocol to which it conforms. This 993 document is v2. 995 "data" is the encapsulated data structure. The various structures 996 named with the "DataV2" suffix are defined in later sections of this 997 document. 999 Note that "VersionedTransType" combines the v1 [RFC6962] type 1000 enumerations "Version", "LogEntryType", "SignatureType" and 1001 "MerkleLeafType". Note also that v1 did not define "TransItem", but 1002 this document provides guidelines (see Appendix A) on how v2 1003 implementations can co-exist with v1 implementations. 1005 Future versions of this protocol may reuse "VersionedTransType" 1006 values defined in this document as long as the corresponding data 1007 structures are not modified, and may add new "VersionedTransType" 1008 values for new or modified data structures. 1010 4.6. Log Artifact Extensions 1011 enum { 1012 reserved(65535) 1013 } ExtensionType; 1015 struct { 1016 ExtensionType extension_type; 1017 opaque extension_data<0..2^16-1>; 1018 } Extension; 1020 The "Extension" structure provides a generic extensibility for log 1021 artifacts, including SCTs (Section 4.8) and STHs (Section 4.10). The 1022 interpretation of the "extension_data" field is determined solely by 1023 the value of the "extension_type" field. 1025 This document does not define any extensions, but it does establish a 1026 registry for future "ExtensionType" values (see Section 10.2.4). 1027 Each document that registers a new "ExtensionType" must specify the 1028 context in which it may be used (e.g., SCT, STH, or both) and 1029 describe how to interpret the corresponding "extension_data". 1031 4.7. Merkle Tree Leaves 1033 The leaves of a log's Merkle Tree correspond to the log's entries 1034 (see Section 4.3). Each leaf is the leaf hash (Section 2.1) of a 1035 "TransItem" structure of type "x509_entry_v2" or "precert_entry_v2", 1036 which encapsulates a "TimestampedCertificateEntryDataV2" structure. 1037 Note that leaf hashes are calculated as HASH(0x00 || TransItem), 1038 where the hash algorithm is one of the log's parameters. 1040 opaque TBSCertificate<1..2^24-1>; 1042 struct { 1043 uint64 timestamp; 1044 opaque issuer_key_hash<32..2^8-1>; 1045 TBSCertificate tbs_certificate; 1046 Extension sct_extensions<0..2^16-1>; 1047 } TimestampedCertificateEntryDataV2; 1049 "timestamp" is the date and time at which the certificate or 1050 precertificate was accepted by the log, in the form of a 64-bit 1051 unsigned number of milliseconds elapsed since the Unix Epoch (1 1052 January 1970 00:00:00 UTC - see [UNIXTIME]), ignoring leap seconds, 1053 in network byte order. Note that the leaves of a log's Merkle Tree 1054 are not required to be in strict chronological order. 1056 "issuer_key_hash" is the HASH of the public key of the CA that issued 1057 the certificate or precertificate, calculated over the DER encoding 1058 of the key represented as SubjectPublicKeyInfo [RFC5280]. This is 1059 needed to bind the CA to the certificate or precertificate, making it 1060 impossible for the corresponding SCT to be valid for any other 1061 certificate or precertificate whose TBSCertificate matches 1062 "tbs_certificate". The length of the "issuer_key_hash" MUST match 1063 HASH_SIZE. 1065 "tbs_certificate" is the DER encoded TBSCertificate from the 1066 submission. (Note that a precertificate's TBSCertificate can be 1067 reconstructed from the corresponding certificate as described in 1068 Section 8.1.2). 1070 "sct_extensions" is byte-for-byte identical to the SCT extensions of 1071 the corresponding SCT. 1073 The type of the "TransItem" corresponds to the value of the "type" 1074 parameter supplied in the Section 5.1 call. 1076 4.8. Signed Certificate Timestamp (SCT) 1078 An SCT is a "TransItem" structure of type "x509_sct_v2" or 1079 "precert_sct_v2", which encapsulates a 1080 "SignedCertificateTimestampDataV2" structure: 1082 struct { 1083 LogID log_id; 1084 uint64 timestamp; 1085 Extension sct_extensions<0..2^16-1>; 1086 opaque signature<1..2^16-1>; 1087 } SignedCertificateTimestampDataV2; 1089 "log_id" is this log's unique ID, encoded in an opaque vector as 1090 described in Section 4.4. 1092 "timestamp" is equal to the timestamp from the corresponding 1093 "TimestampedCertificateEntryDataV2" structure. 1095 "sct_extensions" is a vector of 0 or more SCT extensions. This 1096 vector MUST NOT include more than one extension with the same 1097 "extension_type". The extensions in the vector MUST be ordered by 1098 the value of the "extension_type" field, smallest value first. All 1099 SCT extensions are similar to non-critical X.509v3 extensions (i.e., 1100 the "mustUnderstand" field is not set), and a recipient SHOULD ignore 1101 any extension it does not understand. Furthermore, an implementation 1102 MAY choose to ignore any extension(s) that it does understand. 1104 "signature" is computed over a "TransItem" structure of type 1105 "x509_entry_v2" or "precert_entry_v2" (see Section 4.7) using the 1106 signature algorithm declared in the log's parameters (see 1107 Section 4.1). 1109 4.9. Merkle Tree Head 1111 The log stores information about its Merkle Tree in a 1112 "TreeHeadDataV2": 1114 opaque NodeHash<32..2^8-1>; 1116 struct { 1117 uint64 timestamp; 1118 uint64 tree_size; 1119 NodeHash root_hash; 1120 Extension sth_extensions<0..2^16-1>; 1121 } TreeHeadDataV2; 1123 The length of NodeHash MUST match HASH_SIZE of the log. 1125 "timestamp" is the current date and time, using the format defined in 1126 Section 4.7. 1128 "tree_size" is the number of entries currently in the log's Merkle 1129 Tree. 1131 "root_hash" is the root of the Merkle Hash Tree. 1133 "sth_extensions" is a vector of 0 or more STH extensions. This 1134 vector MUST NOT include more than one extension with the same 1135 "extension_type". The extensions in the vector MUST be ordered by 1136 the value of the "extension_type" field, smallest value first. If an 1137 implementation sees an extension that it does not understand, it 1138 SHOULD ignore that extension. Furthermore, an implementation MAY 1139 choose to ignore any extension(s) that it does understand. 1141 4.10. Signed Tree Head (STH) 1143 Periodically each log SHOULD sign its current tree head information 1144 (see Section 4.9) to produce an STH. When a client requests a log's 1145 latest STH (see Section 5.2), the log MUST return an STH that is no 1146 older than the log's MMD. However, since STHs could be used to mark 1147 individual clients (by producing a new STH for each query), a log 1148 MUST NOT produce STHs more frequently than its parameters declare 1149 (see Section 4.1). In general, there is no need to produce a new STH 1150 unless there are new entries in the log; however, in the event that a 1151 log does not accept any submissions during an MMD period, the log 1152 MUST sign the same Merkle Tree Hash with a fresh timestamp. 1154 An STH is a "TransItem" structure of type "signed_tree_head_v2", 1155 which encapsulates a "SignedTreeHeadDataV2" structure: 1157 struct { 1158 LogID log_id; 1159 TreeHeadDataV2 tree_head; 1160 opaque signature<1..2^16-1>; 1161 } SignedTreeHeadDataV2; 1163 "log_id" is this log's unique ID, encoded in an opaque vector as 1164 described in Section 4.4. 1166 The "timestamp" in "tree_head" MUST be at least as recent as the most 1167 recent SCT timestamp in the tree. Each subsequent timestamp MUST be 1168 more recent than the timestamp of the previous update. 1170 "tree_head" contains the latest tree head information (see 1171 Section 4.9). 1173 "signature" is computed over the "tree_head" field using the 1174 signature algorithm declared in the log's parameters (see 1175 Section 4.1). 1177 4.11. Merkle Consistency Proofs 1179 To prepare a Merkle Consistency Proof for distribution to clients, 1180 the log produces a "TransItem" structure of type 1181 "consistency_proof_v2", which encapsulates a "ConsistencyProofDataV2" 1182 structure: 1184 struct { 1185 LogID log_id; 1186 uint64 tree_size_1; 1187 uint64 tree_size_2; 1188 NodeHash consistency_path<0..2^16-1>; 1189 } ConsistencyProofDataV2; 1191 "log_id" is this log's unique ID, encoded in an opaque vector as 1192 described in Section 4.4. 1194 "tree_size_1" is the size of the older tree. 1196 "tree_size_2" is the size of the newer tree. 1198 "consistency_path" is a vector of Merkle Tree nodes proving the 1199 consistency of two STHs as described in Section 2.1.4. 1201 4.12. Merkle Inclusion Proofs 1203 To prepare a Merkle Inclusion Proof for distribution to clients, the 1204 log produces a "TransItem" structure of type "inclusion_proof_v2", 1205 which encapsulates an "InclusionProofDataV2" structure: 1207 struct { 1208 LogID log_id; 1209 uint64 tree_size; 1210 uint64 leaf_index; 1211 NodeHash inclusion_path<0..2^16-1>; 1212 } InclusionProofDataV2; 1214 "log_id" is this log's unique ID, encoded in an opaque vector as 1215 described in Section 4.4. 1217 "tree_size" is the size of the tree on which this inclusion proof is 1218 based. 1220 "leaf_index" is the 0-based index of the log entry corresponding to 1221 this inclusion proof. 1223 "inclusion_path" is a vector of Merkle Tree nodes proving the 1224 inclusion of the chosen certificate or precertificate as described in 1225 Section 2.1.3. 1227 4.13. Shutting down a log 1229 Log operators may decide to shut down a log for various reasons, such 1230 as deprecation of the signature algorithm. If there are entries in 1231 the log for certificates that have not yet expired, simply making TLS 1232 clients stop recognizing that log will have the effect of 1233 invalidating SCTs from that log. In order to avoid that, the 1234 following actions SHOULD be taken: 1236 * Make it known to clients and monitors that the log will be frozen. 1237 This is not part of the API, so it will have to be done via a 1238 relevant out-of-band mechanism. 1240 * Stop accepting new submissions (the error code "shutdown" should 1241 be returned for such requests). 1243 * Once MMD from the last accepted submission has passed and all 1244 pending submissions are incorporated, issue a final STH and 1245 publish it as one of the log's parameters. Having an STH with a 1246 timestamp that is after the MMD has passed from the last SCT 1247 issuance allows clients to audit this log regularly without 1248 special handling for the final STH. At this point the log's 1249 private key is no longer needed and can be destroyed. 1251 * Keep the log running until the certificates in all of its entries 1252 have expired or exist in other logs (this can be determined by 1253 scanning other logs or connecting to domains mentioned in the 1254 certificates and inspecting the SCTs served). 1256 5. Log Client Messages 1258 Messages are sent as HTTPS GET or POST requests. Parameters for 1259 POSTs and all responses are encoded as JavaScript Object Notation 1260 (JSON) objects [RFC8259]. Parameters for GETs are encoded as order- 1261 independent key/value URL parameters, using the "application/x-www- 1262 form-urlencoded" format described in the "HTML 4.01 Specification" 1263 [HTML401]. Binary data is base64 encoded according to section 4 of 1264 [RFC4648] as specified in the individual messages. 1266 Clients are configured with a log's base URL, which is one of the 1267 log's parameters. Clients construct URLs for requests by appending 1268 suffixes to this base URL. This structure places some degree of 1269 restriction on how log operators can deploy these services, as noted 1270 in [RFC8820]. However, operational experience with version 1 of this 1271 protocol has not indicated that these restrictions are a problem in 1272 practice. 1274 Note that JSON objects and URL parameters may contain fields not 1275 specified here, to allow for experimentation. Any fields that are 1276 not understood SHOULD be ignored. 1278 In practice, log servers may include multiple front-end machines. 1279 Since it is impractical to keep these machines in perfect sync, 1280 errors may occur that are caused by skew between the machines. Where 1281 such errors are possible, the front-end will return additional 1282 information (as specified below) making it possible for clients to 1283 make progress, if progress is possible. Front-ends MUST only serve 1284 data that is free of gaps (that is, for example, no front-end will 1285 respond with an STH unless it is also able to prove consistency from 1286 all log entries logged within that STH). 1288 For example, when a consistency proof between two STHs is requested, 1289 the front-end reached may not yet be aware of one or both STHs. In 1290 the case where it is unaware of both, it will return the latest STH 1291 it is aware of. Where it is aware of the first but not the second, 1292 it will return the latest STH it is aware of and a consistency proof 1293 from the first STH to the returned STH. The case where it knows the 1294 second but not the first should not arise (see the "no gaps" 1295 requirement above). 1297 If the log is unable to process a client's request, it MUST return an 1298 HTTP response code of 4xx/5xx (see [RFC7231]), and, in place of the 1299 responses outlined in the subsections below, the body SHOULD be a 1300 JSON Problem Details Object (see [RFC7807] Section 3), containing: 1302 type: A URN reference identifying the problem. To facilitate 1303 automated response to errors, this document defines a set of 1304 standard tokens for use in the "type" field, within the URN 1305 namespace of: "urn:ietf:params:trans:error:". 1307 detail: A human-readable string describing the error that prevented 1308 the log from processing the request, ideally with sufficient 1309 detail to enable the error to be rectified. 1311 e.g., In response to a request of "/ct/v2/get- 1312 entries?start=100&end=99", the log would return a "400 Bad Request" 1313 response code with a body similar to the following: 1315 { 1316 "type": "urn:ietf:params:trans:error:endBeforeStart", 1317 "detail": "'start' cannot be greater than 'end'" 1318 } 1320 Most error types are specific to the type of request and are defined 1321 in the respective subsections below. The one exception is the 1322 "malformed" error type, which indicates that the log server could not 1323 parse the client's request because it did not comply with this 1324 document: 1326 +===========+==================================+ 1327 | type | detail | 1328 +===========+==================================+ 1329 | malformed | The request could not be parsed. | 1330 +-----------+----------------------------------+ 1332 Table 1 1334 Clients SHOULD treat "500 Internal Server Error" and "503 Service 1335 Unavailable" responses as transient failures and MAY retry the same 1336 request without modification at a later date. Note that as per 1337 [RFC7231], in the case of a 503 response the log MAY include a 1338 "Retry-After:" header field in order to request a minimum time for 1339 the client to wait before retrying the request. In the absence of 1340 this header field, this document does not specify a minimum. 1342 Clients SHOULD treat any 4xx error as a problem with the request and 1343 not attempt to resubmit without some modification to the request. 1344 The full status code MAY provide additional details. 1346 This document deliberately does not provide more specific guidance on 1347 the use of HTTP status codes. 1349 5.1. Submit Entry to Log 1351 POST /ct/v2/submit-entry 1353 Inputs: submission: The base64 encoded certificate or 1354 precertificate. 1356 type: The "VersionedTransType" integer value that indicates 1357 the type of the "submission": 1 for "x509_entry_v2", or 2 for 1358 "precert_entry_v2". 1360 chain: An array of zero or more JSON strings, each of which 1361 is a base64 encoded CA certificate. The first element is the 1362 certifier of the "submission"; the second certifies the first; 1363 etc. The last element of "chain" (or, if "chain" is an empty 1364 array, the "submission") is certified by an accepted trust 1365 anchor. 1367 Outputs: sct: A base64 encoded "TransItem" of type "x509_sct_v2" or 1368 "precert_sct_v2", signed by this log, that corresponds to the 1369 "submission". 1371 If the submitted entry is immediately appended to (or already 1372 exists in) this log's tree, then the log SHOULD also output: 1374 sth: A base64 encoded "TransItem" of type "signed_tree_head_v2", 1375 signed by this log. 1377 inclusion: A base64 encoded "TransItem" of type 1378 "inclusion_proof_v2" whose "inclusion_path" array of Merkle 1379 Tree nodes proves the inclusion of the "submission" in the 1380 returned "sth". 1382 Error codes: 1384 +================+==============================================+ 1385 | type | detail | 1386 +================+==============================================+ 1387 | badSubmission | "submission" is neither a valid certificate | 1388 | | nor a valid precertificate. | 1389 +----------------+----------------------------------------------+ 1390 | badType | "type" is neither 1 nor 2. | 1391 +----------------+----------------------------------------------+ 1392 | badChain | The first element of "chain" is not the | 1393 | | certifier of the "submission", or the second | 1394 | | element does not certify the first, etc. | 1395 +----------------+----------------------------------------------+ 1396 | badCertificate | One or more certificates in the "chain" are | 1397 | | not valid (e.g., not properly encoded). | 1398 +----------------+----------------------------------------------+ 1399 | unknownAnchor | The last element of "chain" (or, if "chain" | 1400 | | is an empty array, the "submission") both is | 1401 | | not, and is not certified by, an accepted | 1402 | | trust anchor. | 1403 +----------------+----------------------------------------------+ 1404 | shutdown | The log is no longer accepting submissions. | 1405 +----------------+----------------------------------------------+ 1407 Table 2 1409 If the version of "sct" is not v2, then a v2 client may be unable to 1410 verify the signature. It MUST NOT construe this as an error. This 1411 is to avoid forcing an upgrade of compliant v2 clients that do not 1412 use the returned SCTs. 1414 If a log detects bad encoding in a chain that otherwise verifies 1415 correctly then the log MUST either log the certificate or return the 1416 "bad certificate" error. If the certificate is logged, an SCT MUST 1417 be issued. Logging the certificate is useful, because monitors 1418 (Section 8.2) can then detect these encoding errors, which may be 1419 accepted by some TLS clients. 1421 If "submission" is an accepted trust anchor whose certifier is 1422 neither an accepted trust anchor nor the first element of "chain", 1423 then the log MUST return the "unknown anchor" error. A log is not 1424 able to generate an SCT for a submission if it does not have access 1425 to the issuer's public key. 1427 If the returned "sct" is intended to be provided to TLS clients, then 1428 "sth" and "inclusion" (if returned) SHOULD also be provided to TLS 1429 clients. For example, if "type" was 2 (indicating "precert_sct_v2") 1430 then all three "TransItem"s could be embedded in the certificate. 1432 5.2. Retrieve Latest STH 1434 GET /ct/v2/get-sth 1436 No inputs. 1438 Outputs: sth: A base64 encoded "TransItem" of type 1439 "signed_tree_head_v2", signed by this log, that is no older 1440 than the log's MMD. 1442 5.3. Retrieve Merkle Consistency Proof between Two STHs 1444 GET /ct/v2/get-sth-consistency 1446 Inputs: first: The tree_size of the older tree, in decimal. 1448 second: The tree_size of the newer tree, in decimal 1449 (optional). 1451 Both tree sizes must be from existing v2 STHs. However, because 1452 of skew, the receiving front-end may not know one or both of the 1453 existing STHs. If both are known, then only the "consistency" 1454 output is returned. If the first is known but the second is not 1455 (or has been omitted), then the latest known STH is returned, 1456 along with a consistency proof between the first STH and the 1457 latest. If neither are known, then the latest known STH is 1458 returned without a consistency proof. 1460 Outputs: consistency: A base64 encoded "TransItem" of type 1461 "consistency_proof_v2", whose "tree_size_1" MUST match the 1462 "first" input. If the "sth" output is omitted, then 1463 "tree_size_2" MUST match the "second" input. If "first" and 1464 "second" are equal and correspond to a known STH, the returned 1465 consistency proof MUST be empty (a "consistency_path" array 1466 with zero elements). 1468 sth: A base64 encoded "TransItem" of type 1469 "signed_tree_head_v2", signed by this log. 1471 Note that no signature is required for the "consistency" output as 1472 it is used to verify the consistency between two STHs, which are 1473 signed. 1475 Error codes: 1477 +===================+======================================+ 1478 | type | detail | 1479 +===================+======================================+ 1480 | firstUnknown | "first" is before the latest known | 1481 | | STH but is not from an existing STH. | 1482 +-------------------+--------------------------------------+ 1483 | secondUnknown | "second" is before the latest known | 1484 | | STH but is not from an existing STH. | 1485 +-------------------+--------------------------------------+ 1486 | secondBeforeFirst | "second" is smaller than "first". | 1487 +-------------------+--------------------------------------+ 1489 Table 3 1491 See Section 2.1.4.2 for an outline of how to use the "consistency" 1492 output. 1494 5.4. Retrieve Merkle Inclusion Proof from Log by Leaf Hash 1496 GET /ct/v2/get-proof-by-hash 1498 Inputs: hash: A base64 encoded v2 leaf hash. 1500 tree_size: The tree_size of the tree on which to base the 1501 proof, in decimal. 1503 The "hash" must be calculated as defined in Section 4.7. A v2 STH 1504 must exist for the "tree_size". Because of skew, the front-end 1505 may not know the requested tree head. In that case, it will 1506 return the latest STH it knows, along with an inclusion proof to 1507 that STH. If the front-end knows the requested tree head then 1508 only "inclusion" is returned. 1510 Outputs: inclusion: A base64 encoded "TransItem" of type 1511 "inclusion_proof_v2" whose "inclusion_path" array of Merkle 1512 Tree nodes proves the inclusion of the certificate (as 1513 specified by the "hash" parameter) in the selected STH. 1515 sth: A base64 encoded "TransItem" of type 1516 "signed_tree_head_v2", signed by this log. 1518 Note that no signature is required for the "inclusion" output as 1519 it is used to verify inclusion in the selected STH, which is 1520 signed. 1522 Error codes: 1524 +=================+=====================================+ 1525 | type | detail | 1526 +=================+=====================================+ 1527 | hashUnknown | "hash" is not the hash of a known | 1528 | | leaf (may be caused by skew or by a | 1529 | | known certificate not yet merged). | 1530 +-----------------+-------------------------------------+ 1531 | treeSizeUnknown | "hash" is before the latest known | 1532 | | STH but is not from an existing | 1533 | | STH. | 1534 +-----------------+-------------------------------------+ 1536 Table 4 1538 See Section 2.1.3.2 for an outline of how to use the "inclusion" 1539 output. 1541 5.5. Retrieve Merkle Inclusion Proof, STH and Consistency Proof by Leaf 1542 Hash 1544 GET /ct/v2/get-all-by-hash 1546 Inputs: hash: A base64 encoded v2 leaf hash. 1548 tree_size: The tree_size of the tree on which to base the 1549 proofs, in decimal. 1551 The "hash" must be calculated as defined in Section 4.7. A v2 STH 1552 must exist for the "tree_size". 1554 Because of skew, the front-end may not know the requested tree head 1555 or the requested hash, which leads to a number of cases: 1557 +=====================+=====================================+ 1558 | Case | Response | 1559 +=====================+=====================================+ 1560 | latest STH < | Return latest STH | 1561 | requested tree head | | 1562 +---------------------+-------------------------------------+ 1563 | latest STH > | Return latest STH and a consistency | 1564 | requested tree head | proof between it and the requested | 1565 | | tree head (see Section 5.3) | 1566 +---------------------+-------------------------------------+ 1567 | index of requested | Return "inclusion" | 1568 | hash < latest STH | | 1569 +---------------------+-------------------------------------+ 1571 Table 5 1573 Note that more than one case can be true, in which case the returned 1574 data is their union. It is also possible for none to be true, in 1575 which case the front-end MUST return an empty response. 1577 Outputs: inclusion: A base64 encoded "TransItem" of type 1578 "inclusion_proof_v2" whose "inclusion_path" array of Merkle 1579 Tree nodes proves the inclusion of the certificate (as 1580 specified by the "hash" parameter) in the selected STH. 1582 sth: A base64 encoded "TransItem" of type 1583 "signed_tree_head_v2", signed by this log. 1585 consistency: A base64 encoded "TransItem" of type 1586 "consistency_proof_v2" that proves the consistency of the 1587 requested tree head and the returned STH. 1589 Note that no signature is required for the "inclusion" or 1590 "consistency" outputs as they are used to verify inclusion in and 1591 consistency of STHs, which are signed. 1593 Errors are the same as in Section 5.4. 1595 See Section 2.1.3.2 for an outline of how to use the "inclusion" 1596 output, and see Section 2.1.4.2 for an outline of how to use the 1597 "consistency" output. 1599 5.6. Retrieve Entries and STH from Log 1601 GET /ct/v2/get-entries 1603 Inputs: start: 0-based index of first entry to retrieve, in 1604 decimal. 1606 end: 0-based index of last entry to retrieve, in decimal. 1608 Outputs: entries: An array of objects, each consisting of 1610 log_entry: The base64 encoded "TransItem" structure of type 1611 "x509_entry_v2" or "precert_entry_v2" (see Section 4.3). 1613 submitted_entry: JSON object equivalent to inputs that were 1614 submitted to "submit-entry", with the addition of the trust 1615 anchor to the "chain" field if the submission did not 1616 include it. 1618 sct: The base64 encoded "TransItem" of type "x509_sct_v2" or 1619 "precert_sct_v2" corresponding to this log entry. 1621 sth: A base64 encoded "TransItem" of type 1622 "signed_tree_head_v2", signed by this log. 1624 Note that this message is not signed -- the "entries" data can be 1625 verified by constructing the Merkle Tree Hash corresponding to a 1626 retrieved STH. All leaves MUST be v2. However, a compliant v2 1627 client MUST NOT construe an unrecognized TransItem type as an error. 1628 This means it may be unable to parse some entries, but note that each 1629 client can inspect the entries it does recognize as well as verify 1630 the integrity of the data by treating unrecognized leaves as opaque 1631 input to the tree. 1633 The "start" and "end" parameters SHOULD be within the range 0 <= x < 1634 "tree_size" as returned by "get-sth" in Section 5.2. 1636 The "start" parameter MUST be less than or equal to the "end" 1637 parameter. 1639 Each "submitted_entry" output parameter MUST include the trust anchor 1640 that the log used to verify the "submission", even if that trust 1641 anchor was not provided to "submit-entry" (see Section 5.1). If the 1642 "submission" does not certify itself, then the first element of 1643 "chain" MUST be present and MUST certify the "submission". 1645 Log servers MUST honor requests where 0 <= "start" < "tree_size" and 1646 "end" >= "tree_size" by returning a partial response covering only 1647 the valid entries in the specified range. "end" >= "tree_size" could 1648 be caused by skew. Note that the following restriction may also 1649 apply: 1651 Logs MAY restrict the number of entries that can be retrieved per 1652 "get-entries" request. If a client requests more than the permitted 1653 number of entries, the log SHALL return the maximum number of entries 1654 permissible. These entries SHALL be sequential beginning with the 1655 entry specified by "start". Note that limit on the number of entries 1656 is not immutable and therefore the restriction may be changed or 1657 lifted at any time and is not listed with the other Log Parameters in 1658 Section 4.1. 1660 Because of skew, it is possible the log server will not have any 1661 entries between "start" and "end". In this case it MUST return an 1662 empty "entries" array. 1664 In any case, the log server MUST return the latest STH it knows 1665 about. 1667 See Section 2.1.2 for an outline of how to use a complete list of 1668 "log_entry" entries to verify the "root_hash". 1670 Error codes: 1672 +================+====================================+ 1673 | type | detail | 1674 +================+====================================+ 1675 | startUnknown | "start" is greater than the number | 1676 | | of entries in the Merkle tree. | 1677 +----------------+------------------------------------+ 1678 | endBeforeStart | "start" cannot be greater than | 1679 | | "end". | 1680 +----------------+------------------------------------+ 1682 Table 6 1684 5.7. Retrieve Accepted Trust Anchors 1686 GET /ct/v2/get-anchors 1688 No inputs. 1690 Outputs: certificates: An array of JSON strings, each of which is a 1691 base64 encoded CA certificate that is acceptable to the log. 1693 max_chain_length: If the server has chosen to limit the 1694 length of chains it accepts, this is the maximum number of 1695 certificates in the chain, in decimal. If there is no limit, 1696 this is omitted. 1698 This data is not signed and the protocol depends on the security 1699 guarantees of TLS to ensure correctness. 1701 6. TLS Servers 1703 CT-using TLS servers MUST use at least one of the mechanisms 1704 described below to present one or more SCTs from one or more logs to 1705 each TLS client during full TLS handshakes, when requested by the 1706 client, where each SCT corresponds to the server certificate. (Of 1707 course, a server can only send a TLS extension if the client has 1708 specified it first.) Servers SHOULD also present corresponding 1709 inclusion proofs and STHs. 1711 A server can provide SCTs using a TLS 1.3 extension (Section 4.2 of 1712 [RFC8446]) with type "transparency_info" (see Section 6.5). This 1713 mechanism allows TLS servers to participate in CT without the 1714 cooperation of CAs, unlike the other two mechanisms. It also allows 1715 SCTs and inclusion proofs to be updated on the fly. 1717 The server may also use an Online Certificate Status Protocol (OCSP) 1718 [RFC6960] response extension (see Section 7.1.1), providing the OCSP 1719 response as part of the TLS handshake. Providing a response during a 1720 TLS handshake is popularly known as "OCSP stapling." For TLS 1.3, 1721 the information is encoded as an extension in the "status_request" 1722 extension data; see Section 4.4.2.1 of [RFC8446]. For TLS 1.2 1723 ([RFC5246]), the information is encoded in the "CertificateStatus" 1724 message; see Section 8 of [RFC6066]. Using stapling also allows SCTs 1725 and inclusion proofs to be updated on the fly. 1727 CT information can also be encoded as an extension in the X.509v3 1728 certificate (see Section 7.1.2). This mechanism allows the use of 1729 unmodified TLS servers, but the SCTs and inclusion proofs cannot be 1730 updated on the fly. Since the logs from which the SCTs and inclusion 1731 proofs originated won't necessarily be accepted by TLS clients for 1732 the full lifetime of the certificate, there is a risk that TLS 1733 clients may subsequently consider the certificate to be non-compliant 1734 and in need of re-issuance or the use of one of the other two methods 1735 for delivering CT information. 1737 6.1. TLS Client Authentication 1739 This specification includes no description of how a TLS server can 1740 use CT for TLS client certificates. While this may be useful, it is 1741 not documented here for the following reasons: 1743 * The greater security exposure is for clients to end up interacting 1744 with an illegitimate server. 1746 * In general, TLS client certificates are not expected to be 1747 submitted to CT logs, particularly those intended for general 1748 public use. 1750 A future version could include such information. 1752 6.2. Multiple SCTs 1754 CT-using TLS servers SHOULD send SCTs from multiple logs, because: 1756 * One or more logs may not have become acceptable to all CT-using 1757 TLS clients. Note that client discovery, trust, and distrust of 1758 logs is expected to be handled out-of-band and is out of scope of 1759 this document. 1761 * If a CA and a log collude, it is possible to temporarily hide 1762 misissuance from clients. When a TLS client requires SCTs from 1763 multiple logs to be provided, it is more difficult to mount this 1764 attack. 1766 * If a log misbehaves or suffers a key compromise, a consequence may 1767 be that clients cease to trust it. Since the time an SCT may be 1768 in use can be considerable (several years is common in current 1769 practice when embedded in a certificate), including SCTs from 1770 multiple logs reduces the probability of the certificate being 1771 rejected by TLS clients. 1773 * TLS clients may have policies related to the above risks requiring 1774 TLS servers to present multiple SCTs. For example, at the time of 1775 writing, Chromium [Chromium.Log.Policy] requires multiple SCTs to 1776 be presented with EV certificates in order for the EV indicator to 1777 be shown. 1779 To select the logs from which to obtain SCTs, a TLS server can, for 1780 example, examine the set of logs popular TLS clients accept and 1781 recognize. 1783 6.3. TransItemList Structure 1785 Multiple SCTs, inclusion proofs, and indeed "TransItem" structures of 1786 any type, are combined into a list as follows: 1788 opaque SerializedTransItem<1..2^16-1>; 1790 struct { 1791 SerializedTransItem trans_item_list<1..2^16-1>; 1792 } TransItemList; 1794 Here, "SerializedTransItem" is an opaque byte string that contains 1795 the serialized "TransItem" structure. This encoding ensures that TLS 1796 clients can decode each "TransItem" individually (so, for example, if 1797 there is a version upgrade, out-of-date clients can still parse old 1798 "TransItem" structures while skipping over new "TransItem" structures 1799 whose versions they don't understand). 1801 6.4. Presenting SCTs, inclusions proofs and STHs 1803 In each "TransItemList" that is sent during a TLS handshake, the TLS 1804 server MUST include a "TransItem" structure of type "x509_sct_v2" or 1805 "precert_sct_v2". 1807 Presenting inclusion proofs and STHs in the TLS handshake helps to 1808 protect the client's privacy (see Section 8.1.4) and reduces load on 1809 log servers. Therefore, if the TLS server can obtain them, it SHOULD 1810 also include "TransItem"s of type "inclusion_proof_v2" and 1811 "signed_tree_head_v2" in the "TransItemList". 1813 6.5. transparency_info TLS Extension 1815 Provided that a TLS client includes the "transparency_info" extension 1816 type in the ClientHello and the TLS server supports the 1817 "transparency_info" extension: 1819 * The TLS server MUST verify that the received "extension_data" is 1820 empty. 1822 * The TLS server MUST construct a "TransItemList" of relevant 1823 "TransItem"s (see Section 6.4), which SHOULD omit any "TransItem"s 1824 that are already embedded in the server certificate or the stapled 1825 OCSP response (see Section 7.1). If the constructed 1826 "TransItemList" is not empty, then the TLS server MUST include the 1827 "transparency_info" extension with the "extension_data" set to 1828 this "TransItemList". If the list is empty then the server SHOULD 1829 omit the "extension_data" element, but MAY send it with an empty 1830 array. 1832 TLS servers MUST only include this extension in the following 1833 messages: 1835 * the ServerHello message (for TLS 1.2 or earlier). 1837 * the Certificate or CertificateRequest message (for TLS 1.3). 1839 TLS servers MUST NOT process or include this extension when a TLS 1840 session is resumed, since session resumption uses the original 1841 session information. 1843 7. Certification Authorities 1845 7.1. Transparency Information X.509v3 Extension 1847 The Transparency Information X.509v3 extension, which has OID 1848 1.3.101.75 and SHOULD be non-critical, contains one or more 1849 "TransItem" structures in a "TransItemList". This extension MAY be 1850 included in OCSP responses (see Section 7.1.1) and certificates (see 1851 Section 7.1.2). Since RFC5280 requires the "extnValue" field (an 1852 OCTET STRING) of each X.509v3 extension to include the DER encoding 1853 of an ASN.1 value, a "TransItemList" MUST NOT be included directly. 1854 Instead, it MUST be wrapped inside an additional OCTET STRING, which 1855 is then put into the "extnValue" field: 1857 TransparencyInformationSyntax ::= OCTET STRING 1859 "TransparencyInformationSyntax" contains a "TransItemList". 1861 7.1.1. OCSP Response Extension 1863 A certification authority MAY include a Transparency Information 1864 X.509v3 extension in the "singleExtensions" of a "SingleResponse" in 1865 an OCSP response. All included SCTs and inclusion proofs MUST be for 1866 the certificate identified by the "certID" of that "SingleResponse", 1867 or for a precertificate that corresponds to that certificate. 1869 7.1.2. Certificate Extension 1871 A certification authority MAY include a Transparency Information 1872 X.509v3 extension in a certificate. All included SCTs and inclusion 1873 proofs MUST be for a precertificate that corresponds to this 1874 certificate. 1876 7.2. TLS Feature X.509v3 Extension 1878 A certification authority SHOULD NOT issue any certificate that 1879 identifies the "transparency_info" TLS extension in a TLS feature 1880 extension [RFC7633], because TLS servers are not required to support 1881 the "transparency_info" TLS extension in order to participate in CT 1882 (see Section 6). 1884 8. Clients 1886 There are various different functions clients of logs might perform. 1887 We describe here some typical clients and how they should function. 1888 Any inconsistency may be used as evidence that a log has not behaved 1889 correctly, and the signatures on the data structures prevent the log 1890 from denying that misbehavior. 1892 All clients need various parameters in order to communicate with logs 1893 and verify their responses. These parameters are described in 1894 Section 4.1, but note that this document does not describe how the 1895 parameters are obtained, which is implementation-dependent (see, for 1896 example, [Chromium.Policy]). 1898 8.1. TLS Client 1900 8.1.1. Receiving SCTs and inclusion proofs 1902 TLS clients receive SCTs and inclusion proofs alongside or in 1903 certificates. CT-using TLS clients MUST implement all of the three 1904 mechanisms by which TLS servers may present SCTs (see Section 6). 1906 TLS clients that support the "transparency_info" TLS extension (see 1907 Section 6.5) SHOULD include it in ClientHello messages, with empty 1908 "extension_data". If a TLS server includes the "transparency_info" 1909 TLS extension when resuming a TLS session, the TLS client MUST abort 1910 the handshake. 1912 8.1.2. Reconstructing the TBSCertificate 1914 Validation of an SCT for a certificate (where the "type" of the 1915 "TransItem" is "x509_sct_v2") uses the unmodified TBSCertificate 1916 component of the certificate. 1918 Before an SCT for a precertificate (where the "type" of the 1919 "TransItem" is "precert_sct_v2") can be validated, the TBSCertificate 1920 component of the precertificate needs to be reconstructed from the 1921 TBSCertificate component of the certificate as follows: 1923 * Remove the Transparency Information extension (see Section 7.1). 1925 * Remove embedded v1 SCTs, identified by OID 1.3.6.1.4.1.11129.2.4.2 1926 (see section 3.3 of [RFC6962]). This allows embedded v1 and v2 1927 SCTs to co-exist in a certificate (see Appendix A). 1929 8.1.3. Validating SCTs 1931 In order to make use of a received SCT, the TLS client MUST first 1932 validate it as follows: 1934 * Compute the signature input by constructing a "TransItem" of type 1935 "x509_entry_v2" or "precert_entry_v2", depending on the SCT's 1936 "TransItem" type. The "TimestampedCertificateEntryDataV2" 1937 structure is constructed in the following manner: 1939 - "timestamp" is copied from the SCT. 1941 - "tbs_certificate" is the reconstructed TBSCertificate portion 1942 of the server certificate, as described in Section 8.1.2. 1944 - "issuer_key_hash" is computed as described in Section 4.7. 1946 - "sct_extensions" is copied from the SCT. 1948 * Verify the SCT's "signature" against the computed signature input 1949 using the public key of the corresponding log, which is identified 1950 by the "log_id". The required signature algorithm is one of the 1951 log's parameters. 1953 If the TLS client does not have the corresponding log's parameters, 1954 it cannot attempt to validate the SCT. When evaluating compliance 1955 (see Section 8.1.6), the TLS client will consider only those SCTs 1956 that it was able to validate. 1958 Note that SCT validation is not a substitute for the normal 1959 validation of the server certificate and its chain. 1961 8.1.4. Fetching inclusion proofs 1963 When a TLS client has validated a received SCT but does not yet 1964 possess a corresponding inclusion proof, the TLS client MAY request 1965 the inclusion proof directly from a log using "get-proof-by-hash" 1966 (Section 5.4) or "get-all-by-hash" (Section 5.5). 1968 Note that fetching inclusion proofs directly from a log will disclose 1969 to the log which TLS server the client has been communicating with. 1970 This may be regarded as a significant privacy concern, and so it is 1971 preferable for the TLS server to send the inclusion proofs (see 1972 Section 6.4). 1974 8.1.5. Validating inclusion proofs 1976 When a TLS client has received, or fetched, an inclusion proof (and 1977 an STH), it SHOULD proceed to verifying the inclusion proof to the 1978 provided STH. The TLS client SHOULD also verify consistency between 1979 the provided STH and an STH it knows about. 1981 If the TLS client holds an STH that predates the SCT, it MAY, in the 1982 process of auditing, request a new STH from the log (Section 5.2), 1983 then verify it by requesting a consistency proof (Section 5.3). Note 1984 that if the TLS client uses "get-all-by-hash", then it will already 1985 have the new STH. 1987 8.1.6. Evaluating compliance 1989 It is up to a client's local policy to specify the quantity and form 1990 of evidence (SCTs, inclusion proofs or a combination) needed to 1991 achieve compliance and how to handle non-compliance. 1993 A TLS client can only evaluate compliance if it has given the TLS 1994 server the opportunity to send SCTs and inclusion proofs by any of 1995 the three mechanisms that are mandatory to implement for CT-using TLS 1996 clients (see Section 8.1.1). Therefore, a TLS client MUST NOT 1997 evaluate compliance if it did not include both the 1998 "transparency_info" and "status_request" TLS extensions in the 1999 ClientHello. 2001 8.2. Monitor 2003 Monitors watch logs to check that they behave correctly, for 2004 certificates of interest, or both. For example, a monitor may be 2005 configured to report on all certificates that apply to a specific 2006 domain name when fetching new entries for consistency validation. 2008 A monitor MUST at least inspect every new entry in every log it 2009 watches, and it MAY also choose to keep copies of entire logs. 2011 To inspect all of the existing entries, the monitor SHOULD follow 2012 these steps once for each log: 2014 1. Fetch the current STH (Section 5.2). 2016 2. Verify the STH signature. 2018 3. Fetch all the entries in the tree corresponding to the STH 2019 (Section 5.6). 2021 4. If applicable, check each entry to see if it's a certificate of 2022 interest. 2024 5. Confirm that the tree made from the fetched entries produces the 2025 same hash as that in the STH. 2027 To inspect new entries, the monitor SHOULD follow these steps 2028 repeatedly for each log: 2030 1. Fetch the current STH (Section 5.2). Repeat until the STH 2031 changes. This document does not specify the polling frequency, 2032 to allow for experimentation. 2034 2. Verify the STH signature. 2036 3. Fetch all the new entries in the tree corresponding to the STH 2037 (Section 5.6). If they remain unavailable for an extended 2038 period, then this should be viewed as misbehavior on the part of 2039 the log. 2041 4. If applicable, check each entry to see if it's a certificate of 2042 interest. 2044 5. Either: 2046 1. Verify that the updated list of all entries generates a tree 2047 with the same hash as the new STH. 2049 Or, if it is not keeping all log entries: 2051 1. Fetch a consistency proof for the new STH with the previous 2052 STH (Section 5.3). 2054 2. Verify the consistency proof. 2056 3. Verify that the new entries generate the corresponding 2057 elements in the consistency proof. 2059 6. Repeat from step 1. 2061 8.3. Auditing 2063 Auditing ensures that the current published state of a log is 2064 reachable from previously published states that are known to be good, 2065 and that the promises made by the log in the form of SCTs have been 2066 kept. Audits are performed by monitors or TLS clients. 2068 In particular, there are four log behavior properties that should be 2069 checked: 2071 * The Maximum Merge Delay (MMD). 2073 * The STH Frequency Count. 2075 * The append-only property. 2077 * The consistency of the log view presented to all query sources. 2079 A benign, conformant log publishes a series of STHs over time, each 2080 derived from the previous STH and the submitted entries incorporated 2081 into the log since publication of the previous STH. This can be 2082 proven through auditing of STHs. SCTs returned to TLS clients can be 2083 audited by verifying against the accompanying certificate, and using 2084 Merkle Inclusion Proofs, against the log's Merkle tree. 2086 The action taken by the auditor if an audit fails is not specified, 2087 but note that in general if audit fails, the auditor is in possession 2088 of signed proof of the log's misbehavior. 2090 A monitor (Section 8.2) can audit by verifying the consistency of 2091 STHs it receives, ensure that each entry can be fetched and that the 2092 STH is indeed the result of making a tree from all fetched entries. 2094 A TLS client (Section 8.1) can audit by verifying an SCT against any 2095 STH dated after the SCT timestamp + the Maximum Merge Delay by 2096 requesting a Merkle inclusion proof (Section 5.4). It can also 2097 verify that the SCT corresponds to the server certificate it arrived 2098 with (i.e., the log entry is that certificate, or is a precertificate 2099 corresponding to that certificate). 2101 Checking of the consistency of the log view presented to all entities 2102 is more difficult to perform because it requires a way to share log 2103 responses among a set of CT-using entities, and is discussed in 2104 Section 11.3. 2106 9. Algorithm Agility 2108 It is not possible for a log to change any of its algorithms part way 2109 through its lifetime: 2111 Signature algorithm: SCT signatures must remain valid so signature 2112 algorithms can only be added, not removed. 2114 Hash algorithm: A log would have to support the old and new hash 2115 algorithms to allow backwards-compatibility with clients that are 2116 not aware of a hash algorithm change. 2118 Allowing multiple signature or hash algorithms for a log would 2119 require that all data structures support it and would significantly 2120 complicate client implementation, which is why it is not supported by 2121 this document. 2123 If it should become necessary to deprecate an algorithm used by a 2124 live log, then the log MUST be frozen as specified in Section 4.13 2125 and a new log SHOULD be started. Certificates in the frozen log that 2126 have not yet expired and require new SCTs SHOULD be submitted to the 2127 new log and the SCTs from that log used instead. 2129 10. IANA Considerations 2131 The assignment policy criteria mentioned in this section refer to the 2132 policies outlined in [RFC8126]. 2134 10.1. Additions to existing registries 2136 This sub-section defines additions to existing registries. 2138 10.1.1. New Entry to the TLS ExtensionType Registry 2140 IANA is asked to add the following entry to the "TLS ExtensionType 2141 Values" registry defined in [RFC8446], with an assigned Value: 2143 +=======+===================+============+=============+===========+ 2144 | Value | Extension Name | TLS 1.3 | Recommended | Reference | 2145 +=======+===================+============+=============+===========+ 2146 | TBD | transparency_info | CH, CR, CT | Y | RFCXXXX | 2147 +-------+-------------------+------------+-------------+-----------+ 2149 Table 7 2151 10.1.2. URN Sub-namespace for TRANS errors 2152 (urn:ietf:params:trans:error) 2154 IANA is requested to add a new entry in the "IETF URN Sub-namespace 2155 for Registered Protocol Parameter Identifiers" registry, following 2156 the template in [RFC3553]: 2158 Registry name: trans:error 2160 Specification: RFCXXXX 2162 Repository: https://www.iana.org/assignments/trans 2164 Index value: No transformation needed. 2166 10.2. New CT-Related registries 2168 IANA is requested to add a new protocol registry, "Public Notary 2169 Transparency", to the list that appears at https://www.iana.org/ 2170 assignments/ 2171 The rest of this section defines sub-registries to be created within 2172 the new Public Notary Transparency registry. 2174 10.2.1. Hash Algorithms 2176 IANA is asked to establish a registry of hash algorithm values, named 2177 "Hash Algorithms", that initially consists of: 2179 +========+============+========================+===================+ 2180 | Value | Hash | OID | Reference / | 2181 | | Algorithm | | Assignment Policy | 2182 +========+============+========================+===================+ 2183 | 0x00 | SHA-256 | 2.16.840.1.101.3.4.2.1 | [RFC6234] | 2184 +--------+------------+------------------------+-------------------+ 2185 | 0x01 - | Unassigned | | Specification | 2186 | 0xDF | | | Required | 2187 +--------+------------+------------------------+-------------------+ 2188 | 0xE0 - | Reserved | | Experimental Use | 2189 | 0xEF | | | | 2190 +--------+------------+------------------------+-------------------+ 2191 | 0xF0 - | Reserved | | Private Use | 2192 | 0xFF | | | | 2193 +--------+------------+------------------------+-------------------+ 2195 Table 8 2197 The Designated Expert(s) should ensure that the proposed algorithm 2198 has a public specification and is suitable for use as a cryptographic 2199 hash algorithm with no known preimage or collision attacks. These 2200 attacks can damage the integrity of the log. 2202 10.2.2. Signature Algorithms 2204 IANA is asked to establish a registry of signature algorithm values, 2205 named "Signature Algorithms". 2207 The following notes should be added: 2209 * This is a subset of the TLS SignatureScheme Registry, limited to 2210 those algorithms that are appropriate for CT. A major advantage 2211 of this is leveraging the expertise of the TLS working group and 2212 its Designated Expert(s). 2214 * The value "0x0403" appears twice. While this may be confusing, it 2215 is okay because the verification process is the same for both 2216 algorithms, and the choice of which to use when generating a 2217 signature is purely internal to the log server. 2219 The registry should initially consist of: 2221 +================================+==================+===============+ 2222 | SignatureScheme Value | Signature | Reference / | 2223 | | Algorithm | Assignment | 2224 | | | Policy | 2225 +================================+==================+===============+ 2226 | 0x0000 - 0x0402 | Unassigned | Specification | 2227 | | | Required | 2228 +--------------------------------+------------------+---------------+ 2229 | ecdsa_secp256r1_sha256(0x0403) | ECDSA (NIST | [FIPS186-4] | 2230 | | P-256) with | | 2231 | | SHA-256 | | 2232 +--------------------------------+------------------+---------------+ 2233 | ecdsa_secp256r1_sha256(0x0403) | Deterministic | [RFC6979] | 2234 | | ECDSA (NIST | | 2235 | | P-256) with | | 2236 | | HMAC-SHA256 | | 2237 +--------------------------------+------------------+---------------+ 2238 | 0x0404 - 0x0806 | Unassigned | Specification | 2239 | | | Required | 2240 +--------------------------------+------------------+---------------+ 2241 | ed25519(0x0807) | Ed25519 | [RFC8032] | 2242 | | (PureEdDSA | | 2243 | | with the | | 2244 | | edwards25519 | | 2245 | | curve) | | 2246 +--------------------------------+------------------+---------------+ 2247 | 0x0808 - 0xFDFF | Unassigned | Expert Review | 2248 +--------------------------------+------------------+---------------+ 2249 | 0xFE00 - 0xFEFF | Reserved | Experimental | 2250 | | | Use | 2251 +--------------------------------+------------------+---------------+ 2252 | 0xFF00 - 0xFFFF | Reserved | Private Use | 2253 +--------------------------------+------------------+---------------+ 2255 Table 9 2257 The Designated Expert(s) should ensure that the proposed algorithm 2258 has a public specification, has a value assigned to it in the TLS 2259 SignatureScheme Registry (that IANA was asked to establish in 2260 [RFC8446]), and is suitable for use as a cryptographic signature 2261 algorithm. 2263 10.2.3. VersionedTransTypes 2265 IANA is asked to establish a registry of "VersionedTransType" values, 2266 named "VersionedTransTypes". 2268 The following note should be added: 2270 * The 0x0000 value is reserved so that v1 SCTs are distinguishable 2271 from v2 SCTs and other "TransItem" structures. 2273 The registry should initially consist of: 2275 +==========+======================+===============================+ 2276 | Value | Type and Version | Reference / Assignment Policy | 2277 +==========+======================+===============================+ 2278 | 0x0000 | Reserved | [RFC6962] | 2279 +----------+----------------------+-------------------------------+ 2280 | 0x0001 | x509_entry_v2 | RFCXXXX | 2281 +----------+----------------------+-------------------------------+ 2282 | 0x0002 | precert_entry_v2 | RFCXXXX | 2283 +----------+----------------------+-------------------------------+ 2284 | 0x0003 | x509_sct_v2 | RFCXXXX | 2285 +----------+----------------------+-------------------------------+ 2286 | 0x0004 | precert_sct_v2 | RFCXXXX | 2287 +----------+----------------------+-------------------------------+ 2288 | 0x0005 | signed_tree_head_v2 | RFCXXXX | 2289 +----------+----------------------+-------------------------------+ 2290 | 0x0006 | consistency_proof_v2 | RFCXXXX | 2291 +----------+----------------------+-------------------------------+ 2292 | 0x0007 | inclusion_proof_v2 | RFCXXXX | 2293 +----------+----------------------+-------------------------------+ 2294 | 0x0008 - | Unassigned | Specification Required | 2295 | 0xDFFF | | | 2296 +----------+----------------------+-------------------------------+ 2297 | 0xE000 - | Reserved | Experimental Use | 2298 | 0xEFFF | | | 2299 +----------+----------------------+-------------------------------+ 2300 | 0xF000 - | Reserved | Private Use | 2301 | 0xFFFF | | | 2302 +----------+----------------------+-------------------------------+ 2304 Table 10 2306 The Designated Expert(s) should review the public specification to 2307 ensure that it is detailed enough to ensure implementation 2308 interoperability. 2310 10.2.4. Log Artifact Extension Registry 2312 IANA is asked to establish a registry of "ExtensionType" values, 2313 named "Log Artifact Extensions", that initially consists of: 2315 +===============+============+=====+===============================+ 2316 | ExtensionType | Status | Use | Reference / Assignment Policy | 2317 +===============+============+=====+===============================+ 2318 | 0x0000 - | Unassigned | n/a | Specification Required | 2319 | 0xDFFF | | | | 2320 +---------------+------------+-----+-------------------------------+ 2321 | 0xE000 - | Reserved | n/a | Experimental Use | 2322 | 0xEFFF | | | | 2323 +---------------+------------+-----+-------------------------------+ 2324 | 0xF000 - | Reserved | n/a | Private Use | 2325 | 0xFFFF | | | | 2326 +---------------+------------+-----+-------------------------------+ 2328 Table 11 2330 The "Use" column should contain one or both of the following values: 2332 * "SCT", for extensions specified for use in Signed Certificate 2333 Timestamps. 2335 * "STH", for extensions specified for use in Signed Tree Heads. 2337 The Designated Expert(s) should review the public specification to 2338 ensure that it is detailed enough to ensure implementation 2339 interoperability. They should also verify that the extension is 2340 appropriate to the contexts in which it is specified to be used (SCT, 2341 STH, or both). 2343 10.2.5. Log IDs Registry 2345 IANA is asked to establish a registry of Log IDs, named "Log IDs", 2346 that initially consists of: 2348 +================+==============+==============+===================+ 2349 | Log ID | Log Base URL | Log Operator | Reference / | 2350 | | | | Assignment Policy | 2351 +================+==============+==============+===================+ 2352 | 1.3.101.8192 - | Unassigned | Unassigned | First Come First | 2353 | 1.3.101.16383 | | | Served | 2354 +----------------+--------------+--------------+-------------------+ 2355 | 1.3.101.80.0 - | Unassigned | Unassigned | First Come First | 2356 | 1.3.101.80.* | | | Served | 2357 +----------------+--------------+--------------+-------------------+ 2359 Table 12 2361 All OIDs in the range from 1.3.101.8192 to 1.3.101.16383 have been 2362 set aside for Log IDs. This is a limited resource of 8,192 OIDs, 2363 each of which has an encoded length of 4 octets. 2365 The 1.3.101.80 arc has also been set aside for Log IDs. This is an 2366 unlimited resource, but only the 128 OIDs from 1.3.101.80.0 to 2367 1.3.101.80.127 have an encoded length of only 4 octets. 2369 Each application for the allocation of a Log ID MUST be accompanied 2370 by: 2372 * the Log's Base URL (see Section 4.1). 2374 * the Log Operator's contact details. 2376 IANA is asked to reject any request to update a Log ID or Log Base 2377 URL in this registry, because these fields are immutable (see 2378 Section 4.1). 2380 IANA is asked to accept requests from log operators to update their 2381 contact details in this registry. 2383 Since log operators can choose to not use this registry (see 2384 Section 4.4), it is not expected to be a global directory of all 2385 logs. 2387 10.2.6. Error Types Registry 2389 IANA is requested to create a new registry for errors, the "Error 2390 Types" registry. 2392 Requirements for this registry are Specification Required. 2394 This registry should have the following three fields: 2396 +============+========+===========+ 2397 | Field Name | Type | Reference | 2398 +============+========+===========+ 2399 | identifier | string | RFCXXXX | 2400 +------------+--------+-----------+ 2401 | meaning | string | RFCXXXX | 2402 +------------+--------+-----------+ 2403 | reference | string | RFCXXXX | 2404 +------------+--------+-----------+ 2406 Table 13 2408 The initial values are as follows, taken from the text above: 2410 +===================+===============================+===========+ 2411 | Identifier | Meaning | Reference | 2412 +===================+===============================+===========+ 2413 | malformed | The request could not be | RFCXXXX | 2414 | | parsed. | | 2415 +-------------------+-------------------------------+-----------+ 2416 | badSubmission | "submission" is neither a | RFCXXXX | 2417 | | valid certificate nor a valid | | 2418 | | precertificate | | 2419 +-------------------+-------------------------------+-----------+ 2420 | badType | "type" is neither 1 nor 2 | RFCXXXX | 2421 +-------------------+-------------------------------+-----------+ 2422 | badChain | The first element of "chain" | RFCXXXX | 2423 | | is not the certifier of the | | 2424 | | "submission", or the second | | 2425 | | element does not certify the | | 2426 | | first, etc. | | 2427 +-------------------+-------------------------------+-----------+ 2428 | badCertificate | One or more certificates in | RFCXXXX | 2429 | | the "chain" are not valid | | 2430 | | (e.g., not properly encoded) | | 2431 +-------------------+-------------------------------+-----------+ 2432 | unknownAnchor | The last element of "chain" | RFCXXXX | 2433 | | (or, if "chain" is an empty | | 2434 | | array, the "submission") both | | 2435 | | is not, and is not certified | | 2436 | | by, an accepted trust anchor | | 2437 +-------------------+-------------------------------+-----------+ 2438 | shutdown | The log is no longer | RFCXXXX | 2439 | | accepting submissions | | 2440 +-------------------+-------------------------------+-----------+ 2441 | firstUnknown | "first" is before the latest | RFCXXXX | 2442 | | known STH but is not from an | | 2443 | | existing STH. | | 2444 +-------------------+-------------------------------+-----------+ 2445 | secondUnknown | "second" is before the latest | RFCXXXX | 2446 | | known STH but is not from an | | 2447 | | existing STH. | | 2448 +-------------------+-------------------------------+-----------+ 2449 | secondBeforeFirst | "second" is smaller than | RFCXXXX | 2450 | | "first". | | 2451 +-------------------+-------------------------------+-----------+ 2452 | hashUnknown | "hash" is not the hash of a | RFCXXXX | 2453 | | known leaf (may be caused by | | 2454 | | skew or by a known | | 2455 | | certificate not yet merged). | | 2456 +-------------------+-------------------------------+-----------+ 2457 | treeSizeUnknown | "hash" is before the latest | RFCXXXX | 2458 | | known STH but is not from an | | 2459 | | existing STH. | | 2460 +-------------------+-------------------------------+-----------+ 2461 | startUnknown | "start" is greater than the | RFCXXXX | 2462 | | number of entries in the | | 2463 | | Merkle tree. | | 2464 +-------------------+-------------------------------+-----------+ 2465 | endBeforeStart | "start" cannot be greater | RFCXXXX | 2466 | | than "end". | | 2467 +-------------------+-------------------------------+-----------+ 2469 Table 14 2471 10.3. OID Assignment 2473 IANA is asked to assign one object identifier from the "SMI Security 2474 for PKIX Module Identifier" registry to identify the ASN.1 module in 2475 Appendix B of this document with an assigned Decimal value. 2477 +=========+=========================+============+ 2478 | Decimal | Description | References | 2479 +=========+=========================+============+ 2480 | TBD | id-mod-public-notary-v2 | RFCXXXX | 2481 +---------+-------------------------+------------+ 2483 Table 15 2485 11. Security Considerations 2487 With CAs, logs, and servers performing the actions described here, 2488 TLS clients can use logs and signed timestamps to reduce the 2489 likelihood that they will accept misissued certificates. If a server 2490 presents a valid signed timestamp for a certificate, then the client 2491 knows that a log has committed to publishing the certificate. From 2492 this, the client knows that monitors acting for the subject of the 2493 certificate have had some time to notice the misissuance and take 2494 some action, such as asking a CA to revoke a misissued certificate. 2495 A signed timestamp does not guarantee this though, since appropriate 2496 monitors might not have checked the logs or the CA might have refused 2497 to revoke the certificate. 2499 In addition, if TLS clients will not accept unlogged certificates, 2500 then site owners will have a greater incentive to submit certificates 2501 to logs, possibly with the assistance of their CA, increasing the 2502 overall transparency of the system. 2504 11.1. Misissued Certificates 2506 Misissued certificates that have not been publicly logged, and thus 2507 do not have a valid SCT, are not considered compliant. Misissued 2508 certificates that do have an SCT from a log will appear in that 2509 public log within the Maximum Merge Delay, assuming the log is 2510 operating correctly. Since a log is allowed to serve an STH of any 2511 age up to the MMD, the maximum period of time during which a 2512 misissued certificate can be used without being available for audit 2513 is twice the MMD. 2515 11.2. Detection of Misissue 2517 The logs do not themselves detect misissued certificates; they rely 2518 instead on interested parties, such as domain owners, to monitor them 2519 and take corrective action when a misissue is detected. 2521 11.3. Misbehaving Logs 2523 A log can misbehave in several ways. Examples include: failing to 2524 incorporate a certificate with an SCT in the Merkle Tree within the 2525 MMD; presenting different, conflicting views of the Merkle Tree at 2526 different times and/or to different parties; issuing STHs too 2527 frequently; mutating the signature of a logged certificate; and 2528 failing to present a chain containing the certifier of a logged 2529 certificate. 2531 Violation of the MMD contract is detected by log clients requesting a 2532 Merkle inclusion proof (Section 5.4) for each observed SCT. These 2533 checks can be asynchronous and need only be done once per 2534 certificate. However, note that there may be privacy concerns (see 2535 Section 8.1.4). 2537 Violation of the append-only property or the STH issuance rate limit 2538 can be detected by multiple clients comparing their instances of the 2539 STHs. This technique, known as "gossip," is an active area of 2540 research and not defined here. Proof of misbehavior in such cases 2541 would be: a series of STHs that were issued too closely together, 2542 proving violation of the STH issuance rate limit; or an STH with a 2543 root hash that does not match the one calculated from a copy of the 2544 log, proving violation of the append-only property. 2546 Clients that report back SCTs can be tracked or traced if a log 2547 produces multiple STHs or SCTs with the same timestamp and data but 2548 different signatures. Logs SHOULD mitigate this risk by either: 2550 * Using deterministic signature schemes, or 2551 * Producing no more than one SCT for each distinct submission and no 2552 more than one STH for each distinct tree_size. Each of these SCTs 2553 and STHs can be stored by the log and served to other clients that 2554 submit the same certificate or request the same STH. 2556 11.4. Multiple SCTs 2558 By requiring TLS servers to offer multiple SCTs, each from a 2559 different log, TLS clients reduce the effectiveness of an attack 2560 where a CA and a log collude (see Section 6.2). 2562 11.5. Leakage of DNS Information 2564 Malicious monitors can use logs to learn about the existence of 2565 domain names that might not otherwise be easy to discover. Some 2566 subdomain labels may reveal information about the service and 2567 software for which the subdomain is used, which in turn might 2568 facilitate targeted attacks. 2570 12. Acknowledgements 2572 The authors would like to thank Erwann Abelea, Robin Alden, Andrew 2573 Ayer, Richard Barnes, Al Cutter, David Drysdale, Francis Dupont, Adam 2574 Eijdenberg, Stephen Farrell, Daniel Kahn Gillmor, Paul Hadfield, Brad 2575 Hill, Jeff Hodges, Paul Hoffman, Jeffrey Hutzelman, Kat Joyce, 2576 Stephen Kent, SM, Alexey Melnikov, Linus Nordberg, Chris Palmer, 2577 Trevor Perrin, Pierre Phaneuf, Eric Rescorla, Rich Salz, Melinda 2578 Shore, Ryan Sleevi, Martin Smith, Carl Wallace and Paul Wouters for 2579 their valuable contributions. 2581 A big thank you to Symantec for kindly donating the OIDs from the 2582 1.3.101 arc that are used in this document. 2584 13. References 2586 13.1. Normative References 2588 [FIPS186-4] 2589 NIST, "FIPS PUB 186-4", 1 July 2013, 2590 . 2593 [HTML401] Raggett, D., Le Hors, A., and I. Jacobs, "HTML 4.01 2594 Specification", World Wide Web Consortium Recommendation 2595 REC-html401-19991224, 24 December 1999, 2596 . 2598 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2599 Requirement Levels", BCP 14, RFC 2119, 2600 DOI 10.17487/RFC2119, March 1997, 2601 . 2603 [RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An 2604 IETF URN Sub-namespace for Registered Protocol 2605 Parameters", BCP 73, RFC 3553, DOI 10.17487/RFC3553, June 2606 2003, . 2608 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2609 Resource Identifier (URI): Generic Syntax", STD 66, 2610 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2611 . 2613 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 2614 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 2615 . 2617 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 2618 (TLS) Protocol Version 1.2", RFC 5246, 2619 DOI 10.17487/RFC5246, August 2008, 2620 . 2622 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 2623 Housley, R., and W. Polk, "Internet X.509 Public Key 2624 Infrastructure Certificate and Certificate Revocation List 2625 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 2626 . 2628 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2629 RFC 5652, DOI 10.17487/RFC5652, September 2009, 2630 . 2632 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 2633 Extensions: Extension Definitions", RFC 6066, 2634 DOI 10.17487/RFC6066, January 2011, 2635 . 2637 [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms 2638 (SHA and SHA-based HMAC and HKDF)", RFC 6234, 2639 DOI 10.17487/RFC6234, May 2011, 2640 . 2642 [RFC6960] Santesson, S., Myers, M., Ankney, R., Malpani, A., 2643 Galperin, S., and C. Adams, "X.509 Internet Public Key 2644 Infrastructure Online Certificate Status Protocol - OCSP", 2645 RFC 6960, DOI 10.17487/RFC6960, June 2013, 2646 . 2648 [RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature 2649 Algorithm (DSA) and Elliptic Curve Digital Signature 2650 Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August 2651 2013, . 2653 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2654 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 2655 DOI 10.17487/RFC7231, June 2014, 2656 . 2658 [RFC7633] Hallam-Baker, P., "X.509v3 Transport Layer Security (TLS) 2659 Feature Extension", RFC 7633, DOI 10.17487/RFC7633, 2660 October 2015, . 2662 [RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP 2663 APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016, 2664 . 2666 [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital 2667 Signature Algorithm (EdDSA)", RFC 8032, 2668 DOI 10.17487/RFC8032, January 2017, 2669 . 2671 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2672 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2673 May 2017, . 2675 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2676 Interchange Format", STD 90, RFC 8259, 2677 DOI 10.17487/RFC8259, December 2017, 2678 . 2680 [RFC8391] Huelsing, A., Butin, D., Gazdag, S., Rijneveld, J., and A. 2681 Mohaisen, "XMSS: eXtended Merkle Signature Scheme", 2682 RFC 8391, DOI 10.17487/RFC8391, May 2018, 2683 . 2685 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 2686 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 2687 . 2689 [UNIXTIME] IEEE, "The Open Group Base Specifications Issue 7 IEEE Std 2690 1003.1-2008, 2016 Edition", n.d., 2691 . 2695 [X690] ITU-T, "Information technology - ASN.1 encoding Rules: 2696 Specification of Basic Encoding Rules (BER), Canonical 2697 Encoding Rules (CER) and Distinguished Encoding Rules 2698 (DER)", ISO/IEC 8825-1:2002, November 2015. 2700 13.2. Informative References 2702 [CABBR] CA/Browser Forum, "Baseline Requirements for the Issuance 2703 and Management of Publicly-Trusted Certificates", 2020, 2704 . 2707 [Chromium.Log.Policy] 2708 The Chromium Projects, "Chromium Certificate Transparency 2709 Log Policy", 2014, . 2712 [Chromium.Policy] 2713 The Chromium Projects, "Chromium Certificate 2714 Transparency", 2014, . 2717 [CrosbyWallach] 2718 Crosby, S. and D. Wallach, "Efficient Data Structures for 2719 Tamper-Evident Logging", Proceedings of the 18th USENIX 2720 Security Symposium, Montreal, August 2009, 2721 . 2724 [JSON.Metadata] 2725 The Chromium Projects, "Chromium Log Metadata JSON 2726 Schema", 2014, . 2729 [RFC6962] Laurie, B., Langley, A., and E. Kasper, "Certificate 2730 Transparency", RFC 6962, DOI 10.17487/RFC6962, June 2013, 2731 . 2733 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2734 Writing an IANA Considerations Section in RFCs", BCP 26, 2735 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2736 . 2738 [RFC8820] Nottingham, M., "URI Design and Ownership", BCP 190, 2739 RFC 8820, DOI 10.17487/RFC8820, June 2020, 2740 . 2742 Appendix A. Supporting v1 and v2 simultaneously (Informative) 2744 Certificate Transparency logs have to be either v1 (conforming to 2745 [RFC6962]) or v2 (conforming to this document), as the data 2746 structures are incompatible and so a v2 log could not issue a valid 2747 v1 SCT. 2749 CT clients, however, can support v1 and v2 SCTs, for the same 2750 certificate, simultaneously, as v1 SCTs are delivered in different 2751 TLS, X.509 and OCSP extensions than v2 SCTs. 2753 v1 and v2 SCTs for X.509 certificates can be validated independently. 2754 For precertificates, v2 SCTs should be embedded in the TBSCertificate 2755 before submission of the TBSCertificate (inside a v1 precertificate, 2756 as described in Section 3.1. of [RFC6962]) to a v1 log so that TLS 2757 clients conforming to [RFC6962] but not this document are oblivious 2758 to the embedded v2 SCTs. An issuer can follow these steps to produce 2759 an X.509 certificate with embedded v1 and v2 SCTs: 2761 * Create a CMS precertificate as described in Section 3.2 and submit 2762 it to v2 logs. 2764 * Embed the obtained v2 SCTs in the TBSCertificate, as described in 2765 Section 7.1.2. 2767 * Use that TBSCertificate to create a v1 precertificate, as 2768 described in Section 3.1. of [RFC6962] and submit it to v1 logs. 2770 * Embed the v1 SCTs in the TBSCertificate, as described in 2771 Section 3.3 of [RFC6962]. 2773 * Sign that TBSCertificate (which now contains v1 and v2 SCTs) to 2774 issue the final X.509 certificate. 2776 Appendix B. An ASN.1 Module (Informative) 2778 The following ASN.1 module may be useful to implementors. 2780 CertificateTransparencyV2Module-2021 2781 -- { id-mod-public-notary-v2 from above, in 2782 iso(1) identified-organization(3) ... 2783 form } 2784 DEFINITIONS IMPLICIT TAGS ::= BEGIN 2785 -- EXPORTS ALL -- 2787 IMPORTS 2788 EXTENSION 2789 FROM PKIX-CommonTypes-2009 -- RFC 5912 2790 { iso(1) identified-organization(3) dod(6) internet(1) 2791 security(5) mechanisms(5) pkix(7) id-mod(0) 2792 id-mod-pkixCommon-02(57) } 2794 CONTENT-TYPE 2795 FROM CryptographicMessageSyntax-2010 -- RFC 6268 2796 { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 2797 pkcs-9(9) smime(16) modules(0) id-mod-cms-2009(58) } 2799 TBSCertificate 2800 FROM PKIX1Explicit-2009 -- RFC 5912 2801 { iso(1) identified-organization(3) dod(6) internet(1) 2802 security(5) mechanisms(5) pkix(7) id-mod(0) 2803 id-mod-pkix1-explicit-02(51) } 2804 ; 2806 -- 2807 -- Section 3.2. Precertificates 2808 -- 2810 ct-tbsCertificate CONTENT-TYPE ::= { 2811 TYPE TBSCertificate 2812 IDENTIFIED BY id-ct-tbsCertificate } 2814 id-ct-tbsCertificate OBJECT IDENTIFIER ::= { 1 3 101 78 } 2816 -- 2817 -- Section 7.1. Transparency Information X.509v3 Extension 2818 -- 2820 ext-transparencyInfo EXTENSION ::= { 2821 SYNTAX TransparencyInformationSyntax 2822 IDENTIFIED BY id-ce-transparencyInfo 2823 CRITICALITY { FALSE } } 2825 id-ce-transparencyInfo OBJECT IDENTIFIER ::= { 1 3 101 75 } 2827 TransparencyInformationSyntax ::= OCTET STRING 2829 -- 2830 -- Section 7.1.1. OCSP Response Extension 2831 -- 2832 ext-ocsp-transparencyInfo EXTENSION ::= { 2833 SYNTAX TransparencyInformationSyntax 2834 IDENTIFIED BY id-pkix-ocsp-transparencyInfo 2835 CRITICALITY { FALSE } } 2837 id-pkix-ocsp-transparencyInfo OBJECT IDENTIFIER ::= 2838 id-ce-transparencyInfo 2840 -- 2841 -- Section 8.1.2. Reconstructing the TBSCertificate 2842 -- 2844 ext-embeddedSCT-CTv1 EXTENSION ::= { 2845 SYNTAX SignedCertificateTimestampList 2846 IDENTIFIED BY id-ce-embeddedSCT-CTv1 2847 CRITICALITY { FALSE } } 2849 id-ce-embeddedSCT-CTv1 OBJECT IDENTIFIER ::= { 2850 1 3 6 1 4 1 11129 2 4 2 } 2852 SignedCertificateTimestampList ::= OCTET STRING 2854 END 2856 Authors' Addresses 2858 Ben Laurie 2859 Google UK Ltd. 2861 Email: benl@google.com 2863 Adam Langley 2864 Google Inc. 2866 Email: agl@google.com 2868 Emilia Kasper 2869 Google Switzerland GmbH 2871 Email: ekasper@google.com 2873 Eran Messeri 2874 Google UK Ltd. 2876 Email: eranm@google.com 2877 Rob Stradling 2878 Sectigo Ltd. 2880 Email: rob@sectigo.com