idnits 2.17.00 (12 Aug 2021) /tmp/idnits11898/draft-ietf-tls-rfc4346-bis-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 14. -- Found old boilerplate from RFC 3978, Section 5.5 on line 5028. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 5005. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 5012. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 5018. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 140 instances of too long lines in the document, the longest one being 12 characters in excess of 72. == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 706 has weird spacing: '...gorithm bul...' == Line 2251 has weird spacing: '...ensions reque...' == Line 3460 has weird spacing: '...ensions reque...' == Line 4642 has weird spacing: '...tegrity and...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: After sending a hello request, servers SHOULD not repeat the request until the subsequent handshake negotiation is complete. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: Warning: Because the SessionID is transmitted without encryption or immediate MAC protection, servers MUST not place confidential information in session identifiers or let the contents of fake session identifiers cause any breach of security. (Note that the content of the handshake as a whole, including the SessionID, is protected by the Finished messages exchanged at the end of the handshake.) == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: Meaning of this message: With this message, the premaster secret is set, either though direct transmission of the RSA-encrypted secret, or by the transmission of Diffie-Hellman parameters which will allow each side to agree upon the same premaster secret. When the key exchange method is DH_RSA or DH_DSS, client certification has been requested, and the client was able to respond with a certificate which contained a Diffie-Hellman public key whose parameters (group and generator) matched those specified by the server in its certificate, this message MUST not contain any data. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- Couldn't find a document date in the document -- date freshness check skipped. -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. 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: '0' on line 293 -- Looks like a reference, but probably isn't: '1' on line 293 -- Looks like a reference, but probably isn't: '3' on line 4173 -- Looks like a reference, but probably isn't: '9' on line 329 -- Looks like a reference, but probably isn't: '2' on line 3358 -- Looks like a reference, but probably isn't: '4' on line 364 -- Looks like a reference, but probably isn't: '8' on line 365 -- Looks like a reference, but probably isn't: '10' on line 459 -- Looks like a reference, but probably isn't: '20' on line 3596 -- Looks like a reference, but probably isn't: '48' on line 3778 -- Looks like a reference, but probably isn't: '32' on line 3780 == Missing Reference: 'ChangeCipherSpec' is mentioned on line 1566, but not defined -- Looks like a reference, but probably isn't: '28' on line 3353 == Missing Reference: 'TLS' is mentioned on line 4476, but not defined == Missing Reference: 'IANA' is mentioned on line 3144, but not defined -- Looks like a reference, but probably isn't: '46' on line 3558 -- Looks like a reference, but probably isn't: '12' on line 3605 == Missing Reference: 'PKCS1' is mentioned on line 3069, but not defined == Missing Reference: 'RFC 2434' is mentioned on line 3132, but not defined ** Obsolete undefined reference: RFC 2434 (Obsoleted by RFC 5226) == Missing Reference: 'RSADSI' is mentioned on line 3910, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'AES' -- Possible downref: Non-RFC (?) normative reference: ref. '3DES' -- Possible downref: Non-RFC (?) normative reference: ref. 'DES' -- Possible downref: Non-RFC (?) normative reference: ref. 'DSS' ** Downref: Normative reference to an Informational RFC: RFC 2104 (ref. 'HMAC') ** Obsolete normative reference: RFC 2616 (ref. 'HTTP') (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) -- Possible downref: Non-RFC (?) normative reference: ref. 'IDEA' ** Obsolete normative reference: RFC 3490 (ref. 'IDNA') (Obsoleted by RFC 5890, RFC 5891) ** Downref: Normative reference to an Informational RFC: RFC 1321 (ref. 'MD5') ** Obsolete normative reference: RFC 2560 (ref. 'OCSP') (Obsoleted by RFC 6960) ** Obsolete normative reference: RFC 2313 (ref. 'PKCS1A') (Obsoleted by RFC 2437) ** Obsolete normative reference: RFC 3447 (ref. 'PKCS1B') (Obsoleted by RFC 8017) ** Obsolete normative reference: RFC 3280 (ref. 'PKIX') (Obsoleted by RFC 5280) ** Downref: Normative reference to an Informational RFC: RFC 2268 (ref. 'RC2') -- Possible downref: Non-RFC (?) normative reference: ref. 'SCH' -- Possible downref: Non-RFC (?) normative reference: ref. 'SHA' ** Obsolete normative reference: RFC 3268 (ref. 'TLSAES') (Obsoleted by RFC 5246) ** Obsolete normative reference: RFC 3546 (ref. 'TLSEXT') (Obsoleted by RFC 4366) ** Obsolete normative reference: RFC 2396 (ref. 'URI') (Obsoleted by RFC 3986) -- Possible downref: Non-RFC (?) normative reference: ref. 'X509-4th' -- Possible downref: Non-RFC (?) normative reference: ref. 'X509-4th-TC1' -- Obsolete informational reference (is this intentional?): RFC 2402 (ref. 'AH') (Obsoleted by RFC 4302, RFC 4305) -- Obsolete informational reference (is this intentional?): RFC 2406 (ref. 'ESP') (Obsoleted by RFC 4303, RFC 4305) -- Obsolete informational reference (is this intentional?): RFC 1750 (ref. 'RANDOM') (Obsoleted by RFC 4086) -- Obsolete informational reference (is this intentional?): RFC 1948 (ref. 'SEQNUM') (Obsoleted by RFC 6528) -- Obsolete informational reference (is this intentional?): RFC 1832 (ref. 'XDR') (Obsoleted by RFC 4506) Summary: 17 errors (**), 0 flaws (~~), 17 warnings (==), 36 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Tim Dierks 2 Independent 3 Eric Rescorla 4 INTERNET-DRAFT Network Resonance, Inc. 5 February 2006 (Expires August 2006) 7 The TLS Protocol 8 Version 1.2 10 Status of this Memo 11 By submitting this Internet-Draft, each author represents that any 12 applicable patent or other IPR claims of which he or she is aware 13 have been or will be disclosed, and any of which he or she becomes 14 aware will be disclosed, in accordance with Section 6 of BCP 79. 16 Internet-Drafts are working documents of the Internet Engineering 17 Task Force (IETF), its areas, and its working groups. Note that 18 other groups may also distribute working documents as Internet- 19 Drafts. 21 Internet-Drafts are draft documents valid for a maximum of six months 22 and may be updated, replaced, or obsoleted by other documents at any 23 time. It is inappropriate to use Internet-Drafts as reference 24 material or to cite them other than as "work in progress." 26 The list of current Internet-Drafts can be accessed at 27 http://www.ietf.org/ietf/1id-abstracts.txt. 29 The list of Internet-Draft Shadow Directories can be accessed at 30 http://www.ietf.org/shadow.html. 32 Copyright Notice 34 Copyright (C) The Internet Society (2006). 36 Abstract 38 This document specifies Version 1.2 of the Transport Layer Security 39 (TLS) protocol. The TLS protocol provides communications security 40 over the Internet. The protocol allows client/server applications to 41 communicate in a way that is designed to prevent eavesdropping, 42 tampering, or message forgery. 44 Table of Contents 46 1. Introduction 4 47 1.1 Differences from TLS 1.1 5 48 1.1 Requirements Terminology 5 49 2. Goals 5 50 3. Goals of this document 6 51 4. Presentation language 6 52 4.1. Basic block size 7 53 4.2. Miscellaneous 7 54 4.3. Vectors 7 55 4.4. Numbers 8 56 4.5. Enumerateds 8 57 4.6. Constructed types 9 58 4.6.1. Variants 10 59 4.7. Cryptographic attributes 11 60 4.8. Constants 12 61 5. HMAC and the pseudorandom function 12 62 6. The TLS Record Protocol 14 63 6.1. Connection states 15 64 6.2. Record layer 17 65 6.2.1. Fragmentation 18 66 6.2.2. Record compression and decompression 19 67 6.2.3. Record payload protection 19 68 6.2.3.1. Null or standard stream cipher 20 69 6.2.3.2. CBC block cipher 21 70 6.3. Key calculation 23 71 7. The TLS Handshaking Protocols 24 72 7.1. Change cipher spec protocol 26 73 7.2. Alert protocol 26 74 7.2.1. Closure alerts 27 75 7.2.2. Error alerts 28 76 7.3. Handshake Protocol overview 32 77 7.4. Handshake protocol 36 78 7.4.1. Hello messages 37 79 7.4.1.1. Hello request 37 80 7.4.1.2. Client hello 38 81 7.4.1.3. Server hello 41 82 7.4.1.4 Hello Extensions 42 83 7.4.1.4.1 Server Name Indication 44 84 7.4.1.4.2 Maximum Fragment Length Negotiation 45 85 7.4.1.4.3 Client Certificate URLs 47 86 7.4.1.4.4 Trusted CA Indication 47 87 7.4.1.4.5 Truncated HMAC 49 88 7.4.1.4.6 Certificate Status Request 50 89 7.4.1.4.7 Procedure for Defining New Extensions 51 90 7.4.2. Server certificate 52 91 7.4.3. Server key exchange message 53 92 7.4.4. CertificateStatus 56 93 7.4.5. Certificate request 57 94 7.4.6. Server hello done 58 95 7.4.7. Client certificate 58 96 7.4.8. Client Certificate URLs 59 97 7.4.9. Client key exchange message 61 98 7.4.9.1. RSA encrypted premaster secret message 62 99 7.4.9.2. Client Diffie-Hellman public value 64 100 7.4.10. Certificate verify 64 101 7.4.10. Finished 65 102 8. Cryptographic computations 66 103 8.1. Computing the master secret 66 104 8.1.1. RSA 67 105 8.1.2. Diffie-Hellman 67 106 9. Mandatory Cipher Suites 67 107 A. Protocol constant values 71 108 A.1. Record layer 71 109 A.2. Change cipher specs message 72 110 A.3. Alert messages 72 111 A.4. Handshake protocol 74 112 A.4.1. Hello messages 74 113 A.4.2. Server authentication and key exchange messages 77 114 A.4.3. Client authentication and key exchange messages 78 115 A.4.4. Handshake finalization message 79 116 A.5. The CipherSuite 80 117 A.6. The Security Parameters 82 118 B. Glossary 84 119 C. CipherSuite definitions 88 120 D. Implementation Notes 90 121 D.1 Random Number Generation and Seeding 90 122 D.2 Certificates and authentication 90 123 D.3 CipherSuites 90 124 E. Backward Compatibility With SSL 91 125 E.1. Version 2 client hello 92 126 E.2. Avoiding man-in-the-middle version rollback 93 127 F. Security analysis 95 128 F.1. Handshake protocol 95 129 F.1.1. Authentication and key exchange 95 130 F.1.1.1. Anonymous key exchange 95 131 F.1.1.2. RSA key exchange and authentication 96 132 F.1.1.3. Diffie-Hellman key exchange with authentication 97 133 F.1.2. Version rollback attacks 97 134 F.1.3. Detecting attacks against the handshake protocol 98 135 F.1.4. Resuming sessions 98 136 F.1.5 Extensions 99 137 F.1.5.1 Security of server_name 99 138 F.1.5.2 Security of client_certificate_url 100 139 F.1.5.4. Security of trusted_ca_keys 101 140 F.1.5.5. Security of truncated_hmac 101 141 F.1.5.6. Security of status_request 102 142 F.2. Protecting application data 102 143 F.3. Explicit IVs 103 144 F.4 Security of Composite Cipher Modes 103 145 F.5 Denial of Service 104 146 F.6. Final notes 104 148 Change history 150 18-Feb-06 First draft by ekr@rtfm.com 152 1. Introduction 154 The primary goal of the TLS Protocol is to provide privacy and data 155 integrity between two communicating applications. The protocol is 156 composed of two layers: the TLS Record Protocol and the TLS Handshake 157 Protocol. At the lowest level, layered on top of some reliable 158 transport protocol (e.g., TCP[TCP]), is the TLS Record Protocol. The 159 TLS Record Protocol provides connection security that has two basic 160 properties: 162 - The connection is private. Symmetric cryptography is used for 163 data encryption (e.g., DES [DES], RC4 [SCH], etc.). The keys for 164 this symmetric encryption are generated uniquely for each 165 connection and are based on a secret negotiated by another 166 protocol (such as the TLS Handshake Protocol). The Record 167 Protocol can also be used without encryption. 169 - The connection is reliable. Message transport includes a message 170 integrity check using a keyed MAC. Secure hash functions (e.g., 171 SHA, MD5, etc.) are used for MAC computations. The Record 172 Protocol can operate without a MAC, but is generally only used in 173 this mode while another protocol is using the Record Protocol as 174 a transport for negotiating security parameters. 176 The TLS Record Protocol is used for encapsulation of various higher 177 level protocols. One such encapsulated protocol, the TLS Handshake 178 Protocol, allows the server and client to authenticate each other and 179 to negotiate an encryption algorithm and cryptographic keys before 180 the application protocol transmits or receives its first byte of 181 data. The TLS Handshake Protocol provides connection security that 182 has three basic properties: 184 - The peer's identity can be authenticated using asymmetric, or 185 public key, cryptography (e.g., RSA [RSA], DSS [DSS], etc.). This 186 authentication can be made optional, but is generally required 187 for at least one of the peers. 189 - The negotiation of a shared secret is secure: the negotiated 190 secret is unavailable to eavesdroppers, and for any authenticated 191 connection the secret cannot be obtained, even by an attacker who 192 can place himself in the middle of the connection. 194 - The negotiation is reliable: no attacker can modify the 195 negotiation communication without being detected by the parties 196 to the communication. 198 One advantage of TLS is that it is application protocol independent. 199 Higher level protocols can layer on top of the TLS Protocol 200 transparently. The TLS standard, however, does not specify how 201 protocols add security with TLS; the decisions on how to initiate TLS 202 handshaking and how to interpret the authentication certificates 203 exchanged are left up to the judgment of the designers and 204 implementors of protocols which run on top of TLS. 206 1.1 Differences from TLS 1.1 207 This document is a revision of the TLS 1.1 [TLS1.1] protocol which 208 contains improved flexibility, particularly for negotiation of 209 cryptographic algorithms. The major changes are: 211 - Merged in TLS Extensions and AES Cipher Suites from external 212 documents. 214 - Replacement of MD5/SHA-1 combination in the PRF 216 - Replacement of MD5/SHA-1 combination in the digitally-signed 217 element. 219 - Allow the client to indicate which hash functions it supports. 221 1.1 Requirements Terminology 223 Keywords "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT" and 224 "MAY" that appear in this document are to be interpreted as described 225 in RFC 2119 [REQ]. 227 2. Goals 229 The goals of TLS Protocol, in order of their priority, are: 231 1. Cryptographic security: TLS should be used to establish a secure 232 connection between two parties. 234 2. Interoperability: Independent programmers should be able to 235 develop applications utilizing TLS that will then be able to 236 successfully exchange cryptographic parameters without knowledge 237 of one another's code. 239 3. Extensibility: TLS seeks to provide a framework into which new 240 public key and bulk encryption methods can be incorporated as 241 necessary. This will also accomplish two sub-goals: to prevent 242 the need to create a new protocol (and risking the introduction 243 of possible new weaknesses) and to avoid the need to implement an 244 entire new security library. 246 4. Relative efficiency: Cryptographic operations tend to be highly 247 CPU intensive, particularly public key operations. For this 248 reason, the TLS protocol has incorporated an optional session 249 caching scheme to reduce the number of connections that need to 250 be established from scratch. Additionally, care has been taken to 251 reduce network activity. 253 3. Goals of this document 255 This document and the TLS protocol itself are based on the SSL 3.0 256 Protocol Specification as published by Netscape. The differences 257 between this protocol and SSL 3.0 are not dramatic, but they are 258 significant enough that the various versions of TLS and SSL 3.0 do 259 not interoperate (although each protocol incorporates a mechanism by 260 which an implementation can back down prior versions. This document 261 is intended primarily for readers who will be implementing the 262 protocol and those doing cryptographic analysis of it. The 263 specification has been written with this in mind, and it is intended 264 to reflect the needs of those two groups. For that reason, many of 265 the algorithm-dependent data structures and rules are included in the 266 body of the text (as opposed to in an appendix), providing easier 267 access to them. 269 This document is not intended to supply any details of service 270 definition nor interface definition, although it does cover select 271 areas of policy as they are required for the maintenance of solid 272 security. 274 4. Presentation language 276 This document deals with the formatting of data in an external 277 representation. The following very basic and somewhat casually 278 defined presentation syntax will be used. The syntax draws from 279 several sources in its structure. Although it resembles the 280 programming language "C" in its syntax and XDR [XDR] in both its 281 syntax and intent, it would be risky to draw too many parallels. The 282 purpose of this presentation language is to document TLS only, not to 283 have general application beyond that particular goal. 285 4.1. Basic block size 287 The representation of all data items is explicitly specified. The 288 basic data block size is one byte (i.e. 8 bits). Multiple byte data 289 items are concatenations of bytes, from left to right, from top to 290 bottom. From the bytestream a multi-byte item (a numeric in the 291 example) is formed (using C notation) by: 293 value = (byte[0] << 8*(n-1)) | (byte[1] << 8*(n-2)) | 294 ... | byte[n-1]; 296 This byte ordering for multi-byte values is the commonplace network 297 byte order or big endian format. 299 4.2. Miscellaneous 301 Comments begin with "/*" and end with "*/". 303 Optional components are denoted by enclosing them in "[[ ]]" double 304 brackets. 306 Single byte entities containing uninterpreted data are of type 307 opaque. 309 4.3. Vectors 311 A vector (single dimensioned array) is a stream of homogeneous data 312 elements. The size of the vector may be specified at documentation 313 time or left unspecified until runtime. In either case the length 314 declares the number of bytes, not the number of elements, in the 315 vector. The syntax for specifying a new type T' that is a fixed 316 length vector of type T is 318 T T'[n]; 320 Here T' occupies n bytes in the data stream, where n is a multiple of 321 the size of T. The length of the vector is not included in the 322 encoded stream. 324 In the following example, Datum is defined to be three consecutive 325 bytes that the protocol does not interpret, while Data is three 326 consecutive Datum, consuming a total of nine bytes. 328 opaque Datum[3]; /* three uninterpreted bytes */ 329 Datum Data[9]; /* 3 consecutive 3 byte vectors */ 330 Variable length vectors are defined by specifying a subrange of legal 331 lengths, inclusively, using the notation . When 332 encoded, the actual length precedes the vector's contents in the byte 333 stream. The length will be in the form of a number consuming as many 334 bytes as required to hold the vector's specified maximum (ceiling) 335 length. A variable length vector with an actual length field of zero 336 is referred to as an empty vector. 338 T T'; 340 In the following example, mandatory is a vector that must contain 341 between 300 and 400 bytes of type opaque. It can never be empty. The 342 actual length field consumes two bytes, a uint16, sufficient to 343 represent the value 400 (see Section 4.4). On the other hand, longer 344 can represent up to 800 bytes of data, or 400 uint16 elements, and it 345 may be empty. Its encoding will include a two byte actual length 346 field prepended to the vector. The length of an encoded vector must 347 be an even multiple of the length of a single element (for example, a 348 17 byte vector of uint16 would be illegal). 350 opaque mandatory<300..400>; 351 /* length field is 2 bytes, cannot be empty */ 352 uint16 longer<0..800>; 353 /* zero to 400 16-bit unsigned integers */ 355 4.4. Numbers 357 The basic numeric data type is an unsigned byte (uint8). All larger 358 numeric data types are formed from fixed length series of bytes 359 concatenated as described in Section 4.1 and are also unsigned. The 360 following numeric types are predefined. 362 uint8 uint16[2]; 363 uint8 uint24[3]; 364 uint8 uint32[4]; 365 uint8 uint64[8]; 367 All values, here and elsewhere in the specification, are stored in 368 "network" or "big-endian" order; the uint32 represented by the hex 369 bytes 01 02 03 04 is equivalent to the decimal value 16909060. 371 4.5. Enumerateds 373 An additional sparse data type is available called enum. A field of 374 type enum can only assume the values declared in the definition. 375 Each definition is a different type. Only enumerateds of the same 376 type may be assigned or compared. Every element of an enumerated must 377 be assigned a value, as demonstrated in the following example. Since 378 the elements of the enumerated are not ordered, they can be assigned 379 any unique value, in any order. 381 enum { e1(v1), e2(v2), ... , en(vn) [[, (n)]] } Te; 383 Enumerateds occupy as much space in the byte stream as would its 384 maximal defined ordinal value. The following definition would cause 385 one byte to be used to carry fields of type Color. 387 enum { red(3), blue(5), white(7) } Color; 389 One may optionally specify a value without its associated tag to 390 force the width definition without defining a superfluous element. 391 In the following example, Taste will consume two bytes in the data 392 stream but can only assume the values 1, 2 or 4. 394 enum { sweet(1), sour(2), bitter(4), (32000) } Taste; 396 The names of the elements of an enumeration are scoped within the 397 defined type. In the first example, a fully qualified reference to 398 the second element of the enumeration would be Color.blue. Such 399 qualification is not required if the target of the assignment is well 400 specified. 402 Color color = Color.blue; /* overspecified, legal */ 403 Color color = blue; /* correct, type implicit */ 405 For enumerateds that are never converted to external representation, 406 the numerical information may be omitted. 408 enum { low, medium, high } Amount; 410 4.6. Constructed types 412 Structure types may be constructed from primitive types for 413 convenience. Each specification declares a new, unique type. The 414 syntax for definition is much like that of C. 416 struct { 417 T1 f1; 418 T2 f2; 419 ... 420 Tn fn; 421 } [[T]]; 422 The fields within a structure may be qualified using the type's name 423 using a syntax much like that available for enumerateds. For example, 424 T.f2 refers to the second field of the previous declaration. 425 Structure definitions may be embedded. 427 4.6.1. Variants 429 Defined structures may have variants based on some knowledge that is 430 available within the environment. The selector must be an enumerated 431 type that defines the possible variants the structure defines. There 432 must be a case arm for every element of the enumeration declared in 433 the select. The body of the variant structure may be given a label 434 for reference. The mechanism by which the variant is selected at 435 runtime is not prescribed by the presentation language. 437 struct { 438 T1 f1; 439 T2 f2; 440 .... 441 Tn fn; 442 select (E) { 443 case e1: Te1; 444 case e2: Te2; 445 .... 446 case en: Ten; 447 } [[fv]]; 448 } [[Tv]]; 450 For example: 452 enum { apple, orange } VariantTag; 453 struct { 454 uint16 number; 455 opaque string<0..10>; /* variable length */ 456 } V1; 457 struct { 458 uint32 number; 459 opaque string[10]; /* fixed length */ 460 } V2; 461 struct { 462 select (VariantTag) { /* value of selector is implicit */ 463 case apple: V1; /* VariantBody, tag = apple */ 464 case orange: V2; /* VariantBody, tag = orange */ 465 } variant_body; /* optional label on variant */ 466 } VariantRecord; 468 Variant structures may be qualified (narrowed) by specifying a value 469 for the selector prior to the type. For example, a 470 orange VariantRecord 472 is a narrowed type of a VariantRecord containing a variant_body of 473 type V2. 475 4.7. Cryptographic attributes 477 The four cryptographic operations digital signing, stream cipher 478 encryption, block cipher encryption, and public key encryption are 479 designated digitally-signed, stream-ciphered, block-ciphered, and 480 public-key-encrypted, respectively. A field's cryptographic 481 processing is specified by prepending an appropriate key word 482 designation before the field's type specification. Cryptographic keys 483 are implied by the current session state (see Section 6.1). 485 In digital signing, one-way hash functions are used as input for a 486 signing algorithm. A digitally-signed element is encoded as an opaque 487 vector <0..2^16-1>, where the length is specified by the signing 488 algorithm and key. 490 In RSA signing, the output of the chosen hash function is encoded as 491 a PKCS #1 DigestInfo and then signed using block type 01 as described 492 in Section 8.1 as described in [PKCS1A]. 494 Note: the standard reference for PKCS#1 is now RFC 3447 [PKCS1B]. 495 However, to minimize differences with TLS 1.0 text, we are using the 496 terminology of RFC 2313 [PKCS1A]. 498 In DSS, the 20 bytes of the SHA-1 hash are run directly through the 499 Digital Signing Algorithm with no additional hashing. This produces 500 two values, r and s. The DSS signature is an opaque vector, as above, 501 the contents of which are the DER encoding of: 503 Dss-Sig-Value ::= SEQUENCE { 504 r INTEGER, 505 s INTEGER 506 } 508 In stream cipher encryption, the plaintext is exclusive-ORed with an 509 identical amount of output generated from a cryptographically-secure 510 keyed pseudorandom number generator. 512 In block cipher encryption, every block of plaintext encrypts to a 513 block of ciphertext. All block cipher encryption is done in CBC 514 (Cipher Block Chaining) mode, and all items which are block-ciphered 515 will be an exact multiple of the cipher block length. 517 In public key encryption, a public key algorithm is used to encrypt 518 data in such a way that it can be decrypted only with the matching 519 private key. A public-key-encrypted element is encoded as an opaque 520 vector <0..2^16-1>, where the length is specified by the signing 521 algorithm and key. 523 An RSA encrypted value is encoded with PKCS #1 block type 2 as 524 described in [PKCS1A]. 526 In the following example: 528 stream-ciphered struct { 529 uint8 field1; 530 uint8 field2; 531 digitally-signed opaque hash[20]; 532 } UserType; 534 The contents of hash are used as input for the signing algorithm, 535 then the entire structure is encrypted with a stream cipher. The 536 length of this structure, in bytes would be equal to 2 bytes for 537 field1 and field2, plus two bytes for the length of the signature, 538 plus the length of the output of the signing algorithm. This is known 539 due to the fact that the algorithm and key used for the signing are 540 known prior to encoding or decoding this structure. 542 4.8. Constants 544 Typed constants can be defined for purposes of specification by 545 declaring a symbol of the desired type and assigning values to it. 546 Under-specified types (opaque, variable length vectors, and 547 structures that contain opaque) cannot be assigned values. No fields 548 of a multi-element structure or vector may be elided. 550 For example, 552 struct { 553 uint8 f1; 554 uint8 f2; 555 } Example1; 557 Example1 ex1 = {1, 4}; /* assigns f1 = 1, f2 = 4 */ 559 5. HMAC and the pseudorandom function 561 A number of operations in the TLS record and handshake layer required 562 a keyed MAC; this is a secure digest of some data protected by a 563 secret. Forging the MAC is infeasible without knowledge of the MAC 564 secret. The construction we use for this operation is known as HMAC, 565 described in [HMAC]. 567 HMAC can be used with a variety of different hash algorithms. TLS 568 uses it in the handshake with two different algorithms: MD5 and 569 SHA-1, denoting these as HMAC_MD5(secret, data) and HMAC_SHA(secret, 570 data). Additional hash algorithms can be defined by cipher suites and 571 used to protect record data, but MD5 and SHA-1 are hard coded into 572 the description of the handshaking for this version of the protocol. 574 In addition, a construction is required to do expansion of secrets 575 into blocks of data for the purposes of key generation or validation. 576 This pseudo-random function (PRF) takes as input a secret, a seed, 577 and an identifying label and produces an output of arbitrary length. 579 First, we define a data expansion function, P_hash(secret, data) 580 which uses a single hash function to expand a secret and seed into an 581 arbitrary quantity of output: 583 P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + 584 HMAC_hash(secret, A(2) + seed) + 585 HMAC_hash(secret, A(3) + seed) + ... 587 Where + indicates concatenation. 589 A() is defined as: 590 A(0) = seed 591 A(i) = HMAC_hash(secret, A(i-1)) 593 P_hash can be iterated as many times as is necessary to produce the 594 required quantity of data. For example, if P_SHA-1 was being used to 595 create 64 bytes of data, it would have to be iterated 4 times 596 (through A(4)), creating 80 bytes of output data; the last 16 bytes 597 of the final iteration would then be discarded, leaving 64 bytes of 598 output data. 600 TLS's PRF is created by applying P_hash to the secret S. The hash 601 function used in P MUST be the same hash function selected for the 602 HMAC in the cipher suite. 604 The label is an ASCII string. It should be included in the exact form 605 it is given without a length byte or trailing null character. For 606 example, the label "slithy toves" would be processed by hashing the 607 following bytes: 609 73 6C 69 74 68 79 20 74 6F 76 65 73 611 6. The TLS Record Protocol 613 The TLS Record Protocol is a layered protocol. At each layer, 614 messages may include fields for length, description, and content. 615 The Record Protocol takes messages to be transmitted, fragments the 616 data into manageable blocks, optionally compresses the data, applies 617 a MAC, encrypts, and transmits the result. Received data is 618 decrypted, verified, decompressed, and reassembled, then delivered to 619 higher level clients. 621 Four record protocol clients are described in this document: the 622 handshake protocol, the alert protocol, the change cipher spec 623 protocol, and the application data protocol. In order to allow 624 extension of the TLS protocol, additional record types can be 625 supported by the record protocol. Any new record types SHOULD 626 allocate type values immediately beyond the ContentType values for 627 the four record types described here (see Appendix A.1). All such 628 values must be defined by RFC 2434 Standards Action. See section 11 629 for IANA Considerations for ContentType values. 631 If a TLS implementation receives a record type it does not 632 understand, it SHOULD just ignore it. Any protocol designed for use 633 over TLS MUST be carefully designed to deal with all possible attacks 634 against it. Note that because the type and length of a record are 635 not protected by encryption, care SHOULD be taken to minimize the 636 value of traffic analysis of these values. 638 6.1. Connection states 640 A TLS connection state is the operating environment of the TLS Record 641 Protocol. It specifies a compression algorithm, encryption algorithm, 642 and MAC algorithm. In addition, the parameters for these algorithms 643 are known: the MAC secret and the bulk encryption keys for the 644 connection in both the read and the write directions. Logically, 645 there are always four connection states outstanding: the current read 646 and write states, and the pending read and write states. All records 647 are processed under the current read and write states. The security 648 parameters for the pending states can be set by the TLS Handshake 649 Protocol, and the Change Cipher Spec can selectively make either of 650 the pending states current, in which case the appropriate current 651 state is disposed of and replaced with the pending state; the pending 652 state is then reinitialized to an empty state. It is illegal to make 653 a state which has not been initialized with security parameters a 654 current state. The initial current state always specifies that no 655 encryption, compression, or MAC will be used. 657 The security parameters for a TLS Connection read and write state are 658 set by providing the following values: 660 connection end 661 Whether this entity is considered the "client" or the "server" in 662 this connection. 664 bulk encryption algorithm 665 An algorithm to be used for bulk encryption. This specification 666 includes the key size of this algorithm, how much of that key is 667 secret, whether it is a block or stream cipher, the block size of 668 the cipher (if appropriate). 670 MAC algorithm 671 An algorithm to be used for message authentication. This 672 specification includes the size of the hash which is returned by 673 the MAC algorithm. 675 compression algorithm 676 An algorithm to be used for data compression. This specification 677 must include all information the algorithm requires to do 678 compression. 680 master secret 681 A 48 byte secret shared between the two peers in the connection. 683 client random 684 A 32 byte value provided by the client. 686 server random 687 A 32 byte value provided by the server. 689 These parameters are defined in the presentation language as: 691 enum { server, client } ConnectionEnd; 693 enum { null, rc4, rc2, des, 3des, des40, idea, aes } BulkCipherAlgorithm; 695 enum { stream, block } CipherType; 697 enum { null, md5, sha } MACAlgorithm; 699 enum { null(0), (255) } CompressionMethod; 701 /* The algorithms specified in CompressionMethod, 702 BulkCipherAlgorithm, and MACAlgorithm may be added to. */ 704 struct { 705 ConnectionEnd entity; 706 BulkCipherAlgorithm bulk_cipher_algorithm; 707 CipherType cipher_type; 708 uint8 key_size; 709 uint8 key_material_length; 710 MACAlgorithm mac_algorithm; 711 uint8 hash_size; 712 CompressionMethod compression_algorithm; 713 opaque master_secret[48]; 714 opaque client_random[32]; 715 opaque server_random[32]; 716 } SecurityParameters; 718 The record layer will use the security parameters to generate the 719 following four items: 721 client write MAC secret 722 server write MAC secret 723 client write key 724 server write key 726 The client write parameters are used by the server when receiving and 727 processing records and vice-versa. The algorithm used for generating 728 these items from the security parameters is described in section 6.3. 730 Once the security parameters have been set and the keys have been 731 generated, the connection states can be instantiated by making them 732 the current states. These current states MUST be updated for each 733 record processed. Each connection state includes the following 734 elements: 736 compression state 737 The current state of the compression algorithm. 739 cipher state 740 The current state of the encryption algorithm. This will consist 741 of the scheduled key for that connection. For stream ciphers, 742 this will also contain whatever the necessary state information 743 is to allow the stream to continue to encrypt or decrypt data. 745 MAC secret 746 The MAC secret for this connection as generated above. 748 sequence number 749 Each connection state contains a sequence number, which is 750 maintained separately for read and write states. The sequence 751 number MUST be set to zero whenever a connection state is made 752 the active state. Sequence numbers are of type uint64 and may not 753 exceed 2^64-1. Sequence numbers do not wrap. If a TLS 754 implementation would need to wrap a sequence number it must 755 renegotiate instead. A sequence number is incremented after each 756 record: specifically, the first record which is transmitted under 757 a particular connection state MUST use sequence number 0. 759 6.2. Record layer 760 The TLS Record Layer receives uninterpreted data from higher layers 761 in non-empty blocks of arbitrary size. 763 6.2.1. Fragmentation 765 The record layer fragments information blocks into TLSPlaintext 766 records carrying data in chunks of 2^14 bytes or less. Client message 767 boundaries are not preserved in the record layer (i.e., multiple 768 client messages of the same ContentType MAY be coalesced into a 769 single TLSPlaintext record, or a single message MAY be fragmented 770 across several records). 772 struct { 773 uint8 major, minor; 774 } ProtocolVersion; 776 enum { 777 change_cipher_spec(20), alert(21), handshake(22), 778 application_data(23), (255) 779 } ContentType; 781 struct { 782 ContentType type; 783 ProtocolVersion version; 784 uint16 length; 785 opaque fragment[TLSPlaintext.length]; 786 } TLSPlaintext; 788 type 789 The higher level protocol used to process the enclosed fragment. 791 version 792 The version of the protocol being employed. This document 793 describes TLS Version 1.1, which uses the version { 3, 2 }. The 794 version value 3.2 is historical: TLS version 1.1 is a minor 795 modification to the TLS 1.0 protocol, which was itself a minor 796 modification to the SSL 3.0 protocol, which bears the version 797 value 3.0. (See Appendix A.1). 799 length 800 The length (in bytes) of the following TLSPlaintext.fragment. 801 The length should not exceed 2^14. 803 fragment 804 The application data. This data is transparent and treated as an 805 independent block to be dealt with by the higher level protocol 806 specified by the type field. 808 Note: Data of different TLS Record layer content types MAY be 809 interleaved. Application data is generally of higher precedence 810 for transmission than other content types and therefore handshake 811 records may be held if application data is pending. However, 812 records MUST be delivered to the network in the same order as 813 they are protected by the record layer. Recipients MUST receive 814 and process interleaved application layer traffic during 815 handshakes subsequent to the first one on a connection. 817 6.2.2. Record compression and decompression 819 All records are compressed using the compression algorithm defined in 820 the current session state. There is always an active compression 821 algorithm; however, initially it is defined as 822 CompressionMethod.null. The compression algorithm translates a 823 TLSPlaintext structure into a TLSCompressed structure. Compression 824 functions are initialized with default state information whenever a 825 connection state is made active. 827 Compression must be lossless and may not increase the content length 828 by more than 1024 bytes. If the decompression function encounters a 829 TLSCompressed.fragment that would decompress to a length in excess of 830 2^14 bytes, it should report a fatal decompression failure error. 832 struct { 833 ContentType type; /* same as TLSPlaintext.type */ 834 ProtocolVersion version;/* same as TLSPlaintext.version */ 835 uint16 length; 836 opaque fragment[TLSCompressed.length]; 837 } TLSCompressed; 839 length 840 The length (in bytes) of the following TLSCompressed.fragment. 841 The length should not exceed 2^14 + 1024. 843 fragment 844 The compressed form of TLSPlaintext.fragment. 846 Note: A CompressionMethod.null operation is an identity operation; no 847 fields are altered. 849 Implementation note: 850 Decompression functions are responsible for ensuring that 851 messages cannot cause internal buffer overflows. 853 6.2.3. Record payload protection 855 The encryption and MAC functions translate a TLSCompressed structure 856 into a TLSCiphertext. The decryption functions reverse the process. 857 The MAC of the record also includes a sequence number so that 858 missing, extra or repeated messages are detectable. 860 struct { 861 ContentType type; 862 ProtocolVersion version; 863 uint16 length; 864 select (CipherSpec.cipher_type) { 865 case stream: GenericStreamCipher; 866 case block: GenericBlockCipher; 867 } fragment; 868 } TLSCiphertext; 870 type 871 The type field is identical to TLSCompressed.type. 873 version 874 The version field is identical to TLSCompressed.version. 876 length 877 The length (in bytes) of the following TLSCiphertext.fragment. 878 The length may not exceed 2^14 + 2048. 880 fragment 881 The encrypted form of TLSCompressed.fragment, with the MAC. 883 6.2.3.1. Null or standard stream cipher 885 Stream ciphers (including BulkCipherAlgorithm.null - see Appendix 886 A.6) convert TLSCompressed.fragment structures to and from stream 887 TLSCiphertext.fragment structures. 889 stream-ciphered struct { 890 opaque content[TLSCompressed.length]; 891 opaque MAC[CipherSpec.hash_size]; 892 } GenericStreamCipher; 894 The MAC is generated as: 896 HMAC_hash(MAC_write_secret, seq_num + TLSCompressed.type + 897 TLSCompressed.version + TLSCompressed.length + 898 TLSCompressed.fragment)); 900 where "+" denotes concatenation. 902 seq_num 903 The sequence number for this record. 905 hash 906 The hashing algorithm specified by 907 SecurityParameters.mac_algorithm. 909 Note that the MAC is computed before encryption. The stream cipher 910 encrypts the entire block, including the MAC. For stream ciphers that 911 do not use a synchronization vector (such as RC4), the stream cipher 912 state from the end of one record is simply used on the subsequent 913 packet. If the CipherSuite is TLS_NULL_WITH_NULL_NULL, encryption 914 consists of the identity operation (i.e., the data is not encrypted 915 and the MAC size is zero implying that no MAC is used). 916 TLSCiphertext.length is TLSCompressed.length plus 917 CipherSpec.hash_size. 919 6.2.3.2. CBC block cipher 921 For block ciphers (such as RC2, DES, or AES), the encryption and MAC 922 functions convert TLSCompressed.fragment structures to and from block 923 TLSCiphertext.fragment structures. 925 block-ciphered struct { 926 opaque IV[CipherSpec.block_length]; 927 opaque content[TLSCompressed.length]; 928 opaque MAC[CipherSpec.hash_size]; 929 uint8 padding[GenericBlockCipher.padding_length]; 930 uint8 padding_length; 931 } GenericBlockCipher; 933 The MAC is generated as described in Section 6.2.3.1. 935 IV 936 Unlike previous versions of SSL and TLS, TLS 1.1 uses an explicit 937 IV in order to prevent the attacks described by [CBCATT]. 938 We recommend the following equivalently strong procedures. 939 For clarity we use the following notation. 941 IV -- the transmitted value of the IV field in the 942 GenericBlockCipher structure. 943 CBC residue -- the last ciphertext block of the previous record 944 mask -- the actual value which the cipher XORs with the 945 plaintext prior to encryption of the first cipher block 946 of the record. 948 In prior versions of TLS, there was no IV field and the CBC residue 949 and mask were one and the same. See Sections 6.1, 6.2.3.2 and 6.3, 950 of [TLS1.0] for details of TLS 1.0 IV handling. 952 One of the following two algorithms SHOULD be used to generate the 953 per-record IV: 955 (1) Generate a cryptographically strong random string R of 956 length CipherSpec.block_length. Place R 957 in the IV field. Set the mask to R. Thus, the first 958 cipher block will be encrypted as E(R XOR Data). 960 (2) Generate a cryptographically strong random number R of 961 length CipherSpec.block_length and prepend it to the plaintext 962 prior to encryption. In 963 this case either: 965 (a) The cipher may use a fixed mask such as zero. 966 (b) The CBC residue from the previous record may be used 967 as the mask. This preserves maximum code compatibility 968 with TLS 1.0 and SSL 3. It also has the advantage that 969 it does not require the ability to quickly reset the IV, 970 which is known to be a problem on some systems. 972 In either 2(a) or 2(b) the data (R || data) is fed into the 973 encryption process. The first cipher block (containing 974 E(mask XOR R) is placed in the IV field. The first 975 block of content contains E(IV XOR data) 977 The following alternative procedure MAY be used: However, it has 978 not been demonstrated to be equivalently cryptographically strong 979 to the above procedures. The sender prepends a fixed block F to 980 the plaintext (or alternatively a block generated with a weak 981 PRNG). He then encrypts as in (2) above, using the CBC residue 982 from the previous block as the mask for the prepended block. Note 983 that in this case the mask for the first record transmitted by 984 the application (the Finished) MUST be generated using a 985 cryptographically strong PRNG. 987 The decryption operation for all three alternatives is the same. 988 The receiver decrypts the entire GenericBlockCipher structure and 989 then discards the first cipher block, corresponding to the IV 990 component. 992 padding 993 Padding that is added to force the length of the plaintext to be 994 an integral multiple of the block cipher's block length. The 995 padding MAY be any length up to 255 bytes long, as long as it 996 results in the TLSCiphertext.length being an integral multiple of 997 the block length. Lengths longer than necessary might be 998 desirable to frustrate attacks on a protocol based on analysis of 999 the lengths of exchanged messages. Each uint8 in the padding data 1000 vector MUST be filled with the padding length value. The receiver 1001 MUST check this padding and SHOULD use the bad_record_mac alert 1002 to indicate padding errors. 1004 padding_length 1005 The padding length MUST be such that the total size of the 1006 GenericBlockCipher structure is a multiple of the cipher's block 1007 length. Legal values range from zero to 255, inclusive. This 1008 length specifies the length of the padding field exclusive of the 1009 padding_length field itself. 1011 The encrypted data length (TLSCiphertext.length) is one more than the 1012 sum of TLSCompressed.length, CipherSpec.hash_size, and 1013 padding_length. 1015 Example: If the block length is 8 bytes, the content length 1016 (TLSCompressed.length) is 61 bytes, and the MAC length is 20 1017 bytes, the length before padding is 82 bytes (this does not 1018 include the IV, which may or may not be encrypted, as 1019 discussed above). Thus, the padding length modulo 8 must be 1020 equal to 6 in order to make the total length an even multiple 1021 of 8 bytes (the block length). The padding length can be 6, 1022 14, 22, and so on, through 254. If the padding length were the 1023 minimum necessary, 6, the padding would be 6 bytes, each 1024 containing the value 6. Thus, the last 8 octets of the 1025 GenericBlockCipher before block encryption would be xx 06 06 1026 06 06 06 06 06, where xx is the last octet of the MAC. 1028 Note: With block ciphers in CBC mode (Cipher Block Chaining), 1029 it is critical that the entire plaintext of the record be known 1030 before any ciphertext is transmitted. Otherwise it is possible 1031 for the attacker to mount the attack described in [CBCATT]. 1033 Implementation Note: Canvel et. al. [CBCTIME] have demonstrated a 1034 timing attack on CBC padding based on the time required to 1035 compute the MAC. In order to defend against this attack, 1036 implementations MUST ensure that record processing time is 1037 essentially the same whether or not the padding is correct. In 1038 general, the best way to to do this is to compute the MAC even if 1039 the padding is incorrect, and only then reject the packet. For 1040 instance, if the pad appears to be incorrect the implementation 1041 might assume a zero-length pad and then compute the MAC. This 1042 leaves a small timing channel, since MAC performance depends to 1043 some extent on the size of the data fragment, but it is not 1044 believed to be large enough to be exploitable due to the large 1045 block size of existing MACs and the small size of the timing 1046 signal. 1048 6.3. Key calculation 1049 The Record Protocol requires an algorithm to generate keys, and MAC 1050 secrets from the security parameters provided by the handshake 1051 protocol. 1053 The master secret is hashed into a sequence of secure bytes, which 1054 are assigned to the MAC secrets and keys required by the current 1055 connection state (see Appendix A.6). CipherSpecs require a client 1056 write MAC secret, a server write MAC secret, a client write key, and 1057 a server write key, which are generated from the master secret in 1058 that order. Unused values are empty. 1060 When generating keys and MAC secrets, the master secret is used as an 1061 entropy source. 1063 To generate the key material, compute 1065 key_block = PRF(SecurityParameters.master_secret, 1066 "key expansion", 1067 SecurityParameters.server_random + 1068 SecurityParameters.client_random); 1070 until enough output has been generated. Then the key_block is 1071 partitioned as follows: 1073 client_write_MAC_secret[SecurityParameters.hash_size] 1074 server_write_MAC_secret[SecurityParameters.hash_size] 1075 client_write_key[SecurityParameters.key_material_length] 1076 server_write_key[SecurityParameters.key_material_length] 1078 Implementation note: 1079 The currently defined which requires the most material is 1080 AES_256_CBC_SHA, defined in [TLSAES]. It requires 2 x 32 byte 1081 keys and 2 x 20 byte MAC secrets, for a total 104 bytes of key 1082 material. 1084 7. The TLS Handshaking Protocols 1086 TLS has three subprotocols which are used to allow peers to agree 1087 upon security parameters for the record layer, authenticate 1088 themselves, instantiate negotiated security parameters, and 1089 report error conditions to each other. 1091 The Handshake Protocol is responsible for negotiating a session, 1092 which consists of the following items: 1094 session identifier 1095 An arbitrary byte sequence chosen by the server to identify an 1096 active or resumable session state. 1098 peer certificate 1099 X509v3 [X509] certificate of the peer. This element of the 1100 state may be null. 1102 compression method 1103 The algorithm used to compress data prior to encryption. 1105 cipher spec 1106 Specifies the bulk data encryption algorithm (such as null, 1107 DES, etc.) and a MAC algorithm (such as MD5 or SHA). It also 1108 defines cryptographic attributes such as the hash_size. (See 1109 Appendix A.6 for formal definition) 1111 master secret 1112 48-byte secret shared between the client and server. 1114 is resumable 1115 A flag indicating whether the session can be used to initiate 1116 new connections. 1118 These items are then used to create security parameters for use by 1119 the Record Layer when protecting application data. Many connections 1120 can be instantiated using the same session through the resumption 1121 feature of the TLS Handshake Protocol. 1123 7.1. Change cipher spec protocol 1125 The change cipher spec protocol exists to signal transitions in 1126 ciphering strategies. The protocol consists of a single message, 1127 which is encrypted and compressed under the current (not the pending) 1128 connection state. The message consists of a single byte of value 1. 1130 struct { 1131 enum { change_cipher_spec(1), (255) } type; 1132 } ChangeCipherSpec; 1134 The change cipher spec message is sent by both the client and server 1135 to notify the receiving party that subsequent records will be 1136 protected under the newly negotiated CipherSpec and keys. Reception 1137 of this message causes the receiver to instruct the Record Layer to 1138 immediately copy the read pending state into the read current state. 1139 Immediately after sending this message, the sender MUST instruct the 1140 record layer to make the write pending state the write active state. 1141 (See section 6.1.) The change cipher spec message is sent during the 1142 handshake after the security parameters have been agreed upon, but 1143 before the verifying finished message is sent (see section 7.4.9). 1145 Note: if a rehandshake occurs while data is flowing on a connection, 1146 the communicating parties may continue to send data using the old 1147 CipherSpec. However, once the ChangeCipherSpec has been sent, the new 1148 CipherSpec MUST be used. The first side to send the ChangeCipherSpec 1149 does not know that the other side has finished computing the new 1150 keying material (e.g. if it has to perform a time consuming public 1151 key operation). Thus, a small window of time during which the 1152 recipient must buffer the data MAY exist. In practice, with modern 1153 machines this interval is likely to be fairly short. 1155 7.2. Alert protocol 1157 One of the content types supported by the TLS Record layer is the 1158 alert type. Alert messages convey the severity of the message and a 1159 description of the alert. Alert messages with a level of fatal result 1160 in the immediate termination of the connection. In this case, other 1161 connections corresponding to the session may continue, but the 1162 session identifier MUST be invalidated, preventing the failed session 1163 from being used to establish new connections. Like other messages, 1164 alert messages are encrypted and compressed, as specified by the 1165 current connection state. 1167 enum { warning(1), fatal(2), (255) } AlertLevel; 1169 enum { 1170 close_notify(0), 1171 unexpected_message(10), 1172 bad_record_mac(20), 1173 decryption_failed(21), 1174 record_overflow(22), 1175 decompression_failure(30), 1176 handshake_failure(40), 1177 no_certificate_RESERVED (41), 1178 bad_certificate(42), 1179 unsupported_certificate(43), 1180 certificate_revoked(44), 1181 certificate_expired(45), 1182 certificate_unknown(46), 1183 illegal_parameter(47), 1184 unknown_ca(48), 1185 access_denied(49), 1186 decode_error(50), 1187 decrypt_error(51), 1188 export_restriction_RESERVED(60), 1189 protocol_version(70), 1190 insufficient_security(71), 1191 internal_error(80), 1192 user_canceled(90), 1193 no_renegotiation(100), 1194 unsupported_extension(110), /* new */ 1195 certificate_unobtainable(111), /* new */ 1196 unrecognized_name(112), /* new */ 1197 bad_certificate_status_response(113), /* new */ 1198 bad_certificate_hash_value(114), /* new */ 1199 (255) 1200 } AlertDescription; 1202 struct { 1203 AlertLevel level; 1204 AlertDescription description; 1205 } Alert; 1207 7.2.1. Closure alerts 1209 The client and the server must share knowledge that the connection is 1210 ending in order to avoid a truncation attack. Either party may 1211 initiate the exchange of closing messages. 1213 close_notify 1214 This message notifies the recipient that the sender will not send 1215 any more messages on this connection. Note that as of TLS 1.1, 1216 failure to properly close a connection no longer requires that a 1217 session not be resumed. This is a change from TLS 1.0 to conform 1218 with widespread implementation practice. 1220 Either party may initiate a close by sending a close_notify alert. 1221 Any data received after a closure alert is ignored. 1223 Unless some other fatal alert has been transmitted, each party is 1224 required to send a close_notify alert before closing the write side 1225 of the connection. The other party MUST respond with a close_notify 1226 alert of its own and close down the connection immediately, 1227 discarding any pending writes. It is not required for the initiator 1228 of the close to wait for the responding close_notify alert before 1229 closing the read side of the connection. 1231 If the application protocol using TLS provides that any data may be 1232 carried over the underlying transport after the TLS connection is 1233 closed, the TLS implementation must receive the responding 1234 close_notify alert before indicating to the application layer that 1235 the TLS connection has ended. If the application protocol will not 1236 transfer any additional data, but will only close the underlying 1237 transport connection, then the implementation MAY choose to close the 1238 transport without waiting for the responding close_notify. No part of 1239 this standard should be taken to dictate the manner in which a usage 1240 profile for TLS manages its data transport, including when 1241 connections are opened or closed. 1243 Note: It is assumed that closing a connection reliably delivers 1244 pending data before destroying the transport. 1246 7.2.2. Error alerts 1248 Error handling in the TLS Handshake protocol is very simple. When an 1249 error is detected, the detecting party sends a message to the other 1250 party. Upon transmission or receipt of an fatal alert message, both 1251 parties immediately close the connection. Servers and clients MUST 1252 forget any session-identifiers, keys, and secrets associated with a 1253 failed connection. Thus, any connection terminated with a fatal alert 1254 MUST NOT be resumed. The following error alerts are defined: 1256 unexpected_message 1257 An inappropriate message was received. This alert is always fatal 1258 and should never be observed in communication between proper 1259 implementations. 1261 bad_record_mac 1262 This alert is returned if a record is received with an incorrect 1263 MAC. This alert also MUST be returned if an alert is sent because 1264 a TLSCiphertext decrypted in an invalid way: either it wasn't an 1265 even multiple of the block length, or its padding values, when 1266 checked, weren't correct. This message is always fatal. 1268 decryption_failed 1269 This alert MAY be returned if a TLSCiphertext decrypted in an 1270 invalid way: either it wasn't an even multiple of the block 1271 length, or its padding values, when checked, weren't correct. 1272 This message is always fatal. 1274 Note: Differentiating between bad_record_mac and 1275 decryption_failed alerts may permit certain attacks against CBC 1276 mode as used in TLS [CBCATT]. It is preferable to uniformly use 1277 the bad_record_mac alert to hide the specific type of the error. 1279 record_overflow 1280 A TLSCiphertext record was received which had a length more than 1281 2^14+2048 bytes, or a record decrypted to a TLSCompressed record 1282 with more than 2^14+1024 bytes. This message is always fatal. 1284 decompression_failure 1285 The decompression function received improper input (e.g. data 1286 that would expand to excessive length). This message is always 1287 fatal. 1289 handshake_failure 1290 Reception of a handshake_failure alert message indicates that the 1291 sender was unable to negotiate an acceptable set of security 1292 parameters given the options available. This is a fatal error. 1294 no_certificate_RESERVED 1295 This alert was used in SSLv3 but not in TLS. It should not be 1296 sent by compliant implementations. 1298 bad_certificate 1299 A certificate was corrupt, contained signatures that did not 1300 verify correctly, etc. 1302 unsupported_certificate 1303 A certificate was of an unsupported type. 1305 certificate_revoked 1306 A certificate was revoked by its signer. 1308 certificate_expired 1309 A certificate has expired or is not currently valid. 1311 certificate_unknown 1312 Some other (unspecified) issue arose in processing the 1313 certificate, rendering it unacceptable. 1315 illegal_parameter 1316 A field in the handshake was out of range or inconsistent with 1317 other fields. This is always fatal. 1319 unknown_ca 1320 A valid certificate chain or partial chain was received, but the 1321 certificate was not accepted because the CA certificate could not 1322 be located or couldn't be matched with a known, trusted CA. This 1323 message is always fatal. 1325 access_denied 1326 A valid certificate was received, but when access control was 1327 applied, the sender decided not to proceed with negotiation. 1328 This message is always fatal. 1330 decode_error 1331 A message could not be decoded because some field was out of the 1332 specified range or the length of the message was incorrect. This 1333 message is always fatal. 1335 decrypt_error 1336 A handshake cryptographic operation failed, including being 1337 unable to correctly verify a signature, decrypt a key exchange, 1338 or validate a finished message. 1340 export_restriction_RESERVED 1341 This alert was used in TLS 1.0 but not TLS 1.1. 1343 protocol_version 1344 The protocol version the client has attempted to negotiate is 1345 recognized, but not supported. (For example, old protocol 1346 versions might be avoided for security reasons). This message is 1347 always fatal. 1349 insufficient_security 1350 Returned instead of handshake_failure when a negotiation has 1351 failed specifically because the server requires ciphers more 1352 secure than those supported by the client. This message is always 1353 fatal. 1355 internal_error 1356 An internal error unrelated to the peer or the correctness of the 1357 protocol makes it impossible to continue (such as a memory 1358 allocation failure). This message is always fatal. 1360 user_canceled 1361 This handshake is being canceled for some reason unrelated to a 1362 protocol failure. If the user cancels an operation after the 1363 handshake is complete, just closing the connection by sending a 1364 close_notify is more appropriate. This alert should be followed 1365 by a close_notify. This message is generally a warning. 1367 no_renegotiation 1368 Sent by the client in response to a hello request or by the 1369 server in response to a client hello after initial handshaking. 1370 Either of these would normally lead to renegotiation; when that 1371 is not appropriate, the recipient should respond with this alert; 1372 at that point, the original requester can decide whether to 1373 proceed with the connection. One case where this would be 1374 appropriate would be where a server has spawned a process to 1375 satisfy a request; the process might receive security parameters 1376 (key length, authentication, etc.) at startup and it might be 1377 difficult to communicate changes to these parameters after that 1378 point. This message is always a warning. 1380 The following error alerts apply only to the extensions described 1381 in Section XXX. To avoid "breaking" existing clients and servers, 1382 these alerts MUST NOT be sent unless the sending party has 1383 received an extended hello message from the party they are 1384 communicating with. 1386 unsupported_extension 1387 sent by clients that receive an extended server hello containing 1388 an extension that they did not put in the corresponding client 1389 hello (see Section 2.3). This message is always fatal. 1391 unrecognized_name 1392 sent by servers that receive a server_name extension request, but 1393 do not recognize the server name. This message MAY be fatal. 1395 certificate_unobtainable 1396 sent by servers who are unable to retrieve a certificate chain 1397 from the URL supplied by the client (see Section 3.3). This 1398 message MAY be fatal - for example if client authentication is 1399 required by the server for the handshake to continue and the 1400 server is unable to retrieve the certificate chain, it may send a 1401 fatal alert. 1403 bad_certificate_status_response 1404 sent by clients that receive an invalid certificate status 1405 response (see Section 3.6). This message is always fatal. 1407 bad_certificate_hash_value 1408 sent by servers when a certificate hash does not match a client 1409 provided certificate_hash. This message is always fatal. 1411 For all errors where an alert level is not explicitly specified, the 1412 sending party MAY determine at its discretion whether this is a fatal 1413 error or not; if an alert with a level of warning is received, the 1414 receiving party MAY decide at its discretion whether to treat this as 1415 a fatal error or not. However, all messages which are transmitted 1416 with a level of fatal MUST be treated as fatal messages. 1418 New alerts values MUST be defined by RFC 2434 Standards Action. See 1419 Section 11 for IANA Considerations for alert values. 1421 7.3. Handshake Protocol overview 1423 The cryptographic parameters of the session state are produced by the 1424 TLS Handshake Protocol, which operates on top of the TLS Record 1425 Layer. When a TLS client and server first start communicating, they 1426 agree on a protocol version, select cryptographic algorithms, 1427 optionally authenticate each other, and use public-key encryption 1428 techniques to generate shared secrets. 1430 The TLS Handshake Protocol involves the following steps: 1432 - Exchange hello messages to agree on algorithms, exchange random 1433 values, and check for session resumption. 1435 - Exchange the necessary cryptographic parameters to allow the 1436 client and server to agree on a premaster secret. 1438 - Exchange certificates and cryptographic information to allow the 1439 client and server to authenticate themselves. 1441 - Generate a master secret from the premaster secret and exchanged 1442 random values. 1444 - Provide security parameters to the record layer. 1446 - Allow the client and server to verify that their peer has 1447 calculated the same security parameters and that the handshake 1448 occurred without tampering by an attacker. 1450 Note that higher layers should not be overly reliant on TLS always 1451 negotiating the strongest possible connection between two peers: 1452 there are a number of ways a man in the middle attacker can attempt 1453 to make two entities drop down to the least secure method they 1454 support. The protocol has been designed to minimize this risk, but 1455 there are still attacks available: for example, an attacker could 1456 block access to the port a secure service runs on, or attempt to get 1457 the peers to negotiate an unauthenticated connection. The fundamental 1458 rule is that higher levels must be cognizant of what their security 1459 requirements are and never transmit information over a channel less 1460 secure than what they require. The TLS protocol is secure, in that 1461 any cipher suite offers its promised level of security: if you 1462 negotiate 3DES with a 1024 bit RSA key exchange with a host whose 1463 certificate you have verified, you can expect to be that secure. 1465 However, you SHOULD never send data over a link encrypted with 40 bit 1466 security unless you feel that data is worth no more than the effort 1467 required to break that encryption. 1469 These goals are achieved by the handshake protocol, which can be 1470 summarized as follows: The client sends a client hello message to 1471 which the server must respond with a server hello message, or else a 1472 fatal error will occur and the connection will fail. The client hello 1473 and server hello are used to establish security enhancement 1474 capabilities between client and server. The client hello and server 1475 hello establish the following attributes: Protocol Version, Session 1476 ID, Cipher Suite, and Compression Method. Additionally, two random 1477 values are generated and exchanged: ClientHello.random and 1478 ServerHello.random. 1480 The actual key exchange uses up to four messages: the server 1481 certificate, the server key exchange, the client certificate, and the 1482 client key exchange. New key exchange methods can be created by 1483 specifying a format for these messages and defining the use of the 1484 messages to allow the client and server to agree upon a shared 1485 secret. This secret MUST be quite long; currently defined key 1486 exchange methods exchange secrets which range from 48 to 128 bytes in 1487 length. 1489 Following the hello messages, the server will send its certificate, 1490 if it is to be authenticated. Additionally, a server key exchange 1491 message may be sent, if it is required (e.g. if their server has no 1492 certificate, or if its certificate is for signing only). If the 1493 server is authenticated, it may request a certificate from the 1494 client, if that is appropriate to the cipher suite selected. Now the 1495 server will send the server hello done message, indicating that the 1496 hello-message phase of the handshake is complete. The server will 1497 then wait for a client response. If the server has sent a certificate 1498 request message, the client must send the certificate message. The 1499 client key exchange message is now sent, and the content of that 1500 message will depend on the public key algorithm selected between the 1501 client hello and the server hello. If the client has sent a 1502 certificate with signing ability, a digitally-signed certificate 1503 verify message is sent to explicitly verify the certificate. 1505 At this point, a change cipher spec message is sent by the client, 1506 and the client copies the pending Cipher Spec into the current Cipher 1507 Spec. The client then immediately sends the finished message under 1508 the new algorithms, keys, and secrets. In response, the server will 1509 send its own change cipher spec message, transfer the pending to the 1510 current Cipher Spec, and send its finished message under the new 1511 Cipher Spec. At this point, the handshake is complete and the client 1512 and server may begin to exchange application layer data. (See flow 1513 chart below.) Application data MUST NOT be sent prior to the 1514 completion of the first handshake (before a cipher suite other 1515 TLS_NULL_WITH_NULL_NULL is established). 1516 Client Server 1518 ClientHello --------> 1519 ServerHello 1520 Certificate* 1521 CertificateStatus* 1522 ServerKeyExchange* 1523 CertificateRequest* 1524 <-------- ServerHelloDone 1525 Certificate* 1526 CertificateURL* 1527 ClientKeyExchange 1528 CertificateVerify* 1529 [ChangeCipherSpec] 1530 Finished --------> 1531 [ChangeCipherSpec] 1532 <-------- Finished 1533 Application Data <-------> Application Data 1535 Fig. 1 - Message flow for a full handshake 1537 * Indicates optional or situation-dependent messages that are not 1538 always sent. 1540 Note: To help avoid pipeline stalls, ChangeCipherSpec is an 1541 independent TLS Protocol content type, and is not actually a TLS 1542 handshake message. 1544 When the client and server decide to resume a previous session or 1545 duplicate an existing session (instead of negotiating new security 1546 parameters) the message flow is as follows: 1548 The client sends a ClientHello using the Session ID of the session to 1549 be resumed. The server then checks its session cache for a match. If 1550 a match is found, and the server is willing to re-establish the 1551 connection under the specified session state, it will send a 1552 ServerHello with the same Session ID value. At this point, both 1553 client and server MUST send change cipher spec messages and proceed 1554 directly to finished messages. Once the re-establishment is complete, 1555 the client and server MAY begin to exchange application layer data. 1556 (See flow chart below.) If a Session ID match is not found, the 1557 server generates a new session ID and the TLS client and server 1558 perform a full handshake. 1560 Client Server 1562 ClientHello --------> 1563 ServerHello 1564 [ChangeCipherSpec] 1565 <-------- Finished 1566 [ChangeCipherSpec] 1567 Finished --------> 1568 Application Data <-------> Application Data 1570 Fig. 2 - Message flow for an abbreviated handshake 1572 The contents and significance of each message will be presented in 1573 detail in the following sections. 1575 7.4. Handshake protocol 1577 The TLS Handshake Protocol is one of the defined higher level clients 1578 of the TLS Record Protocol. This protocol is used to negotiate the 1579 secure attributes of a session. Handshake messages are supplied to 1580 the TLS Record Layer, where they are encapsulated within one or more 1581 TLSPlaintext structures, which are processed and transmitted as 1582 specified by the current active session state. 1584 enum { 1585 hello_request(0), client_hello(1), server_hello(2), 1586 certificate(11), server_key_exchange (12), 1587 certificate_request(13), server_hello_done(14), 1588 certificate_verify(15), client_key_exchange(16), 1589 finished(20), certificate_url(21), certificate_status(22), 1590 (255) 1591 } HandshakeType; 1593 struct { 1594 HandshakeType msg_type; /* handshake type */ 1595 uint24 length; /* bytes in message */ 1596 select (HandshakeType) { 1597 case hello_request: HelloRequest; 1598 case client_hello: ClientHello; 1599 case server_hello: ServerHello; 1600 case certificate: Certificate; 1601 case server_key_exchange: ServerKeyExchange; 1602 case certificate_request: CertificateRequest; 1603 case server_hello_done: ServerHelloDone; 1604 case certificate_verify: CertificateVerify; 1605 case client_key_exchange: ClientKeyExchange; 1606 case finished: Finished; 1607 case certificate_url: CertificateURL; 1608 case certificate_status: CertificateStatus; 1609 } body; 1610 } Handshake; 1612 The handshake protocol messages are presented below in the order they 1613 MUST be sent; sending handshake messages in an unexpected order 1614 results in a fatal error. Unneeded handshake messages can be omitted, 1615 however. Note one exception to the ordering: the Certificate message 1616 is used twice in the handshake (from server to client, then from 1617 client to server), but described only in its first position. The one 1618 message which is not bound by these ordering rules is the Hello 1619 Request message, which can be sent at any time, but which should be 1620 ignored by the client if it arrives in the middle of a handshake. 1622 New Handshake message type values MUST be defined via RFC 2434 1623 Standards Action. See Section 11 for IANA Considerations for these 1624 values. 1626 7.4.1. Hello messages 1628 The hello phase messages are used to exchange security enhancement 1629 capabilities between the client and server. When a new session 1630 begins, the Record Layer's connection state encryption, hash, and 1631 compression algorithms are initialized to null. The current 1632 connection state is used for renegotiation messages. 1634 7.4.1.1. Hello request 1636 When this message will be sent: 1637 The hello request message MAY be sent by the server at any time. 1639 Meaning of this message: 1640 Hello request is a simple notification that the client should 1641 begin the negotiation process anew by sending a client hello 1642 message when convenient. This message will be ignored by the 1643 client if the client is currently negotiating a session. This 1644 message may be ignored by the client if it does not wish to 1645 renegotiate a session, or the client may, if it wishes, respond 1646 with a no_renegotiation alert. Since handshake messages are 1647 intended to have transmission precedence over application data, 1648 it is expected that the negotiation will begin before no more 1649 than a few records are received from the client. If the server 1650 sends a hello request but does not receive a client hello in 1651 response, it may close the connection with a fatal alert. 1653 After sending a hello request, servers SHOULD not repeat the request 1654 until the subsequent handshake negotiation is complete. 1656 Structure of this message: 1657 struct { } HelloRequest; 1659 Note: This message MUST NOT be included in the message hashes which are 1660 maintained throughout the handshake and used in the finished 1661 messages and the certificate verify message. 1663 7.4.1.2. Client hello 1665 When this message will be sent: 1666 When a client first connects to a server it is required to send 1667 the client hello as its first message. The client can also send a 1668 client hello in response to a hello request or on its own 1669 initiative in order to renegotiate the security parameters in an 1670 existing connection. 1672 Structure of this message: 1673 The client hello message includes a random structure, which is 1674 used later in the protocol. 1676 struct { 1677 uint32 gmt_unix_time; 1678 opaque random_bytes[28]; 1679 } Random; 1681 gmt_unix_time 1682 The current time and date in standard UNIX 32-bit format (seconds 1683 since the midnight starting Jan 1, 1970, GMT, ignoring leap 1684 seconds) according to the sender's internal clock. Clocks are not 1685 required to be set correctly by the basic TLS Protocol; higher 1686 level or application protocols may define additional 1687 requirements. 1689 random_bytes 1690 28 bytes generated by a secure random number generator. 1692 The client hello message includes a variable length session 1693 identifier. If not empty, the value identifies a session between the 1694 same client and server whose security parameters the client wishes to 1695 reuse. The session identifier MAY be from an earlier connection, this 1696 connection, or another currently active connection. The second option 1697 is useful if the client only wishes to update the random structures 1698 and derived values of a connection, while the third option makes it 1699 possible to establish several independent secure connections without 1700 repeating the full handshake protocol. These independent connections 1701 may occur sequentially or simultaneously; a SessionID becomes valid 1702 when the handshake negotiating it completes with the exchange of 1703 Finished messages and persists until removed due to aging or because 1704 a fatal error was encountered on a connection associated with the 1705 session. The actual contents of the SessionID are defined by the 1706 server. 1708 opaque SessionID<0..32>; 1710 Warning: 1711 Because the SessionID is transmitted without encryption or 1712 immediate MAC protection, servers MUST not place confidential 1713 information in session identifiers or let the contents of fake 1714 session identifiers cause any breach of security. (Note that the 1715 content of the handshake as a whole, including the SessionID, is 1716 protected by the Finished messages exchanged at the end of the 1717 handshake.) 1719 The CipherSuite list, passed from the client to the server in the 1720 client hello message, contains the combinations of cryptographic 1721 algorithms supported by the client in order of the client's 1722 preference (favorite choice first). Each CipherSuite defines a key 1723 exchange algorithm, a bulk encryption algorithm (including secret key 1724 length) and a MAC algorithm. The server will select a cipher suite 1725 or, if no acceptable choices are presented, return a handshake 1726 failure alert and close the connection. 1728 uint8 CipherSuite[2]; /* Cryptographic suite selector */ 1730 The client hello includes a list of compression algorithms supported 1731 by the client, ordered according to the client's preference. 1733 enum { null(0), (255) } CompressionMethod; 1735 struct { 1736 ProtocolVersion client_version; 1737 Random random; 1738 SessionID session_id; 1739 CipherSuite cipher_suites<2..2^16-1>; 1740 CompressionMethod compression_methods<1..2^8-1>; 1741 } ClientHello; 1743 If the client wishes to use extensions (see Section XXX), 1744 it may send an ExtendedClientHello: 1746 struct { 1747 ProtocolVersion client_version; 1748 Random random; 1749 SessionID session_id; 1750 CipherSuite cipher_suites<2..2^16-1>; 1751 CompressionMethod compression_methods<1..2^8-1>; 1752 Extension client_hello_extension_list<0..2^16-1>; 1753 } ExtendedClientHello; 1755 These two messages can be distinguished by determining whether there 1756 are bytes following what would be the end of the ClientHello. 1758 client_version 1759 The version of the TLS protocol by which the client wishes to 1760 communicate during this session. This SHOULD be the latest 1761 (highest valued) version supported by the client. For this 1762 version of the specification, the version will be 3.2 (See 1763 Appendix E for details about backward compatibility). 1765 random 1766 A client-generated random structure. 1768 session_id 1769 The ID of a session the client wishes to use for this connection. 1770 This field should be empty if no session_id is available or the 1771 client wishes to generate new security parameters. 1773 cipher_suites 1774 This is a list of the cryptographic options supported by the 1775 client, with the client's first preference first. If the 1776 session_id field is not empty (implying a session resumption 1777 request) this vector MUST include at least the cipher_suite from 1778 that session. Values are defined in Appendix A.5. 1780 compression_methods 1781 This is a list of the compression methods supported by the 1782 client, sorted by client preference. If the session_id field is 1783 not empty (implying a session resumption request) it must include 1784 the compression_method from that session. This vector must 1785 contain, and all implementations must support, 1786 CompressionMethod.null. Thus, a client and server will always be 1787 able to agree on a compression method. 1789 client_hello_extension_list 1790 Clients MAY request extended functionality from servers by 1791 sending data in the client_hello_extension_list. Here the new 1792 "client_hello_extension_list" field contains a list of 1793 extensions. The actual "Extension" format is defined in Section 1794 XXX. 1796 In the event that a client requests additional functionality 1797 using the extended client hello, and this functionality is not 1798 supplied by the server, the client MAY abort the handshake. 1800 A server that supports the extensions mechanism MUST accept only 1801 client hello messages in either the original or extended 1802 ClientHello ormat, and (as for all other messages) MUST check 1803 that the amount of data in the message precisely matches one of 1804 these formats; if not then it MUST send a fatal "decode_error" 1805 alert. 1807 After sending the client hello message, the client waits for a server 1808 hello message. Any other handshake message returned by the server 1809 except for a hello request is treated as a fatal error. 1811 7.4.1.3. Server hello 1813 When this message will be sent: 1814 The server will send this message in response to a client hello 1815 message when it was able to find an acceptable set of algorithms. If 1816 it cannot find such a match, it will respond with a handshake failure 1817 alert. 1819 Structure of this message: 1820 struct { 1821 ProtocolVersion server_version; 1822 Random random; 1823 SessionID session_id; 1824 CipherSuite cipher_suite; 1825 CompressionMethod compression_method; 1826 } ServerHello; 1828 If the server is sending an extension, it should use the 1829 ExtendedServerHello: 1831 struct { 1832 ProtocolVersion server_version; 1833 Random random; 1834 SessionID session_id; 1835 CipherSuite cipher_suite; 1836 CompressionMethod compression_method; 1837 Extension server_hello_extension_list<0..2^16-1>; 1838 } ExtendedServerHello; 1840 These two messages can be distinguished by determining whether there 1841 are bytes following what would be the end of the ServerHello. 1843 server_version 1844 This field will contain the lower of that suggested by the client in 1845 the client hello and the highest supported by the server. For this 1846 version of the specification, the version is 3.2 (See Appendix E for 1847 details about backward compatibility). 1849 random 1850 This structure is generated by the server and MUST be independently 1851 generated from the ClientHello.random. 1853 session_id 1854 This is the identity of the session corresponding to this connection. 1855 If the ClientHello.session_id was non-empty, the server will look in 1856 its session cache for a match. If a match is found and the server is 1857 willing to establish the new connection using the specified session 1858 state, the server will respond with the same value as was supplied by 1859 the client. This indicates a resumed session and dictates that the 1860 parties must proceed directly to the finished messages. Otherwise 1861 this field will contain a different value identifying the new 1862 session. The server may return an empty session_id to indicate that 1863 the session will not be cached and therefore cannot be resumed. If a 1864 session is resumed, it must be resumed using the same cipher suite it 1865 was originally negotiated with. 1867 cipher_suite 1868 The single cipher suite selected by the server from the list in 1869 ClientHello.cipher_suites. For resumed sessions this field is the 1870 value from the state of the session being resumed. 1872 compression_method 1873 The single compression algorithm selected by the server from the list 1874 in ClientHello.compression_methods. For resumed sessions this field 1875 is the value from the resumed session state. 1877 server_hello_extension_list 1878 A list of extensions. Note that only extensions offered by the client 1879 can appear in the server's list. 1881 7.4.1.4 Hello Extensions 1883 The extension format for extended client hellos and extended server 1884 hellos is: 1886 struct { 1887 ExtensionType extension_type; 1888 opaque extension_data<0..2^16-1>; 1889 } Extension; 1890 Here: 1892 - "extension_type" identifies the particular extension type. 1894 - "extension_data" contains information specific to the particular 1895 extension type. 1897 The extension types defined in this document are: 1899 enum { 1900 server_name(0), max_fragment_length(1), 1901 client_certificate_url(2), trusted_ca_keys(3), 1902 truncated_hmac(4), status_request(5), 1903 cert_hash_types(6), (65535) 1904 } ExtensionType; 1906 The list of defined extension types is maintained by the IANA. The 1907 current list can be found at XXX (suggest 1908 http://www.iana.org/assignments/tls-extensions). See sections XXX and 1909 YYY for more information on how new values are added. 1911 Note that for all extension types (including those defined in 1912 future), the extension type MUST NOT appear in the extended server 1913 hello unless the same extension type appeared in the corresponding 1914 client hello. Thus clients MUST abort the handshake if they receive 1915 an extension type in the extended server hello that they did not 1916 request in the associated (extended) client hello. 1918 Nonetheless "server oriented" extensions may be provided in the 1919 future within this framework - such an extension, say of type x, 1920 would require the client to first send an extension of type x in the 1921 (extended) client hello with empty extension_data to indicate that it 1922 supports the extension type. In this case the client is offering the 1923 capability to understand the extension type, and the server is taking 1924 the client up on its offer. 1926 Also note that when multiple extensions of different types are 1927 present in the extended client hello or the extended server hello, 1928 the extensions may appear in any order. There MUST NOT be more than 1929 one extension of the same type. 1931 An extended client hello may be sent both when starting a new session 1932 and when requesting session resumption. Indeed a client that 1933 requests resumption of a session does not in general know whether the 1934 server will accept this request, and therefore it SHOULD send an 1935 extended client hello if it would normally do so for a new session. 1936 In general the specification of each extension type must include a 1937 discussion of the effect of the extension both during new sessions 1938 and during resumed sessions. 1940 Note also that all the extensions defined in this document are 1941 relevant only when a session is initiated. When a client includes one 1942 or more of the defined extension types in an extended client hello 1943 while requesting session resumption: 1945 - If the resumption request is denied, the use of the extensions 1946 is negotiated as normal. 1948 - If, on the other hand, the older session is resumed, then the 1949 server MUST ignore the extensions and send a server hello 1950 containing none of the extension types; in this case the 1951 functionality of these extensions negotiated during the original 1952 session initiation is applied to the resumed session. 1954 7.4.1.4.1 Server Name Indication 1956 [TLS1.1] does not provide a mechanism for a client to tell a server 1957 the name of the server it is contacting. It may be desirable for 1958 clients to provide this information to facilitate secure connections 1959 to servers that host multiple 'virtual' servers at a single 1960 underlying network address. 1962 In order to provide the server name, clients MAY include an extension 1963 of type "server_name" in the (extended) client hello. The 1964 "extension_data" field of this extension SHALL contain 1965 "ServerNameList" where: 1967 struct { 1968 NameType name_type; 1969 select (name_type) { 1970 case host_name: HostName; 1971 } name; 1972 } ServerName; 1974 enum { 1975 host_name(0), (255) 1976 } NameType; 1978 opaque HostName<1..2^16-1>; 1980 struct { 1981 ServerName server_name_list<1..2^16-1> 1982 } ServerNameList; 1984 Currently the only server names supported are DNS hostnames, however 1985 this does not imply any dependency of TLS on DNS, and other name 1986 types may be added in the future (by an RFC that Updates this 1987 document). TLS MAY treat provided server names as opaque data and 1988 pass the names and types to the application. 1990 "HostName" contains the fully qualified DNS hostname of the server, 1991 as understood by the client. The hostname is represented as a byte 1992 string using UTF-8 encoding [UTF8], without a trailing dot. 1994 If the hostname labels contain only US-ASCII characters, then the 1995 client MUST ensure that labels are separated only by the byte 0x2E, 1996 representing the dot character U+002E (requirement 1 in section 3.1 1997 of [IDNA] notwithstanding). If the server needs to match the HostName 1998 against names that contain non-US-ASCII characters, it MUST perform 1999 the conversion operation described in section 4 of [IDNA], treating 2000 the HostName as a "query string" (i.e. the AllowUnassigned flag MUST 2001 be set). Note that IDNA allows labels to be separated by any of the 2002 Unicode characters U+002E, U+3002, U+FF0E, and U+FF61, therefore 2003 servers MUST accept any of these characters as a label separator. If 2004 the server only needs to match the HostName against names containing 2005 exclusively ASCII characters, it MUST compare ASCII names case- 2006 insensitively. 2008 Literal IPv4 and IPv6 addresses are not permitted in "HostName". It 2009 is RECOMMENDED that clients include an extension of type 2010 "server_name" in the client hello whenever they locate a server by a 2011 supported name type. 2013 A server that receives a client hello containing the "server_name" 2014 extension, MAY use the information contained in the extension to 2015 guide its selection of an appropriate certificate to return to the 2016 client, and/or other aspects of security policy. In this event, the 2017 server SHALL include an extension of type "server_name" in the 2018 (extended) server hello. The "extension_data" field of this 2019 extension SHALL be empty. 2021 If the server understood the client hello extension but does not 2022 recognize the server name, it SHOULD send an "unrecognized_name" 2023 alert (which MAY be fatal). 2025 If an application negotiates a server name using an application 2026 protocol, then upgrades to TLS, and a server_name extension is sent, 2027 then the extension SHOULD contain the same name that was negotiated 2028 in the application protocol. If the server_name is established in 2029 the TLS session handshake, the client SHOULD NOT attempt to request a 2030 different server name at the application layer. 2032 7.4.1.4.2 Maximum Fragment Length Negotiation 2033 By default, TLS uses fixed maximum plaintext fragment length of 2^14 2034 bytes. It may be desirable for constrained clients to negotiate a 2035 smaller maximum fragment length due to memory limitations or 2036 bandwidth limitations. 2038 In order to negotiate smaller maximum fragment lengths, clients MAY 2039 include an extension of type "max_fragment_length" in the (extended) 2040 client hello. The "extension_data" field of this extension SHALL 2041 contain: 2043 enum{ 2044 2^9(1), 2^10(2), 2^11(3), 2^12(4), (255) 2045 } MaxFragmentLength; 2047 whose value is the desired maximum fragment length. The allowed 2048 values for this field are: 2^9, 2^10, 2^11, and 2^12. 2050 Servers that receive an extended client hello containing a 2051 "max_fragment_length" extension, MAY accept the requested maximum 2052 fragment length by including an extension of type 2053 "max_fragment_length" in the (extended) server hello. The 2054 "extension_data" field of this extension SHALL contain 2055 "MaxFragmentLength" whose value is the same as the requested maximum 2056 fragment length. 2058 If a server receives a maximum fragment length negotiation request 2059 for a value other than the allowed values, it MUST abort the 2060 handshake with an "illegal_parameter" alert. Similarly, if a client 2061 receives a maximum fragment length negotiation response that differs 2062 from the length it requested, it MUST also abort the handshake with 2063 an "illegal_parameter" alert. 2065 Once a maximum fragment length other than 2^14 has been successfully 2066 negotiated, the client and server MUST immediately begin fragmenting 2067 messages (including handshake messages), to ensure that no fragment 2068 larger than the negotiated length is sent. Note that TLS already 2069 requires clients and servers to support fragmentation of handshake 2070 messages. 2072 The negotiated length applies for the duration of the session 2073 including session resumptions. 2075 The negotiated length limits the input that the record layer may 2076 process without fragmentation (that is, the maximum value of 2077 TLSPlaintext.length; see [TLS] section 6.2.1). Note that the output 2078 of the record layer may be larger. For example, if the negotiated 2079 length is 2^9=512, then for currently defined cipher suites and when 2080 null compression is used, the record layer output can be at most 793 2081 bytes: 5 bytes of headers, 512 bytes of application data, 256 bytes 2082 of padding, and 20 bytes of MAC. That means that in this event a TLS 2083 record layer peer receiving a TLS record layer message larger than 2084 793 bytes may discard the message and send a "record_overflow" alert, 2085 without decrypting the message. 2087 7.4.1.4.3 Client Certificate URLs 2089 Ordinarily, when client authentication is performed, client 2090 certificates are sent by clients to servers during the TLS handshake. 2091 It may be desirable for constrained clients to send certificate URLs 2092 in place of certificates, so that they do not need to store their 2093 certificates and can therefore save memory. 2095 In order to negotiate to send certificate URLs to a server, clients 2096 MAY include an extension of type "client_certificate_url" in the 2097 (extended) client hello. The "extension_data" field of this 2098 extension SHALL be empty. 2100 (Note that it is necessary to negotiate use of client certificate 2101 URLs in order to avoid "breaking" existing TLS 1.0 servers.) 2103 Servers that receive an extended client hello containing a 2104 "client_certificate_url" extension, MAY indicate that they are 2105 willing to accept certificate URLs by including an extension of type 2106 "client_certificate_url" in the (extended) server hello. The 2107 "extension_data" field of this extension SHALL be empty. 2109 After negotiation of the use of client certificate URLs has been 2110 successfully completed (by exchanging hellos including 2111 "client_certificate_url" extensions), clients MAY send a 2112 "CertificateURL" message in place of a "Certificate" message. See 2113 Section XXX. 2115 7.4.1.4.4 Trusted CA Indication 2117 Constrained clients that, due to memory limitations, possess only a 2118 small number of CA root keys, may wish to indicate to servers which 2119 root keys they possess, in order to avoid repeated handshake 2120 failures. 2122 In order to indicate which CA root keys they possess, clients MAY 2123 include an extension of type "trusted_ca_keys" in the (extended) 2124 client hello. The "extension_data" field of this extension SHALL 2125 contain "TrustedAuthorities" where: 2127 struct { 2128 TrustedAuthority trusted_authorities_list<0..2^16-1>; 2129 } TrustedAuthorities; 2131 struct { 2132 IdentifierType identifier_type; 2133 select (identifier_type) { 2134 case pre_agreed: struct {}; 2135 case key_sha1_hash: SHA1Hash; 2136 case x509_name: DistinguishedName; 2137 case cert_sha1_hash: SHA1Hash; 2138 } identifier; 2139 } TrustedAuthority; 2141 enum { 2142 pre_agreed(0), key_sha1_hash(1), x509_name(2), 2143 cert_sha1_hash(3), (255) 2144 } IdentifierType; 2146 opaque DistinguishedName<1..2^16-1>; 2148 Here "TrustedAuthorities" provides a list of CA root key identifiers 2149 that the client possesses. Each CA root key is identified via 2150 either: 2152 - "pre_agreed" - no CA root key identity supplied. 2154 - "key_sha1_hash" - contains the SHA-1 hash of the CA root key. 2155 For 2156 DSA and ECDSA keys, this is the hash of the "subjectPublicKey" 2157 value. For RSA keys, the hash is of the big-endian byte string 2158 representation of the modulus without any initial 0-valued bytes. 2159 (This copies the key hash formats deployed in other 2160 environments.) 2162 - "x509_name" - contains the DER-encoded X.509 DistinguishedName 2163 of 2164 the CA. 2166 - "cert_sha1_hash" - contains the SHA-1 hash of a DER-encoded 2167 Certificate containing the CA root key. 2169 Note that clients may include none, some, or all of the CA root keys 2170 they possess in this extension. 2172 Note also that it is possible that a key hash or a Distinguished Name 2173 alone may not uniquely identify a certificate issuer - for example if 2174 a particular CA has multiple key pairs - however here we assume this 2175 is the case following the use of Distinguished Names to identify 2176 certificate issuers in TLS. 2178 The option to include no CA root keys is included to allow the client 2179 to indicate possession of some pre-defined set of CA root keys. 2181 Servers that receive a client hello containing the "trusted_ca_keys" 2182 extension, MAY use the information contained in the extension to 2183 guide their selection of an appropriate certificate chain to return 2184 to the client. In this event, the server SHALL include an extension 2185 of type "trusted_ca_keys" in the (extended) server hello. The 2186 "extension_data" field of this extension SHALL be empty. 2188 7.4.1.4.5 Truncated HMAC 2190 Currently defined TLS cipher suites use the MAC construction HMAC 2191 with either MD5 or SHA-1 [HMAC] to authenticate record layer 2192 communications. In TLS the entire output of the hash function is 2193 used as the MAC tag. However it may be desirable in constrained 2194 environments to save bandwidth by truncating the output of the hash 2195 function to 80 bits when forming MAC tags. 2197 In order to negotiate the use of 80-bit truncated HMAC, clients MAY 2198 include an extension of type "truncated_hmac" in the extended client 2199 hello. The "extension_data" field of this extension SHALL be empty. 2201 Servers that receive an extended hello containing a "truncated_hmac" 2202 extension, MAY agree to use a truncated HMAC by including an 2203 extension of type "truncated_hmac", with empty "extension_data", in 2204 the extended server hello. 2206 Note that if new cipher suites are added that do not use HMAC, and 2207 the session negotiates one of these cipher suites, this extension 2208 will have no effect. It is strongly recommended that any new cipher 2209 suites using other MACs consider the MAC size as an integral part of 2210 the cipher suite definition, taking into account both security and 2211 bandwidth considerations. 2213 If HMAC truncation has been successfully negotiated during a TLS 2214 handshake, and the negotiated cipher suite uses HMAC, both the client 2215 and the server pass this fact to the TLS record layer along with the 2216 other negotiated security parameters. Subsequently during the 2217 session, clients and servers MUST use truncated HMACs, calculated as 2218 specified in [HMAC]. That is, CipherSpec.hash_size is 10 bytes, and 2219 only the first 10 bytes of the HMAC output are transmitted and 2220 checked. Note that this extension does not affect the calculation of 2221 the PRF as part of handshaking or key derivation. 2223 The negotiated HMAC truncation size applies for the duration of the 2224 session including session resumptions. 2226 7.4.1.4.6 Certificate Status Request 2228 Constrained clients may wish to use a certificate-status protocol 2229 such as OCSP [OCSP] to check the validity of server certificates, in 2230 order to avoid transmission of CRLs and therefore save bandwidth on 2231 constrained networks. This extension allows for such information to 2232 be sent in the TLS handshake, saving roundtrips and resources. 2234 In order to indicate their desire to receive certificate status 2235 information, clients MAY include an extension of type 2236 "status_request" in the (extended) client hello. The 2237 "extension_data" field of this extension SHALL contain 2238 "CertificateStatusRequest" where: 2240 struct { 2241 CertificateStatusType status_type; 2242 select (status_type) { 2243 case ocsp: OCSPStatusRequest; 2244 } request; 2245 } CertificateStatusRequest; 2247 enum { ocsp(1), (255) } CertificateStatusType; 2249 struct { 2250 ResponderID responder_id_list<0..2^16-1>; 2251 Extensions request_extensions; 2252 } OCSPStatusRequest; 2254 opaque ResponderID<1..2^16-1>; 2256 In the OCSPStatusRequest, the "ResponderIDs" provides a list of OCSP 2257 responders that the client trusts. A zero-length "responder_id_list" 2258 sequence has the special meaning that the responders are implicitly 2259 known to the server - e.g., by prior arrangement. "Extensions" is a 2260 DER encoding of OCSP request extensions. 2262 Both "ResponderID" and "Extensions" are DER-encoded ASN.1 types as 2263 defined in [OCSP]. "Extensions" is imported from [PKIX]. A zero- 2264 length "request_extensions" value means that there are no extensions 2265 (as opposed to a zero-length ASN.1 SEQUENCE, which is not valid for 2266 the "Extensions" type). 2268 In the case of the "id-pkix-ocsp-nonce" OCSP extension, [OCSP] is 2269 unclear about its encoding; for clarification, the nonce MUST be a 2270 DER-encoded OCTET STRING, which is encapsulated as another OCTET 2271 STRING (note that implementations based on an existing OCSP client 2272 will need to be checked for conformance to this requirement). 2274 Servers that receive a client hello containing the "status_request" 2275 extension, MAY return a suitable certificate status response to the 2276 client along with their certificate. If OCSP is requested, they 2277 SHOULD use the information contained in the extension when selecting 2278 an OCSP responder, and SHOULD include request_extensions in the OCSP 2279 request. 2281 Servers return a certificate response along with their certificate by 2282 sending a "CertificateStatus" message immediately after the 2283 "Certificate" message (and before any "ServerKeyExchange" or 2284 "CertificateRequest" messages). Section XXX describes the 2285 CertificateStatus message. 2287 7.4.1.4.7 Cert Hash Types 2289 The client MAY use the "cert_hash_types" to indicate to the server 2290 which hash functions may be used in the signature on the server's 2291 certificate. The "extension_data" field of this extension contains: 2293 enum{ 2294 md5(0), sha1(1), sha256(2), sha512(3), (255) 2295 } HashType; 2297 struct { 2298 HashType<255> types; 2299 } CertHashTypes; 2301 These values indicate support for MD5 [MD5], SHA-1, SHA-256, and 2302 SHA-512 [SHA] respectively. The server MUST NOT send this extension. 2304 Clients SHOULD send this extension if they support any algorithm 2305 other than SHA-1. If this extension is not used, servers SHOULD 2306 assume that the client supports only SHA-1. 2308 7.4.1.4.8 Procedure for Defining New Extensions 2310 The list of extension types, as defined in Section 2.3, is maintained 2311 by the Internet Assigned Numbers Authority (IANA). Thus an 2312 application needs to be made to the IANA in order to obtain a new 2313 extension type value. Since there are subtle (and not so subtle) 2314 interactions that may occur in this protocol between new features and 2315 existing features which may result in a significant reduction in 2316 overall security, new values SHALL be defined only through the IETF 2317 Consensus process specified in [IANA]. 2319 (This means that new assignments can be made only via RFCs approved 2320 by the IESG.) 2321 The following considerations should be taken into account when 2322 designing new extensions: 2324 - All of the extensions defined in this document follow the 2325 convention that for each extension that a client requests and 2326 that the server understands, the server replies with an extension 2327 of the same type. 2329 - Some cases where a server does not agree to an extension are 2330 error 2331 conditions, and some simply a refusal to support a particular 2332 feature. In general error alerts should be used for the former, 2333 and a field in the server extension response for the latter. 2335 - Extensions should as far as possible be designed to prevent any 2336 attack that forces use (or non-use) of a particular feature by 2337 manipulation of handshake messages. This principle should be 2338 followed regardless of whether the feature is believed to cause a 2339 security problem. 2341 Often the fact that the extension fields are included in the 2342 inputs to the Finished message hashes will be sufficient, but 2343 extreme care is needed when the extension changes the meaning of 2344 messages sent in the handshake phase. Designers and implementors 2345 should be aware of the fact that until the handshake has been 2346 authenticated, active attackers can modify messages and insert, 2347 remove, or replace extensions. 2349 - It would be technically possible to use extensions to change 2350 major 2351 aspects of the design of TLS; for example the design of cipher 2352 suite negotiation. This is not recommended; it would be more 2353 appropriate to define a new version of TLS - particularly since 2354 the TLS handshake algorithms have specific protection against 2355 version rollback attacks based on the version number, and the 2356 possibility of version rollback should be a significant 2357 consideration in any major design change. 2359 7.4.2. Server certificate 2361 When this message will be sent: 2362 The server MUST send a certificate whenever the agreed-upon key 2363 exchange method is not an anonymous one. This message will always 2364 immediately follow the server hello message. 2366 Meaning of this message: 2367 The certificate type MUST be appropriate for the selected cipher 2368 suite's key exchange algorithm, and is generally an X.509v3 2369 certificate. It MUST contain a key which matches the key exchange 2370 method, as follows. Unless otherwise specified, the signing 2371 algorithm for the certificate MUST be the same as the algorithm 2372 for the certificate key. Unless otherwise specified, the public 2373 key MAY be of any length. 2375 Key Exchange Algorithm Certificate Key Type 2377 RSA RSA public key; the certificate MUST 2378 allow the key to be used for encryption. 2380 DHE_DSS DSS public key. 2382 DHE_RSA RSA public key which can be used for 2383 signing. 2385 DH_DSS Diffie-Hellman key. The algorithm used 2386 to sign the certificate MUST be DSS. 2388 DH_RSA Diffie-Hellman key. The algorithm used 2389 to sign the certificate MUST be RSA. 2391 All certificate profiles, key and cryptographic formats are defined 2392 by the IETF PKIX working group [PKIX]. When a key usage extension is 2393 present, the digitalSignature bit MUST be set for the key to be 2394 eligible for signing, as described above, and the keyEncipherment bit 2395 MUST be present to allow encryption, as described above. The 2396 keyAgreement bit must be set on Diffie-Hellman certificates. 2398 As CipherSuites which specify new key exchange methods are specified 2399 for the TLS Protocol, they will imply certificate format and the 2400 required encoded keying information. 2402 Structure of this message: 2403 opaque ASN.1Cert<1..2^24-1>; 2405 struct { 2406 ASN.1Cert certificate_list<0..2^24-1>; 2407 } Certificate; 2409 certificate_list 2410 This is a sequence (chain) of X.509v3 certificates. The sender's 2411 certificate must come first in the list. Each following 2412 certificate must directly certify the one preceding it. Because 2413 certificate validation requires that root keys be distributed 2414 independently, the self-signed certificate which specifies the 2415 root certificate authority may optionally be omitted from the 2416 chain, under the assumption that the remote end must already 2417 possess it in order to validate it in any case. 2419 The same message type and structure will be used for the client's 2420 response to a certificate request message. Note that a client MAY 2421 send no certificates if it does not have an appropriate certificate 2422 to send in response to the server's authentication request. 2424 Note: PKCS #7 [PKCS7] is not used as the format for the certificate 2425 vector because PKCS #6 [PKCS6] extended certificates are not 2426 used. Also PKCS #7 defines a SET rather than a SEQUENCE, making 2427 the task of parsing the list more difficult. 2429 7.4.3. Server key exchange message 2431 When this message will be sent: 2432 This message will be sent immediately after the server 2433 certificate message (or the server hello message, if this is an 2434 anonymous negotiation). 2436 The server key exchange message is sent by the server only when 2437 the server certificate message (if sent) does not contain enough 2438 data to allow the client to exchange a premaster secret. This is 2439 true for the following key exchange methods: 2441 DHE_DSS 2442 DHE_RSA 2443 DH_anon 2445 It is not legal to send the server key exchange message for the 2446 following key exchange methods: 2448 RSA 2449 DH_DSS 2450 DH_RSA 2452 Meaning of this message: 2453 This message conveys cryptographic information to allow the 2454 client to communicate the premaster secret: either an RSA public 2455 key to encrypt the premaster secret with, or a Diffie-Hellman 2456 public key with which the client can complete a key exchange 2457 (with the result being the premaster secret.) 2459 As additional CipherSuites are defined for TLS which include new key 2460 exchange algorithms, the server key exchange message will be sent if 2461 and only if the certificate type associated with the key exchange 2462 algorithm does not provide enough information for the client to 2463 exchange a premaster secret. 2465 If the SignatureAlgorithm being used to sign the ServerKeyExchange 2466 message is DSA, the hash function used MUST be SHA-1. If the 2467 SignatureAlgorithm it must be the same hash function used in the 2468 signature of the server's certificate (found in the Certificate) 2469 message. This algorithm is denoted Hash below. Hash.length is the 2470 length of the output of that algorithm. 2472 Structure of this message: 2473 enum { rsa, diffie_hellman } KeyExchangeAlgorithm; 2475 struct { 2476 opaque rsa_modulus<1..2^16-1>; 2477 opaque rsa_exponent<1..2^16-1>; 2478 } ServerRSAParams; 2480 rsa_modulus 2481 The modulus of the server's temporary RSA key. 2483 rsa_exponent 2484 The public exponent of the server's temporary RSA key. 2486 struct { 2487 opaque dh_p<1..2^16-1>; 2488 opaque dh_g<1..2^16-1>; 2489 opaque dh_Ys<1..2^16-1>; 2490 } ServerDHParams; /* Ephemeral DH parameters */ 2492 dh_p 2493 The prime modulus used for the Diffie-Hellman operation. 2495 dh_g 2496 The generator used for the Diffie-Hellman operation. 2498 dh_Ys 2499 The server's Diffie-Hellman public value (g^X mod p). 2501 struct { 2502 select (KeyExchangeAlgorithm) { 2503 case diffie_hellman: 2504 ServerDHParams params; 2505 Signature signed_params; 2506 case rsa: 2507 ServerRSAParams params; 2508 Signature signed_params; 2509 }; 2510 } ServerKeyExchange; 2512 struct { 2513 select (KeyExchangeAlgorithm) { 2514 case diffie_hellman: 2515 ServerDHParams params; 2516 case rsa: 2517 ServerRSAParams params; 2518 }; 2519 } ServerParams; 2521 params 2522 The server's key exchange parameters. 2524 signed_params 2525 For non-anonymous key exchanges, a hash of the corresponding 2526 params value, with the signature appropriate to that hash 2527 applied. 2529 hash 2530 Hash(ClientHello.random + ServerHello.random + ServerParams) 2532 sha_hash 2533 SHA1(ClientHello.random + ServerHello.random + ServerParams) 2535 enum { anonymous, rsa, dsa } SignatureAlgorithm; 2537 struct { 2538 select (SignatureAlgorithm) { 2539 case anonymous: struct { }; 2540 case rsa: 2541 digitally-signed struct { 2542 opaque hash[Hash.length]; 2543 }; 2544 case dsa: 2545 digitally-signed struct { 2546 opaque sha_hash[20]; 2547 }; 2548 }; 2549 }; 2550 } Signature; 2552 7.4.4. CertificateStatus 2554 If a server returns a 2555 "CertificateStatus" message, then the server MUST have included an 2556 extension of type "status_request" with empty "extension_data" in the 2557 extended server hello. 2559 struct { 2560 CertificateStatusType status_type; 2561 select (status_type) { 2562 case ocsp: OCSPResponse; 2563 } response; 2564 } CertificateStatus; 2566 opaque OCSPResponse<1..2^24-1>; 2568 An "ocsp_response" contains a complete, DER-encoded OCSP response 2569 (using the ASN.1 type OCSPResponse defined in [OCSP]). Note that 2570 only one OCSP response may be sent. 2572 The "CertificateStatus" message is conveyed using the handshake 2573 message type "certificate_status". 2575 Note that a server MAY also choose not to send a "CertificateStatus" 2576 message, even if it receives a "status_request" extension in the 2577 client hello message. 2579 Note in addition that servers MUST NOT send the "CertificateStatus" 2580 message unless it received a "status_request" extension in the client 2581 hello message. 2583 Clients requesting an OCSP response, and receiving an OCSP response 2584 in a "CertificateStatus" message MUST check the OCSP response and 2585 abort the handshake if the response is not satisfactory. 2587 7.4.5. Certificate request 2589 When this message will be sent: 2590 A non-anonymous server can optionally request a certificate from 2591 the client, if appropriate for the selected cipher suite. This 2592 message, if sent, will immediately follow the Server Key Exchange 2593 message (if it is sent; otherwise, the Server Certificate 2594 message). 2596 Structure of this message: 2597 enum { 2598 rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), 2599 rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), 2600 fortezza_dms_RESERVED(20), 2601 (255) 2602 } ClientCertificateType; 2604 opaque DistinguishedName<1..2^16-1>; 2606 struct { 2607 ClientCertificateType certificate_types<1..2^8-1>; 2608 DistinguishedName certificate_authorities<0..2^16-1>; 2609 } CertificateRequest; 2611 certificate_types 2612 This field is a list of the types of certificates requested, 2613 sorted in order of the server's preference. 2615 certificate_authorities 2616 A list of the distinguished names of acceptable certificate 2617 authorities. These distinguished names may specify a desired 2618 distinguished name for a root CA or for a subordinate CA; 2619 thus, this message can be used both to describe known roots 2620 and a desired authorization space. If the 2621 certificate_authorities list is empty then the client MAY 2622 send any certificate of the appropriate 2623 ClientCertificateType, unless there is some external 2624 arrangement to the contrary. 2626 ClientCertificateType values are divided into three groups: 2628 1. Values from 0 (zero) through 63 decimal (0x3F) inclusive are 2629 reserved for IETF Standards Track protocols. 2631 2. Values from 64 decimal (0x40) through 223 decimal (0xDF) inclusive 2632 are reserved for assignment for non-Standards Track methods. 2634 3. Values from 224 decimal (0xE0) through 255 decimal (0xFF) 2635 inclusive are reserved for private use. 2637 Additional information describing the role of IANA in the 2638 allocation of ClientCertificateType code points is described 2639 in Section 11. 2641 Note: Values listed as RESERVED may not be used. They were used in SSLv3. 2643 Note: DistinguishedName is derived from [X501]. DistinguishedNames are 2644 represented in DER-encoded format. 2646 Note: It is a fatal handshake_failure alert for an anonymous server to 2647 request client authentication. 2649 7.4.6. Server hello done 2651 When this message will be sent: 2652 The server hello done message is sent by the server to indicate 2653 the end of the server hello and associated messages. After 2654 sending this message the server will wait for a client response. 2656 Meaning of this message: 2657 This message means that the server is done sending messages to 2658 support the key exchange, and the client can proceed with its 2659 phase of the key exchange. 2661 Upon receipt of the server hello done message the client SHOULD 2662 verify that the server provided a valid certificate if required 2663 and check that the server hello parameters are acceptable. 2665 Structure of this message: 2666 struct { } ServerHelloDone; 2668 7.4.7. Client certificate 2670 When this message will be sent: 2671 This is the first message the client can send after receiving a 2672 server hello done message. This message is only sent if the 2673 server requests a certificate. If no suitable certificate is 2674 available, the client SHOULD send a certificate message 2675 containing no certificates. That is, the certificate_list 2676 structure has a length of zero. If client authentication is 2677 required by the server for the handshake to continue, it may 2678 respond with a fatal handshake failure alert. Client certificates 2679 are sent using the Certificate structure defined in Section 2680 7.4.2. 2682 Note: When using a static Diffie-Hellman based key exchange method 2683 (DH_DSS or DH_RSA), if client authentication is requested, the 2684 Diffie-Hellman group and generator encoded in the client's 2685 certificate MUST match the server specified Diffie-Hellman 2686 parameters if the client's parameters are to be used for the key 2687 exchange. 2689 7.4.8. Client Certificate URLs 2691 After negotiation of the use of client certificate URLs has been 2692 successfully completed (by exchanging hellos including 2693 "client_certificate_url" extensions), clients MAY send a 2694 "CertificateURL" message in place of a "Certificate" message. 2696 enum { 2697 individual_certs(0), pkipath(1), (255) 2698 } CertChainType; 2700 enum { 2701 false(0), true(1) 2702 } Boolean; 2704 struct { 2705 CertChainType type; 2706 URLAndOptionalHash url_and_hash_list<1..2^16-1>; 2707 } CertificateURL; 2709 struct { 2710 opaque url<1..2^16-1>; 2711 Boolean hash_present; 2712 select (hash_present) { 2713 case false: struct {}; 2714 case true: SHA1Hash; 2715 } hash; 2716 } URLAndOptionalHash; 2718 opaque SHA1Hash[20]; 2720 Here "url_and_hash_list" contains a sequence of URLs and optional 2721 hashes. 2723 When X.509 certificates are used, there are two possibilities: 2725 - if CertificateURL.type is "individual_certs", each URL refers to 2726 a 2727 single DER-encoded X.509v3 certificate, with the URL for the 2728 client's certificate first, or 2730 - if CertificateURL.type is "pkipath", the list contains a single 2731 URL referring to a DER-encoded certificate chain, using the type 2732 PkiPath described in Section 8. 2734 When any other certificate format is used, the specification that 2735 describes use of that format in TLS should define the encoding format 2736 of certificates or certificate chains, and any constraint on their 2737 ordering. 2739 The hash corresponding to each URL at the client's discretion is 2740 either not present or is the SHA-1 hash of the certificate or 2741 certificate chain (in the case of X.509 certificates, the DER-encoded 2742 certificate or the DER-encoded PkiPath). 2744 Note that when a list of URLs for X.509 certificates is used, the 2745 ordering of URLs is the same as that used in the TLS Certificate 2746 message (see [TLS] Section 7.4.2), but opposite to the order in which 2747 certificates are encoded in PkiPath. In either case, the self-signed 2748 root certificate MAY be omitted from the chain, under the assumption 2749 that the server must already possess it in order to validate it. 2751 Servers receiving "CertificateURL" SHALL attempt to retrieve the 2752 client's certificate chain from the URLs, and then process the 2753 certificate chain as usual. A cached copy of the content of any URL 2754 in the chain MAY be used, provided that a SHA-1 hash is present for 2755 that URL and it matches the hash of the cached copy. 2757 Servers that support this extension MUST support the http: URL scheme 2758 for certificate URLs, and MAY support other schemes. Use of other 2759 schemes than "http", "https", or "ftp" may create unexpected 2760 problems. 2762 If the protocol used is HTTP, then the HTTP server can be configured 2763 to use the Cache-Control and Expires directives described in [HTTP] 2764 to specify whether and for how long certificates or certificate 2765 chains should be cached. 2767 The TLS server is not required to follow HTTP redirects when 2768 retrieving the certificates or certificate chain. The URLs used in 2769 this extension SHOULD therefore be chosen not to depend on such 2770 redirects. 2772 If the protocol used to retrieve certificates or certificate chains 2773 returns a MIME formatted response (as HTTP does), then the following 2774 MIME Content-Types SHALL be used: when a single X.509v3 certificate 2775 is returned, the Content-Type is "application/pkix-cert" [PKIOP], and 2776 when a chain of X.509v3 certificates is returned, the Content-Type is 2777 "application/pkix-pkipath" (see Section XXX). 2779 If a SHA-1 hash is present for an URL, then the server MUST check 2780 that the SHA-1 hash of the contents of the object retrieved from that 2781 URL (after decoding any MIME Content-Transfer-Encoding) matches the 2782 given hash. If any retrieved object does not have the correct SHA-1 2783 hash, the server MUST abort the handshake with a 2784 "bad_certificate_hash_value" alert. 2786 Note that clients may choose to send either "Certificate" or 2787 "CertificateURL" after successfully negotiating the option to send 2788 certificate URLs. The option to send a certificate is included to 2789 provide flexibility to clients possessing multiple certificates. 2791 If a server encounters an unreasonable delay in obtaining 2792 certificates in a given CertificateURL, it SHOULD time out and signal 2793 a "certificate_unobtainable" error alert. 2795 7.4.9. Client key exchange message 2796 When this message will be sent: 2797 This message is always sent by the client. It MUST immediately follow 2798 the client certificate message, if it is sent. Otherwise it MUST be 2799 the first message sent by the client after it receives the server 2800 hello done message. 2802 Meaning of this message: 2803 With this message, the premaster secret is set, either though direct 2804 transmission of the RSA-encrypted secret, or by the transmission of 2805 Diffie-Hellman parameters which will allow each side to agree upon 2806 the same premaster secret. When the key exchange method is DH_RSA or 2807 DH_DSS, client certification has been requested, and the client was 2808 able to respond with a certificate which contained a Diffie-Hellman 2809 public key whose parameters (group and generator) matched those 2810 specified by the server in its certificate, this message MUST not 2811 contain any data. 2813 Structure of this message: 2814 The choice of messages depends on which key exchange method has been 2815 selected. See Section 7.4.3 for the KeyExchangeAlgorithm definition. 2817 struct { 2818 select (KeyExchangeAlgorithm) { 2819 case rsa: EncryptedPreMasterSecret; 2820 case diffie_hellman: ClientDiffieHellmanPublic; 2821 } exchange_keys; 2822 } ClientKeyExchange; 2824 7.4.9.1. RSA encrypted premaster secret message 2826 Meaning of this message: 2827 If RSA is being used for key agreement and authentication, the client 2828 generates a 48-byte premaster secret, encrypts it using the public 2829 key from the server's certificate or the temporary RSA key provided 2830 in a server key exchange message, and sends the result in an 2831 encrypted premaster secret message. This structure is a variant of 2832 the client key exchange message, not a message in itself. 2834 Structure of this message: 2835 struct { 2836 ProtocolVersion client_version; 2837 opaque random[46]; 2838 } PreMasterSecret; 2840 client_version 2841 The latest (newest) version supported by the client. This is 2842 used to detect version roll-back attacks. Upon receiving the 2843 premaster secret, the server SHOULD check that this value 2844 matches the value transmitted by the client in the client 2845 hello message. 2847 random 2848 46 securely-generated random bytes. 2850 struct { 2851 public-key-encrypted PreMasterSecret pre_master_secret; 2852 } EncryptedPreMasterSecret; 2854 pre_master_secret 2855 This random value is generated by the client and is used to 2856 generate the master secret, as specified in Section 8.1. 2858 Note: An attack discovered by Daniel Bleichenbacher [BLEI] can be used 2859 to attack a TLS server which is using PKCS#1 v 1.5 encoded RSA. 2860 The attack takes advantage of the fact that by failing in 2861 different ways, a TLS server can be coerced into revealing 2862 whether a particular message, when decrypted, is properly PKCS#1 2863 v1.5 formatted or not. 2865 The best way to avoid vulnerability to this attack is to treat 2866 incorrectly formatted messages in a manner indistinguishable from 2867 correctly formatted RSA blocks. Thus, when it receives an 2868 incorrectly formatted RSA block, a server should generate a 2869 random 48-byte value and proceed using it as the premaster 2870 secret. Thus, the server will act identically whether the 2871 received RSA block is correctly encoded or not. 2873 [PKCS1B] defines a newer version of PKCS#1 encoding that is more 2874 secure against the Bleichenbacher attack. However, for maximal 2875 compatibility with TLS 1.0, TLS 1.1 retains the original 2876 encoding. No variants of the Bleichenbacher attack are known to 2877 exist provided that the above recommendations are followed. 2879 Implementation Note: public-key-encrypted data is represented as an 2880 opaque vector <0..2^16-1> (see section 4.7). Thus the RSA- 2881 encrypted PreMasterSecret in a ClientKeyExchange is preceded by 2882 two length bytes. These bytes are redundant in the case of RSA 2883 because the EncryptedPreMasterSecret is the only data in the 2884 ClientKeyExchange and its length can therefore be unambiguously 2885 determined. The SSLv3 specification was not clear about the 2886 encoding of public-key-encrypted data and therefore many SSLv3 2887 implementations do not include the the length bytes, encoding the 2888 RSA encrypted data directly in the ClientKeyExchange message. 2890 This specification requires correct encoding of the 2891 EncryptedPreMasterSecret complete with length bytes. The 2892 resulting PDU is incompatible with many SSLv3 implementations. 2893 Implementors upgrading from SSLv3 must modify their 2894 implementations to generate and accept the correct encoding. 2895 Implementors who wish to be compatible with both SSLv3 and TLS 2896 should make their implementation's behavior dependent on the 2897 protocol version. 2899 Implementation Note: It is now known that remote timing-based attacks 2900 on SSL are possible, at least when the client and server are on 2901 the same LAN. Accordingly, implementations which use static RSA 2902 keys SHOULD use RSA blinding or some other anti-timing technique, 2903 as described in [TIMING]. 2905 Note: The version number in the PreMasterSecret MUST be the version 2906 offered by the client in the ClientHello, not the version 2907 negotiated for the connection. This feature is designed to 2908 prevent rollback attacks. Unfortunately, many implementations use 2909 the negotiated version instead and therefore checking the version 2910 number may lead to failure to interoperate with such incorrect 2911 client implementations. Client implementations MUST and Server 2912 implementations MAY check the version number. In practice, since 2913 the TLS handshake MACs prevent downgrade and no good attacks are 2914 known on those MACs, ambiguity is not considered a serious 2915 security risk. Note that if servers choose to to check the 2916 version number, they should randomize the PreMasterSecret in case 2917 of error, rather than generate an alert, in order to avoid 2918 variants on the Bleichenbacher attack. [KPR03] 2920 7.4.9.2. Client Diffie-Hellman public value 2922 Meaning of this message: 2923 This structure conveys the client's Diffie-Hellman public value 2924 (Yc) if it was not already included in the client's certificate. 2925 The encoding used for Yc is determined by the enumerated 2926 PublicValueEncoding. This structure is a variant of the client 2927 key exchange message, not a message in itself. 2929 Structure of this message: 2930 enum { implicit, explicit } PublicValueEncoding; 2932 implicit 2933 If the client certificate already contains a suitable Diffie- 2934 Hellman key, then Yc is implicit and does not need to be sent 2935 again. In this case, the client key exchange message will be 2936 sent, but MUST be empty. 2938 explicit 2939 Yc needs to be sent. 2941 struct { 2942 select (PublicValueEncoding) { 2943 case implicit: struct { }; 2944 case explicit: opaque dh_Yc<1..2^16-1>; 2945 } dh_public; 2946 } ClientDiffieHellmanPublic; 2948 dh_Yc 2949 The client's Diffie-Hellman public value (Yc). 2951 7.4.10. Certificate verify 2953 When this message will be sent: 2954 This message is used to provide explicit verification of a client 2955 certificate. This message is only sent following a client 2956 certificate that has signing capability (i.e. all certificates 2957 except those containing fixed Diffie-Hellman parameters). When 2958 sent, it MUST immediately follow the client key exchange message. 2960 Structure of this message: 2961 struct { 2962 Signature signature; 2963 } CertificateVerify; 2965 The Signature type is defined in 7.4.3. If the SignatureAlgorithm 2966 is DSA, then the sha_hash value must be used. If it is RSA, 2967 the same function (denoted Hash) must be used as was used to 2968 create the signature for the client's certificate. 2970 CertificateVerify.signature.hash 2971 Hash(handshake_messages); 2973 CertificateVerify.signature.sha_hash 2974 SHA(handshake_messages); 2976 Here handshake_messages refers to all handshake messages sent or 2977 received starting at client hello up to but not including this 2978 message, including the type and length fields of the handshake 2979 messages. This is the concatenation of all the Handshake structures 2980 as defined in 7.4 exchanged thus far. 2982 7.4.10. Finished 2984 When this message will be sent: 2985 A finished message is always sent immediately after a change 2986 cipher spec message to verify that the key exchange and 2987 authentication processes were successful. It is essential that a 2988 change cipher spec message be received between the other 2989 handshake messages and the Finished message. 2991 Meaning of this message: 2992 The finished message is the first protected with the just- 2993 negotiated algorithms, keys, and secrets. Recipients of finished 2994 messages MUST verify that the contents are correct. Once a side 2995 has sent its Finished message and received and validated the 2996 Finished message from its peer, it may begin to send and receive 2997 application data over the connection. 2999 struct { 3000 opaque verify_data[12]; 3001 } Finished; 3003 verify_data 3004 PRF(master_secret, finished_label, MD5(handshake_messages) + 3005 SHA-1(handshake_messages)) [0..11]; 3007 finished_label 3008 For Finished messages sent by the client, the string "client 3009 finished". For Finished messages sent by the server, the 3010 string "server finished". 3012 handshake_messages 3013 All of the data from all messages in this handshake (not 3014 including any HelloRequest messages) up to but not including 3015 this message. This is only data visible at the handshake 3016 layer and does not include record layer headers. This is the 3017 concatenation of all the Handshake structures as defined in 3018 7.4 exchanged thus far. 3020 It is a fatal error if a finished message is not preceded by a change 3021 cipher spec message at the appropriate point in the handshake. 3023 The value handshake_messages includes all handshake messages starting 3024 at client hello up to, but not including, this finished message. This 3025 may be different from handshake_messages in Section 7.4.8 because it 3026 would include the certificate verify message (if sent). Also, the 3027 handshake_messages for the finished message sent by the client will 3028 be different from that for the finished message sent by the server, 3029 because the one which is sent second will include the prior one. 3031 Note: Change cipher spec messages, alerts and any other record types 3032 are not handshake messages and are not included in the hash 3033 computations. Also, Hello Request messages are omitted from 3034 handshake hashes. 3036 8. Cryptographic computations 3037 In order to begin connection protection, the TLS Record Protocol 3038 requires specification of a suite of algorithms, a master secret, and 3039 the client and server random values. The authentication, encryption, 3040 and MAC algorithms are determined by the cipher_suite selected by the 3041 server and revealed in the server hello message. The compression 3042 algorithm is negotiated in the hello messages, and the random values 3043 are exchanged in the hello messages. All that remains is to calculate 3044 the master secret. 3046 8.1. Computing the master secret 3048 For all key exchange methods, the same algorithm is used to convert 3049 the pre_master_secret into the master_secret. The pre_master_secret 3050 should be deleted from memory once the master_secret has been 3051 computed. 3053 master_secret = PRF(pre_master_secret, "master secret", 3054 ClientHello.random + ServerHello.random) 3055 [0..47]; 3057 The master secret is always exactly 48 bytes in length. The length of 3058 the premaster secret will vary depending on key exchange method. 3060 8.1.1. RSA 3062 When RSA is used for server authentication and key exchange, a 3063 48-byte pre_master_secret is generated by the client, encrypted under 3064 the server's public key, and sent to the server. The server uses its 3065 private key to decrypt the pre_master_secret. Both parties then 3066 convert the pre_master_secret into the master_secret, as specified 3067 above. 3069 RSA digital signatures are performed using PKCS #1 [PKCS1] block type 3070 1. RSA public key encryption is performed using PKCS #1 block type 2. 3072 8.1.2. Diffie-Hellman 3074 A conventional Diffie-Hellman computation is performed. The 3075 negotiated key (Z) is used as the pre_master_secret, and is converted 3076 into the master_secret, as specified above. Leading bytes of Z that 3077 contain all zero bits are stripped before it is used as the 3078 pre_master_secret. 3080 Note: Diffie-Hellman parameters are specified by the server, and may 3081 be either ephemeral or contained within the server's certificate. 3083 9. Mandatory Cipher Suites 3085 In the absence of an application profile standard specifying 3086 otherwise, a TLS compliant application MUST implement the cipher 3087 suite TLS_RSA_WITH_3DES_EDE_CBC_SHA. 3089 10. Application data protocol 3091 Application data messages are carried by the Record Layer and are 3092 fragmented, compressed and encrypted based on the current connection 3093 state. The messages are treated as transparent data to the record 3094 layer. 3096 11. IANA Considerations 3098 This document describes a number of new registries to be created by 3099 IANA. We recommend that they be placed as individual registries items 3100 under a common TLS category. 3102 Section 7.4.3 describes a TLS ClientCertificateType Registry to be 3103 maintained by the IANA, as defining a number of such code point 3104 identifiers. ClientCertificateType identifiers with values in the 3105 range 0-63 (decimal) inclusive are assigned via RFC 2434 Standards 3106 Action. Values from the range 64-223 (decimal) inclusive are assigned 3107 via [RFC 2434] Specification Required. Identifier values from 3108 224-255 (decimal) inclusive are reserved for RFC 2434 Private Use. 3109 The registry will be initially populated with the values in this 3110 document, Section 7.4.4. 3112 Section A.5 describes a TLS Cipher Suite Registry to be maintained by 3113 the IANA, as well as defining a number of such cipher suite 3114 identifiers. Cipher suite values with the first byte in the range 3115 0-191 (decimal) inclusive are assigned via RFC 2434 Standards Action. 3116 Values with the first byte in the range 192-254 (decimal) are 3117 assigned via RFC 2434 Specification Required. Values with the first 3118 byte 255 (decimal) are reserved for RFC 2434 Private Use. The 3119 registry will be initially populated with the values from Section A.5 3120 of this document, [TLSAES], and Section 3 of [TLSKRB]. 3122 Section 6 requires that all ContentType values be defined by RFC 2434 3123 Standards Action. IANA SHOULD create a TLS ContentType registry, 3124 initially populated with values from Section 6.2.1 of this document. 3125 Future values MUST be allocated via Standards Action as described in 3126 [RFC 2434]. 3128 Section 7.2.2 requires that all Alert values be defined by RFC 2434 3129 Standards Action. IANA SHOULD create a TLS Alert registry, initially 3130 populated with values from Section 7.2 of this document and Section 4 3131 of [TLSEXT]. Future values MUST be allocated via Standards Action as 3132 described in [RFC 2434]. 3134 Section 7.4 requires that all HandshakeType values be defined by RFC 3135 2434 Standards Action. IANA SHOULD create a TLS HandshakeType 3136 registry, initially populated with values from Section 7.4 of this 3137 document and Section 2.4 of [TLSEXT]. Future values MUST be 3138 allocated via Standards Action as described in [RFC2434]. 3140 11.1 Extensions 3142 Sections XXX and XXX describes a registry of ExtensionType values to 3143 be maintained by the IANA. ExtensionType values are to be assigned 3144 via IETF Consensus as defined in RFC 2434 [IANA]. The initial 3145 registry corresponds to the definition of "ExtensionType" in Section 3146 2.3. 3148 The MIME type "application/pkix-pkipath" has been registered by the 3149 IANA with the following template: 3151 To: ietf-types@iana.org Subject: Registration of MIME media type 3152 application/pkix-pkipath 3154 MIME media type name: application 3155 MIME subtype name: pkix-pkipath 3157 Optional parameters: version (default value is "1") 3159 Encoding considerations: 3160 This MIME type is a DER encoding of the ASN.1 type PkiPath, 3161 defined as follows: 3162 PkiPath ::= SEQUENCE OF Certificate 3163 PkiPath is used to represent a certification path. Within the 3164 sequence, the order of certificates is such that the subject of 3165 the first certificate is the issuer of the second certificate, 3166 etc. 3168 This is identical to the definition published in [X509-4th-TC1]; 3169 note that it is different from that in [X509-4th]. 3171 All Certificates MUST conform to [PKIX]. (This should be 3172 interpreted as a requirement to encode only PKIX-conformant 3173 certificates using this type. It does not necessarily require 3174 that all certificates that are not strictly PKIX-conformant must 3175 be rejected by relying parties, although the security consequences 3176 of accepting any such certificates should be considered 3177 carefully.) 3179 DER (as opposed to BER) encoding MUST be used. If this type is 3180 sent over a 7-bit transport, base64 encoding SHOULD be used. 3182 Security considerations: 3183 The security considerations of [X509-4th] and [PKIX] (or any 3184 updates to them) apply, as well as those of any protocol that uses 3185 this type (e.g., TLS). 3187 Note that this type only specifies a certificate chain that can be 3188 assessed for validity according to the relying party's existing 3189 configuration of trusted CAs; it is not intended to be used to 3190 specify any change to that configuration. 3192 Interoperability considerations: 3193 No specific interoperability problems are known with this type, 3194 but for recommendations relating to X.509 certificates in general, 3195 see [PKIX]. 3197 Published specification: this memo, and [PKIX]. 3199 Applications which use this media type: TLS. It may also be used by 3200 other protocols, or for general interchange of PKIX certificate 3202 Additional information: 3204 Magic number(s): DER-encoded ASN.1 can be easily recognized. 3205 Further parsing is required to distinguish from other ASN.1 3206 types. 3207 File extension(s): .pkipath 3208 Macintosh File Type Code(s): not specified 3210 Person & email address to contact for further information: 3211 Magnus Nystrom 3213 Intended usage: COMMON 3215 Change controller: 3216 IESG 3217 A. Protocol constant values 3219 This section describes protocol types and constants. 3221 A.1. Record layer 3223 struct { 3224 uint8 major, minor; 3225 } ProtocolVersion; 3227 ProtocolVersion version = { 3, 2 }; /* TLS v1.1 */ 3229 enum { 3230 change_cipher_spec(20), alert(21), handshake(22), 3231 application_data(23), (255) 3232 } ContentType; 3234 struct { 3235 ContentType type; 3236 ProtocolVersion version; 3237 uint16 length; 3238 opaque fragment[TLSPlaintext.length]; 3239 } TLSPlaintext; 3241 struct { 3242 ContentType type; 3243 ProtocolVersion version; 3244 uint16 length; 3245 opaque fragment[TLSCompressed.length]; 3246 } TLSCompressed; 3248 struct { 3249 ContentType type; 3250 ProtocolVersion version; 3251 uint16 length; 3252 select (CipherSpec.cipher_type) { 3253 case stream: GenericStreamCipher; 3254 case block: GenericBlockCipher; 3255 } fragment; 3256 } TLSCiphertext; 3258 stream-ciphered struct { 3259 opaque content[TLSCompressed.length]; 3260 opaque MAC[CipherSpec.hash_size]; 3261 } GenericStreamCipher; 3263 block-ciphered struct { 3264 opaque IV[CipherSpec.block_length]; 3265 opaque content[TLSCompressed.length]; 3266 opaque MAC[CipherSpec.hash_size]; 3267 uint8 padding[GenericBlockCipher.padding_length]; 3268 uint8 padding_length; 3269 } GenericBlockCipher; 3271 A.2. Change cipher specs message 3273 struct { 3274 enum { change_cipher_spec(1), (255) } type; 3275 } ChangeCipherSpec; 3277 A.3. Alert messages 3279 enum { warning(1), fatal(2), (255) } AlertLevel; 3281 enum { 3282 close_notify(0), 3283 unexpected_message(10), 3284 bad_record_mac(20), 3285 decryption_failed(21), 3286 record_overflow(22), 3287 decompression_failure(30), 3288 handshake_failure(40), 3289 no_certificate_RESERVED (41), 3290 bad_certificate(42), 3291 unsupported_certificate(43), 3292 certificate_revoked(44), 3293 certificate_expired(45), 3294 certificate_unknown(46), 3295 illegal_parameter(47), 3296 unknown_ca(48), 3297 access_denied(49), 3298 decode_error(50), 3299 decrypt_error(51), 3300 export_restriction_RESERVED(60), 3301 protocol_version(70), 3302 insufficient_security(71), 3303 internal_error(80), 3304 user_canceled(90), 3305 no_renegotiation(100), 3306 unsupported_extension(110), /* new */ 3307 certificate_unobtainable(111), /* new */ 3308 unrecognized_name(112), /* new */ 3309 bad_certificate_status_response(113), /* new */ 3310 bad_certificate_hash_value(114), /* new */ 3311 (255) 3312 } AlertDescription; 3313 struct { 3314 AlertLevel level; 3315 AlertDescription description; 3316 } Alert; 3317 A.4. Handshake protocol 3319 enum { 3320 hello_request(0), client_hello(1), server_hello(2), 3321 certificate(11), server_key_exchange (12), 3322 certificate_request(13), server_hello_done(14), 3323 certificate_verify(15), client_key_exchange(16), 3324 finished(20), certificate_url(21), certificate_status(22), 3325 (255) 3326 } HandshakeType; 3328 struct { 3329 HandshakeType msg_type; 3330 uint24 length; 3331 select (HandshakeType) { 3332 case hello_request: HelloRequest; 3333 case client_hello: ClientHello; 3334 case server_hello: ServerHello; 3335 case certificate: Certificate; 3336 case server_key_exchange: ServerKeyExchange; 3337 case certificate_request: CertificateRequest; 3338 case server_hello_done: ServerHelloDone; 3339 case certificate_verify: CertificateVerify; 3340 case client_key_exchange: ClientKeyExchange; 3341 case finished: Finished; 3342 case certificate_url: CertificateURL; 3343 case certificate_status: CertificateStatus; 3344 } body; 3345 } Handshake; 3347 A.4.1. Hello messages 3349 struct { } HelloRequest; 3351 struct { 3352 uint32 gmt_unix_time; 3353 opaque random_bytes[28]; 3354 } Random; 3356 opaque SessionID<0..32>; 3358 uint8 CipherSuite[2]; 3360 enum { null(0), (255) } CompressionMethod; 3362 struct { 3363 ProtocolVersion client_version; 3364 Random random; 3365 SessionID session_id; 3366 CipherSuite cipher_suites<2..2^16-1>; 3367 CompressionMethod compression_methods<1..2^8-1>; 3368 Extension client_hello_extension_list<0..2^16-1>; 3369 } ClientHello; 3371 struct { 3372 ProtocolVersion client_version; 3373 Random random; 3374 SessionID session_id; 3375 CipherSuite cipher_suites<2..2^16-1>; 3376 CompressionMethod compression_methods<1..2^8-1>; 3377 Extension client_hello_extension_list<0..2^16-1>; 3378 } ExtendedClientHello; 3380 struct { 3381 ProtocolVersion server_version; 3382 Random random; 3383 SessionID session_id; 3384 CipherSuite cipher_suite; 3385 CompressionMethod compression_method; 3386 } ServerHello; 3388 struct { 3389 ProtocolVersion server_version; 3390 Random random; 3391 SessionID session_id; 3392 CipherSuite cipher_suite; 3393 CompressionMethod compression_method; 3394 Extension server_hello_extension_list<0..2^16-1>; 3395 } ExtendedServerHello; 3397 struct { 3398 ExtensionType extension_type; 3399 opaque extension_data<0..2^16-1>; 3400 } Extension; 3402 enum { 3403 server_name(0), max_fragment_length(1), 3404 client_certificate_url(2), trusted_ca_keys(3), 3405 truncated_hmac(4), status_request(5), 3406 cert_hash_types(6), (65535) 3407 } ExtensionType; 3409 struct { 3410 NameType name_type; 3411 select (name_type) { 3412 case host_name: HostName; 3413 } name; 3414 } ServerName; 3416 enum { 3417 host_name(0), (255) 3418 } NameType; 3420 opaque HostName<1..2^16-1>; 3422 struct { 3423 ServerName server_name_list<1..2^16-1> 3424 } ServerNameList; 3426 enum{ 3427 2^9(1), 2^10(2), 2^11(3), 2^12(4), (255) 3428 } MaxFragmentLength; 3430 struct { 3431 TrustedAuthority trusted_authorities_list<0..2^16-1>; 3432 } TrustedAuthorities; 3434 struct { 3435 IdentifierType identifier_type; 3436 select (identifier_type) { 3437 case pre_agreed: struct {}; 3438 case key_sha1_hash: SHA1Hash; 3439 case x509_name: DistinguishedName; 3440 case cert_sha1_hash: SHA1Hash; 3441 } identifier; 3442 } TrustedAuthority; 3444 enum { 3445 pre_agreed(0), key_sha1_hash(1), x509_name(2), 3446 cert_sha1_hash(3), (255) 3447 } IdentifierType; 3449 struct { 3450 CertificateStatusType status_type; 3451 select (status_type) { 3452 case ocsp: OCSPStatusRequest; 3453 } request; 3454 } CertificateStatusRequest; 3456 enum { ocsp(1), (255) } CertificateStatusType; 3458 struct { 3459 ResponderID responder_id_list<0..2^16-1>; 3460 Extensions request_extensions; 3461 } OCSPStatusRequest; 3463 opaque ResponderID<1..2^16-1>; 3464 A.4.2. Server authentication and key exchange messages 3466 opaque ASN.1Cert<2^24-1>; 3468 struct { 3469 ASN.1Cert certificate_list<0..2^24-1>; 3470 } Certificate; 3472 struct { 3473 CertificateStatusType status_type; 3474 select (status_type) { 3475 case ocsp: OCSPResponse; 3476 } response; 3477 } CertificateStatus; 3479 opaque OCSPResponse<1..2^24-1>; 3481 enum { rsa, diffie_hellman } KeyExchangeAlgorithm; 3483 struct { 3484 opaque rsa_modulus<1..2^16-1>; 3485 opaque rsa_exponent<1..2^16-1>; 3486 } ServerRSAParams; 3488 struct { 3489 opaque dh_p<1..2^16-1>; 3490 opaque dh_g<1..2^16-1>; 3491 opaque dh_Ys<1..2^16-1>; 3492 } ServerDHParams; 3494 struct { 3495 select (KeyExchangeAlgorithm) { 3496 case diffie_hellman: 3497 ServerDHParams params; 3498 Signature signed_params; 3499 case rsa: 3500 ServerRSAParams params; 3501 Signature signed_params; 3502 }; 3503 } ServerKeyExchange; 3505 enum { anonymous, rsa, dsa } SignatureAlgorithm; 3507 struct { 3508 select (KeyExchangeAlgorithm) { 3509 case diffie_hellman: 3510 ServerDHParams params; 3511 case rsa: 3512 ServerRSAParams params; 3513 }; 3514 } ServerParams; 3516 struct { 3517 select (SignatureAlgorithm) { 3518 case anonymous: struct { }; 3519 case rsa: 3520 digitally-signed struct { 3521 opaque hash[Hash.length]; 3522 }; 3523 case dsa: 3524 digitally-signed struct { 3525 opaque sha_hash[20]; 3526 }; 3527 }; 3528 }; 3529 } Signature; 3531 enum { 3532 rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), 3533 rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), 3534 fortezza_dms_RESERVED(20), 3535 (255) 3536 } ClientCertificateType; 3538 opaque DistinguishedName<1..2^16-1>; 3540 struct { 3541 ClientCertificateType certificate_types<1..2^8-1>; 3542 DistinguishedName certificate_authorities<0..2^16-1>; 3543 } CertificateRequest; 3545 struct { } ServerHelloDone; 3547 A.4.3. Client authentication and key exchange messages 3549 struct { 3550 select (KeyExchangeAlgorithm) { 3551 case rsa: EncryptedPreMasterSecret; 3552 case diffie_hellman: ClientDiffieHellmanPublic; 3553 } exchange_keys; 3554 } ClientKeyExchange; 3556 struct { 3557 ProtocolVersion client_version; 3558 opaque random[46]; 3559 } PreMasterSecret; 3561 struct { 3562 public-key-encrypted PreMasterSecret pre_master_secret; 3563 } EncryptedPreMasterSecret; 3565 enum { implicit, explicit } PublicValueEncoding; 3567 struct { 3568 select (PublicValueEncoding) { 3569 case implicit: struct {}; 3570 case explicit: opaque DH_Yc<1..2^16-1>; 3571 } dh_public; 3572 } ClientDiffieHellmanPublic; 3574 enum { 3575 individual_certs(0), pkipath(1), (255) 3576 } CertChainType; 3578 enum { 3579 false(0), true(1) 3580 } Boolean; 3582 struct { 3583 CertChainType type; 3584 URLAndOptionalHash url_and_hash_list<1..2^16-1>; 3585 } CertificateURL; 3587 struct { 3588 opaque url<1..2^16-1>; 3589 Boolean hash_present; 3590 select (hash_present) { 3591 case false: struct {}; 3592 case true: SHA1Hash; 3593 } hash; 3594 } URLAndOptionalHash; 3596 opaque SHA1Hash[20]; 3598 struct { 3599 Signature signature; 3600 } CertificateVerify; 3602 A.4.4. Handshake finalization message 3604 struct { 3605 opaque verify_data[12]; 3606 } Finished; 3608 A.5. The CipherSuite 3610 The following values define the CipherSuite codes used in the client 3611 hello and server hello messages. 3613 A CipherSuite defines a cipher specification supported in TLS Version 3614 1.1. 3616 TLS_NULL_WITH_NULL_NULL is specified and is the initial state of a 3617 TLS connection during the first handshake on that channel, but must 3618 not be negotiated, as it provides no more protection than an 3619 unsecured connection. 3621 CipherSuite TLS_NULL_WITH_NULL_NULL = { 0x00,0x00 }; 3623 The following CipherSuite definitions require that the server provide 3624 an RSA certificate that can be used for key exchange. The server may 3625 request either an RSA or a DSS signature-capable certificate in the 3626 certificate request message. 3628 CipherSuite TLS_RSA_WITH_NULL_MD5 = { 0x00,0x01 }; 3629 CipherSuite TLS_RSA_WITH_NULL_SHA = { 0x00,0x02 }; 3630 CipherSuite TLS_RSA_WITH_RC4_128_MD5 = { 0x00,0x04 }; 3631 CipherSuite TLS_RSA_WITH_RC4_128_SHA = { 0x00,0x05 }; 3632 CipherSuite TLS_RSA_WITH_IDEA_CBC_SHA = { 0x00,0x07 }; 3633 CipherSuite TLS_RSA_WITH_DES_CBC_SHA = { 0x00,0x09 }; 3634 CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x0A }; 3635 CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = { 0x00, 0x2F }; 3636 CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = { 0x00, 0x35 }; 3637 The following CipherSuite definitions are used for server- 3638 authenticated (and optionally client-authenticated) Diffie-Hellman. 3639 DH denotes cipher suites in which the server's certificate contains 3640 the Diffie-Hellman parameters signed by the certificate authority 3641 (CA). DHE denotes ephemeral Diffie-Hellman, where the Diffie-Hellman 3642 parameters are signed by a DSS or RSA certificate, which has been 3643 signed by the CA. The signing algorithm used is specified after the 3644 DH or DHE parameter. The server can request an RSA or DSS signature- 3645 capable certificate from the client for client authentication or it 3646 may request a Diffie-Hellman certificate. Any Diffie-Hellman 3647 certificate provided by the client must use the parameters (group and 3648 generator) described by the server. 3650 CipherSuite TLS_DH_DSS_WITH_DES_CBC_SHA = { 0x00,0x0C }; 3651 CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00,0x0D }; 3652 CipherSuite TLS_DH_RSA_WITH_DES_CBC_SHA = { 0x00,0x0F }; 3653 CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x10 }; 3654 CipherSuite TLS_DHE_DSS_WITH_DES_CBC_SHA = { 0x00,0x12 }; 3655 CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00,0x13 }; 3656 CipherSuite TLS_DHE_RSA_WITH_DES_CBC_SHA = { 0x00,0x15 }; 3657 CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x16 }; 3658 CipherSuite TLS_DH_DSS_WITH_AES_128_CBC_SHA = { 0x00, 0x30 }; 3659 CipherSuite TLS_DH_RSA_WITH_AES_128_CBC_SHA = { 0x00, 0x31 }; 3660 CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = { 0x00, 0x32 }; 3661 CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = { 0x00, 0x33 }; 3662 CipherSuite TLS_DH_anon_WITH_AES_128_CBC_SHA = { 0x00, 0x34 }; 3663 CipherSuite TLS_DH_DSS_WITH_AES_256_CBC_SHA = { 0x00, 0x36 }; 3664 CipherSuite TLS_DH_RSA_WITH_AES_256_CBC_SHA = { 0x00, 0x37 }; 3665 CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = { 0x00, 0x38 }; 3666 CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = { 0x00, 0x39 }; 3667 CipherSuite TLS_DH_anon_WITH_AES_256_CBC_SHA = { 0x00, 0x3A }; 3669 The following cipher suites are used for completely anonymous Diffie- 3670 Hellman communications in which neither party is authenticated. Note 3671 that this mode is vulnerable to man-in-the-middle attacks and is 3672 therefore deprecated. 3674 CipherSuite TLS_DH_anon_WITH_RC4_128_MD5 = { 0x00,0x18 }; 3675 CipherSuite TLS_DH_anon_WITH_DES_CBC_SHA = { 0x00,0x1A }; 3676 CipherSuite TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = { 0x00,0x1B }; 3678 When SSLv3 and TLS 1.0 were designed, the United States restricted 3679 the export of cryptographic software containing certain strong 3680 encryption algorithms. A series of cipher suites were designed to 3681 operate at reduced key lengths in order to comply with those 3682 regulations. Due to advances in computer performance, these 3683 algorithms are now unacceptably weak and export restrictions have 3684 since been loosened. TLS 1.1 implementations MUST NOT negotiate these 3685 cipher suites in TLS 1.1 mode. However, for backward compatibility 3686 they may be offered in the ClientHello for use with TLS 1.0 or SSLv3 3687 only servers. TLS 1.1 clients MUST check that the server did not 3688 choose one of these cipher suites during the handshake. These 3689 ciphersuites are listed below for informational purposes and to 3690 reserve the numbers. 3692 CipherSuite TLS_RSA_EXPORT_WITH_RC4_40_MD5 = { 0x00,0x03 }; 3693 CipherSuite TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = { 0x00,0x06 }; 3694 CipherSuite TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x08 }; 3695 CipherSuite TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x0B }; 3696 CipherSuite TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x0E }; 3697 CipherSuite TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x11 }; 3698 CipherSuite TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x14 }; 3699 CipherSuite TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = { 0x00,0x17 }; 3700 CipherSuite TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x19 }; 3701 The following cipher suites were defined in [TLSKRB] and are included 3702 here for completeness. See [TLSKRB] for details: 3704 CipherSuite TLS_KRB5_WITH_DES_CBC_SHA = { 0x00,0x1E }; 3705 CipherSuite TLS_KRB5_WITH_3DES_EDE_CBC_SHA = { 0x00,0x1F }; 3706 CipherSuite TLS_KRB5_WITH_RC4_128_SHA = { 0x00,0x20 }; 3707 CipherSuite TLS_KRB5_WITH_IDEA_CBC_SHA = { 0x00,0x21 }; 3708 CipherSuite TLS_KRB5_WITH_DES_CBC_MD5 = { 0x00,0x22 }; 3709 CipherSuite TLS_KRB5_WITH_3DES_EDE_CBC_MD5 = { 0x00,0x23 }; 3710 CipherSuite TLS_KRB5_WITH_RC4_128_MD5 = { 0x00,0x24 }; 3711 CipherSuite TLS_KRB5_WITH_IDEA_CBC_MD5 = { 0x00,0x25 }; 3713 The following exportable cipher suites were defined in [TLSKRB] and 3714 are included here for completeness. TLS 1.1 implementations MUST NOT 3715 negotiate these cipher suites. 3717 CipherSuite TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA = { 0x00,0x26 3718 }; 3719 CipherSuite TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA = { 0x00,0x27 3720 }; 3721 CipherSuite TLS_KRB5_EXPORT_WITH_RC4_40_SHA = { 0x00,0x28 3722 }; 3723 CipherSuite TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 = { 0x00,0x29 3724 }; 3725 CipherSuite TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 = { 0x00,0x2A 3726 }; 3727 CipherSuite TLS_KRB5_EXPORT_WITH_RC4_40_MD5 = { 0x00,0x2B 3728 }; 3730 The cipher suite space is divided into three regions: 3732 1. Cipher suite values with first byte 0x00 (zero) 3733 through decimal 191 (0xBF) inclusive are reserved for the IETF 3734 Standards Track protocols. 3736 2. Cipher suite values with first byte decimal 192 (0xC0) 3737 through decimal 254 (0xFE) inclusive are reserved 3738 for assignment for non-Standards Track methods. 3740 3. Cipher suite values with first byte 0xFF are 3741 reserved for private use. 3742 Additional information describing the role of IANA in the allocation 3743 of cipher suite code points is described in Section 11. 3745 Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are 3746 reserved to avoid collision with Fortezza-based cipher suites in SSL 3747 3. 3749 A.6. The Security Parameters 3751 These security parameters are determined by the TLS Handshake 3752 Protocol and provided as parameters to the TLS Record Layer in order 3753 to initialize a connection state. SecurityParameters includes: 3755 enum { null(0), (255) } CompressionMethod; 3757 enum { server, client } ConnectionEnd; 3759 enum { null, rc4, rc2, des, 3des, des40, aes, idea } 3760 BulkCipherAlgorithm; 3762 enum { stream, block } CipherType; 3764 enum { null, md5, sha } MACAlgorithm; 3766 /* The algorithms specified in CompressionMethod, 3767 BulkCipherAlgorithm, and MACAlgorithm may be added to. */ 3769 struct { 3770 ConnectionEnd entity; 3771 BulkCipherAlgorithm bulk_cipher_algorithm; 3772 CipherType cipher_type; 3773 uint8 key_size; 3774 uint8 key_material_length; 3775 MACAlgorithm mac_algorithm; 3776 uint8 hash_size; 3777 CompressionMethod compression_algorithm; 3778 opaque master_secret[48]; 3779 opaque client_random[32]; 3780 opaque server_random[32]; 3781 } SecurityParameters; 3782 B. Glossary 3784 Advanced Encryption Standard (AES) 3785 AES is a widely used symmetric encryption algorithm. 3786 AES is 3787 a block cipher with a 128, 192, or 256 bit keys and a 16 byte 3788 block size. [AES] TLS currently only supports the 128 and 256 3789 bit key sizes. 3791 application protocol 3792 An application protocol is a protocol that normally layers 3793 directly on top of the transport layer (e.g., TCP/IP). Examples 3794 include HTTP, TELNET, FTP, and SMTP. 3796 asymmetric cipher 3797 See public key cryptography. 3799 authentication 3800 Authentication is the ability of one entity to determine the 3801 identity of another entity. 3803 block cipher 3804 A block cipher is an algorithm that operates on plaintext in 3805 groups of bits, called blocks. 64 bits is a common block size. 3807 bulk cipher 3808 A symmetric encryption algorithm used to encrypt large quantities 3809 of data. 3811 cipher block chaining (CBC) 3812 CBC is a mode in which every plaintext block encrypted with a 3813 block cipher is first exclusive-ORed with the previous ciphertext 3814 block (or, in the case of the first block, with the 3815 initialization vector). For decryption, every block is first 3816 decrypted, then exclusive-ORed with the previous ciphertext block 3817 (or IV). 3819 certificate 3820 As part of the X.509 protocol (a.k.a. ISO Authentication 3821 framework), certificates are assigned by a trusted Certificate 3822 Authority and provide a strong binding between a party's identity 3823 or some other attributes and its public key. 3825 client 3826 The application entity that initiates a TLS connection to a 3827 server. This may or may not imply that the client initiated the 3828 underlying transport connection. The primary operational 3829 difference between the server and client is that the server is 3830 generally authenticated, while the client is only optionally 3831 authenticated. 3833 client write key 3834 The key used to encrypt data written by the client. 3836 client write MAC secret 3837 The secret data used to authenticate data written by the client. 3839 connection 3840 A connection is a transport (in the OSI layering model 3841 definition) that provides a suitable type of service. For TLS, 3842 such connections are peer to peer relationships. The connections 3843 are transient. Every connection is associated with one session. 3845 Data Encryption Standard 3846 DES is a very widely used symmetric encryption algorithm. DES is 3847 a block cipher with a 56 bit key and an 8 byte block size. Note 3848 that in TLS, for key generation purposes, DES is treated as 3849 having an 8 byte key length (64 bits), but it still only provides 3850 56 bits of protection. (The low bit of each key byte is presumed 3851 to be set to produce odd parity in that key byte.) DES can also 3852 be operated in a mode where three independent keys and three 3853 encryptions are used for each block of data; this uses 168 bits 3854 of key (24 bytes in the TLS key generation method) and provides 3855 the equivalent of 112 bits of security. [DES], [3DES] 3857 Digital Signature Standard (DSS) 3858 A standard for digital signing, including the Digital Signing 3859 Algorithm, approved by the National Institute of Standards and 3860 Technology, defined in NIST FIPS PUB 186, "Digital Signature 3861 Standard," published May, 1994 by the U.S. Dept. of Commerce. 3862 [DSS] 3864 digital signatures 3865 Digital signatures utilize public key cryptography and one-way 3866 hash functions to produce a signature of the data that can be 3867 authenticated, and is difficult to forge or repudiate. 3869 handshake 3870 An initial negotiation between client and server that establishes 3871 the parameters of their transactions. 3873 Initialization Vector (IV) 3874 When a block cipher is used in CBC mode, the initialization 3875 vector is exclusive-ORed with the first plaintext block prior to 3876 encryption. 3878 IDEA 3879 A 64-bit block cipher designed by Xuejia Lai and James Massey. 3880 [IDEA] 3882 Message Authentication Code (MAC) 3883 A Message Authentication Code is a one-way hash computed from a 3884 message and some secret data. It is difficult to forge without 3885 knowing the secret data. Its purpose is to detect if the message 3886 has been altered. 3888 master secret 3889 Secure secret data used for generating encryption keys, MAC 3890 secrets, and IVs. 3892 MD5 3893 MD5 is a secure hashing function that converts an arbitrarily 3894 long data stream into a digest of fixed size (16 bytes). [MD5] 3896 public key cryptography 3897 A class of cryptographic techniques employing two-key ciphers. 3898 Messages encrypted with the public key can only be decrypted with 3899 the associated private key. Conversely, messages signed with the 3900 private key can be verified with the public key. 3902 one-way hash function 3903 A one-way transformation that converts an arbitrary amount of 3904 data into a fixed-length hash. It is computationally hard to 3905 reverse the transformation or to find collisions. MD5 and SHA are 3906 examples of one-way hash functions. 3908 RC2 3909 A block cipher developed by Ron Rivest at RSA Data Security, Inc. 3910 [RSADSI] described in [RC2]. 3912 RC4 3913 A stream cipher invented by Ron Rivest. A compatible cipher is 3914 described in [SCH]. 3916 RSA 3917 A very widely used public-key algorithm that can be used for 3918 either encryption or digital signing. [RSA] 3920 server 3921 The server is the application entity that responds to requests 3922 for connections from clients. See also under client. 3924 session 3925 A TLS session is an association between a client and a server. 3926 Sessions are created by the handshake protocol. Sessions define a 3927 set of cryptographic security parameters, which can be shared 3928 among multiple connections. Sessions are used to avoid the 3929 expensive negotiation of new security parameters for each 3930 connection. 3932 session identifier 3933 A session identifier is a value generated by a server that 3934 identifies a particular session. 3936 server write key 3937 The key used to encrypt data written by the server. 3939 server write MAC secret 3940 The secret data used to authenticate data written by the server. 3942 SHA 3943 The Secure Hash Algorithm is defined in FIPS PUB 180-2. It 3944 produces a 20-byte output. Note that all references to SHA 3945 actually use the modified SHA-1 algorithm. [SHA] 3947 SSL 3948 Netscape's Secure Socket Layer protocol [SSL3]. TLS is based on 3949 SSL Version 3.0 3951 stream cipher 3952 An encryption algorithm that converts a key into a 3953 cryptographically-strong keystream, which is then exclusive-ORed 3954 with the plaintext. 3956 symmetric cipher 3957 See bulk cipher. 3959 Transport Layer Security (TLS) 3960 This protocol; also, the Transport Layer Security working group 3961 of the Internet Engineering Task Force (IETF). See "Comments" at 3962 the end of this document. 3964 C. CipherSuite definitions 3966 CipherSuite Key Cipher Hash 3967 Exchange 3969 TLS_NULL_WITH_NULL_NULL NULL NULL NULL 3970 TLS_RSA_WITH_NULL_MD5 RSA NULL MD5 3971 TLS_RSA_WITH_NULL_SHA RSA NULL SHA 3972 TLS_RSA_WITH_RC4_128_MD5 RSA RC4_128 MD5 3973 TLS_RSA_WITH_RC4_128_SHA RSA RC4_128 SHA 3974 TLS_RSA_WITH_IDEA_CBC_SHA RSA IDEA_CBC SHA 3975 TLS_RSA_WITH_DES_CBC_SHA RSA DES_CBC SHA 3976 TLS_RSA_WITH_3DES_EDE_CBC_SHA RSA 3DES_EDE_CBC SHA 3977 TLS_RSA_WITH_AES_128_CBC_SHA RSA AES_128_CBC SHA 3978 TLS_RSA_WITH_AES_256_SHA RSA AES_256_CBC SHA 3979 TLS_DH_DSS_WITH_DES_CBC_SHA DH_DSS DES_CBC SHA 3980 TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA DH_DSS 3DES_EDE_CBC SHA 3981 TLS_DH_RSA_WITH_DES_CBC_SHA DH_RSA DES_CBC SHA 3982 TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA DH_RSA 3DES_EDE_CBC SHA 3983 TLS_DHE_DSS_WITH_DES_CBC_SHA DHE_DSS DES_CBC SHA 3984 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA DHE_DSS 3DES_EDE_CBC SHA 3985 TLS_DHE_RSA_WITH_DES_CBC_SHA DHE_RSA DES_CBC SHA 3986 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA DHE_RSA 3DES_EDE_CBC SHA 3987 TLS_DH_anon_WITH_RC4_128_MD5 DH_anon RC4_128 MD5 3988 TLS_DH_anon_WITH_DES_CBC_SHA DH_anon DES_CBC SHA 3989 TLS_DH_anon_WITH_3DES_EDE_CBC_SHA DH_anon 3DES_EDE_CBC SHA 3990 TLS_DH_DSS_WITH_AES_128_CBC_SHA DH_DSS AES_128_CBC SHA 3991 TLS_DH_RSA_WITH_AES_128_CBC_SHA DH_RSA AES_128_CBC SHA 3992 TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE_DSS AES_128_CBC SHA 3993 TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE_RSA AES_128_CBC SHA 3994 TLS_DH_anon_WITH_AES_128_CBC_SHA DH_anon AES_128_CBC SHA 3995 TLS_DH_DSS_WITH_AES_256_CBC_SHA DH_DSS AES_256_CBC SHA 3996 TLS_DH_RSA_WITH_AES_256_CBC_SHA DH_RSA AES_256_CBC SHA 3997 TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE_DSS AES_256_CBC SHA 3998 TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE_RSA AES_256_CBC SHA 3999 TLS_DH_anon_WITH_AES_256_CBC_SHA DH_anon AES_256_CBC SHA 4001 Key 4002 Exchange 4003 Algorithm Description Key size limit 4005 DHE_DSS Ephemeral DH with DSS signatures None 4006 DHE_RSA Ephemeral DH with RSA signatures None 4007 DH_anon Anonymous DH, no signatures None 4008 DH_DSS DH with DSS-based certificates None 4009 DH_RSA DH with RSA-based certificates None 4010 RSA = none 4011 NULL No key exchange N/A 4012 RSA RSA key exchange None 4014 Key Expanded IV Block 4015 Cipher Type Material Key Material Size Size 4017 NULL Stream 0 0 0 N/A 4018 IDEA_CBC Block 16 16 8 8 4019 RC2_CBC_40 Block 5 16 8 8 4020 RC4_40 Stream 5 16 0 N/A 4021 RC4_128 Stream 16 16 0 N/A 4022 DES40_CBC Block 5 8 8 8 4023 DES_CBC Block 8 8 8 8 4024 3DES_EDE_CBC Block 24 24 8 8 4026 Type 4027 Indicates whether this is a stream cipher or a block cipher 4028 running in CBC mode. 4030 Key Material 4031 The number of bytes from the key_block that are used for 4032 generating the write keys. 4034 Expanded Key Material 4035 The number of bytes actually fed into the encryption algorithm 4037 IV Size 4038 How much data needs to be generated for the initialization 4039 vector. Zero for stream ciphers; equal to the block size for 4040 block ciphers. 4042 Block Size 4043 The amount of data a block cipher enciphers in one chunk; a 4044 block cipher running in CBC mode can only encrypt an even 4045 multiple of its block size. 4047 Hash Hash Padding 4048 function Size Size 4049 NULL 0 0 4050 MD5 16 48 4051 SHA 20 40 4052 D. Implementation Notes 4054 The TLS protocol cannot prevent many common security mistakes. This 4055 section provides several recommendations to assist implementors. 4057 D.1 Random Number Generation and Seeding 4059 TLS requires a cryptographically-secure pseudorandom number generator 4060 (PRNG). Care must be taken in designing and seeding PRNGs. PRNGs 4061 based on secure hash operations, most notably MD5 and/or SHA, are 4062 acceptable, but cannot provide more security than the size of the 4063 random number generator state. (For example, MD5-based PRNGs usually 4064 provide 128 bits of state.) 4066 To estimate the amount of seed material being produced, add the 4067 number of bits of unpredictable information in each seed byte. For 4068 example, keystroke timing values taken from a PC compatible's 18.2 Hz 4069 timer provide 1 or 2 secure bits each, even though the total size of 4070 the counter value is 16 bits or more. To seed a 128-bit PRNG, one 4071 would thus require approximately 100 such timer values. 4073 [RANDOM] provides guidance on the generation of random values. 4075 D.2 Certificates and authentication 4077 Implementations are responsible for verifying the integrity of 4078 certificates and should generally support certificate revocation 4079 messages. Certificates should always be verified to ensure proper 4080 signing by a trusted Certificate Authority (CA). The selection and 4081 addition of trusted CAs should be done very carefully. Users should 4082 be able to view information about the certificate and root CA. 4084 D.3 CipherSuites 4086 TLS supports a range of key sizes and security levels, including some 4087 which provide no or minimal security. A proper implementation will 4088 probably not support many cipher suites. For example, 40-bit 4089 encryption is easily broken, so implementations requiring strong 4090 security should not allow 40-bit keys. Similarly, anonymous Diffie- 4091 Hellman is strongly discouraged because it cannot prevent man-in-the- 4092 middle attacks. Applications should also enforce minimum and maximum 4093 key sizes. For example, certificate chains containing 512-bit RSA 4094 keys or signatures are not appropriate for high-security 4095 applications. 4097 E. Backward Compatibility With SSL 4099 For historical reasons and in order to avoid a profligate consumption 4100 of reserved port numbers, application protocols which are secured by 4101 TLS 1.1, TLS 1.0, SSL 3.0, and SSL 2.0 all frequently share the same 4102 connection port: for example, the https protocol (HTTP secured by SSL 4103 or TLS) uses port 443 regardless of which security protocol it is 4104 using. Thus, some mechanism must be determined to distinguish and 4105 negotiate among the various protocols. 4107 TLS versions 1.1, 1.0, and SSL 3.0 are very similar; thus, supporting 4108 both is easy. TLS clients who wish to negotiate with such older 4109 servers SHOULD send client hello messages using the SSL 3.0 record 4110 format and client hello structure, sending {3, 2} for the version 4111 field to note that they support TLS 1.1. If the server supports only 4112 TLS 1.0 or SSL 3.0, it will respond with a downrev 3.0 server hello; 4113 if it supports TLS 1.1 it will respond with a TLS 1.1 server hello. 4114 The negotiation then proceeds as appropriate for the negotiated 4115 protocol. 4117 Similarly, a TLS 1.1 server which wishes to interoperate with TLS 4118 1.0 or SSL 3.0 clients SHOULD accept SSL 3.0 client hello messages 4119 and respond with a SSL 3.0 server hello if an SSL 3.0 client hello 4120 with a version field of {3, 0} is received, denoting that this client 4121 does not support TLS. Similarly, if a SSL 3.0 or TLS 1.0 hello with a 4122 version field of {3, 1} is received, the server SHOULD respond with a 4123 TLS 1.0 hello with a version field of {3, 1}. 4125 Whenever a client already knows the highest protocol known to a 4126 server (for example, when resuming a session), it SHOULD initiate the 4127 connection in that native protocol. 4129 TLS 1.1 clients that support SSL Version 2.0 servers MUST send SSL 4130 Version 2.0 client hello messages [SSL2]. TLS servers SHOULD accept 4131 either client hello format if they wish to support SSL 2.0 clients on 4132 the same connection port. The only deviations from the Version 2.0 4133 specification are the ability to specify a version with a value of 4134 three and the support for more ciphering types in the CipherSpec. 4136 Warning: The ability to send Version 2.0 client hello messages will be 4137 phased out with all due haste. Implementors SHOULD make every 4138 effort to move forward as quickly as possible. Version 3.0 4139 provides better mechanisms for moving to newer versions. 4141 The following cipher specifications are carryovers from SSL Version 4142 2.0. These are assumed to use RSA for key exchange and 4143 authentication. 4145 V2CipherSpec TLS_RC4_128_WITH_MD5 = { 0x01,0x00,0x80 }; 4146 V2CipherSpec TLS_RC4_128_EXPORT40_WITH_MD5 = { 0x02,0x00,0x80 }; 4147 V2CipherSpec TLS_RC2_CBC_128_CBC_WITH_MD5 = { 0x03,0x00,0x80 }; 4148 V2CipherSpec TLS_RC2_CBC_128_CBC_EXPORT40_WITH_MD5 4149 = { 0x04,0x00,0x80 }; 4150 V2CipherSpec TLS_IDEA_128_CBC_WITH_MD5 = { 0x05,0x00,0x80 }; 4151 V2CipherSpec TLS_DES_64_CBC_WITH_MD5 = { 0x06,0x00,0x40 }; 4152 V2CipherSpec TLS_DES_192_EDE3_CBC_WITH_MD5 = { 0x07,0x00,0xC0 }; 4154 Cipher specifications native to TLS can be included in Version 2.0 4155 client hello messages using the syntax below. Any V2CipherSpec 4156 element with its first byte equal to zero will be ignored by Version 4157 2.0 servers. Clients sending any of the above V2CipherSpecs SHOULD 4158 also include the TLS equivalent (see Appendix A.5): 4160 V2CipherSpec (see TLS name) = { 0x00, CipherSuite }; 4162 Note: TLS 1.1 clients may generate the SSLv2 EXPORT cipher suites in 4163 handshakes for backward compatibility but MUST NOT negotiate them in 4164 TLS 1.1 mode. 4166 E.1. Version 2 client hello 4168 The Version 2.0 client hello message is presented below using this 4169 document's presentation model. The true definition is still assumed 4170 to be the SSL Version 2.0 specification. Note that this message MUST 4171 be sent directly on the wire, not wrapped as an SSLv3 record 4173 uint8 V2CipherSpec[3]; 4175 struct { 4176 uint16 msg_length; 4177 uint8 msg_type; 4178 Version version; 4179 uint16 cipher_spec_length; 4180 uint16 session_id_length; 4181 uint16 challenge_length; 4182 V2CipherSpec cipher_specs[V2ClientHello.cipher_spec_length]; 4183 opaque session_id[V2ClientHello.session_id_length]; 4184 opaque challenge[V2ClientHello.challenge_length; 4185 } V2ClientHello; 4187 msg_length 4188 This field is the length of the following data in bytes. The high 4189 bit MUST be 1 and is not part of the length. 4191 msg_type 4192 This field, in conjunction with the version field, identifies a 4193 version 2 client hello message. The value SHOULD be one (1). 4195 version 4196 The highest version of the protocol supported by the client 4197 (equals ProtocolVersion.version, see Appendix A.1). 4199 cipher_spec_length 4200 This field is the total length of the field cipher_specs. It 4201 cannot be zero and MUST be a multiple of the V2CipherSpec length 4202 (3). 4204 session_id_length 4205 This field MUST have a value of zero. 4207 challenge_length 4208 The length in bytes of the client's challenge to the server to 4209 authenticate itself. When using the SSLv2 backward compatible 4210 handshake the client MUST use a 32-byte challenge. 4212 cipher_specs 4213 This is a list of all CipherSpecs the client is willing and able 4214 to use. There MUST be at least one CipherSpec acceptable to the 4215 server. 4217 session_id 4218 This field MUST be empty. 4220 challenge 4221 The client challenge to the server for the server to identify 4222 itself is a (nearly) arbitrary length random. The TLS server will 4223 right justify the challenge data to become the ClientHello.random 4224 data (padded with leading zeroes, if necessary), as specified in 4225 this protocol specification. If the length of the challenge is 4226 greater than 32 bytes, only the last 32 bytes are used. It is 4227 legitimate (but not necessary) for a V3 server to reject a V2 4228 ClientHello that has fewer than 16 bytes of challenge data. 4230 Note: Requests to resume a TLS session MUST use a TLS client hello. 4232 E.2. Avoiding man-in-the-middle version rollback 4234 When TLS clients fall back to Version 2.0 compatibility mode, they 4235 SHOULD use special PKCS #1 block formatting. This is done so that TLS 4236 servers will reject Version 2.0 sessions with TLS-capable clients. 4238 When TLS clients are in Version 2.0 compatibility mode, they set the 4239 right-hand (least-significant) 8 random bytes of the PKCS padding 4240 (not including the terminal null of the padding) for the RSA 4241 encryption of the ENCRYPTED-KEY-DATA field of the CLIENT-MASTER-KEY 4242 to 0x03 (the other padding bytes are random). After decrypting the 4243 ENCRYPTED-KEY-DATA field, servers that support TLS SHOULD issue an 4244 error if these eight padding bytes are 0x03. Version 2.0 servers 4245 receiving blocks padded in this manner will proceed normally. 4247 F. Security analysis 4249 The TLS protocol is designed to establish a secure connection between 4250 a client and a server communicating over an insecure channel. This 4251 document makes several traditional assumptions, including that 4252 attackers have substantial computational resources and cannot obtain 4253 secret information from sources outside the protocol. Attackers are 4254 assumed to have the ability to capture, modify, delete, replay, and 4255 otherwise tamper with messages sent over the communication channel. 4256 This appendix outlines how TLS has been designed to resist a variety 4257 of attacks. 4259 F.1. Handshake protocol 4261 The handshake protocol is responsible for selecting a CipherSpec and 4262 generating a Master Secret, which together comprise the primary 4263 cryptographic parameters associated with a secure session. The 4264 handshake protocol can also optionally authenticate parties who have 4265 certificates signed by a trusted certificate authority. 4267 F.1.1. Authentication and key exchange 4269 TLS supports three authentication modes: authentication of both 4270 parties, server authentication with an unauthenticated client, and 4271 total anonymity. Whenever the server is authenticated, the channel is 4272 secure against man-in-the-middle attacks, but completely anonymous 4273 sessions are inherently vulnerable to such attacks. Anonymous 4274 servers cannot authenticate clients. If the server is authenticated, 4275 its certificate message must provide a valid certificate chain 4276 leading to an acceptable certificate authority. Similarly, 4277 authenticated clients must supply an acceptable certificate to the 4278 server. Each party is responsible for verifying that the other's 4279 certificate is valid and has not expired or been revoked. 4281 The general goal of the key exchange process is to create a 4282 pre_master_secret known to the communicating parties and not to 4283 attackers. The pre_master_secret will be used to generate the 4284 master_secret (see Section 8.1). The master_secret is required to 4285 generate the finished messages, encryption keys, and MAC secrets (see 4286 Sections 7.4.8, 7.4.9 and 6.3). By sending a correct finished 4287 message, parties thus prove that they know the correct 4288 pre_master_secret. 4290 F.1.1.1. Anonymous key exchange 4292 Completely anonymous sessions can be established using RSA or Diffie- 4293 Hellman for key exchange. With anonymous RSA, the client encrypts a 4294 pre_master_secret with the server's uncertified public key extracted 4295 from the server key exchange message. The result is sent in a client 4296 key exchange message. Since eavesdroppers do not know the server's 4297 private key, it will be infeasible for them to decode the 4298 pre_master_secret. 4300 Note: No anonymous RSA Cipher Suites are defined in this document. 4302 With Diffie-Hellman, the server's public parameters are contained in 4303 the server key exchange message and the client's are sent in the 4304 client key exchange message. Eavesdroppers who do not know the 4305 private values should not be able to find the Diffie-Hellman result 4306 (i.e. the pre_master_secret). 4308 Warning: Completely anonymous connections only provide protection 4309 against passive eavesdropping. Unless an independent tamper- 4310 proof channel is used to verify that the finished messages 4311 were not replaced by an attacker, server authentication is 4312 required in environments where active man-in-the-middle 4313 attacks are a concern. 4315 F.1.1.2. RSA key exchange and authentication 4317 With RSA, key exchange and server authentication are combined. The 4318 public key may be either contained in the server's certificate or may 4319 be a temporary RSA key sent in a server key exchange message. When 4320 temporary RSA keys are used, they are signed by the server's RSA 4321 certificate. The signature includes the current ClientHello.random, 4322 so old signatures and temporary keys cannot be replayed. Servers may 4323 use a single temporary RSA key for multiple negotiation sessions. 4325 Note: The temporary RSA key option is useful if servers need large 4326 certificates but must comply with government-imposed size limits 4327 on keys used for key exchange. 4329 Note that if ephemeral RSA is not used, compromise of the server's 4330 static RSA key results in a loss of confidentiality for all sessions 4331 protected under that static key. TLS users desiring Perfect Forward 4332 Secrecy should use DHE cipher suites. The damage done by exposure of 4333 a private key can be limited by changing one's private key (and 4334 certificate) frequently. 4336 After verifying the server's certificate, the client encrypts a 4337 pre_master_secret with the server's public key. By successfully 4338 decoding the pre_master_secret and producing a correct finished 4339 message, the server demonstrates that it knows the private key 4340 corresponding to the server certificate. 4342 When RSA is used for key exchange, clients are authenticated using 4343 the certificate verify message (see Section 7.4.8). The client signs 4344 a value derived from the master_secret and all preceding handshake 4345 messages. These handshake messages include the server certificate, 4346 which binds the signature to the server, and ServerHello.random, 4347 which binds the signature to the current handshake process. 4349 F.1.1.3. Diffie-Hellman key exchange with authentication 4351 When Diffie-Hellman key exchange is used, the server can either 4352 supply a certificate containing fixed Diffie-Hellman parameters or 4353 can use the server key exchange message to send a set of temporary 4354 Diffie-Hellman parameters signed with a DSS or RSA certificate. 4355 Temporary parameters are hashed with the hello.random values before 4356 signing to ensure that attackers do not replay old parameters. In 4357 either case, the client can verify the certificate or signature to 4358 ensure that the parameters belong to the server. 4360 If the client has a certificate containing fixed Diffie-Hellman 4361 parameters, its certificate contains the information required to 4362 complete the key exchange. Note that in this case the client and 4363 server will generate the same Diffie-Hellman result (i.e., 4364 pre_master_secret) every time they communicate. To prevent the 4365 pre_master_secret from staying in memory any longer than necessary, 4366 it should be converted into the master_secret as soon as possible. 4367 Client Diffie-Hellman parameters must be compatible with those 4368 supplied by the server for the key exchange to work. 4370 If the client has a standard DSS or RSA certificate or is 4371 unauthenticated, it sends a set of temporary parameters to the server 4372 in the client key exchange message, then optionally uses a 4373 certificate verify message to authenticate itself. 4375 If the same DH keypair is to be used for multiple handshakes, either 4376 because the client or server has a certificate containing a fixed DH 4377 keypair or because the server is reusing DH keys, care must be taken 4378 to prevent small subgroup attacks. Implementations SHOULD follow the 4379 guidelines found in [SUBGROUP]. 4381 Small subgroup attacks are most easily avoided by using one of the 4382 DHE ciphersuites and generating a fresh DH private key (X) for each 4383 handshake. If a suitable base (such as 2) is chosen, g^X mod p can be 4384 computed very quickly so the performance cost is minimized. 4385 Additionally, using a fresh key for each handshake provides Perfect 4386 Forward Secrecy. Implementations SHOULD generate a new X for each 4387 handshake when using DHE ciphersuites. 4389 F.1.2. Version rollback attacks 4390 Because TLS includes substantial improvements over SSL Version 2.0, 4391 attackers may try to make TLS-capable clients and servers fall back 4392 to Version 2.0. This attack can occur if (and only if) two TLS- 4393 capable parties use an SSL 2.0 handshake. 4395 Although the solution using non-random PKCS #1 block type 2 message 4396 padding is inelegant, it provides a reasonably secure way for Version 4397 3.0 servers to detect the attack. This solution is not secure against 4398 attackers who can brute force the key and substitute a new ENCRYPTED- 4399 KEY-DATA message containing the same key (but with normal padding) 4400 before the application specified wait threshold has expired. Parties 4401 concerned about attacks of this scale should not be using 40-bit 4402 encryption keys anyway. Altering the padding of the least-significant 4403 8 bytes of the PKCS padding does not impact security for the size of 4404 the signed hashes and RSA key lengths used in the protocol, since 4405 this is essentially equivalent to increasing the input block size by 4406 8 bytes. 4408 F.1.3. Detecting attacks against the handshake protocol 4410 An attacker might try to influence the handshake exchange to make the 4411 parties select different encryption algorithms than they would 4412 normally chooses. 4414 For this attack, an attacker must actively change one or more 4415 handshake messages. If this occurs, the client and server will 4416 compute different values for the handshake message hashes. As a 4417 result, the parties will not accept each others' finished messages. 4418 Without the master_secret, the attacker cannot repair the finished 4419 messages, so the attack will be discovered. 4421 F.1.4. Resuming sessions 4423 When a connection is established by resuming a session, new 4424 ClientHello.random and ServerHello.random values are hashed with the 4425 session's master_secret. Provided that the master_secret has not been 4426 compromised and that the secure hash operations used to produce the 4427 encryption keys and MAC secrets are secure, the connection should be 4428 secure and effectively independent from previous connections. 4429 Attackers cannot use known encryption keys or MAC secrets to 4430 compromise the master_secret without breaking the secure hash 4431 operations (which use both SHA and MD5). 4433 Sessions cannot be resumed unless both the client and server agree. 4434 If either party suspects that the session may have been compromised, 4435 or that certificates may have expired or been revoked, it should 4436 force a full handshake. An upper limit of 24 hours is suggested for 4437 session ID lifetimes, since an attacker who obtains a master_secret 4438 may be able to impersonate the compromised party until the 4439 corresponding session ID is retired. Applications that may be run in 4440 relatively insecure environments should not write session IDs to 4441 stable storage. 4443 F.1.5 Extensions 4445 Security considerations for the extension mechanism in general, and 4446 the design of new extensions, are described in the previous section. 4447 A security analysis of each of the extensions defined in this 4448 document is given below. 4450 In general, implementers should continue to monitor the state of the 4451 art, and address any weaknesses identified. 4453 F.1.5.1 Security of server_name 4455 If a single server hosts several domains, then clearly it is 4456 necessary for the owners of each domain to ensure that this satisfies 4457 their security needs. Apart from this, server_name does not appear 4458 to introduce significant security issues. 4460 Implementations MUST ensure that a buffer overflow does not occur 4461 whatever the values of the length fields in server_name. 4463 Although this document specifies an encoding for internationalized 4464 hostnames in the server_name extension, it does not address any 4465 security issues associated with the use of internationalized 4466 hostnames in TLS - in particular, the consequences of "spoofed" names 4467 that are indistinguishable from another name when displayed or 4468 printed. It is recommended that server certificates not be issued 4469 for internationalized hostnames unless procedures are in place to 4470 mitigate the risk of spoofed hostnames. 4472 6.2. Security of max_fragment_length 4474 The maximum fragment length takes effect immediately, including for 4475 handshake messages. However, that does not introduce any security 4476 complications that are not already present in TLS, since [TLS] 4477 requires implementations to be able to handle fragmented handshake 4478 messages. 4480 Note that as described in section XXX, once a non-null cipher suite 4481 has been activated, the effective maximum fragment length depends on 4482 the cipher suite and compression method, as well as on the negotiated 4483 max_fragment_length. This must be taken into account when sizing 4484 buffers, and checking for buffer overflow. 4486 F.1.5.2 Security of client_certificate_url 4488 There are two major issues with this extension. 4490 The first major issue is whether or not clients should include 4491 certificate hashes when they send certificate URLs. 4493 When client authentication is used *without* the 4494 client_certificate_url extension, the client certificate chain is 4495 covered by the Finished message hashes. The purpose of including 4496 hashes and checking them against the retrieved certificate chain, is 4497 to ensure that the same property holds when this extension is used - 4498 i.e., that all of the information in the certificate chain retrieved 4499 by the server is as the client intended. 4501 On the other hand, omitting certificate hashes enables functionality 4502 that is desirable in some circumstances - for example clients can be 4503 issued daily certificates that are stored at a fixed URL and need not 4504 be provided to the client. Clients that choose to omit certificate 4505 hashes should be aware of the possibility of an attack in which the 4506 attacker obtains a valid certificate on the client's key that is 4507 different from the certificate the client intended to provide. 4508 Although TLS uses both MD5 and SHA-1 hashes in several other places, 4509 this was not believed to be necessary here. The property required of 4510 SHA-1 is second pre-image resistance. 4512 The second major issue is that support for client_certificate_url 4513 involves the server acting as a client in another URL protocol. The 4514 server therefore becomes subject to many of the same security 4515 concerns that clients of the URL scheme are subject to, with the 4516 added concern that the client can attempt to prompt the server to 4517 connect to some, possibly weird-looking URL. 4519 In general this issue means that an attacker might use the server to 4520 indirectly attack another host that is vulnerable to some security 4521 flaw. It also introduces the possibility of denial of service 4522 attacks in which an attacker makes many connections to the server, 4523 each of which results in the server attempting a connection to the 4524 target of the attack. 4526 Note that the server may be behind a firewall or otherwise able to 4527 access hosts that would not be directly accessible from the public 4528 Internet; this could exacerbate the potential security and denial of 4529 service problems described above, as well as allowing the existence 4530 of internal hosts to be confirmed when they would otherwise be 4531 hidden. 4533 The detailed security concerns involved will depend on the URL 4534 schemes supported by the server. In the case of HTTP, the concerns 4535 are similar to those that apply to a publicly accessible HTTP proxy 4536 server. In the case of HTTPS, the possibility for loops and 4537 deadlocks to be created exists and should be addressed. In the case 4538 of FTP, attacks similar to FTP bounce attacks arise. 4540 As a result of this issue, it is RECOMMENDED that the 4541 client_certificate_url extension should have to be specifically 4542 enabled by a server administrator, rather than being enabled by 4543 default. It is also RECOMMENDED that URI protocols be enabled by the 4544 administrator individually, and only a minimal set of protocols be 4545 enabled, with unusual protocols offering limited security or whose 4546 security is not well-understood being avoided. 4548 As discussed in [URI], URLs that specify ports other than the default 4549 may cause problems, as may very long URLs (which are more likely to 4550 be useful in exploiting buffer overflow bugs). 4552 Also note that HTTP caching proxies are common on the Internet, and 4553 some proxies do not check for the latest version of an object 4554 correctly. If a request using HTTP (or another caching protocol) 4555 goes through a misconfigured or otherwise broken proxy, the proxy may 4556 return an out-of-date response. 4558 F.1.5.4. Security of trusted_ca_keys 4560 It is possible that which CA root keys a client possesses could be 4561 regarded as confidential information. As a result, the CA root key 4562 indication extension should be used with care. 4564 The use of the SHA-1 certificate hash alternative ensures that each 4565 certificate is specified unambiguously. As for the previous 4566 extension, it was not believed necessary to use both MD5 and SHA-1 4567 hashes. 4569 F.1.5.5. Security of truncated_hmac 4571 It is possible that truncated MACs are weaker than "un-truncated" 4572 MACs. However, no significant weaknesses are currently known or 4573 expected to exist for HMAC with MD5 or SHA-1, truncated to 80 bits. 4575 Note that the output length of a MAC need not be as long as the 4576 length of a symmetric cipher key, since forging of MAC values cannot 4577 be done off-line: in TLS, a single failed MAC guess will cause the 4578 immediate termination of the TLS session. 4580 Since the MAC algorithm only takes effect after the handshake 4581 messages have been authenticated by the hashes in the Finished 4582 messages, it is not possible for an active attacker to force 4583 negotiation of the truncated HMAC extension where it would not 4584 otherwise be used (to the extent that the handshake authentication is 4585 secure). Therefore, in the event that any security problem were 4586 found with truncated HMAC in future, if either the client or the 4587 server for a given session were updated to take into account the 4588 problem, they would be able to veto use of this extension. 4590 F.1.5.6. Security of status_request 4592 If a client requests an OCSP response, it must take into account that 4593 an attacker's server using a compromised key could (and probably 4594 would) pretend not to support the extension. A client that requires 4595 OCSP validation of certificates SHOULD either contact the OCSP server 4596 directly in this case, or abort the handshake. 4598 Use of the OCSP nonce request extension (id-pkix-ocsp-nonce) may 4599 improve security against attacks that attempt to replay OCSP 4600 responses; see section 4.4.1 of [OCSP] for further details. 4602 F.2. Protecting application data 4604 The master_secret is hashed with the ClientHello.random and 4605 ServerHello.random to produce unique data encryption keys and MAC 4606 secrets for each connection. 4608 Outgoing data is protected with a MAC before transmission. To prevent 4609 message replay or modification attacks, the MAC is computed from the 4610 MAC secret, the sequence number, the message length, the message 4611 contents, and two fixed character strings. The message type field is 4612 necessary to ensure that messages intended for one TLS Record Layer 4613 client are not redirected to another. The sequence number ensures 4614 that attempts to delete or reorder messages will be detected. Since 4615 sequence numbers are 64-bits long, they should never overflow. 4616 Messages from one party cannot be inserted into the other's output, 4617 since they use independent MAC secrets. Similarly, the server-write 4618 and client-write keys are independent so stream cipher keys are used 4619 only once. 4621 If an attacker does break an encryption key, all messages encrypted 4622 with it can be read. Similarly, compromise of a MAC key can make 4623 message modification attacks possible. Because MACs are also 4624 encrypted, message-alteration attacks generally require breaking the 4625 encryption algorithm as well as the MAC. 4627 Note: MAC secrets may be larger than encryption keys, so messages can 4628 remain tamper resistant even if encryption keys are broken. 4630 F.3. Explicit IVs 4632 [CBCATT] describes a chosen plaintext attack on TLS that depends 4633 on knowing the IV for a record. Previous versions of TLS [TLS1.0] 4634 used the CBC residue of the previous record as the IV and 4635 therefore enabled this attack. This version uses an explicit IV 4636 in order to protect against this attack. 4638 F.4 Security of Composite Cipher Modes 4640 TLS secures transmitted application data via the use of symmetric 4641 encryption and authentication functions defined in the negotiated 4642 ciphersuite. The objective is to protect both the integrity and 4643 confidentiality of the transmitted data from malicious actions by 4644 active attackers in the network. It turns out that the order in 4645 which encryption and authentication functions are applied to the 4646 data plays an important role for achieving this goal [ENCAUTH]. 4648 The most robust method, called encrypt-then-authenticate, first 4649 applies encryption to the data and then applies a MAC to the 4650 ciphertext. This method ensures that the integrity and 4651 confidentiality goals are obtained with ANY pair of encryption 4652 and MAC functions provided that the former is secure against 4653 chosen plaintext attacks and the MAC is secure against chosen- 4654 message attacks. TLS uses another method, called authenticate- 4655 then-encrypt, in which first a MAC is computed on the plaintext 4656 and then the concatenation of plaintext and MAC is encrypted. 4657 This method has been proven secure for CERTAIN combinations of 4658 encryption functions and MAC functions, but is not guaranteed to 4659 be secure in general. In particular, it has been shown that there 4660 exist perfectly secure encryption functions (secure even in the 4661 information theoretic sense) that combined with any secure MAC 4662 function fail to provide the confidentiality goal against an 4663 active attack. Therefore, new ciphersuites and operation modes 4664 adopted into TLS need to be analyzed under the authenticate-then- 4665 encrypt method to verify that they achieve the stated integrity 4666 and confidentiality goals. 4668 Currently, the security of the authenticate-then-encrypt method 4669 has been proven for some important cases. One is the case of 4670 stream ciphers in which a computationally unpredictable pad of 4671 the length of the message plus the length of the MAC tag is 4672 produced using a pseudo-random generator and this pad is xor-ed 4673 with the concatenation of plaintext and MAC tag. The other is 4674 the case of CBC mode using a secure block cipher. In this case, 4675 security can be shown if one applies one CBC encryption pass to 4676 the concatenation of plaintext and MAC and uses a new, 4677 independent and unpredictable, IV for each new pair of plaintext 4678 and MAC. In previous versions of SSL, CBC mode was used properly 4679 EXCEPT that it used a predictable IV in the form of the last 4680 block of the previous ciphertext. This made TLS open to chosen 4681 plaintext attacks. This verson of the protocol is immune to 4682 those attacks. For exact details in the encryption modes proven 4683 secure see [ENCAUTH]. 4685 F.5 Denial of Service 4687 TLS is susceptible to a number of denial of service (DoS) 4688 attacks. In particular, an attacker who initiates a large number 4689 of TCP connections can cause a server to consume large amounts of 4690 CPU doing RSA decryption. However, because TLS is generally used 4691 over TCP, it is difficult for the attacker to hide his point of 4692 origin if proper TCP SYN randomization is used [SEQNUM] by the 4693 TCP stack. 4695 Because TLS runs over TCP, it is also susceptible to a number of 4696 denial of service attacks on individual connections. In 4697 particular, attackers can forge RSTs, terminating connections, or 4698 forge partial TLS records, causing the connection to stall. 4699 These attacks cannot in general be defended against by a TCP- 4700 using protocol. Implementors or users who are concerned with this 4701 class of attack should use IPsec AH [AH] or ESP [ESP]. 4703 F.6. Final notes 4705 For TLS to be able to provide a secure connection, both the client 4706 and server systems, keys, and applications must be secure. In 4707 addition, the implementation must be free of security errors. 4709 The system is only as strong as the weakest key exchange and 4710 authentication algorithm supported, and only trustworthy 4711 cryptographic functions should be used. Short public keys, 40-bit 4712 bulk encryption keys, and anonymous servers should be used with great 4713 caution. Implementations and users must be careful when deciding 4714 which certificates and certificate authorities are acceptable; a 4715 dishonest certificate authority can do tremendous damage. 4717 Security Considerations 4719 Security issues are discussed throughout this memo, especially in 4720 Appendices D, E, and F. 4722 Normative References 4723 [AES] National Institute of Standards and Technology, 4724 "Specification for the Advanced Encryption Standard (AES)" 4725 FIPS 197. November 26, 2001. 4727 [3DES] W. Tuchman, "Hellman Presents No Shortcut Solutions To DES," 4728 IEEE Spectrum, v. 16, n. 7, July 1979, pp40-41. 4730 [DES] ANSI X3.106, "American National Standard for Information 4731 Systems-Data Link Encryption," American National Standards 4732 Institute, 1983. 4734 [DSS] NIST FIPS PUB 186-2, "Digital Signature Standard," National 4735 Institute of Standards and Technology, U.S. Department of 4736 Commerce, 2000. 4738 [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 4739 Hashing for Message Authentication," RFC 2104, February 4740 1997. 4742 [HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, 4743 L., Leach, P. and T. Berners-Lee, "Hypertext Transfer 4744 Protocol -- HTTP/1.1", RFC 2616, June 1999. 4746 [IDEA] X. Lai, "On the Design and Security of Block Ciphers," ETH 4747 Series in Information Processing, v. 1, Konstanz: Hartung- 4748 Gorre Verlag, 1992. 4750 [IDNA] Faltstrom, P., Hoffman, P. and A. Costello, 4751 "Internationalizing Domain Names in Applications (IDNA)", 4752 RFC 3490, March 2003. 4754 [MD5] Rivest, R., "The MD5 Message Digest Algorithm", RFC 1321, 4755 April 1992. 4757 [OCSP] Myers, M., Ankney, R., Malpani, A., Galperin, S. and C. 4758 Adams, "Internet X.509 Public Key Infrastructure: Online 4759 Certificate Status Protocol - OCSP", RFC 2560, June 1999. 4761 [PKCS1A] B. Kaliski, "Public-Key Cryptography Standards (PKCS) #1: 4762 RSA Cryptography Specifications Version 1.5", RFC 2313, 4763 March 1998. 4765 [PKCS1B] J. Jonsson, B. Kaliski, "Public-Key Cryptography Standards 4766 (PKCS) #1: RSA Cryptography Specifications Version 2.1", RFC 4767 3447, February 2003. 4769 [PKIOP] Housley, R. and P. Hoffman, "Internet X.509 Public Key 4770 Infrastructure - Operation Protocols: FTP and HTTP", RFC 4771 2585, May 1999. 4773 [PKIX] Housley, R., Ford, W., Polk, W. and D. Solo, "Internet 4774 Public Key Infrastructure: Part I: X.509 Certificate and CRL 4775 Profile", RFC 3280, April 2002. 4777 [RC2] Rivest, R., "A Description of the RC2(r) Encryption 4778 Algorithm", RFC 2268, January 1998. 4780 [SCH] B. Schneier. "Applied Cryptography: Protocols, Algorithms, 4781 and Source Code in C, 2ed", Published by John Wiley & Sons, 4782 Inc. 1996. 4784 [SHA] NIST FIPS PUB 180-2, "Secure Hash Standard," National 4785 Institute of Standards and Technology, U.S. Department of 4786 Commerce., August 2001. 4788 [REQ] Bradner, S., "Key words for use in RFCs to Indicate 4789 Requirement Levels", BCP 14, RFC 2119, March 1997. 4791 [RFC2434] T. Narten, H. Alvestrand, "Guidelines for Writing an IANA 4792 Considerations Section in RFCs", RFC 3434, October 1998. 4794 [TLSAES] Chown, P. "Advanced Encryption Standard (AES) Ciphersuites 4795 for Transport Layer Security (TLS)", RFC 3268, June 2002. 4797 [TLSEXT] Blake-Wilson, S., Nystrom, M, Hopwood, D., Mikkelsen, J., 4798 Wright, T., "Transport Layer Security (TLS) Extensions", RFC 4799 3546, June 2003. 4800 [TLSKRB] A. Medvinsky, M. Hur, "Addition of Kerberos Cipher Suites to 4801 Transport Layer Security (TLS)", RFC 2712, October 1999. 4803 [URI] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform 4804 Resource Identifiers (URI): Generic Syntax", RFC 2396, 4805 August 1998. 4807 [UTF8] Yergeau, F., "UTF-8, a transformation format of ISO 10646", 4808 RFC 3629, November 2003. 4810 [X509-4th] ITU-T Recommendation X.509 (2000) | ISO/IEC 9594- 8:2001, 4811 "Information Systems - Open Systems Interconnection - The 4812 Directory: Public key and Attribute certificate 4813 frameworks." 4815 [X509-4th-TC1] ITU-T Recommendation X.509(2000) Corrigendum 1(2001) | 4816 ISO/IEC 9594-8:2001/Cor.1:2002, Technical Corrigendum 1 to 4817 ISO/IEC 9594:8:2001. 4819 Informative References 4821 [AH] Kent, S., and Atkinson, R., "IP Authentication Header", RFC 4822 2402, November 1998. 4824 [BLEI] Bleichenbacher D., "Chosen Ciphertext Attacks against 4825 Protocols Based on RSA Encryption Standard PKCS #1" in 4826 Advances in Cryptology -- CRYPTO'98, LNCS vol. 1462, pages: 4827 1-12, 1998. 4829 [CBCATT] Moeller, B., "Security of CBC Ciphersuites in SSL/TLS: 4830 Problems and Countermeasures", 4831 http://www.openssl.org/~bodo/tls-cbc.txt. 4833 [CBCTIME] Canvel, B., "Password Interception in a SSL/TLS Channel", 4834 http://lasecwww.epfl.ch/memo_ssl.shtml, 2003. 4836 [ENCAUTH] Krawczyk, H., "The Order of Encryption and Authentication 4837 for Protecting Communications (Or: How Secure is SSL?)", 4838 Crypto 2001. 4840 [ESP] Kent, S., and Atkinson, R., "IP Encapsulating Security 4841 Payload (ESP)", RFC 2406, November 1998. 4843 [KPR03] Klima, V., Pokorny, O., Rosa, T., "Attacking RSA-based 4844 Sessions in SSL/TLS", http://eprint.iacr.org/2003/052/, 4845 March 2003. 4847 [PKCS6] RSA Laboratories, "PKCS #6: RSA Extended Certificate Syntax 4848 Standard," version 1.5, November 1993. 4850 [PKCS7] RSA Laboratories, "PKCS #7: RSA Cryptographic Message Syntax 4851 Standard," version 1.5, November 1993. 4853 [RANDOM] D. Eastlake 3rd, S. Crocker, J. Schiller. "Randomness 4854 Recommendations for Security", RFC 1750, December 1994. 4856 [RSA] R. Rivest, A. Shamir, and L. M. Adleman, "A Method for 4857 Obtaining Digital Signatures and Public-Key Cryptosystems," 4858 Communications of the ACM, v. 21, n. 2, Feb 1978, pp. 4860 120-126. 4862 [SEQNUM] Bellovin. S., "Defending Against Sequence Number Attacks", 4863 RFC 1948, May 1996. 4865 [SSL2] Hickman, Kipp, "The SSL Protocol", Netscape Communications 4866 Corp., Feb 9, 1995. 4868 [SSL3] A. Frier, P. Karlton, and P. Kocher, "The SSL 3.0 Protocol", 4869 Netscape Communications Corp., Nov 18, 1996. 4871 [SUBGROUP] R. Zuccherato, "Methods for Avoiding the Small-Subgroup 4872 Attacks on the Diffie-Hellman Key Agreement Method for 4873 S/MIME", RFC 2785, March 2000. 4875 [TCP] Postel, J., "Transmission Control Protocol," STD 7, RFC 793, 4876 September 1981. 4878 [TIMING] Boneh, D., Brumley, D., "Remote timing attacks are 4879 practical", USENIX Security Symposium 2003. 4881 [TLS1.0] Dierks, T., and Allen, C., "The TLS Protocol, Version 1.0", 4882 RFC 2246, January 1999. 4884 [X501] ITU-T Recommendation X.501: Information Technology - Open 4885 Systems Interconnection - The Directory: Models, 1993. 4887 [X509] ITU-T Recommendation X.509 (1997 E): Information Technology - 4888 Open Systems Interconnection - "The Directory - 4889 Authentication Framework". 1988. 4891 [XDR] R. Srinivansan, Sun Microsystems, "XDR: External Data 4892 Representation Standard", RFC 1832, August 1995. 4894 Credits 4896 Working Group Chairs 4897 Eric Rescorla 4898 EMail: ekr@rtfm.com 4900 Pasi Eronen 4901 pasi.eronen@nokia.com 4903 Editors 4905 Tim Dierks Eric Rescorla 4906 Independent Network Resonance, Inc. 4908 EMail: tim@dierks.org EMail: ekr@networkresonance.com 4910 Other contributors 4912 Christopher Allen (co-editor of TLS 1.0) 4913 Alacrity Ventures 4914 ChristopherA@AlacrityManagement.com 4916 Martin Abadi 4917 University of California, Santa Cruz 4918 abadi@cs.ucsc.edu 4920 Steven M. Bellovin 4921 Columbia University 4922 smb@cs.columbia.edu 4924 Simon Blake-Wilson 4925 BCI 4926 EMail: sblakewilson@bcisse.com 4928 Ran Canetti 4929 IBM 4930 canetti@watson.ibm.com 4932 Pete Chown 4933 Skygate Technology Ltd 4934 pc@skygate.co.uk 4936 Taher Elgamal 4937 taher@securify.com 4938 Securify 4940 Anil Gangolli 4941 anil@busybuddha.org 4943 Kipp Hickman 4945 David Hopwood 4946 Independent Consultant 4947 EMail: david.hopwood@blueyonder.co.uk 4949 Phil Karlton (co-author of SSLv3) 4951 Paul Kocher (co-author of SSLv3) 4952 Cryptography Research 4953 paul@cryptography.com 4955 Hugo Krawczyk 4956 Technion Israel Institute of Technology 4957 hugo@ee.technion.ac.il 4959 Jan Mikkelsen 4960 Transactionware 4961 EMail: janm@transactionware.com 4963 Magnus Nystrom 4964 RSA Security 4965 EMail: magnus@rsasecurity.com 4967 Robert Relyea 4968 Netscape Communications 4969 relyea@netscape.com 4971 Jim Roskind 4972 Netscape Communications 4973 jar@netscape.com 4975 Michael Sabin 4977 Dan Simon 4978 Microsoft, Inc. 4979 dansimon@microsoft.com 4981 Tom Weinstein 4983 Tim Wright 4984 Vodafone 4985 EMail: timothy.wright@vodafone.com 4987 Comments 4989 The discussion list for the IETF TLS working group is located at the 4990 e-mail address . Information on the group and 4991 information on how to subscribe to the list is at 4992 4994 Archives of the list can be found at: 4995 4996 Intellectual Property Statement 4998 The IETF takes no position regarding the validity or scope of any 4999 Intellectual Property Rights or other rights that might be claimed to 5000 pertain to the implementation or use of the technology described in 5001 this document or the extent to which any license under such rights 5002 might or might not be available; nor does it represent that it has 5003 made any independent effort to identify any such rights. Information 5004 on the procedures with respect to rights in RFC documents can be 5005 found in BCP 78 and BCP 79. 5007 Copies of IPR disclosures made to the IETF Secretariat and any 5008 assurances of licenses to be made available, or the result of an 5009 attempt made to obtain a general license or permission for the use of 5010 such proprietary rights by implementers or users of this 5011 specification can be obtained from the IETF on-line IPR repository at 5012 http://www.ietf.org/ipr. 5014 The IETF invites any interested party to bring to its attention any 5015 copyrights, patents or patent applications, or other proprietary 5016 rights that may cover technology that may be required to implement 5017 this standard. Please address the information to the IETF at 5018 ietf-ipr@ietf.org. 5020 Disclaimer of Validity 5022 This document and the information contained herein are provided on an 5023 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 5024 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 5025 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 5026 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 5027 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 5028 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 5030 Copyright Statement 5032 Copyright (C) The Internet Society (2006). This document is subject 5033 to the rights, licenses and restrictions contained in BCP 78, and 5034 except as set forth therein, the authors retain all their rights. 5036 Acknowledgment 5038 Funding for the RFC Editor function is currently provided by the 5039 Internet Society.