idnits 2.17.1 draft-ietf-dane-protocol-17.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (February 29, 2012) is 4430 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) == Missing Reference: 'This' is mentioned on line 662, but not defined ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) -- Obsolete informational reference (is this intentional?): RFC 2818 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 2845 (Obsoleted by RFC 8945) -- Obsolete informational reference (is this intentional?): RFC 4641 (Obsoleted by RFC 6781) Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group P. Hoffman 3 Internet-Draft VPN Consortium 4 Intended status: Standards Track J. Schlyter 5 Expires: September 1, 2012 Kirei AB 6 February 29, 2012 8 The DNS-Based Authentication of Named Entities (DANE) Protocol for 9 Transport Layer Security (TLS) 10 draft-ietf-dane-protocol-17 12 Abstract 14 Encrypted communication on the Internet often uses Transport Level 15 Security (TLS), which depends on third parties to certify the keys 16 used. This document improves on that situation by enabling the 17 administrator of a domain name to certify the keys used in that 18 domain's TLS servers. This requires matching improvements in TLS 19 client software, but no change in TLS server software. 21 Status of this Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on September 1, 2012. 38 Copyright Notice 40 Copyright (c) 2012 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 1.1. Background of the Problem . . . . . . . . . . . . . . . . 4 57 1.2. Securing the Association with a Server's Certificate . . . 5 58 1.3. Method For Securing Certificate Associations . . . . . . . 6 59 1.4. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 60 2. The TLSA Resource Record . . . . . . . . . . . . . . . . . . . 7 61 2.1. TLSA RDATA Wire Format . . . . . . . . . . . . . . . . . . 7 62 2.1.1. The Certificate Usage Field . . . . . . . . . . . . . 7 63 2.1.2. The Selector Field . . . . . . . . . . . . . . . . . . 8 64 2.1.3. The Matching Type Field . . . . . . . . . . . . . . . 9 65 2.1.4. The Certificate Association Data Field . . . . . . . . 9 66 2.2. TLSA RR Presentation Format . . . . . . . . . . . . . . . 9 67 2.3. TLSA RR Examples . . . . . . . . . . . . . . . . . . . . . 10 68 3. Domain Names for TLS Certificate Associations . . . . . . . . 10 69 4. Use of TLSA Records in TLS . . . . . . . . . . . . . . . . . . 11 70 5. TLSA and DANE Use Cases and Requirements . . . . . . . . . . . 12 71 6. Mandatory-to-Implement Features . . . . . . . . . . . . . . . 14 72 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 73 7.1. TLSA RRtype . . . . . . . . . . . . . . . . . . . . . . . 14 74 7.2. TLSA Usages . . . . . . . . . . . . . . . . . . . . . . . 15 75 7.3. TLSA Selectors . . . . . . . . . . . . . . . . . . . . . . 15 76 7.4. TLSA Matching Types . . . . . . . . . . . . . . . . . . . 15 77 8. Security Considerations . . . . . . . . . . . . . . . . . . . 16 78 8.1. DNS Caching . . . . . . . . . . . . . . . . . . . . . . . 17 79 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 18 80 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18 81 10.1. Normative References . . . . . . . . . . . . . . . . . . . 18 82 10.2. Informative References . . . . . . . . . . . . . . . . . . 19 83 Appendix A. Operational Considerations for Deploying TLSA 84 Records . . . . . . . . . . . . . . . . . . . . . . . 20 85 A.1. Creating TLSA Records . . . . . . . . . . . . . . . . . . 20 86 A.1.1. Ambiguities and Corner Cases When TLS Clients 87 Build Trust Chains . . . . . . . . . . . . . . . . . . 20 88 A.1.2. Choosing a Selector Type . . . . . . . . . . . . . . . 21 89 A.2. Provisioning TLSA Records in DNS . . . . . . . . . . . . . 22 90 A.2.1. Provisioning TLSA Records with Aliases . . . . . . . . 22 91 A.3. Securing the Last Hop . . . . . . . . . . . . . . . . . . 24 92 A.4. Handling Certificate Rollover . . . . . . . . . . . . . . 25 93 Appendix B. Pseudocode for Using TLSA . . . . . . . . . . . . . . 26 94 B.1. Helper Functions . . . . . . . . . . . . . . . . . . . . . 26 95 B.2. Main TLSA Pseudo Code . . . . . . . . . . . . . . . . . . 27 97 Appendix C. Examples . . . . . . . . . . . . . . . . . . . . . . 29 98 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 31 100 1. Introduction 102 1.1. Background of the Problem 104 Applications that communicate over the Internet often need to prevent 105 eavesdropping, tampering, or forgery of their communications. The 106 Transport Layer Security (TLS) protocol provides this kind of 107 communications privacy over the Internet, using encryption. 109 The security properties of encryption systems depend strongly on the 110 keys that they use. If secret keys are revealed, or if published 111 keys can be replaced by bogus keys, these systems provide little or 112 no security. 114 TLS uses certificates to protect keys. A certificate combines a 115 published key with other information such as the name of the service 116 that the key is used by, and this combination is digitally signed by 117 another key. Having a certificate for a key is only helpful if you 118 trust the other key that signed the certificate. If that other key 119 was itself revealed or substituted, then its signature is worthless 120 in proving anything about the first key. 122 On the Internet, this problem has been solved for years by entities 123 called "Certification Authorities" (CAs). CAs protect their secret 124 key vigorously, while supplying their public key to the software 125 vendors who build TLS clients. They then sign certificates, and 126 supply those to TLS servers. TLS client software uses a set of these 127 CA keys as "trust anchors" to validate the signatures on certificates 128 that the client receives from TLS servers. Client software typically 129 allows any CA to usefully sign any other certificate. 131 This solution has gradually broken down because some CAs have become 132 untrustworthy. A single trusted CA that betrays its trust, either 133 voluntarily or by providing less-than-vigorous protection for its 134 secrets and capabilities, can compromise any other certificate that 135 TLS uses by signing a replacement certificate that contains a bogus 136 key. Several real-world occurrances that have exploited such CAs for 137 subversion of major web sites (presumably to abet wiretapping and 138 large-scale fraud) have brought TLS's CA model into disrepute. 140 The DNS Security Extensions (DNSSEC) provides a similar model that 141 involves trusted keys signing the information for untrusted keys. 142 However, DNSSEC provides three significant improvements. Keys are 143 tied to names in the Domain Name System (DNS), rather than to 144 arbitrary identifying strings; this is more convenient for Internet 145 protocols. Signed keys for any domain are accessible online through 146 a straightforward query using the standard DNSSEC protocol, so there 147 is no problem distributing the signed keys. Most significantly, the 148 keys associated with a domain name can only be signed by a key 149 associated with the parent of that domain name; for example, the keys 150 for "example.com" can only be signed by the keys for "com", and the 151 keys for "com" can only be signed by the DNS root. This prevents an 152 untrustworthy signer from compromising anyone's keys except those in 153 their own subdomains. Like TLS, DNSSEC relies on public keys that 154 come built into the DNSSEC client software, but these keys come only 155 from a single root domain rather than from a multiplicity of CAs. 157 1.2. Securing the Association with a Server's Certificate 159 A TLS client begins a connection by exchanging messages with a TLS 160 server. It looks up the server's name using the DNS to get Internet 161 Protocol (IP) address associated with the name. It then begins a 162 connection to a client-chosen port at that address, and sends an 163 initial message there. However, the client does not yet know whether 164 an adversary is intercepting and/or altering its communication before 165 it reaches the TLS server. It does not even know whether the real 166 TLS server associated with that domain name has ever received its 167 initial messages. 169 The first response from the server in TLS may contain a certificate. 170 In order for the TLS client to authenticate that it is talking to the 171 expected TLS server, the client must validate that this certificate 172 is associated with the domain name used by the client to get to the 173 server. Currently, the client must extract the domain name from the 174 certificate and must successfully validate the certificate, including 175 chaining to a trust anchor. 177 There is a different way to authenticate the association of the 178 server's certificate with the intended domain name without trusting 179 an external CA. Given that the DNS administrator for a domain name 180 is authorized to give identifying information about the zone, it 181 makes sense to allow that administrator to also make an authoritative 182 binding between the domain name and a certificate that might be used 183 by a host at that domain name. The easiest way to do this is to use 184 the DNS, securing the binding with DNSSEC. 186 There are many use cases for such functionality. [RFC6394] lists the 187 ones that the DNS RRtype in this document are meant to apply. 188 [RFC6394] also lists many requirements, most of which this document 189 is believed to meet. Section 5 covers the applicability of this 190 document to the use cases in detail. 192 This document applies to both TLS [RFC5246] and DTLS [RFC6347]. In 193 order to make the document more readable, it mostly only talks about 194 "TLS", but in all cases, it means "TLS or DTLS". This document only 195 relates to securely associating certificates for TLS and DTLS with 196 host names; other security protocols and other forms of 197 identification of TLS servers (such as IP addresses) are handled in 198 other documents. For example, keys for IPsec are covered in 199 [RFC4025] and keys for SSH are covered in [RFC4255]. 201 1.3. Method For Securing Certificate Associations 203 A certificate association is formed from a piece of information 204 identifying a certificate (such as the contents of the certificate or 205 a trust anchor to which the certificate chains) and the domain name 206 where the data is found. This document only applies to PKIX 207 [RFC5280] certificates, not certificates of other formats. 209 A DNS query can return multiple certificate associations, such as in 210 the case of different server software on a single host using 211 different certificates, or in the case that a server is changing from 212 one certificate to another. 214 This document defines a secure method to associate the certificate 215 that is obtained from the TLS server with a domain name using DNS; 216 the DNS information needs to be be protected by DNSSEC. Because the 217 certificate association was retrieved based on a DNS query, the 218 domain name in the query is by definition associated with the 219 certificate. 221 DNSSEC, which is defined in RFCs 4033, 4034, and 4035 ([RFC4033], 222 [RFC4034], and [RFC4035]), uses cryptographic keys and digital 223 signatures to provide authentication of DNS data. Information that 224 is retrieved from the DNS and that is validated using DNSSEC is 225 thereby proved to be the authoritative data. The DNSSEC signature 226 MUST be validated on all responses that use DNSSEC in order to assure 227 the proof of origin of the data. This document does not specify how 228 DNSSEC validation occurs because there are many different proposals 229 for how a client might get validated DNSSEC results. 231 This document only relates to securely getting the DNS information 232 for the certificate association using DNSSEC; other secure DNS 233 mechanisms are out of scope. 235 1.4. Terminology 237 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 238 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 239 document are to be interpreted as described in RFC 2119 [RFC2119]. 241 This document also makes use of standard PKIX, DNSSEC, and TLS 242 terminology. See [RFC5280], [RFC4033], and [RFC5246] respectively, 243 for these terms. In addition, terms related to TLS-protected 244 application services and DNS names are taken from [RFC6125]. 246 2. The TLSA Resource Record 248 The TLSA DNS resource record (RR) is used to associate a certificate 249 with the domain name where the record is found. The semantics of how 250 the TLSA RR is interpreted are given later in this document. 252 The type value for the TLSA RR type is TBD. 254 The TLSA RR is class independent. 256 The TLSA RR has no special TTL requirements. 258 2.1. TLSA RDATA Wire Format 260 The RDATA for a TLSA RR consists of a one octet usage type field, a 261 one octet selector field, a one octet matching type field and the 262 certificate association data field. 264 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 265 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 266 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 267 | Usage | Selector | Matching Type | / 268 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / 269 / / 270 / Certificate Association Data / 271 / / 272 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 274 2.1.1. The Certificate Usage Field 276 A one-octet value, called "certificate usage" or just "usage", 277 specifying the provided association that will be used to match the 278 target certificate from the TLS handshake. This value is defined in 279 a new IANA registry (see Section 7.2) in order to make it easier to 280 add additional certificate usages in the future. The usages defined 281 in this document are: 283 0 -- Certificate usage 0 is used to specify a CA certificate, or 284 the public key of such a certificate, that must be found in any of 285 the PKIX certification paths for the end entity certificate given 286 by the server in TLS. This usage is sometimes referred to as "CA 287 constraint" because it limits which CA can be used to issue 288 certificates for a given host name, port, and protocol. The 289 target certificate MUST pass PKIX certification path validation 290 and a CA certificate that matches the TLSA record MUST be included 291 as part of a valid certification path. 293 1 -- Certificate usage 1 is used to specify an end entity 294 certificate, or the public key of such a certificate, that must be 295 matched with the end entity certificate given by the server in 296 TLS. This usage is sometimes referred to as "service certificate 297 constraint" because it limits which end entity certificate may be 298 used by a given host name, port, and protocol. The target 299 certificate MUST pass PKIX certification path validation and MUST 300 match the TLSA record. 302 2 -- Certificate usage 2 is used to specify a certificate, or the 303 public key of such a certificate, that must be used as a trust 304 anchor when validating the end entity certificate given by the 305 server in TLS. This usage is sometimes referred to as "trust 306 anchor assertion" and allows a domain name administrator to 307 specify a new trust anchor, for example if the domain issues its 308 own certificates under its own CA that is not expected to be in 309 the end users' collection of trust anchors. The target 310 certificate MUST pass PKIX certification path validation, with any 311 certificate matching the TLSA record considered to be a trust 312 anchor for this certification path validation. 314 3 -- Certificate usage 3 is used to specify a certificate, or the 315 public key of such a certificate, that must match the end entity 316 certificate given by the server in TLS. This usage is sometimes 317 referred to as "domain-issued certificate" because it allows for a 318 domain name administrator to issue certificates for a domain 319 without involving a third-party CA. The target certificate MUST 320 match the TLSA record. 322 The certificate usages defined in this document explicitly only apply 323 to PKIX-formatted certificates in DER encoding. If TLS allows other 324 formats later, or if extensions to this RRtype are made that accept 325 other formats for certificates, those certificates will need their 326 own certificate usage values. 328 2.1.2. The Selector Field 330 A one-octet value, called "selector", specifying which part of the 331 TLS certificate presented by the server will be matched against the 332 association data. This value is defined in a new IANA registry (see 333 Section 7.3. The selectors defined in this document are: 335 0 -- Full certificate 337 1 -- SubjectPublicKeyInfo 339 2.1.3. The Matching Type Field 341 A one-octet value, called "matching type", specifying how the 342 certificate association is presented. This value is defined in a new 343 IANA registry (see Section 7.4). The types defined in this document 344 are: 346 0 -- Exact match on selected content 348 1 -- SHA-256 hash of selected content 350 2 -- SHA-512 hash of selected content 352 If the TLSA record's matching type is a hash, the record SHOULD use 353 the same hash algorithm that was used in the signature in the 354 certificate. This will assist clients that support a small number of 355 hash algorithms. 357 2.1.4. The Certificate Association Data Field 359 The "certificate association data" to be matched. This field 360 contains the data to be matched. These bytes are either raw data 361 (that is, the full certificate or its SubjectPublicKeyInfo, depending 362 on the selector) for matching type 0, or the hash of the raw data for 363 matching types 1 and 2. The data refers to the certificate in the 364 association, not to the TLS ASN.1 Certificate object. 366 2.2. TLSA RR Presentation Format 368 The presentation format of the RDATA portion is as follows: 370 o The certificate usage field MUST be represented as an unsigned 371 decimal integer. 373 o The selector field MUST be represented as an unsigned decimal 374 integer. 376 o The matching type field MUST be represented as an unsigned decimal 377 integer. 379 o The certificate association data field MUST be represented as a 380 string of hexadecimal characters. Whitespace is allowed within 381 the string of hexadecimal characters. 383 2.3. TLSA RR Examples 385 An example of a hashed (SHA-256) association of a PKIX CA 386 certificate: 388 _443._tcp.www.example.com. IN TLSA ( 389 0 0 1 d2abde240d7cd3ee6b4b28c54df034b9 390 7983a1d16e8a410e4561cb106618e971 ) 392 An example of a hashed (SHA-512) subject public key association of a 393 PKIX end entity certificate: 395 _443._tcp.www.example.com. IN TLSA ( 396 1 1 2 92003ba34942dc74152e2f2c408d29ec 397 a5a520e7f2e06bb944f4dca346baf63c 398 1b177615d466f6c4b71c216a50292bd5 399 8c9ebdd2f74e38fe51ffd48c43326cbc ) 401 An example of a full certificate association of a PKIX end entity 402 certificate: 404 _443._tcp.www.example.com. IN TLSA ( 405 3 0 0 30820307308201efa003020102020... ) 407 3. Domain Names for TLS Certificate Associations 409 Unless there is a protocol-specific specification that is different 410 than this one, TLSA resource records are stored at a prefixed DNS 411 domain name. The prefix is prepared in the following manner: 413 1. The decimal representation of the port number on which a TLS- 414 based service is assumed to exist is prepended with an underscore 415 character ("_") to become the left-most label in the prepared 416 domain name. This number has no leading zeros. 418 2. The protocol name of the transport on which a TLS-based service 419 is assumed to exist is prepended with an underscore character 420 ("_") to become the second left-most label in the prepared domain 421 name. The transport names defined for this protocol are "tcp", 422 "udp" and "sctp". 424 3. The domain name is appended to the result of step 2 to complete 425 the prepared domain name. 427 For example, to request a TLSA resource record for an HTTP server 428 running TLS on port 443 at "www.example.com", you would use 429 "_443._tcp.www.example.com" in the request. To request a TLSA 430 resource record for an SMTP server running the STARTTLS protocol on 431 port 25 at "mail.example.com", you would use 432 "_25._tcp.mail.example.com". 434 4. Use of TLSA Records in TLS 436 Section 2.1 of this document defines the mandatory matching rules for 437 the data from the TLSA certificate associations and the certificates 438 received from the TLS server. 440 The TLS session that is to be set up MUST be for the specific port 441 number and transport name that was given in the TLSA query. 443 Some specifications for applications that run under TLS, such as 444 [RFC2818] for HTTP, require the server's certificate to have a domain 445 name that matches the host name expected by the client. Some 446 specifications such as [RFC6125] detail how to match the identity 447 given in a PKIX certificate with those expected by the user. 449 An implementation of this protocol makes a DNS query for TLSA records 450 (or uses already-retrieved TLSA records if they are cached within 451 their time to live value), validates these records using DNSSEC, and 452 uses the resulting TLSA records and validation status to modify its 453 responses to the TLS server. 455 If a host is using TLSA usage type 2 for its certifcate, the 456 corresponding TLS server SHOULD send the certificate that is 457 referenced just like it currently sends intermediate certificates. 459 Determining whether a TLSA RRset can be used depends on the DNSSEC 460 validation state (as defined in [RFC4033]). 462 o A TLSA RRset whose DNSSEC validation state is secure MUST be used 463 as a certificate association for TLS unless a local policy would 464 prohibit the use of the specific certificate association in the 465 secure TLSA RRset. 467 o If the DNSSEC validation state on the response to the request for 468 the TLSA RRset is bogus, this MUST cause TLS not to be started or, 469 if the TLS negotiation is already in progress, MUST cause the 470 connection to be aborted. 472 o A TLSA RRset whose DNSSEC validation state is indeterminate or 473 insecure cannot be used for TLS and MUST be considered unusable. 475 Clients which validate the DNSSEC signatures themselves MUST use 476 standard DNSSEC validation procedures. Clients that rely on another 477 entity to perform the DNSSEC signature validation MUST use a secure 478 mechanism between themselves and the validator. Examples of secure 479 transports to other hosts include TSIG [RFC2845], SIG(0) [RFC2931], 480 and IPsec [RFC6071]. Note that it is not sufficient to use secure 481 transport to a DNS resolver that does not do DNSSEC signature 482 validation. 484 If a certificate association contains a certificate usage, selector, 485 or matching type that is not understood by the TLS client, that 486 certificate association MUST be considered unusable. If the 487 comparison data for a certificate is malformed, the certificate 488 association MUST be considered unusable. 490 If a certificate association contains a matching type or certificate 491 association data that uses a cryptographic algorithm that is 492 considered too weak for the TLS client's policy, the certificate 493 association MUST be marked as unusable. 495 If an application receives zero usable certificate associations, it 496 processes TLS in the normal fashion without any input from the TLSA 497 records. If an application receives one or more usable certificate 498 associations, it attempts to match each certificate association with 499 the TLS server's end entity certificate until a successful match is 500 found. 502 5. TLSA and DANE Use Cases and Requirements 504 The different types of certificate associations defined in TLSA are 505 matched with various sections of [RFC6394]. The use cases from 506 Section 3 of [RFC6394] are covered in this document as follows: 508 3.1 CA Constraints -- Implemented using certificate usage 0. 510 3.2 Certificate Constraints -- Implemented using certificate usage 511 1. 513 3.3 Trust Anchor Assertion and Domain-Issued Certificates -- 514 Implemented using certificate usages 2 and 3, respectively. 516 The requirements from Section 4 of [RFC6394] are covered in this 517 document as follows: 519 Multiple Ports -- The TLSA records for different application 520 services running on a single host can be distinguished through the 521 service name and port number prefixed to the host name (see 522 Section 3). 524 No Downgrade -- Section 4 specifies the conditions under which a 525 client can process and act upon TLSA records. Specifically, if 526 the DNSSEC status for the TLSA resource record set is determined 527 to be bogus, TLS is not attempted at all. 529 Encapsulation -- Covered in the TLSA response semantics. 531 Predictability -- The appendixes of this specification provide 532 operational considerations and implementation guidance in order to 533 enable application developers to form a consistent interpretation 534 of the recommended DANE client behavior. 536 Opportunistic Security -- If a client conformant to this 537 specification can reliably determine the presence of a TLSA 538 record, it will attempt to use this information. Conversely, if a 539 client can reliably determine the absence of any TLSA record, it 540 will fall back to processing TLS in the normal fashion. This is 541 discussed in Section 4. 543 Combination -- Multiple TLSA records can be published for a given 544 host name, thus enabling the client to construct multiple TLSA 545 certificate associations that reflect different DANE assertions. 546 No support is provided to combine two TLSA certificate 547 associations in a single operation. 549 Roll-over -- Section 4 states that applications must not cache TLSA 550 records beyond their TTL expiration. This ensures that clients 551 will not latch onto assertions made by expired TLSA records, and 552 will be able to transition between using one DANE mechanism to 553 another. 555 Simple Key Management -- The SubjectPublicKeyInfo selector in the 556 TLSA record provides a mode that enables a domain holder to only 557 have to maintain a single long-lived public/private key pair 558 without the need to manage certificates. Appendix A outlines the 559 usefulness and the potential downsides to using this mode. 561 Minimal Dependencies -- This specification relies on DNSSEC to 562 protect the origin authenticity and integrity of the TLSA resource 563 record set. Additionally, if DNSSEC validation is not performed 564 on the system that wishes to use TLSA certificate bindings, this 565 specification requires that the "last mile" be over a secure 566 transport. There are no other deployment dependencies for this 567 approach. 569 Minimal Options -- The operating modes map precisely to the DANE use 570 cases and requirements. DNSSEC use is mandatory in that this 571 specification encourages applications to use TLSA records that are 572 only shown to be validated. 574 Wild Cards -- Covered in a limited manner in the TLSA request 575 syntax; see Appendix A. 577 Redirection -- Covered in the TLSA request syntax; see Appendix A. 579 6. Mandatory-to-Implement Features 581 A system creating TLSA records that conforms to this specification 582 MUST be able to create TLSA records containing certificate usages 0, 583 1, 2, and 3. A system creating TLSA records that conforms to this 584 specification MUST be able to create TLSA records with selectors 0 585 (full certificate) and 1 (SubjectPublicKeyInfo). A system creating 586 TLSA records that conforms to this specification MUST be able to 587 create TLSA records using matching type 0 (no hash used) and matching 588 type 1 (SHA-256), and SHOULD be able to create TLSA records using 589 matching type 2 (SHA-512). 591 TLS clients conforming to this specification MUST be able to 592 correctly interpret TLSA records with certificate usages 0, 1, 2, and 593 3. TLS clients conforming to this specification MUST be able to 594 compare a certificate association with a certificate from the TLS 595 handshake using selectors type 0 and 1, and matching type 0 (no hash 596 used) and matching type 1 (SHA-256), and SHOULD be able to make such 597 comparisons with matching type 2 (SHA-512). 599 At the time this is written, it is expected that there will be a new 600 family of hash algorithms called SHA-3 within the next few years. It 601 is expected that some of the SHA-3 algorithms will be mandatory 602 and/or recommended for TLSA records after the algorithms are fully 603 defined. At that time, this specification will be updated. 605 7. IANA Considerations 607 7.1. TLSA RRtype 609 This document uses a new DNS RR type, TLSA, whose value is TBD. A 610 separate request for the RR type will be submitted to the expert 611 reviewer, and future versions of this document will have that value 612 instead of TBD. 614 In the following sections, "RFC Required" was chosen for TLSA usages 615 and "Specification Required" for selectors and matching types because 616 of the amount of detail that is likely to be needed for implementers 617 to correctly implement new usages as compared to new selectors and 618 matching types. 620 7.2. TLSA Usages 622 This document creates a new registry, "Certificate Usages for TLSA 623 Resource Records". The registry policy is "RFC Required". The 624 initial entries in the registry are: 626 Value Short description Reference 627 ---------------------------------------------------------- 628 0 CA constraint [This] 629 1 Service certificate constraint [This] 630 2 Trust anchor assertion [This] 631 3 Domain-issued certificate [This] 632 4-254 Unassigned 633 255 Private use 635 Applications to the registry can request specific values that have 636 yet to be assigned. 638 7.3. TLSA Selectors 640 This document creates a new registry, "Selectors for TLSA Resource 641 Records". The registry policy is "Specification Required". The 642 initial entries in the registry are: 644 Value Short description Reference 645 ---------------------------------------------------------- 646 0 Full Certificate [This] 647 1 SubjectPublicKeyInfo [This] 648 2-254 Unassigned 649 255 Private use 651 Applications to the registry can request specific values that have 652 yet to be assigned. 654 7.4. TLSA Matching Types 656 This document creates a new registry, "Matching Types for TLSA 657 Resource Records". The registry policy is "Specification Required". 658 The initial entries in the registry are: 660 Value Short description Reference 661 --------------------------------------------- 662 0 No hash used [This] 663 1 SHA-256 NIST FIPS 180-3 664 2 SHA-512 NIST FIPS 180-3 665 3-254 Unassigned 666 255 Private use 668 Applications to the registry can request specific values that have 669 yet to be assigned. 671 8. Security Considerations 673 The security of the DNS RRtype described in this document relies on 674 the security of DNSSEC as used by the client requesting A/AAAA and 675 TLSA records. 677 A DNS administrator who goes rogue and changes both the A/AAAA and 678 TLSA records for a domain name can cause the user to go to an 679 unauthorized server that will appear authorized, unless the client 680 performs PKIX certification path validation and rejects the 681 certificate. That administrator could probably get a certificate 682 issued anyway, so this is not an additional threat. 684 If the authentication mechanism for adding or changing TLSA data in a 685 zone is weaker than the authentication mechanism for changing the 686 A/AAAA records, a man-in-the-middle who can redirect traffic to their 687 site may be able to impersonate the attacked host in TLS if they can 688 use the weaker authentication mechanism. A better design for 689 authenticating DNS would be to have the same level of authentication 690 used for all DNS additions and changes for a particular owner name. 692 SSL proxies can sometimes act as a man-in-the-middle for TLS clients. 693 In these scenarios, the clients add a new trust anchor whose private 694 key is kept on the SSL proxy; the proxy intercepts TLS requests, 695 creates a new TLS session with the intended host, and sets up a TLS 696 session with the client using a certificate that chains to the trust 697 anchor installed in the client by the proxy. In such environments, 698 the using TLSA records will prevent the SSL proxy from functioning as 699 expected because the TLS client will get a certificate association 700 from the DNS that will not match the certificate that the SSL proxy 701 uses with the client. The client, seeing the proxy's new certificate 702 for the supposed destination will not set up a TLS session. 704 Client treatment of any information included in the certificate trust 705 anchor is a matter of local policy. This specification does not 706 mandate that such information be inspected or validated by the domain 707 name administrator. 709 If a server's certificate is revoked, or if an intermediate CA in a 710 chain between the end entity and a trust anchor has its certificate 711 revoked, a TLSA record with a certificate type of 2 that matches the 712 revoked certificate would in essence override the revocation because 713 the client would treat that revoked certificate as a trust anchor and 714 thus not check its revocation status. Because of this, domain 715 administrators need to be responsible for being sure that the key or 716 certificate used in TLSA records with a certificate type of 2 are in 717 fact able to be used as reliable trust anchors. 719 Certificates that are delivered in TLSA with usage type 2 720 fundamentally change the way the TLS server's end entity certificate 721 is evaluated. For example, the server's certificate might chain to 722 an existing CA through an intermediate CA that has certain policy 723 restrictions, and the certificate would not pass those restrictions 724 and thus normally be rejected. That intermediate CA could issue 725 itself a new certificate without the policy restrictions and tell its 726 customers to use that certificate with usage type 2. This in essence 727 allows an intermediate CA to be come a trust anchor for certificates 728 that the end user might have expected to chain to an existing trust 729 anchor. 731 If an administrator wishes to stop using a TLSA record, the 732 administrator can simply remove it from the DNS. Normal clients will 733 stop using the TLSA record after the TTL has expired. Replay attacks 734 against the TLSA record are not possible after the expiration date on 735 the RRsig of the TLSA record that was removed. 737 8.1. DNS Caching 739 Implementations of this protocol rely heavily on the DNS, and are 740 thus prone to security attacks based on the deliberate mis- 741 association of TLSA records and DNS names. Implementations need to 742 be cautious in assuming the continuing validity of an TLSA records/ 743 DNS name association. 745 In particular, implementations SHOULD rely on their DNS resolver for 746 confirmation of an association between a TLSA record and a DNS name, 747 rather than caching the result of previous domain name lookups. Many 748 platforms already can cache domain name lookups locally when 749 appropriate, and they SHOULD be configured to do so. It is proper 750 for these lookups to be cached, however, only when the TTL (Time To 751 Live) information reported by the DNS makes it likely that the cached 752 information will remain useful. 754 If implementations cache the results of domain name lookups in order 755 to achieve a performance improvement, they MUST observe the TTL 756 information reported by DNS. Implementations that fail to follow 757 this rule this rule could be spoofed when a previously-accessed 758 server's TLSA record changes, such as during a certificate rollover. 760 9. Acknowledgements 762 Many of the ideas in this document have been discussed over many 763 years. More recently, the ideas have been discussed by the authors 764 and others in a more focused fashion. In particular, some of the 765 ideas and words here originated with Paul Vixie, Dan Kaminsky, Jeff 766 Hodges, Phill Hallam-Baker, Simon Josefsson, Warren Kumari, Adam 767 Langley, Ben Laurie, Ilari Liusvaara, Ondrej Mikle, Scott Schmit, 768 Ondrej Sury, Richard Barnes, Jim Schaad, Stephen Farrell, Suresh 769 Krishnaswamy, Peter Palfrader, Pieter Lexis, Wouter Wijngaards and 770 John Gilmore. 772 This document has also been greatly helped by many active 773 participants of the DANE Working Group. 775 10. References 777 10.1. Normative References 779 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 780 Requirement Levels", BCP 14, RFC 2119, March 1997. 782 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 783 Rose, "DNS Security Introduction and Requirements", 784 RFC 4033, March 2005. 786 [RFC4034] Arends, R., Austein, R., Larson, M., Massey, D., and S. 787 Rose, "Resource Records for the DNS Security Extensions", 788 RFC 4034, March 2005. 790 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 791 Rose, "Protocol Modifications for the DNS Security 792 Extensions", RFC 4035, March 2005. 794 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 795 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 797 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 798 Housley, R., and W. Polk, "Internet X.509 Public Key 799 Infrastructure Certificate and Certificate Revocation List 800 (CRL) Profile", RFC 5280, May 2008. 802 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 803 Verification of Domain-Based Application Service Identity 804 within Internet Public Key Infrastructure Using X.509 805 (PKIX) Certificates in the Context of Transport Layer 806 Security (TLS)", RFC 6125, March 2011. 808 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 809 Security Version 1.2", RFC 6347, January 2012. 811 10.2. Informative References 813 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 814 specifying the location of services (DNS SRV)", RFC 2782, 815 February 2000. 817 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 819 [RFC2845] Vixie, P., Gudmundsson, O., Eastlake, D., and B. 820 Wellington, "Secret Key Transaction Authentication for DNS 821 (TSIG)", RFC 2845, May 2000. 823 [RFC2931] Eastlake, D., "DNS Request and Transaction Signatures ( 824 SIG(0)s)", RFC 2931, September 2000. 826 [RFC4025] Richardson, M., "A Method for Storing IPsec Keying 827 Material in DNS", RFC 4025, March 2005. 829 [RFC4255] Schlyter, J. and W. Griffin, "Using DNS to Securely 830 Publish Secure Shell (SSH) Key Fingerprints", RFC 4255, 831 January 2006. 833 [RFC4641] Kolkman, O. and R. Gieben, "DNSSEC Operational Practices", 834 RFC 4641, September 2006. 836 [RFC6066] Eastlake, D., "Transport Layer Security (TLS) Extensions: 837 Extension Definitions", RFC 6066, January 2011. 839 [RFC6071] Frankel, S. and S. Krishnan, "IP Security (IPsec) and 840 Internet Key Exchange (IKE) Document Roadmap", RFC 6071, 841 February 2011. 843 [RFC6394] Barnes, R., "Use Cases and Requirements for DNS-Based 844 Authentication of Named Entities (DANE)", RFC 6394, 845 October 2011. 847 Appendix A. Operational Considerations for Deploying TLSA Records 849 A.1. Creating TLSA Records 851 When creating TLSA records care must be taken to avoid 852 misconfigurations. Section 4 of this document states that a TLSA 853 RRset whose validation state is secure MUST be used. This means that 854 the existence of such a RRset effectively disables other forms of 855 name and path validation. A misconfigured TLSA RRset will 856 effectively disable access to the TLS server for all conforming 857 clients, and this document does not provide any means of making a 858 gradual transition to using TLSA. 860 When creating TLSA records with certificate usage type 0 (CA 861 Certificate) or type 2 (Trust Anchor), one needs to understand the 862 implications when choosing between selector type 0 (full certificate) 863 and 1 (SubjectPublicKeyInfo). A careful choice is required because 864 different methods for building trust chains are used by different TLS 865 clients. The following outlines the cases that one should be aware 866 of and discusses the implications of the choice of selector type. 868 Certificate usage 2 is not affected by the different types of chain 869 building when the end entity certificate is the same as the trust 870 anchor certificate. 872 A.1.1. Ambiguities and Corner Cases When TLS Clients Build Trust Chains 874 TLS clients may implement their own chain-building code rather than 875 rely on the chain presented by the TLS server. This means that, 876 except for the end entity certificate, any certificate presented in 877 the suggested chain might or might not be present in the final chain 878 built by the client. 880 Certificates that the client can use to replace certificates from 881 original chain include: 883 o Client's trust anchors 885 o Certificates cached locally 887 o Certificates retrieved from a URI listed in an Authority 888 Information Access X.509v3 extension 890 CAs frequently reissue certificates with different validity period, 891 signature algorithm (such as an different hash algorithm in the 892 signature algorithm), CA key pair (such as for a cross-certificate), 893 or PKIX extensions where the public key and subject remain the same. 894 These reissued certificates are the certificates TLS client can use 895 in place of an original certificate. 897 Clients are known to exchange or remove certificates that could cause 898 TLSA association that rely on the full certificate to fail. For 899 example: 901 o The client considers the signature algorithm of a certificate to 902 no longer be sufficiently secure 904 o The client might not have an associated root certificate in its 905 trust store and instead uses a cross-certificate with an identical 906 subject and public key. 908 A.1.2. Choosing a Selector Type 910 In this section, "false-negative failure" means that a client will 911 not accept the TLSA association for certificate designated by DNS 912 administrator. Also, "false-positive acceptance" means that the 913 client accepts a TLSA association for a certificate that is not 914 designated by the DNS administrator. 916 A.1.2.1. Selector Type 0 (Full Certificate) 918 The "Full certificate" selector provides the most precise 919 specification of a TLS certificate association, capturing all fields 920 of the PKIX certificate. For a DNS administrator, the best course to 921 avoid false-negative failures in the client when using this selector 922 are: 924 o If a CA issued a replacement certificate, don't associate to CA 925 certificates that have a signature algorithm with a hash that is 926 considered weak (such as MD2 and MD5). 928 o Determine how common client applications process the TLSA 929 association using a fresh client installation, that is, with the 930 local certificate cache empty. 932 A.1.2.2. Selector Type 1 (SubjectPublicKeyInfo) 934 A SubjectPublicKeyInfo selector gives greater flexibility in avoiding 935 some false-negative failures caused by trust-chain-building 936 algorithms used in clients. 938 One specific use-case should be noted: creating a TLSA association to 939 certificate I1 that directly signed end entity certificate S1 of the 940 server. Since the key used to sign S1 is fixed, association to I1 941 must succeed: if a client swaps I1 for I2 (a different certificate), 942 its SPKI must match SPKI of I1. Such and association would not 943 suffer from a false-negative failure on client's side if the client 944 uses a reissued CA certificate I2 in place of I1. 946 The attack surface is a bit broader compared to "full certificate" 947 selector: the DNS administrator might unintentionally specify an 948 association that would lead to false-positive acceptance. 950 o The administrator must know or trust the CA not to engage in bad 951 practices, such as not sharing key of I1 for unrelated CA 952 certificates leading to trust-chain redirect. If possible, the 953 administrator should review all CA certificates that have the same 954 SPKI. 956 o The administrator should understand whether some PKIX extension 957 may adversely affect security of the association. If possible, 958 administrators should review all CA certificates that share the 959 SubjectPublicKeyInfo. 961 Using the SubjectPublicKeyInfo selector for association with a 962 certificate in a chain above I1 needs to be decided on a case-by-case 963 basis: there are too many possibilities based on the issuing CA's 964 practices. Unless the full implications of such an association are 965 understood by the administrator, using selector type 0 is a better 966 option from a security perspective. 968 A.2. Provisioning TLSA Records in DNS 970 A.2.1. Provisioning TLSA Records with Aliases 972 The TLSA resource record is not special in the DNS; it acts exactly 973 like any other RRtype where the queried name has one or more labels 974 prefixed to the base name, such as the SRV RRtype [RFC2782]. This 975 affects the way that the TLSA resource record is used when aliasing 976 in the DNS. 978 Note that the IETF sometimes adds new types of aliasing in the DNS. 979 If that happens in the future, those aliases might affect TLSA 980 records, hopefully in a good way. 982 A.2.1.1. Provisioning TLSA Records with CNAME Records 984 Using CNAME to alias in DNS only aliases from the exact name given, 985 not any zones below the given name. For example, assume that a zone 986 file has only the following: 988 sub1.example.com. IN CNAME sub2.example.com. 990 In this case, a request for the A record at "bottom.sub1.example.com" 991 would not return any records because the CNAME given only aliases the 992 name given. Assume, instead, the zone file has the following: 994 sub3.example.com. IN CNAME sub4.example.com. 995 bottom.sub3.example.com. IN CNAME bottom.sub4.example.com. 997 In this case, a request for the A record at bottom.sub3.example.com 998 would in fact return whatever value for the A record exists at 999 bottom.sub4.example.com. 1001 Application implementations and full-service resolvers request DNS 1002 records using libraries that automatically follow CNAME (and DNAME) 1003 aliasing. This allows hosts to put TLSA records in their own zones 1004 or to use CNAME to do redirection. 1006 If the owner of the original domain wants a TLSA record for the same, 1007 they simply enter it under the defined prefix: 1009 ; No TLSA record in target domain 1010 ; 1011 sub5.example.com. IN CNAME sub6.example.com. 1012 _443._tcp.sub5.example.com. IN TLSA 1 1 1 308202c5308201ab... 1013 sub6.example.com. IN A 192.0.2.1 1014 sub6.example.com. IN AAAA 2001:db8::1 1016 If the owner of the original domain wants to have the target domain 1017 host the TLSA record, the original domain uses a CNAME record: 1019 ; TLSA record for original domain has CNAME to target domain 1020 ; 1021 sub5.example.com. IN CNAME sub6.example.com. 1022 _443._tcp.sub5.example.com. IN CNAME _443._tcp.sub6.example.com. 1023 sub6.example.com. IN A 192.0.2.1 1024 sub6.example.com. IN AAAA 2001:db8::1 1025 _443._tcp.sub6.example.com. IN TLSA 1 1 1 536a570ac49d9ba4... 1027 Note that it is acceptable for both the original domain and the 1028 target domain to have TLSA records, but the two records are 1029 unrelated. Consider the following: 1031 ; TLSA record in both the original and target domain 1032 ; 1033 sub5.example.com. IN CNAME sub6.example.com. 1034 _443._tcp.sub5.example.com. IN TLSA 1 1 1 308202c5308201ab... 1035 sub6.example.com. IN A 192.0.2.1 1036 sub6.example.com. IN AAAA 2001:db8::1 1037 _443._tcp.sub6.example.com. IN TLSA 1 1 1 ac49d9ba4570ac49... 1039 In this example, someone looking for the TLSA record for 1040 sub5.example.com would always get the record whose value starts 1041 "308202c5308201ab"; the TLSA record whose value starts 1042 "ac49d9ba4570ac49" would only be sought by someone who is looking for 1043 the TLSA record for sub6.example.com, and never for sub5.example.com. 1044 One should note that deploying different certificates for multiple 1045 services located at a shared TLS listener often requires the use of 1046 TLS SNI (Server Name Indication) [RFC6066]. 1048 Note that these methods use the normal method for DNS aliasing using 1049 CNAME: the DNS client requests the record type that they actually 1050 want. 1052 A.2.1.2. Provisioning TLSA Records with DNAME Records 1054 Using DNAME records allows a zone owner to alias an entire subtree of 1055 names below the name that has the DNAME. This allows the wholesale 1056 aliasing of prefixed records such as those used by TLSA, SRV, and so 1057 on without aliasing the name itself. However, because DNAME can only 1058 be used for subtrees of a base name, it is rarely used to alias 1059 individual hosts that might also be running TLS. 1061 ; TLSA record in target domain, visible in original domain via DNAME 1062 ; 1063 sub5.example.com. IN CNAME sub6.example.com. 1064 _tcp.sub5.example.com. IN DNAME _tcp.sub6.example.com. 1065 sub6.example.com. IN A 192.0.2.1 1066 sub6.example.com. IN AAAA 2001:db8::1 1067 _443._tcp.sub6.example.com. IN TLSA 1 1 1 536a570ac49d9ba4... 1069 A.2.1.3. Provisioning TLSA Records with Wildcards 1071 Wildcards are generally not terribly useful for RRtypes that require 1072 prefixing because you can only wildcard at a layer below the host 1073 name. For example, if you want to have the same TLSA record for 1074 every TCP port for www.example.com, you might have 1076 *._tcp.www.example.com. IN TLSA 1 1 1 5c1502a6549c423b... 1078 This is possibly useful in some scenarios where the same service is 1079 offered on many ports. 1081 A.3. Securing the Last Hop 1083 As described in Section 4, an application processing TLSA records 1084 must know the DNSSEC validity of those records. There are many ways 1085 for the application to securely find this out, and this specification 1086 does not mandate any single method. 1088 Some common methods for an application to know the DNSSEC validity of 1089 TLSA records include: 1091 o The application can have its own DNS resolver and DNSSEC 1092 validation stack. 1094 o The application can communicate through a trusted channel (such as 1095 requests to the operating system under which the application is 1096 running) to a local DNS resolver that does DNSSEC validation. 1098 o The application can communicate through a secured channel (such as 1099 requests running over TLS, IPsec, TSIG or SIG(0)) to a non-local 1100 DNS resolver that does DNSSEC validation. 1102 o The application can communicate through a secured channel (such as 1103 requests running over TLS, IPsec, TSIG or SIG(0)) to a non-local 1104 DNS resolver that does not do DNSSEC validation, but gets 1105 responses through a secured channel from a different DNS resolver 1106 that does DNSSEC validation. 1108 A.4. Handling Certificate Rollover 1110 Certificate rollover is handled in much the same was as for rolling 1111 DNSSEC zone signing keys using the pre-publish key rollover method 1112 [RFC4641]. Suppose example.com has a single TLSA record for a TLS 1113 service on TCP port 990: 1115 _990._tcp.example.com IN TLSA 1 1 1 1CFC98A706BCF3683015... 1117 To start the rollover process, obtain or generate the new certificate 1118 or SubjectPublicKeyInfo to be used after the rollover and generate 1119 the new TLSA record. Add that record alongside the old one: 1121 _990._tcp.example.com IN TLSA 1 1 1 1CFC98A706BCF3683015... 1122 _990._tcp.example.com IN TLSA 1 1 1 62D5414CD1CC657E3D30... 1124 After the new records have propagated to the authoritative 1125 nameservers and the TTL of the old record has expired, switch to the 1126 new certificate on the TLS server. Once this has occurred, the old 1127 TLSA record can be removed: 1129 _990._tcp.example.com IN TLSA 1 1 1 62D5414CD1CC657E3D30... 1131 This completes the certificate rollover. 1133 Appendix B. Pseudocode for Using TLSA 1135 This appendix describes the interactions given earlier in this 1136 specification in pseudocode format. This appendix is non-normative. 1137 If the steps below disagree with the text earlier in the document, 1138 the steps earlier in the document should be considered correct and 1139 this text incorrect. 1141 Note that this pseudocode is more strict than the normative text. 1142 For instance, it forces an order on the evaluation of criteria which 1143 is not mandatory from the normative text. 1145 B.1. Helper Functions 1147 // implement the function for exiting 1148 function Finish (F) = { 1149 if (F == ABORT_TLS) { 1150 abort the TLS handshake or prevent TLS from starting 1151 exit 1152 } 1154 if (F == NO_TLSA) { 1155 fall back to non-TLSA certificate validation 1156 exit 1157 } 1159 if (F == ACCEPT) { 1160 accept the TLS connection 1161 exit 1162 } 1164 // unreachable 1165 } 1167 // implement the selector function 1168 function Select (S, X) = { 1169 // Full certificate 1170 if (S == 0) { 1171 return X 1172 } 1174 // SubjectPublicKeyInfo 1175 if (S == 1) { 1176 return X.SubjectPublicKeyInfo 1177 } 1179 // unreachable 1181 } 1183 // implement the matching function 1184 function Match (M, X, Y) { 1185 // Exact match on selected content 1186 if (M == 0) { 1187 return (X == Y) 1188 } 1190 // SHA-256 hash of selected content 1191 if (M == 1) { 1192 return (SHA-256(X) == Y) 1193 } 1195 // SHA-512 hash of selected content 1196 if (M == 2) { 1197 return (SHA-512(X) == Y) 1198 } 1200 // unreachable 1201 } 1203 B.2. Main TLSA Pseudo Code 1205 TLS connect using [transport] to [name] on [port] and receiving end 1206 entity cert C for the TLS server: 1208 (TLSArecords, ValState) = DNSSECValidatedLookup( 1209 domainname=_[port]._[transport].[name], RRtype=TLSA) 1211 // check for states that would change processing 1212 if (ValState == BOGUS) { 1213 Finish(ABORT_TLS) 1214 } 1215 if ((ValState == INDETERMINATE) or (ValState == INSECURE)) { 1216 Finish(NO_TLSA) 1217 } 1218 // if here, ValState must be SECURE 1220 for each R in TLSArecords { 1221 // unusable records include unknown certUsage, unknown 1222 // selectorType, unknown matchingType, erroneous RDATA, and 1223 // prohibited by local policy 1224 if (R is unusable) { 1225 remove R from TLSArecords 1226 } 1228 } 1229 if (length(TLSArecords) == 0) { 1230 Finish(NO_TLSA) 1231 } 1233 // A TLS client might have multiple trust anchors that it might use 1234 // when validating the TLS server's end entity certificate. Also, 1235 // there can be multiple PKIX certification paths for the 1236 // certificates given by the server in TLS. Thus, there are 1237 // possibly many chains that might need to be tested during 1238 // PKIX path validation. 1240 for each R in TLSArecords { 1242 // pass PKIX certificate validation and chain through a CA cert 1243 // that comes from TLSA 1244 if (R.certUsage == 0) { 1245 for each PKIX certification path H { 1246 if (C passes PKIX certification path validation in H) { 1247 for each D in H { 1248 if ((D is a CA certificate) and 1249 Match(R.matchingType, Select(R.selectorType, D), 1250 R.cert)) { 1251 Finish(ACCEPT) 1252 } 1253 } 1254 } 1255 } 1256 } 1258 // pass PKIX certificate validation and match EE cert from TLSA 1259 if (R.certUsage == 1) { 1260 for each PKIX certification path H { 1261 if ((C passes PKIX certificate validation in H) and 1262 Match(R.matchingType, Select(R.selectorType, C), 1263 R.cert)) { 1264 Finish(ACCEPT) 1265 } 1266 } 1267 } 1269 // pass PKIX certificaten validation using TLSA record as the 1270 // trust anchor 1271 if (R.certUsage == 2) { 1272 for each PKIX certification path H that has R as the 1273 trust anchor { 1274 if (C passes PKIX certification validation in H) and 1275 Match(R.matchingType, Select(R.selectorType, C), 1276 R.cert)) { 1277 Finish(ACCEPT) 1278 } 1279 } 1280 } 1282 // match the TLSA record and the TLS certificate 1283 if (R.certUsage == 3) { 1284 if Match(R.matchingType, Select(R.selectorType, C), R.cert) 1285 Finish(ACCEPT) 1286 } 1287 } 1289 } 1291 // if here, then none of the TLSA records ended in "Finish(ACCEPT)" 1292 // so abort TLS 1293 Finish(ABORT_TLS) 1295 Appendix C. Examples 1297 The following are examples of self-signed certificates that have been 1298 been generated with various selectors and matching types. They were 1299 generated with one piece of software, and validated by an individual 1300 using other tools. 1302 S = Selector 1303 M = Matching Type 1305 S M Association Data 1306 0 0 30820454308202BC020900AB58D24E77AD2AF6300D06092A86 1307 4886F70D0101050500306C310B3009060355040613024E4C31163014 1308 0603550408130D4E6F6F72642D486F6C6C616E643112301006035504 1309 071309416D7374657264616D310C300A060355040A13034F53333123 1310 30210603550403131A64616E652E6B6965762E70726163746963756D 1311 2E6F73332E6E6C301E170D3132303131363136353730335A170D3232 1312 303131333136353730335A306C310B3009060355040613024E4C3116 1313 30140603550408130D4E6F6F72642D486F6C6C616E64311230100603 1314 5504071309416D7374657264616D310C300A060355040A13034F5333 1315 312330210603550403131A64616E652E6B6965762E70726163746963 1316 756D2E6F73332E6E6C308201A2300D06092A864886F70D0101010500 1317 0382018F003082018A0282018100E62C84A5AFE59F0A2A6B250DEE68 1318 7AC8C5C604F57D26CEB2119140FFAC38C4B9CBBE8923082E7F81626B 1319 6AD5DEA0C8771C74E3CAA7F613054AEFA3673E48FFE47B3F7AF987DE 1320 281A68230B24B9DA1A98DCBE51195B60E42FD7517C328D983E26A827 1321 C877AB914EE4C1BFDEAD48BD25BE5F2C473BA9C1CBBDDDA0C374D0D5 1322 8C389CC3D6D8C20662E19CF768F32441B7F7D14AEA8966CE7C32A172 1323 2AB38623D008029A9E4702883F8B977A1A1E5292BF8AD72239D40393 1324 37B86A3AC60FA001290452177BF1798609A05A130F033457A5212629 1325 FBDDB8E70E2A9E6556873C4F7CA46AE4A8B178F05FB319005E1C1C7D 1326 4BD77DFA34035563C126AA2C3328B900E7990AC9787F01DA82F74C3D 1327 4B6674CCECE1FD4C6EF9E6644F4635EDEDA39D8B0E2F7C8E06DAE775 1328 6213BD3D60831175BE290442B4AFC5AE6F46B769855A067C1097E617 1329 962529E166F22AEE10DDB981B8CD6FF17D3D70723169038DBFBC1A44 1330 9C8D0D31BC683C5F3CE26148E42EC9BBD4D9F261569B25B53C1D7FC2 1331 DDFF6B4CAC050203010001300D06092A864886F70D01010505000382 1332 0181002B2ABE063E9C86AC4A1F7835372091079C8276A9C2C5D1EC57 1333 64DE523FDDABDEAB3FD34E6FE6CBA054580A6785A663595D90132B93 1334 D473929E81FA0887D2FFF78A81C7D014B97778AB6AC9E5E690F6F5A9 1335 E92BB5FBAB71B857AE69B6E18BDCCB0BA6FCD9D4B084A34F3635148C 1336 495D48FE635903B888EC1DEB2610548EDD48D63F86513A4562469831 1337 48C0D5DB82D73A4C350A42BB661D763430FC6C8E5F9D13EA1B76AA52 1338 A4C358E5EA04000F794618303AB6CEEA4E9A8E9C74D73C1B0B7BAF16 1339 DEDE7696B5E2F206F777100F5727E1684D4132F5E692F47AF6756EA8 1340 B421000BE031B5D8F0220E436B51FB154FE9595333C13A2403F9DE08 1341 E5DDC5A22FD6182E339593E26374450220BC14F3E40FF33F084526B0 1342 9C34250702E8A352B332CCCB0F9DE2CF2B338823B92AFC61C0B6B8AB 1343 DB5AF718ED8DDA97C298E46B82A01B14814868CFA4F2C36268BFFF4A 1344 591F42658BF75918902D3E426DFE1D5FF0FC6A212071F6DA8BD833FE 1345 2E560D87775E8EE9333C05B6FB8EB56589D910DB5EA903 1347 0 1 EFDDF0D915C7BDC5782C0881E1B2A95AD099FBDD06D7B1F779 1348 82D9364338D955 1350 0 2 81EE7F6C0ECC6B09B7785A9418F54432DE630DD54DC6EE9E3C 1351 49DE547708D236D4C413C3E97E44F969E635958AA410495844127C04 1352 883503E5B024CF7A8F6A94 1354 1 0 308201A2300D06092A864886F70D01010105000382018F0030 1355 82018A0282018100E62C84A5AFE59F0A2A6B250DEE687AC8C5C604F5 1356 7D26CEB2119140FFAC38C4B9CBBE8923082E7F81626B6AD5DEA0C877 1357 1C74E3CAA7F613054AEFA3673E48FFE47B3F7AF987DE281A68230B24 1358 B9DA1A98DCBE51195B60E42FD7517C328D983E26A827C877AB914EE4 1359 C1BFDEAD48BD25BE5F2C473BA9C1CBBDDDA0C374D0D58C389CC3D6D8 1360 C20662E19CF768F32441B7F7D14AEA8966CE7C32A1722AB38623D008 1361 029A9E4702883F8B977A1A1E5292BF8AD72239D4039337B86A3AC60F 1362 A001290452177BF1798609A05A130F033457A5212629FBDDB8E70E2A 1363 9E6556873C4F7CA46AE4A8B178F05FB319005E1C1C7D4BD77DFA3403 1364 5563C126AA2C3328B900E7990AC9787F01DA82F74C3D4B6674CCECE1 1365 FD4C6EF9E6644F4635EDEDA39D8B0E2F7C8E06DAE7756213BD3D6083 1366 1175BE290442B4AFC5AE6F46B769855A067C1097E617962529E166F2 1367 2AEE10DDB981B8CD6FF17D3D70723169038DBFBC1A449C8D0D31BC68 1368 3C5F3CE26148E42EC9BBD4D9F261569B25B53C1D7FC2DDFF6B4CAC05 1369 0203010001 1371 1 1 8755CDAA8FE24EF16CC0F2C918063185E433FAAF1415664911 1372 D9E30A924138C4 1374 1 2 D43165B4CDF8F8660AECCCC5344D9D9AE45FFD7E6AAB7AB9EE 1375 C169B58E11F227ED90C17330CC17B5CCEF0390066008C720CEC6AAE5 1376 33A934B3A2D7E232C94AB4 1378 Authors' Addresses 1380 Paul Hoffman 1381 VPN Consortium 1383 Email: paul.hoffman@vpnc.org 1385 Jakob Schlyter 1386 Kirei AB 1388 Email: jakob@kirei.se