idnits 2.17.1 draft-ietf-trans-rfc6962-bis-00.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 : ---------------------------------------------------------------------------- ** The document seems to lack an Introduction section. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (February 19, 2014) is 3717 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 229 -- Looks like a reference, but probably isn't: '7' on line 355 -- Looks like a reference, but probably isn't: '32' on line 725 -- Obsolete informational reference (is this intentional?): RFC 2560 (Obsoleted by RFC 6960) -- Obsolete informational reference (is this intentional?): RFC 3447 (Obsoleted by RFC 8017) -- Obsolete informational reference (is this intentional?): RFC 4627 (Obsoleted by RFC 7158, RFC 7159) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Public Notary Transparency Working Group B. Laurie 3 Internet-Draft A. Langley 4 Intended status: Standards Track E. Kasper 5 Expires: August 23, 2014 Google 6 R. Stradling 7 Comodo 8 February 19, 2014 10 Certificate Transparency 11 draft-ietf-trans-rfc6962-bis-00 13 Abstract 15 This document describes an experimental protocol for publicly logging 16 the existence of Transport Layer Security (TLS) certificates as they 17 are issued or observed, in a manner that allows anyone to audit 18 certificate authority (CA) activity and notice the issuance of 19 suspect certificates as well as to audit the certificate logs 20 themselves. The intent is that eventually clients would refuse to 21 honor certificates that do not appear in a log, effectively forcing 22 CAs to add all issued certificates to the logs. 24 Logs are network services that implement the protocol operations for 25 submissions and queries that are defined in this document. 27 Status of This Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at http://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on August 23, 2014. 44 Copyright Notice 46 Copyright (c) 2014 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (http://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. Code Components extracted from this document must 55 include Simplified BSD License text as described in Section 4.e of 56 the Trust Legal Provisions and are provided without warranty as 57 described in the Simplified BSD License. 59 Table of Contents 61 1. Informal Introduction . . . . . . . . . . . . . . . . . . . . 3 62 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 4 63 1.2. Data Structures . . . . . . . . . . . . . . . . . . . . . 4 64 2. Cryptographic Components . . . . . . . . . . . . . . . . . . 4 65 2.1. Merkle Hash Trees . . . . . . . . . . . . . . . . . . . . 4 66 2.1.1. Merkle Audit Paths . . . . . . . . . . . . . . . . . 5 67 2.1.2. Merkle Consistency Proofs . . . . . . . . . . . . . . 6 68 2.1.3. Example . . . . . . . . . . . . . . . . . . . . . . . 7 69 2.1.4. Signatures . . . . . . . . . . . . . . . . . . . . . 8 70 3. Log Format and Operation . . . . . . . . . . . . . . . . . . 9 71 3.1. Log Entries . . . . . . . . . . . . . . . . . . . . . . . 9 72 3.2. Structure of the Signed Certificate Timestamp . . . . . . 12 73 3.3. Including the Signed Certificate Timestamp in the TLS 74 Handshake . . . . . . . . . . . . . . . . . . . . . . . . 13 75 3.3.1. TLS Extension . . . . . . . . . . . . . . . . . . . . 15 76 3.4. Merkle Tree . . . . . . . . . . . . . . . . . . . . . . . 15 77 3.5. Signed Tree Head . . . . . . . . . . . . . . . . . . . . 16 78 4. Log Client Messages . . . . . . . . . . . . . . . . . . . . . 17 79 4.1. Add Chain to Log . . . . . . . . . . . . . . . . . . . . 17 80 4.2. Add PreCertChain to Log . . . . . . . . . . . . . . . . . 18 81 4.3. Retrieve Latest Signed Tree Head . . . . . . . . . . . . 18 82 4.4. Retrieve Merkle Consistency Proof between Two Signed Tree 83 Heads . . . . . . . . . . . . . . . . . . . . . . . . . . 19 84 4.5. Retrieve Merkle Audit Proof from Log by Leaf Hash . . . . 19 85 4.6. Retrieve Entries from Log . . . . . . . . . . . . . . . . 20 86 4.7. Retrieve Accepted Root Certificates . . . . . . . . . . . 21 87 4.8. Retrieve Entry+Merkle Audit Proof from Log . . . . . . . 21 88 5. Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 89 5.1. Submitters . . . . . . . . . . . . . . . . . . . . . . . 22 90 5.2. TLS Client . . . . . . . . . . . . . . . . . . . . . . . 22 91 5.3. Monitor . . . . . . . . . . . . . . . . . . . . . . . . . 22 92 5.4. Auditor . . . . . . . . . . . . . . . . . . . . . . . . . 23 93 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 94 7. Security Considerations . . . . . . . . . . . . . . . . . . . 24 95 7.1. Misissued Certificates . . . . . . . . . . . . . . . . . 24 96 7.2. Detection of Misissue . . . . . . . . . . . . . . . . . . 24 97 7.3. Misbehaving Logs . . . . . . . . . . . . . . . . . . . . 24 98 8. Efficiency Considerations . . . . . . . . . . . . . . . . . . 25 99 9. Future Changes . . . . . . . . . . . . . . . . . . . . . . . 25 100 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 25 101 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 26 102 11.1. Normative Reference . . . . . . . . . . . . . . . . . . 26 103 11.2. Informative References . . . . . . . . . . . . . . . . . 26 105 1. Informal Introduction 107 Certificate transparency aims to mitigate the problem of misissued 108 certificates by providing publicly auditable, append-only, untrusted 109 logs of all issued certificates. The logs are publicly auditable so 110 that it is possible for anyone to verify the correctness of each log 111 and to monitor when new certificates are added to it. The logs do 112 not themselves prevent misissue, but they ensure that interested 113 parties (particularly those named in certificates) can detect such 114 misissuance. Note that this is a general mechanism, but in this 115 document, we only describe its use for public TLS server certificates 116 issued by public certificate authorities (CAs). 118 Each log consists of certificate chains, which can be submitted by 119 anyone. It is expected that public CAs will contribute all their 120 newly issued certificates to one or more logs; it is also expected 121 that certificate holders will contribute their own certificate 122 chains. In order to avoid logs being spammed into uselessness, it is 123 required that each chain is rooted in a known CA certificate. When a 124 chain is submitted to a log, a signed timestamp is returned, which 125 can later be used to provide evidence to clients that the chain has 126 been submitted. TLS clients can thus require that all certificates 127 they see have been logged. 129 Those who are concerned about misissue can monitor the logs, asking 130 them regularly for all new entries, and can thus check whether 131 domains they are responsible for have had certificates issued that 132 they did not expect. What they do with this information, 133 particularly when they find that a misissuance has happened, is 134 beyond the scope of this document, but broadly speaking, they can 135 invoke existing business mechanisms for dealing with misissued 136 certificates. Of course, anyone who wants can monitor the logs and, 137 if they believe a certificate is incorrectly issued, take action as 138 they see fit. 140 Similarly, those who have seen signed timestamps from a particular 141 log can later demand a proof of inclusion from that log. If the log 142 is unable to provide this (or, indeed, if the corresponding 143 certificate is absent from monitors' copies of that log), that is 144 evidence of the incorrect operation of the log. The checking 145 operation is asynchronous to allow TLS connections to proceed without 146 delay, despite network connectivity issues and the vagaries of 147 firewalls. 149 The append-only property of each log is technically achieved using 150 Merkle Trees, which can be used to show that any particular version 151 of the log is a superset of any particular previous version. 152 Likewise, Merkle Trees avoid the need to blindly trust logs: if a log 153 attempts to show different things to different people, this can be 154 efficiently detected by comparing tree roots and consistency proofs. 155 Similarly, other misbehaviors of any log (e.g., issuing signed 156 timestamps for certificates they then don't log) can be efficiently 157 detected and proved to the world at large. 159 1.1. Requirements Language 161 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 162 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 163 document are to be interpreted as described in RFC 2119 [RFC2119]. 165 1.2. Data Structures 167 Data structures are defined according to the conventions laid out in 168 Section 4 of [RFC5246]. 170 2. Cryptographic Components 172 2.1. Merkle Hash Trees 174 Logs use a binary Merkle Hash Tree for efficient auditing. The 175 hashing algorithm is SHA-256 [FIPS.180-4] (note that this is fixed 176 for this experiment, but it is anticipated that each log would be 177 able to specify a hash algorithm). The input to the Merkle Tree Hash 178 is a list of data entries; these entries will be hashed to form the 179 leaves of the Merkle Hash Tree. The output is a single 32-byte 180 Merkle Tree Hash. Given an ordered list of n inputs, D[n] = {d(0), 181 d(1), ..., d(n-1)}, the Merkle Tree Hash (MTH) is thus defined as 182 follows: 184 The hash of an empty list is the hash of an empty string: 186 MTH({}) = SHA-256(). 188 The hash of a list with one entry (also known as a leaf hash) is: 190 MTH({d(0)}) = SHA-256(0x00 || d(0)). 192 For n > 1, let k be the largest power of two smaller than n (i.e., k 193 < n <= 2k). The Merkle Tree Hash of an n-element list D[n] is then 194 defined recursively as 196 MTH(D[n]) = SHA-256(0x01 || MTH(D[0:k]) || MTH(D[k:n])), 198 where || is concatenation and D[k1:k2] denotes the list {d(k1), 199 d(k1+1),..., d(k2-1)} of length (k2 - k1). (Note that the hash 200 calculations for leaves and nodes differ. This domain separation is 201 required to give second preimage resistance.) 203 Note that we do not require the length of the input list to be a 204 power of two. The resulting Merkle Tree may thus not be balanced; 205 however, its shape is uniquely determined by the number of leaves. 206 (Note: This Merkle Tree is essentially the same as the history tree 207 [CrosbyWallach] proposal, except our definition handles non-full 208 trees differently.) 210 2.1.1. Merkle Audit Paths 212 A Merkle audit path for a leaf in a Merkle Hash Tree is the shortest 213 list of additional nodes in the Merkle Tree required to compute the 214 Merkle Tree Hash for that tree. Each node in the tree is either a 215 leaf node or is computed from the two nodes immediately below it 216 (i.e., towards the leaves). At each step up the tree (towards the 217 root), a node from the audit path is combined with the node computed 218 so far. In other words, the audit path consists of the list of 219 missing nodes required to compute the nodes leading from a leaf to 220 the root of the tree. If the root computed from the audit path 221 matches the true root, then the audit path is proof that the leaf 222 exists in the tree. 224 Given an ordered list of n inputs to the tree, D[n] = {d(0), ..., 225 d(n-1)}, the Merkle audit path PATH(m, D[n]) for the (m+1)th input 226 d(m), 0 <= m < n, is defined as follows: 228 The path for the single leaf in a tree with a one-element input list 229 D[1] = {d(0)} is empty: 231 PATH(0, {d(0)}) = {} 233 For n > 1, let k be the largest power of two smaller than n. The path 234 for the (m+1)th element d(m) in a list of n > m elements is then 235 defined recursively as 237 PATH(m, D[n]) = PATH(m, D[0:k]) : MTH(D[k:n]) for m < k; and 239 PATH(m, D[n]) = PATH(m - k, D[k:n]) : MTH(D[0:k]) for m >= k, 240 where : is concatenation of lists and D[k1:k2] denotes the length (k2 241 - k1) list {d(k1), d(k1+1),..., d(k2-1)} as before. 243 2.1.2. Merkle Consistency Proofs 245 Merkle consistency proofs prove the append-only property of the tree. 246 A Merkle consistency proof for a Merkle Tree Hash MTH(D[n]) and a 247 previously advertised hash MTH(D[0:m]) of the first m leaves, m <= n, 248 is the list of nodes in the Merkle Tree required to verify that the 249 first m inputs D[0:m] are equal in both trees. Thus, a consistency 250 proof must contain a set of intermediate nodes (i.e., commitments to 251 inputs) sufficient to verify MTH(D[n]), such that (a subset of) the 252 same nodes can be used to verify MTH(D[0:m]). We define an algorithm 253 that outputs the (unique) minimal consistency proof. 255 Given an ordered list of n inputs to the tree, D[n] = {d(0), ..., 256 d(n-1)}, the Merkle consistency proof PROOF(m, D[n]) for a previous 257 Merkle Tree Hash MTH(D[0:m]), 0 < m < n, is defined as: 259 PROOF(m, D[n]) = SUBPROOF(m, D[n], true) 261 The subproof for m = n is empty if m is the value for which PROOF was 262 originally requested (meaning that the subtree Merkle Tree Hash 263 MTH(D[0:m]) is known): 265 SUBPROOF(m, D[m], true) = {} 267 The subproof for m = n is the Merkle Tree Hash committing inputs 268 D[0:m]; otherwise: 270 SUBPROOF(m, D[m], false) = {MTH(D[m])} 272 For m < n, let k be the largest power of two smaller than n. The 273 subproof is then defined recursively. 275 If m <= k, the right subtree entries D[k:n] only exist in the current 276 tree. We prove that the left subtree entries D[0:k] are consistent 277 and add a commitment to D[k:n]: 279 SUBPROOF(m, D[n], b) = SUBPROOF(m, D[0:k], b) : MTH(D[k:n]) 281 If m > k, the left subtree entries D[0:k] are identical in both 282 trees. We prove that the right subtree entries D[k:n] are consistent 283 and add a commitment to D[0:k]. 285 SUBPROOF(m, D[n], b) = SUBPROOF(m - k, D[k:n], false) : MTH(D[0:k]) 286 Here, : is a concatenation of lists, and D[k1:k2] denotes the length 287 (k2 - k1) list {d(k1), d(k1+1),..., d(k2-1)} as before. 289 The number of nodes in the resulting proof is bounded above by 290 ceil(log2(n)) + 1. 292 2.1.3. Example 294 The binary Merkle Tree with 7 leaves: 296 hash 297 / \ 298 / \ 299 / \ 300 / \ 301 / \ 302 k l 303 / \ / \ 304 / \ / \ 305 / \ / \ 306 g h i j 307 / \ / \ / \ | 308 a b c d e f d6 309 | | | | | | 310 d0 d1 d2 d3 d4 d5 312 The audit path for d0 is [b, h, l]. 314 The audit path for d3 is [c, g, l]. 316 The audit path for d4 is [f, j, k]. 318 The audit path for d6 is [i, k]. 320 The same tree, built incrementally in four steps: 322 hash0 hash1=k 323 / \ / \ 324 / \ / \ 325 / \ / \ 326 g c g h 327 / \ | / \ / \ 328 a b d2 a b c d 329 | | | | | | 330 d0 d1 d0 d1 d2 d3 332 hash2 hash 333 / \ / \ 334 / \ / \ 335 / \ / \ 336 / \ / \ 337 / \ / \ 338 k i k l 339 / \ / \ / \ / \ 340 / \ e f / \ / \ 341 / \ | | / \ / \ 342 g h d4 d5 g h i j 343 / \ / \ / \ / \ / \ | 344 a b c d a b c d e f d6 345 | | | | | | | | | | 346 d0 d1 d2 d3 d0 d1 d2 d3 d4 d5 348 The consistency proof between hash0 and hash is PROOF(3, D[7]) = [c, 349 d, g, l]. c, g are used to verify hash0, and d, l are additionally 350 used to show hash is consistent with hash0. 352 The consistency proof between hash1 and hash is PROOF(4, D[7]) = [l]. 353 hash can be verified using hash1=k and l. 355 The consistency proof between hash2 and hash is PROOF(6, D[7]) = [i, 356 j, k]. k, i are used to verify hash2, and j is additionally used to 357 show hash is consistent with hash2. 359 2.1.4. Signatures 361 Various data structures are signed. A log MUST use either elliptic 362 curve signatures using the NIST P-256 curve (Section D.1.2.3 of the 363 Digital Signature Standard [DSS]) or RSA signatures (RSASSA- 364 PKCS1-V1_5 with SHA-256, Section 8.2 of [RFC3447]) using a key of at 365 least 2048 bits. 367 3. Log Format and Operation 369 Anyone can submit certificates to certificate logs for public 370 auditing; however, since certificates will not be accepted by TLS 371 clients unless logged, it is expected that certificate owners or 372 their CAs will usually submit them. A log is a single, ever-growing, 373 append-only Merkle Tree of such certificates. 375 When a valid certificate is submitted to a log, the log MUST 376 immediately return a Signed Certificate Timestamp (SCT). The SCT is 377 the log's promise to incorporate the certificate in the Merkle Tree 378 within a fixed amount of time known as the Maximum Merge Delay (MMD). 379 If the log has previously seen the certificate, it MAY return the 380 same SCT as it returned before. TLS servers MUST present an SCT from 381 one or more logs to the TLS client together with the certificate. 382 TLS clients MUST reject certificates that do not have a valid SCT for 383 the end-entity certificate. 385 Periodically, each log appends all its new entries to the Merkle Tree 386 and signs the root of the tree. The log MUST incorporate a 387 certificate in its Merkle Tree within the Maximum Merge Delay period 388 after the issuance of the SCT. When encountering an SCT, an Auditor 389 can verify that the certificate was added to the Merkle Tree within 390 that timeframe. 392 Log operators MUST NOT impose any conditions on retrieving or sharing 393 data from the log. 395 3.1. Log Entries 397 Anyone can submit a certificate to any log. In order to enable 398 attribution of each logged certificate to its issuer, the log SHALL 399 publish a list of acceptable root certificates (this list might 400 usefully be the union of root certificates trusted by major browser 401 vendors). Each submitted certificate MUST be accompanied by all 402 additional certificates required to verify the certificate chain up 403 to an accepted root certificate. The root certificate itself MAY be 404 omitted from the chain submitted to the log server. 406 Alternatively, (root as well as intermediate) certificate authorities 407 may submit a certificate to logs prior to issuance in order to 408 incorporate the SCT in the issued certificate. To do so, the CA 409 submits a Precertificate that the log can use to create an entry that 410 will be valid against the issued certificate. The Precertificate is 411 an X.509v3 certificate for simplicity, but, since it isn't used for 412 anything but logging, could equally be some other data structure. 413 The Precertificate is constructed from the certificate to be issued 414 by adding a special critical poison extension (OID 415 1.3.6.1.4.1.11129.2.4.3, whose extnValue OCTET STRING contains ASN.1 416 NULL data (0x05 0x00)) to the end-entity TBSCertificate, minus the 417 SCT extension, which is obviously unknown until after the 418 Precertificate has been submitted to the log. The poison extension 419 is to ensure that the Precertificate cannot be validated by a 420 standard X.509v3 client. The resulting TBSCertificate [RFC5280] is 421 then signed with either 423 o a special-purpose (CA:true, Extended Key Usage: Certificate 424 Transparency, OID 1.3.6.1.4.1.11129.2.4.4) Precertificate Signing 425 Certificate. The Precertificate Signing Certificate MUST be 426 directly certified by the (root or intermediate) CA certificate 427 that will ultimately sign the end-entity TBSCertificate yielding 428 the end-entity certificate (note that the log may relax standard 429 validation rules to allow this, so long as the issued certificate 430 will be valid), 432 o or, the CA certificate that will sign the final certificate. 434 As above, the Precertificate submission MUST be accompanied by the 435 Precertificate Signing Certificate, if used, and all additional 436 certificates required to verify the chain up to an accepted root 437 certificate. The signature on the TBSCertificate indicates the 438 certificate authority's intent to issue a certificate. This intent 439 is considered binding (i.e., misissuance of the Precertificate is 440 considered equal to misissuance of the final certificate). Each log 441 verifies the Precertificate signature chain and issues a Signed 442 Certificate Timestamp on the corresponding TBSCertificate. 444 Logs MUST verify that the submitted end-entity certificate or 445 Precertificate has a valid signature chain leading back to a trusted 446 root CA certificate, using the chain of intermediate CA certificates 447 provided by the submitter. Logs MAY accept certificates that have 448 expired, are not yet valid, have been revoked, or are otherwise not 449 fully valid according to X.509 verification rules in order to 450 accommodate quirks of CA certificate-issuing software. However, logs 451 MUST refuse to publish certificates without a valid chain to a known 452 root CA. If a certificate is accepted and an SCT issued, the 453 accepting log MUST store the entire chain used for verification, 454 including the certificate or Precertificate itself and including the 455 root certificate used to verify the chain (even if it was omitted 456 from the submission), and MUST present this chain for auditing upon 457 request. This chain is required to prevent a CA from avoiding blame 458 by logging a partial or empty chain. (Note: This effectively 459 excludes self-signed and DANE-based certificates until some mechanism 460 to control spam for those certificates is found. The authors welcome 461 suggestions.) 462 Each certificate entry in a log MUST include the following 463 components: 465 enum { x509_entry(0), precert_entry(1), (65535) } LogEntryType; 467 struct { 468 LogEntryType entry_type; 469 select (entry_type) { 470 case x509_entry: X509ChainEntry; 471 case precert_entry: PrecertChainEntry; 472 } entry; 473 } LogEntry; 475 opaque ASN.1Cert<1..2^24-1>; 477 struct { 478 ASN.1Cert leaf_certificate; 479 ASN.1Cert certificate_chain<0..2^24-1>; 480 } X509ChainEntry; 482 struct { 483 ASN.1Cert pre_certificate; 484 ASN.1Cert precertificate_chain<0..2^24-1>; 485 } PrecertChainEntry; 487 Logs MAY limit the length of chain they will accept. 489 "entry_type" is the type of this entry. Future revisions of this 490 protocol version may add new LogEntryType values. Section 4 explains 491 how clients should handle unknown entry types. 493 "leaf_certificate" is the end-entity certificate submitted for 494 auditing. 496 "certificate_chain" is a chain of additional certificates required to 497 verify the end-entity certificate. The first certificate MUST 498 certify the end-entity certificate. Each following certificate MUST 499 directly certify the one preceding it. The final certificate MUST be 500 a root certificate accepted by the log. 502 "pre_certificate" is the Precertificate submitted for auditing. 504 "precertificate_chain" is a chain of additional certificates required 505 to verify the Precertificate submission. The first certificate MAY 506 be a valid Precertificate Signing Certificate and MUST certify the 507 first certificate. Each following certificate MUST directly certify 508 the one preceding it. The final certificate MUST be a root 509 certificate accepted by the log. 511 3.2. Structure of the Signed Certificate Timestamp 513 enum { certificate_timestamp(0), tree_hash(1), (255) } 514 SignatureType; 516 enum { v1(0), (255) } 517 Version; 519 struct { 520 opaque key_id[32]; 521 } LogID; 523 opaque TBSCertificate<1..2^24-1>; 525 struct { 526 opaque issuer_key_hash[32]; 527 TBSCertificate tbs_certificate; 528 } PreCert; 530 opaque CtExtensions<0..2^16-1>; 532 "key_id" is the SHA-256 hash of the log's public key, calculated over 533 the DER encoding of the key represented as SubjectPublicKeyInfo. 535 "issuer_key_hash" is the SHA-256 hash of the certificate issuer's 536 public key, calculated over the DER encoding of the key represented 537 as SubjectPublicKeyInfo. This is needed to bind the issuer to the 538 final certificate. 540 "tbs_certificate" is the DER-encoded TBSCertificate (see [RFC5280]) 541 component of the Precertificate -- that is, without the signature and 542 the poison extension. If the Precertificate is not signed with the 543 CA certificate that will issue the final certificate, then the 544 TBSCertificate also has its issuer changed to that of the CA that 545 will issue the final certificate. Note that it is also possible to 546 reconstruct this TBSCertificate from the final certificate by 547 extracting the TBSCertificate from it and deleting the SCT extension. 548 Also note that since the TBSCertificate contains an 549 AlgorithmIdentifier that must match both the Precertificate signature 550 algorithm and final certificate signature algorithm, they must be 551 signed with the same algorithm and parameters. If the Precertificate 552 is issued using a Precertificate Signing Certificate and an Authority 553 Key Identifier extension is present in the TBSCertificate, the 554 corresponding extension must also be present in the Precertificate 555 Signing Certificate -- in this case, the TBSCertificate also has its 556 Authority Key Identifier changed to match the final issuer. 558 struct { 559 Version sct_version; 560 LogID id; 561 uint64 timestamp; 562 CtExtensions extensions; 563 digitally-signed struct { 564 Version sct_version; 565 SignatureType signature_type = certificate_timestamp; 566 uint64 timestamp; 567 LogEntryType entry_type; 568 select(entry_type) { 569 case x509_entry: ASN.1Cert; 570 case precert_entry: PreCert; 571 } signed_entry; 572 CtExtensions extensions; 573 }; 574 } SignedCertificateTimestamp; 576 The encoding of the digitally-signed element is defined in [RFC5246]. 578 "sct_version" is the version of the protocol to which the SCT 579 conforms. This version is v1. 581 "timestamp" is the current NTP Time [RFC5905], measured since the 582 epoch (January 1, 1970, 00:00), ignoring leap seconds, in 583 milliseconds. 585 "entry_type" may be implicit from the context in which the SCT is 586 presented. 588 "signed_entry" is the "leaf_certificate" (in the case of an 589 X509ChainEntry) or is the PreCert (in the case of a 590 PrecertChainEntry), as described above. 592 "extensions" are future extensions to this protocol version (v1). 593 Currently, no extensions are specified. 595 3.3. Including the Signed Certificate Timestamp in the TLS Handshake 597 The SCT data corresponding to the end-entity certificate from at 598 least one log must be included in the TLS handshake, either by using 599 an X509v3 certificate extension as described below, by using a TLS 600 extension (Section 7.4.1.4 of [RFC5246]) with type 601 "signed_certificate_timestamp", or by using Online Certificate Status 602 Protocol (OCSP) Stapling (also known as the "Certificate Status 603 Request" TLS extension; see [RFC6066]), where the OCSP response 604 includes an extension with OID 1.3.6.1.4.1.11129.2.4.5 (see 605 [RFC2560]) and body: 607 SignedCertificateTimestampList ::= OCTET STRING 609 in the singleExtensions component of the SingleResponse pertaining to 610 the end-entity certificate. 612 At least one SCT MUST be included. Server operators MAY include more 613 than one SCT. 615 Similarly, a certificate authority MAY submit a Precertificate to 616 more than one log, and all obtained SCTs can be directly embedded in 617 the final certificate, by encoding the SignedCertificateTimestampList 618 structure as an ASN.1 OCTET STRING and inserting the resulting data 619 in the TBSCertificate as an X.509v3 certificate extension (OID 620 1.3.6.1.4.1.11129.2.4.2). Upon receiving the certificate, clients 621 can reconstruct the original TBSCertificate to verify the SCT 622 signature. 624 The contents of the ASN.1 OCTET STRING embedded in an OCSP extension 625 or X509v3 certificate extension are as follows: 627 opaque SerializedSCT<1..2^16-1>; 629 struct { 630 SerializedSCT sct_list <1..2^16-1>; 631 } SignedCertificateTimestampList; 633 Here, "SerializedSCT" is an opaque byte string that contains the 634 serialized TLS structure. This encoding ensures that TLS clients can 635 decode each SCT individually (i.e., if there is a version upgrade, 636 out-of-date clients can still parse old SCTs while skipping over new 637 SCTs whose versions they don't understand). 639 Likewise, SCTs can be embedded in a TLS extension. See below for 640 details. 642 TLS clients MUST implement all three mechanisms. Servers MUST 643 implement at least one of the three mechanisms. Note that existing 644 TLS servers can generally use the certificate extension mechanism 645 without modification. 647 TLS servers should send SCTs from multiple logs in case one or more 648 logs are not acceptable to the client (for example, if a log has been 649 struck off for misbehavior or has had a key compromise). 651 3.3.1. TLS Extension 653 The SCT can be sent during the TLS handshake using a TLS extension 654 with type "signed_certificate_timestamp". 656 Clients that support the extension SHOULD send a ClientHello 657 extension with the appropriate type and empty "extension_data". 659 Servers MUST only send SCTs to clients who have indicated support for 660 the extension in the ClientHello, in which case the SCTs are sent by 661 setting the "extension_data" to a "SignedCertificateTimestampList". 663 Session resumption uses the original session information: clients 664 SHOULD include the extension type in the ClientHello, but if the 665 session is resumed, the server is not expected to process it or 666 include the extension in the ServerHello. 668 3.4. Merkle Tree 670 The hashing algorithm for the Merkle Tree Hash is SHA-256. 672 Structure of the Merkle Tree input: 674 enum { timestamped_entry(0), (255) } 675 MerkleLeafType; 677 struct { 678 uint64 timestamp; 679 LogEntryType entry_type; 680 select(entry_type) { 681 case x509_entry: ASN.1Cert; 682 case precert_entry: PreCert; 683 } signed_entry; 684 CtExtensions extensions; 685 } TimestampedEntry; 687 struct { 688 Version version; 689 MerkleLeafType leaf_type; 690 select (leaf_type) { 691 case timestamped_entry: TimestampedEntry; 692 } 693 } MerkleTreeLeaf; 695 Here, "version" is the version of the protocol to which the 696 MerkleTreeLeaf corresponds. This version is v1. 698 "leaf_type" is the type of the leaf input. Currently, only 699 "timestamped_entry" (corresponding to an SCT) is defined. Future 700 revisions of this protocol version may add new MerkleLeafType types. 701 Section 4 explains how clients should handle unknown leaf types. 703 "timestamp" is the timestamp of the corresponding SCT issued for this 704 certificate. 706 "signed_entry" is the "signed_entry" of the corresponding SCT. 708 "extensions" are "extensions" of the corresponding SCT. 710 The leaves of the Merkle Tree are the leaf hashes of the 711 corresponding "MerkleTreeLeaf" structures. 713 3.5. Signed Tree Head 715 Every time a log appends new entries to the tree, the log SHOULD sign 716 the corresponding tree hash and tree information (see the 717 corresponding Signed Tree Head client message in Section 4.3). The 718 signature for that data is structured as follows: 720 digitally-signed struct { 721 Version version; 722 SignatureType signature_type = tree_hash; 723 uint64 timestamp; 724 uint64 tree_size; 725 opaque sha256_root_hash[32]; 726 } TreeHeadSignature; 728 "version" is the version of the protocol to which the 729 TreeHeadSignature conforms. This version is v1. 731 "timestamp" is the current time. The timestamp MUST be at least as 732 recent as the most recent SCT timestamp in the tree. Each subsequent 733 timestamp MUST be more recent than the timestamp of the previous 734 update. 736 "tree_size" equals the number of entries in the new tree. 738 "sha256_root_hash" is the root of the Merkle Hash Tree. 740 Each log MUST produce on demand a Signed Tree Head that is no older 741 than the Maximum Merge Delay. In the unlikely event that it receives 742 no new submissions during an MMD period, the log SHALL sign the same 743 Merkle Tree Hash with a fresh timestamp. 745 4. Log Client Messages 747 Messages are sent as HTTPS GET or POST requests. Parameters for 748 POSTs and all responses are encoded as JavaScript Object Notation 749 (JSON) objects [RFC4627]. Parameters for GETs are encoded as order- 750 independent key/value URL parameters, using the "application/x-www- 751 form-urlencoded" format described in the "HTML 4.01 Specification" 752 [HTML401]. Binary data is base64 encoded [RFC4648] as specified in 753 the individual messages. 755 Note that JSON objects and URL parameters may contain fields not 756 specified here. These extra fields should be ignored. 758 The prefix can include a path as well as a server name 759 and a port. 761 In general, where needed, the "version" is v1 and the "id" is the log 762 id for the log server queried. 764 Any errors will be returned as HTTP 4xx or 5xx responses, with human- 765 readable error messages. 767 4.1. Add Chain to Log 769 POST https:///ct/v1/add-chain 771 Inputs: 773 chain: An array of base64-encoded certificates. The first 774 element is the end-entity certificate; the second chains to the 775 first and so on to the last, which is either the root 776 certificate or a certificate that chains to a known root 777 certificate. 779 Outputs: 781 sct_version: The version of the SignedCertificateTimestamp 782 structure, in decimal. A compliant v1 implementation MUST NOT 783 expect this to be 0 (i.e., v1). 785 id: The log ID, base64 encoded. Since log clients who request an 786 SCT for inclusion in TLS handshakes are not required to verify 787 it, we do not assume they know the ID of the log. 789 timestamp: The SCT timestamp, in decimal. 791 extensions: An opaque type for future expansion. It is likely 792 that not all participants will need to understand data in this 793 field. Logs should set this to the empty string. Clients 794 should decode the base64-encoded data and include it in the 795 SCT. 797 signature: The SCT signature, base64 encoded. 799 If the "sct_version" is not v1, then a v1 client may be unable to 800 verify the signature. It MUST NOT construe this as an error. (Note: 801 Log clients don't need to be able to verify this structure; only TLS 802 clients do. If we were to serve the structure as a binary blob, then 803 we could completely change it without requiring an upgrade to v1 804 clients.) 806 4.2. Add PreCertChain to Log 808 POST https:///ct/v1/add-pre-chain 810 Inputs: 812 chain: An array of base64-encoded Precertificates. The first 813 element is the end-entity certificate; the second chains to the 814 first and so on to the last, which is either the root 815 certificate or a certificate that chains to a known root 816 certificate. 818 Outputs are the same as in Section 4.1. 820 4.3. Retrieve Latest Signed Tree Head 822 GET https:///ct/v1/get-sth 824 No inputs. 826 Outputs: 828 tree_size: The size of the tree, in entries, in decimal. 830 timestamp: The timestamp, in decimal. 832 sha256_root_hash: The Merkle Tree Hash of the tree, in base64. 834 tree_head_signature: A TreeHeadSignature for the above data. 836 4.4. Retrieve Merkle Consistency Proof between Two Signed Tree Heads 838 GET https:///ct/v1/get-sth-consistency 840 Inputs: 842 first: The tree_size of the first tree, in decimal. 844 second: The tree_size of the second tree, in decimal. 846 Both tree sizes must be from existing v1 STHs (Signed Tree Heads). 848 Outputs: 850 consistency: An array of Merkle Tree nodes, base64 encoded. 852 Note that no signature is required on this data, as it is used to 853 verify an STH, which is signed. 855 4.5. Retrieve Merkle Audit Proof from Log by Leaf Hash 857 GET https:///ct/v1/get-proof-by-hash 859 Inputs: 861 hash: A base64-encoded v1 leaf hash. 863 tree_size: The tree_size of the tree on which to base the proof, 864 in decimal. 866 The "hash" must be calculated as defined in Section 3.4. The 867 "tree_size" must designate an existing v1 STH. 869 Outputs: 871 leaf_index: The 0-based index of the entry corresponding to the 872 "hash" parameter. 874 audit_path: An array of base64-encoded Merkle Tree nodes proving 875 the inclusion of the chosen certificate. 877 4.6. Retrieve Entries from Log 879 GET https:///ct/v1/get-entries 881 Inputs: 883 start: 0-based index of first entry to retrieve, in decimal. 885 end: 0-based index of last entry to retrieve, in decimal. 887 Outputs: 889 entries: An array of objects, each consisting of 891 leaf_input: The base64-encoded MerkleTreeLeaf structure. 893 extra_data: The base64-encoded unsigned data pertaining to the 894 log entry. In the case of an X509ChainEntry, this is the 895 "certificate_chain". In the case of a PrecertChainEntry, 896 this is the whole "PrecertChainEntry". 898 Note that this message is not signed -- the retrieved data can be 899 verified by constructing the Merkle Tree Hash corresponding to a 900 retrieved STH. All leaves MUST be v1. However, a compliant v1 901 client MUST NOT construe an unrecognized MerkleLeafType or 902 LogEntryType value as an error. This means it may be unable to parse 903 some entries, but note that each client can inspect the entries it 904 does recognize as well as verify the integrity of the data by 905 treating unrecognized leaves as opaque input to the tree. 907 The "start" and "end" parameters SHOULD be within the range 0 <= x < 908 "tree_size" as returned by "get-sth" in Section 4.3. 910 Logs MAY honor requests where 0 <= "start" < "tree_size" and "end" >= 911 "tree_size" by returning a partial response covering only the valid 912 entries in the specified range. Note that the following restriction 913 may also apply: 915 Logs MAY restrict the number of entries that can be retrieved per 916 "get-entries" request. If a client requests more than the permitted 917 number of entries, the log SHALL return the maximum number of entries 918 permissible. These entries SHALL be sequential beginning with the 919 entry specified by "start". 921 4.7. Retrieve Accepted Root Certificates 923 GET https:///ct/v1/get-roots 925 No inputs. 927 Outputs: 929 certificates: An array of base64-encoded root certificates that 930 are acceptable to the log. 932 4.8. Retrieve Entry+Merkle Audit Proof from Log 934 GET https:///ct/v1/get-entry-and-proof 936 Inputs: 938 leaf_index: The index of the desired entry. 940 tree_size: The tree_size of the tree for which the proof is 941 desired. 943 The tree size must designate an existing STH. 945 Outputs: 947 leaf_input: The base64-encoded MerkleTreeLeaf structure. 949 extra_data: The base64-encoded unsigned data, same as in 950 Section 4.6. 952 audit_path: An array of base64-encoded Merkle Tree nodes proving 953 the inclusion of the chosen certificate. 955 This API is probably only useful for debugging. 957 5. Clients 959 There are various different functions clients of logs might perform. 960 We describe here some typical clients and how they could function. 961 Any inconsistency may be used as evidence that a log has not behaved 962 correctly, and the signatures on the data structures prevent the log 963 from denying that misbehavior. 965 All clients should gossip with each other, exchanging STHs at least; 966 this is all that is required to ensure that they all have a 967 consistent view. The exact mechanism for gossip will be described in 968 a separate document, but it is expected there will be a variety. 970 5.1. Submitters 972 Submitters submit certificates or Precertificates to the log as 973 described above. They may go on to use the returned SCT to construct 974 a certificate or use it directly in a TLS handshake. 976 5.2. TLS Client 978 TLS clients are not directly clients of the log, but they receive 979 SCTs alongside or in server certificates. In addition to normal 980 validation of the certificate and its chain, they should validate the 981 SCT by computing the signature input from the SCT data as well as the 982 certificate and verifying the signature, using the corresponding 983 log's public key. Note that this document does not describe how 984 clients obtain the logs' public keys. 986 TLS clients MUST reject SCTs whose timestamp is in the future. 988 5.3. Monitor 990 Monitors watch logs and check that they behave correctly. They also 991 watch for certificates of interest. 993 A monitor needs to, at least, inspect every new entry in each log it 994 watches. It may also want to keep copies of entire logs. In order 995 to do this, it should follow these steps for each log: 997 1. Fetch the current STH (Section 4.3). 999 2. Verify the STH signature. 1001 3. Fetch all the entries in the tree corresponding to the STH 1002 (Section 4.6). 1004 4. Confirm that the tree made from the fetched entries produces the 1005 same hash as that in the STH. 1007 5. Fetch the current STH (Section 4.3). Repeat until the STH 1008 changes. 1010 6. Verify the STH signature. 1012 7. Fetch all the new entries in the tree corresponding to the STH 1013 (Section 4.6). If they remain unavailable for an extended 1014 period, then this should be viewed as misbehavior on the part of 1015 the log. 1017 8. Either: 1019 1. Verify that the updated list of all entries generates a tree 1020 with the same hash as the new STH. 1022 Or, if it is not keeping all log entries: 1024 1. Fetch a consistency proof for the new STH with the previous 1025 STH (Section 4.4). 1027 2. Verify the consistency proof. 1029 3. Verify that the new entries generate the corresponding 1030 elements in the consistency proof. 1032 9. Go to Step 5. 1034 5.4. Auditor 1036 Auditors take partial information about a log as input and verify 1037 that this information is consistent with other partial information 1038 they have. An auditor might be an integral component of a TLS 1039 client; it might be a standalone service; or it might be a secondary 1040 function of a monitor. 1042 Any pair of STHs from the same log can be verified by requesting a 1043 consistency proof (Section 4.4). 1045 A certificate accompanied by an SCT can be verified against any STH 1046 dated after the SCT timestamp + the Maximum Merge Delay by requesting 1047 a Merkle audit proof (Section 4.5). 1049 Auditors can fetch STHs from time to time of their own accord, of 1050 course (Section 4.3). 1052 6. IANA Considerations 1054 IANA has allocated an RFC 5246 ExtensionType value (18) for the SCT 1055 TLS extension. The extension name is "signed_certificate_timestamp". 1057 7. Security Considerations 1059 With CAs, logs, and servers performing the actions described here, 1060 TLS clients can use logs and signed timestamps to reduce the 1061 likelihood that they will accept misissued certificates. If a server 1062 presents a valid signed timestamp for a certificate, then the client 1063 knows that the certificate has been published in a log. From this, 1064 the client knows that the subject of the certificate has had some 1065 time to notice the misissue and take some action, such as asking a CA 1066 to revoke a misissued certificate. A signed timestamp is not a 1067 guarantee that the certificate is not misissued, since the subject of 1068 the certificate might not have checked the logs or the CA might have 1069 refused to revoke the certificate. 1071 In addition, if TLS clients will not accept unlogged certificates, 1072 then site owners will have a greater incentive to submit certificates 1073 to logs, possibly with the assistance of their CA, increasing the 1074 overall transparency of the system. 1076 7.1. Misissued Certificates 1078 Misissued certificates that have not been publicly logged, and thus 1079 do not have a valid SCT, will be rejected by TLS clients. Misissued 1080 certificates that do have an SCT from a log will appear in that 1081 public log within the Maximum Merge Delay, assuming the log is 1082 operating correctly. Thus, the maximum period of time during which a 1083 misissued certificate can be used without being available for audit 1084 is the MMD. 1086 7.2. Detection of Misissue 1088 The logs do not themselves detect misissued certificates; they rely 1089 instead on interested parties, such as domain owners, to monitor them 1090 and take corrective action when a misissue is detected. 1092 7.3. Misbehaving Logs 1094 A log can misbehave in two ways: (1) by failing to incorporate a 1095 certificate with an SCT in the Merkle Tree within the MMD and (2) by 1096 violating its append-only property by presenting two different, 1097 conflicting views of the Merkle Tree at different times and/or to 1098 different parties. Both forms of violation will be promptly and 1099 publicly detectable. 1101 Violation of the MMD contract is detected by log clients requesting a 1102 Merkle audit proof for each observed SCT. These checks can be 1103 asynchronous and need only be done once per each certificate. In 1104 order to protect the clients' privacy, these checks need not reveal 1105 the exact certificate to the log. Clients can instead request the 1106 proof from a trusted auditor (since anyone can compute the audit 1107 proofs from the log) or request Merkle proofs for a batch of 1108 certificates around the SCT timestamp. 1110 Violation of the append-only property is detected by global 1111 gossiping, i.e., everyone auditing logs comparing their versions of 1112 the latest Signed Tree Heads. As soon as two conflicting Signed Tree 1113 Heads for the same log are detected, this is cryptographic proof of 1114 that log's misbehavior. 1116 8. Efficiency Considerations 1118 The Merkle Tree design serves the purpose of keeping communication 1119 overhead low. 1121 Auditing logs for integrity does not require third parties to 1122 maintain a copy of each entire log. The Signed Tree Heads can be 1123 updated as new entries become available, without recomputing entire 1124 trees. Third-party auditors need only fetch the Merkle consistency 1125 proofs against a log's existing STH to efficiently verify the append- 1126 only property of updates to their Merkle Trees, without auditing the 1127 entire tree. 1129 9. Future Changes 1131 This section lists things we might address in a Standards Track 1132 version of this document. 1134 o Rather than forcing a log operator to create a new log in order to 1135 change the log signing key, we may allow some key roll mechanism. 1137 o We may add hash and signing algorithm agility. 1139 o We may describe some gossip protocols. 1141 10. Acknowledgements 1143 The authors would like to thank Erwann Abelea, Robin Alden, Al 1144 Cutter, Francis Dupont, Stephen Farrell, Brad Hill, Jeff Hodges, Paul 1145 Hoffman, Jeffrey Hutzelman, SM, Alexey Melnikov, Chris Palmer, Trevor 1146 Perrin, Ryan Sleevi, Rob Stradling, and Carl Wallace for their 1147 valuable contributions. 1149 11. References 1151 11.1. Normative Reference 1153 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1154 Requirement Levels", BCP 14, RFC 2119, March 1997. 1156 11.2. Informative References 1158 [CrosbyWallach] 1159 Crosby, S. and D. Wallach, "Efficient Data Structures for 1160 Tamper-Evident Logging", Proceedings of the 18th USENIX 1161 Security Symposium, Montreal, August 2009, 1162 . 1165 [DSS] National Institute of Standards and Technology, "Digital 1166 Signature Standard (DSS)", FIPS 186-3, June 2009, 1167 . 1170 [FIPS.180-4] 1171 National Institute of Standards and Technology, "Secure 1172 Hash Standard", FIPS PUB 180-4, March 2012, 1173 . 1176 [HTML401] Raggett, D., Le Hors, A., and I. Jacobs, "HTML 4.01 1177 Specification", World Wide Web Consortium Recommendation 1178 REC-html401-19991224, December 1999, 1179 . 1181 [RFC2560] Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. 1182 Adams, "X.509 Internet Public Key Infrastructure Online 1183 Certificate Status Protocol - OCSP", RFC 2560, June 1999. 1185 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 1186 Standards (PKCS) #1: RSA Cryptography Specifications 1187 Version 2.1", RFC 3447, February 2003. 1189 [RFC4627] Crockford, D., "The application/json Media Type for 1190 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 1192 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1193 Encodings", RFC 4648, October 2006. 1195 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1196 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1198 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1199 Housley, R., and W. Polk, "Internet X.509 Public Key 1200 Infrastructure Certificate and Certificate Revocation List 1201 (CRL) Profile", RFC 5280, May 2008. 1203 [RFC5905] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network 1204 Time Protocol Version 4: Protocol and Algorithms 1205 Specification", RFC 5905, June 2010. 1207 [RFC6066] Eastlake, D., "Transport Layer Security (TLS) Extensions: 1208 Extension Definitions", RFC 6066, January 2011. 1210 Authors' Addresses 1212 Ben Laurie 1213 Google UK Ltd. 1215 EMail: benl@google.com 1217 Adam Langley 1218 Google Inc. 1220 EMail: agl@google.com 1222 Emilia Kasper 1223 Google Switzerland GmbH 1225 EMail: ekasper@google.com 1227 Rob Stradling 1228 Comodo CA, Ltd. 1230 EMail: rob.stradling@comodo.com