idnits 2.17.1 draft-ietf-tls-rfc4346-bis-03.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 15. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 4301. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 4312. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 4319. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 4325. 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 128 instances of too long lines in the document, the longest one being 8 characters in excess of 72. == There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Line 718 has weird spacing: '...gorithm bul...' == Line 2178 has weird spacing: '...ixed_dh a c...' == Line 2180 has weird spacing: '...ixed_dh a c...' == Line 3863 has weird spacing: '...tegrity and...' == 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: If a TLS implementation receives a record type it does not understand, it SHOULD just ignore it. Any protocol designed for use over TLS MUST be carefully designed to deal with all possible attacks against it. Note that because the type and length of a record are not protected by encryption, care SHOULD be taken to minimize the value of traffic analysis of these values. Implementations MUST not send record types not defined in this document unless negotiated by some extension. == 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: length The length (in bytes) of the following TLSPlaintext.fragment. The length MUST not exceed 2^14. == 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: Implementations MUST not send zero-length fragments of Handshake, Alert, or Change Cipher Spec content types. Zero-length fragments of Application data MAY be sent as they are potentially useful as a traffic analysis countermeasure. == 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: Meaning of this message: Hello request is a simple notification that the client should begin the negotiation process anew by sending a client hello message when convenient. This message is not intended to establish which side is the client or server but merely to initiate a new negotiation. Servers SHOULD not send a HelloRequest immediately upon the client's initial connection. It is the client's job to send a ClientHello at that time. == 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 that 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 that 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. == 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: TLS_NULL_WITH_NULL_NULL is specified and is the initial state of a TLS connection during the first handshake on that channel, but MUST not be negotiated, as it provides no more protection than an unsecured connection. -- 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) == Missing Reference: 'RFC2119' is mentioned on line 196, but not defined -- Looks like a reference, but probably isn't: '0' on line 290 -- Looks like a reference, but probably isn't: '1' on line 290 -- Looks like a reference, but probably isn't: '3' on line 3557 -- Looks like a reference, but probably isn't: '9' on line 326 -- Looks like a reference, but probably isn't: '2' on line 2831 -- Looks like a reference, but probably isn't: '4' on line 362 -- Looks like a reference, but probably isn't: '8' on line 363 -- Looks like a reference, but probably isn't: '10' on line 462 -- Looks like a reference, but probably isn't: '20' on line 2911 -- Looks like a reference, but probably isn't: '48' on line 3144 -- Looks like a reference, but probably isn't: '32' on line 3146 == Missing Reference: 'ChangeCipherSpec' is mentioned on line 1562, but not defined -- Looks like a reference, but probably isn't: '28' on line 2826 == Missing Reference: 'IANA' is mentioned on line 2619, but not defined == Missing Reference: 'TBD' is mentioned on line 1906, but not defined -- Looks like a reference, but probably isn't: '46' on line 2944 -- Looks like a reference, but probably isn't: '12' on line 2967 == Missing Reference: 'RFC4346' is mentioned on line 2566, but not defined ** Obsolete undefined reference: RFC 4346 (Obsoleted by RFC 5246) == Missing Reference: 'RFC4366' is mentioned on line 2594, but not defined ** Obsolete undefined reference: RFC 4366 (Obsoleted by RFC 5246, RFC 6066) == Missing Reference: 'RSADSI' is mentioned on line 3279, but not defined == Unused Reference: 'HTTP' is defined on line 4022, but no explicit reference was found in the text == Unused Reference: 'IDNA' is defined on line 4030, but no explicit reference was found in the text == Unused Reference: 'OCSP' is defined on line 4037, but no explicit reference was found in the text == Unused Reference: 'PKIOP' is defined on line 4045, but no explicit reference was found in the text == Unused Reference: 'REQ' is defined on line 4064, but no explicit reference was found in the text == Unused Reference: 'TLSEXT' is defined on line 4074, but no explicit reference was found in the text == Unused Reference: 'URI' is defined on line 4082, but no explicit reference was found in the text == Unused Reference: 'UTF8' is defined on line 4086, but no explicit reference was found in the text -- 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 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 2434 (Obsoleted by RFC 5226) ** 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' == Outdated reference: A later version (-05) exists of draft-mcgrew-auth-enc-00 -- Obsolete informational reference (is this intentional?): RFC 1948 (ref. 'SEQNUM') (Obsoleted by RFC 6528) -- Obsolete informational reference (is this intentional?): RFC 793 (ref. 'TCP') (Obsoleted by RFC 9293) -- Obsolete informational reference (is this intentional?): RFC 1832 (ref. 'XDR') (Obsoleted by RFC 4506) Summary: 16 errors (**), 0 flaws (~~), 31 warnings (==), 34 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Tim Dierks 3 Independent 4 Eric Rescorla 5 INTERNET-DRAFT Network Resonance, Inc. 6 March 2007 (Expires September 2007) 8 The TLS Protocol 9 Version 1.2 11 Status of this Memo 12 By submitting this Internet-Draft, each author represents that any 13 applicable patent or other IPR claims of which he or she is aware 14 have been or will be disclosed, and any of which he or she becomes 15 aware will be disclosed, in accordance with Section 6 of BCP 79. 17 Internet-Drafts are working documents of the Internet Engineering 18 Task Force (IETF), its areas, and its working groups. Note that 19 other groups may also distribute working documents as Internet- 20 Drafts. 22 Internet-Drafts are draft documents valid for a maximum of six months 23 and may be updated, replaced, or obsoleted by other documents at any 24 time. It is inappropriate to use Internet-Drafts as reference 25 material or to cite them other than as "work in progress." 27 The list of current Internet-Drafts can be accessed at 28 http://www.ietf.org/ietf/1id-abstracts.txt. 30 The list of Internet-Draft Shadow Directories can be accessed at 31 http://www.ietf.org/shadow.html. 33 Copyright Notice 35 Copyright (C) The IETF Trust (2007). 37 Abstract 39 This document specifies Version 1.2 of the Transport Layer Security 40 (TLS) protocol. The TLS protocol provides communications security 41 over the Internet. The protocol allows client/server applications to 42 communicate in a way that is designed to prevent eavesdropping, 43 tampering, or message forgery. 45 Table of Contents 47 1. Introduction 3 48 1.1 Requirements Terminology 4 49 1.2 Major Differences from TLS 1.1 5 50 2. Goals 5 51 3. Goals of This Document 6 52 4. Presentation Language 6 53 4.1. Basic Block Size 6 54 4.2. Miscellaneous 7 55 4.3. Vectors 7 56 4.4. Numbers 8 57 4.5. Enumerateds 8 58 4.6. Constructed Types 9 59 4.6.1. Variants 9 60 4.7. Cryptographic Attributes 10 61 4.8. Constants 12 62 5. HMAC and the Pseudorandom fFunction 12 63 6. The TLS Record Protocol 14 64 6.1. Connection States 14 65 6.2. Record layer 17 66 6.2.1. Fragmentation 17 67 6.2.2. Record Compression and Decompression 18 68 6.2.3. Record Payload Protection 19 69 6.2.3.1. Null or Standard Stream Cipher 19 70 6.2.3.2. CBC Block Cipher 20 71 6.2.3.3. AEAD ciphers 22 72 6.3. Key Calculation 23 73 7. The TLS Handshaking Protocols 24 74 7.1. Change Cipher Spec Protocol 25 75 7.2. Alert Protocol 25 76 7.2.1. Closure Alerts 26 77 7.2.2. Error Alerts 27 78 7.3. Handshake Protocol Overview 30 79 7.4. Handshake Protocol 34 80 7.4.1. Hello Messages 35 81 7.4.1.1. Hello Request 35 82 7.4.1.2. Client Hello 36 83 7.4.1.3. Server Hello 39 84 7.4.1.4 Hello Extensions 40 85 7.4.1.4.1 Cert Hash Types 42 86 7.4.2. Server Certificate 42 87 7.4.3. Server Key Exchange Message 44 88 7.4.4. Certificate Request 46 89 7.4.5 Server hello done 47 90 7.4.6. Client Certificate 48 91 7.4.7. Client Key Exchange Message 48 92 7.4.7.1. RSA Encrypted Premaster Secret Message 49 93 7.4.7.1. Client Diffie-Hellman Public Value 51 94 7.4.8. Certificate verify 52 95 7.4.9. Finished 52 96 8. Cryptographic Computations 53 97 8.1. Computing the Master Secret 54 98 8.1.1. RSA 54 99 8.1.2. Diffie-Hellman 54 100 9. Mandatory Cipher Suites 54 101 A. Protocol Constant Values 58 102 A.1. Record Layer 58 103 A.2. Change Cipher Specs Message 59 104 A.3. Alert Messages 59 105 A.4. Handshake Protocol 61 106 A.4.1. Hello Messages 61 107 A.4.2. Server Authentication and Key Exchange Messages 62 108 A.4.3. Client Authentication and Key Exchange Messages 63 109 A.4.4. Handshake Finalization Message 64 110 A.5. The CipherSuite 64 111 A.6. The Security Parameters 67 112 B. Glossary 69 113 C. CipherSuite Definitions 73 114 D. Implementation Notes 75 115 D.1 Random Number Generation and Seeding 75 116 D.2 Certificates and Authentication 75 117 D.3 CipherSuites 75 118 E. Backward Compatibility 76 119 E.1 Compatibility with TLS 1.0/1.1 and SSL 3.0 76 120 E.2 Compatibility with SSL 2.0 77 121 E.2. Avoiding Man-in-the-Middle Version Rollback 79 122 F. Security Analysis 80 123 F.1. Handshake Protocol 80 124 F.1.1. Authentication and Key Exchange 80 125 F.1.1.1. Anonymous Key Exchange 80 126 F.1.1.2. RSA Key Exchange and Authentication 81 127 F.1.1.3. Diffie-Hellman Key Exchange with Authentication 81 128 F.1.2. Version Rollback Attacks 82 129 F.1.3. Detecting Attacks Against the Handshake Protocol 83 130 F.1.4. Resuming Sessions 83 131 F.1.5 Extensions 83 132 F.2. Protecting Application Data 84 133 F.3. Explicit IVs 84 134 F.4. Security of Composite Cipher Modes 84 135 F.5 Denial of Service 85 136 F.6. Final Notes 86 138 1. Introduction 140 The primary goal of the TLS Protocol is to provide privacy and data 141 integrity between two communicating applications. The protocol is 142 composed of two layers: the TLS Record Protocol and the TLS Handshake 143 Protocol. At the lowest level, layered on top of some reliable 144 transport protocol (e.g., TCP[TCP]), is the TLS Record Protocol. The 145 TLS Record Protocol provides connection security that has two basic 146 properties: 148 - The connection is private. Symmetric cryptography is used for 149 data encryption (e.g., DES [DES], RC4 [SCH] etc.). The keys for 150 this symmetric encryption are generated uniquely for each 151 connection and are based on a secret negotiated by another 152 protocol (such as the TLS Handshake Protocol). The Record 153 Protocol can also be used without encryption. 155 - The connection is reliable. Message transport includes a message 156 integrity check using a keyed MAC. Secure hash functions (e.g., 157 SHA, MD5, etc.) are used for MAC computations. The Record 158 Protocol can operate without a MAC, but is generally only used in 159 this mode while another protocol is using the Record Protocol as 160 a transport for negotiating security parameters. 162 The TLS Record Protocol is used for encapsulation of various higher 163 level protocols. One such encapsulated protocol, the TLS Handshake 164 Protocol, allows the server and client to authenticate each other and 165 to negotiate an encryption algorithm and cryptographic keys before 166 the application protocol transmits or receives its first byte of 167 data. The TLS Handshake Protocol provides connection security that 168 has three basic properties: 170 - The peer's identity can be authenticated using asymmetric, or 171 public key, cryptography (e.g., RSA [RSA], DSS [DSS], etc.). This 172 authentication can be made optional, but is generally required 173 for at least one of the peers. 175 - The negotiation of a shared secret is secure: the negotiated 176 secret is unavailable to eavesdroppers, and for any authenticated 177 connection the secret cannot be obtained, even by an attacker who 178 can place himself in the middle of the connection. 180 - The negotiation is reliable: no attacker can modify the 181 negotiation communication without being detected by the parties 182 to the communication. 184 One advantage of TLS is that it is application protocol independent. 185 Higher-level protocols can layer on top of the TLS Protocol 186 transparently. The TLS standard, however, does not specify how 187 protocols add security with TLS; the decisions on how to initiate TLS 188 handshaking and how to interpret the authentication certificates 189 exchanged are left to the judgment of the designers and implementors 190 of protocols which run on top of TLS. 192 1.1 Requirements Terminology 193 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 194 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 195 document are to be interpreted as described in RFC 2119 [RFC2119]. 197 1.2 Major Differences from TLS 1.1 198 This document is a revision of the TLS 1.1 [TLS1.1] protocol which 199 contains improved flexibility, particularly for negotiation of 200 cryptographic algorithms. The major changes are: 202 - Merged in TLS Extensions definition and AES Cipher Suites from 203 external documents. 205 - Replacement of MD5/SHA-1 combination in the PRF. Addition 206 of cipher-suite specified PRFs. 208 - Replacement of MD5/SHA-1 combination in the digitally-signed 209 element. 211 - Allow the client to indicate which hash functions it supports 212 for digital signature. 214 - Allow the server to indicate which hash functions it supports 215 for digital signature. 217 - Addition of support for authenticated encryption with additional 218 data modes. 220 - Tightened up a number of requirements. 222 - The usual clarifications and editorial work. 224 2. Goals 226 The goals of TLS Protocol, in order of their priority, are as 227 follows: 229 1. Cryptographic security: TLS should be used to establish a secure 230 connection between two parties. 232 2. Interoperability: Independent programmers should be able to 233 develop applications utilizing TLS that can successfully exchange 234 cryptographic parameters without knowledge of one another's code. 236 3. Extensibility: TLS seeks to provide a framework into which new 237 public key and bulk encryption methods can be incorporated as 238 necessary. This will also accomplish two sub-goals: preventing 239 the need to create a new protocol (and risking the introduction 240 of possible new weaknesses) and avoiding the need to implement an 241 entire new security library. 243 4. Relative efficiency: Cryptographic operations tend to be highly 244 CPU intensive, particularly public key operations. For this 245 reason, the TLS protocol has incorporated an optional session 246 caching scheme to reduce the number of connections that need to 247 be established from scratch. Additionally, care has been taken to 248 reduce network activity. 250 3. Goals of This Document 252 This document and the TLS protocol itself are based on the SSL 3.0 253 Protocol Specification as published by Netscape. The differences 254 between this protocol and SSL 3.0 are not dramatic, but they are 255 significant enough that the various versions of TLS and SSL 3.0 do 256 not interoperate (although each protocol incorporates a mechanism by 257 which an implementation can back down to prior versions). This 258 document is intended primarily for readers who will be implementing 259 the protocol and for those doing cryptographic analysis of it. The 260 specification has been written with this in mind, and it is intended 261 to reflect the needs of those two groups. For that reason, many of 262 the algorithm-dependent data structures and rules are included in the 263 body of the text (as opposed to in an appendix), providing easier 264 access to them. 266 This document is not intended to supply any details of service 267 definition or of interface definition, although it does cover select 268 areas of policy as they are required for the maintenance of solid 269 security. 271 4. Presentation Language 273 This document deals with the formatting of data in an external 274 representation. The following very basic and somewhat casually 275 defined presentation syntax will be used. The syntax draws from 276 several sources in its structure. Although it resembles the 277 programming language "C" in its syntax and XDR [XDR] in both its 278 syntax and intent, it would be risky to draw too many parallels. The 279 purpose of this presentation language is to document TLS only; it has 280 no have general application beyond that particular goal. 282 4.1. Basic Block Size 284 The representation of all data items is explicitly specified. The 285 basic data block size is one byte (i.e., 8 bits). Multiple byte data 286 items are concatenations of bytes, from left to right, from top to 287 bottom. From the bytestream, a multi-byte item (a numeric in the 288 example) is formed (using C notation) by: 290 value = (byte[0] << 8*(n-1)) | (byte[1] << 8*(n-2)) | 291 ... | byte[n-1]; 293 This byte ordering for multi-byte values is the commonplace network 294 byte order or big endian format. 296 4.2. Miscellaneous 298 Comments begin with "/*" and end with "*/". 300 Optional components are denoted by enclosing them in "[[ ]]" double 301 brackets. 303 Single-byte entities containing uninterpreted data are of type 304 opaque. 306 4.3. Vectors 308 A vector (single dimensioned array) is a stream of homogeneous data 309 elements. The size of the vector may be specified at documentation 310 time or left unspecified until runtime. In either case, the length 311 declares the number of bytes, not the number of elements, in the 312 vector. The syntax for specifying a new type, T' that is a fixed- 313 length vector of type T is 315 T T'[n]; 317 Here, T' occupies n bytes in the data stream, where n is a multiple 318 of the size of T. The length of the vector is not included in the 319 encoded stream. 321 In the following example, Datum is defined to be three consecutive 322 bytes that the protocol does not interpret, while Data is three 323 consecutive Datum, consuming a total of nine bytes. 325 opaque Datum[3]; /* three uninterpreted bytes */ 326 Datum Data[9]; /* 3 consecutive 3 byte vectors */ 328 Variable-length vectors are defined by specifying a subrange of legal 329 lengths, inclusively, using the notation . When 330 these are encoded, the actual length precedes the vector's contents 331 in the byte stream. The length will be in the form of a number 332 consuming as many bytes as required to hold the vector's specified 333 maximum (ceiling) length. A variable-length vector with an actual 334 length field of zero is referred to as an empty vector. 336 T T'; 338 In the following example, mandatory is a vector that must contain 339 between 300 and 400 bytes of type opaque. It can never be empty. The 340 actual length field consumes two bytes, a uint16, sufficient to 341 represent the value 400 (see Section 4.4). On the other hand, longer 342 can represent up to 800 bytes of data, or 400 uint16 elements, and it 343 may be empty. Its encoding will include a two-byte actual length 344 field prepended to the vector. The length of an encoded vector must 345 be an even multiple of the length of a single element (for example, a 346 17-byte vector of uint16 would be illegal). 348 opaque mandatory<300..400>; 349 /* length field is 2 bytes, cannot be empty */ 350 uint16 longer<0..800>; 351 /* zero to 400 16-bit unsigned integers */ 353 4.4. Numbers 355 The basic numeric data type is an unsigned byte (uint8). All larger 356 numeric data types are formed from fixed-length series of bytes 357 concatenated as described in Section 4.1 and are also unsigned. The 358 following numeric types are predefined. 360 uint8 uint16[2]; 361 uint8 uint24[3]; 362 uint8 uint32[4]; 363 uint8 uint64[8]; 365 All values, here and elsewhere in the specification, are stored in 366 "network" or "big-endian" order; the uint32 represented by the hex 367 bytes 01 02 03 04 is equivalent to the decimal value 16909060. 369 Note that in some cases (e.g., DH parameters) it is necessary to 370 represent integers as opaque vectors. In such cases, they are 371 represented as unsigned integers (i.e., leading zero octets are not 372 required even if the most significant bit is set). 374 4.5. Enumerateds 376 An additional sparse data type is available called enum. A field of 377 type enum can only assume the values declared in the definition. 378 Each definition is a different type. Only enumerateds of the same 379 type may be assigned or compared. Every element of an enumerated must 380 be assigned a value, as demonstrated in the following example. Since 381 the elements of the enumerated are not ordered, they can be assigned 382 any unique value, in any order. 384 enum { e1(v1), e2(v2), ... , en(vn) [[, (n)]] } Te; 386 Enumerateds occupy as much space in the byte stream as would its 387 maximal defined ordinal value. The following definition would cause 388 one byte to be used to carry fields of type Color. 390 enum { red(3), blue(5), white(7) } Color; 392 One may optionally specify a value without its associated tag to 393 force the width definition without defining a superfluous element. 394 In the following example, Taste will consume two bytes in the data 395 stream but can only assume the values 1, 2, or 4. 397 enum { sweet(1), sour(2), bitter(4), (32000) } Taste; 399 The names of the elements of an enumeration are scoped within the 400 defined type. In the first example, a fully qualified reference to 401 the second element of the enumeration would be Color.blue. Such 402 qualification is not required if the target of the assignment is well 403 specified. 405 Color color = Color.blue; /* overspecified, legal */ 406 Color color = blue; /* correct, type implicit */ 408 For enumerateds that are never converted to external representation, 409 the numerical information may be omitted. 411 enum { low, medium, high } Amount; 413 4.6. Constructed Types 415 Structure types may be constructed from primitive types for 416 convenience. Each specification declares a new, unique type. The 417 syntax for definition is much like that of C. 419 struct { 420 T1 f1; 421 T2 f2; 422 ... 423 Tn fn; 424 } [[T]]; 426 The fields within a structure may be qualified using the type's name, 427 with a syntax much like that available for enumerateds. For example, 428 T.f2 refers to the second field of the previous declaration. 429 Structure definitions may be embedded. 431 4.6.1. Variants 432 Defined structures may have variants based on some knowledge that is 433 available within the environment. The selector must be an enumerated 434 type that defines the possible variants the structure defines. There 435 must be a case arm for every element of the enumeration declared in 436 the select. The body of the variant structure may be given a label 437 for reference. The mechanism by which the variant is selected at 438 runtime is not prescribed by the presentation language. 440 struct { 441 T1 f1; 442 T2 f2; 443 .... 444 Tn fn; 445 select (E) { 446 case e1: Te1; 447 case e2: Te2; 448 .... 449 case en: Ten; 450 } [[fv]]; 451 } [[Tv]]; 453 For example: 455 enum { apple, orange } VariantTag; 456 struct { 457 uint16 number; 458 opaque string<0..10>; /* variable length */ 459 } V1; 460 struct { 461 uint32 number; 462 opaque string[10]; /* fixed length */ 463 } V2; 464 struct { 465 select (VariantTag) { /* value of selector is implicit */ 466 case apple: V1; /* VariantBody, tag = apple */ 467 case orange: V2; /* VariantBody, tag = orange */ 468 } variant_body; /* optional label on variant */ 469 } VariantRecord; 471 Variant structures may be qualified (narrowed) by specifying a value 472 for the selector prior to the type. For example, a 474 orange VariantRecord 476 is a narrowed type of a VariantRecord containing a variant_body of 477 type V2. 479 4.7. Cryptographic Attributes 480 The five cryptographic operations digital signing, stream cipher 481 encryption, block cipher encryption, authenticated encryption with 482 additional data (AEAD) encryption and public key encryption are 483 designated digitally-signed, stream-ciphered, block-ciphered, aead- 484 ciphered, and public-key-encrypted, respectively. A field's 485 cryptographic processing is specified by prepending an appropriate 486 key word designation before the field's type specification. 487 Cryptographic keys are implied by the current session state (see 488 Section 6.1). 490 In digital signing, one-way hash functions are used as input for a 491 signing algorithm. A digitally-signed element is encoded as an opaque 492 vector <0..2^16-1>, where the length is specified by the signing 493 algorithm and key. 495 In RSA signing, the opaque vector contains the signature generated 496 using the RSASSA-PKCS1-v1_5 signature scheme defined in [PKCS1B]. As 497 discussed in [PKCS1B], the DigestInfo MUST be DER encoded and for 498 digest algorithms without parameters (which include SHA-1) the 499 DigestInfo.AlgorithmIdentifier.parameters field SHOULD be omitted but 500 implementations MUST accept both without parameters and with NULL 501 parameters. Note that earlier versions of TLS used a different RSA 502 signature scheme which did not include a DigestInfo encoding. 504 In DSS, the 20 bytes of the SHA-1 hash are run directly through the 505 Digital Signing Algorithm with no additional hashing. This produces 506 two values, r and s. The DSS signature is an opaque vector, as above, 507 the contents of which are the DER encoding of: 509 Dss-Sig-Value ::= SEQUENCE { 510 r INTEGER, 511 s INTEGER 512 } 514 In stream cipher encryption, the plaintext is exclusive-ORed with an 515 identical amount of output generated from a cryptographically secure 516 keyed pseudorandom number generator. 518 In block cipher encryption, every block of plaintext encrypts to a 519 block of ciphertext. All block cipher encryption is done in CBC 520 (Cipher Block Chaining) mode, and all items that are block-ciphered 521 will be an exact multiple of the cipher block length. 523 In AEAD encryption, the plaintext is simultaneously encrypted and 524 integrity protected. The input may be of any length and the output is 525 generally larger than the input in order to accomodate the integrity 526 check value. 528 In public key encryption, a public key algorithm is used to encrypt 529 data in such a way that it can be decrypted only with the matching 530 private key. A public-key-encrypted element is encoded as an opaque 531 vector <0..2^16-1>, where the length is specified by the signing 532 algorithm and key. 534 RSA encryption is done using the RSAES-PKCS1-v1_5 encryption scheme 535 defined in [PKCS1B]. 537 In the following example 539 stream-ciphered struct { 540 uint8 field1; 541 uint8 field2; 542 digitally-signed opaque hash[20]; 543 } UserType; 545 the contents of hash are used as input for the signing algorithm, and 546 then the entire structure is encrypted with a stream cipher. The 547 length of this structure, in bytes would be equal to two bytes for 548 field1 and field2, plus two bytes for the length of the signature, 549 plus the length of the output of the signing algorithm. This is known 550 because the algorithm and key used for the signing are known prior to 551 encoding or decoding this structure. 553 4.8. Constants 555 Typed constants can be defined for purposes of specification by 556 declaring a symbol of the desired type and assigning values to it. 557 Under-specified types (opaque, variable length vectors, and 558 structures that contain opaque) cannot be assigned values. No fields 559 of a multi-element structure or vector may be elided. 561 For example: 563 struct { 564 uint8 f1; 565 uint8 f2; 566 } Example1; 568 Example1 ex1 = {1, 4}; /* assigns f1 = 1, f2 = 4 */ 570 5. HMAC and the Pseudorandom fFunction 572 A number of operations in the TLS record and handshake layer requires 573 a keyed MAC; this is a secure digest of some data protected by a 574 secret. Forging the MAC is infeasible without knowledge of the MAC 575 secret. The construction TLS provides for this operation is known as 576 HMAC and is described in [HMAC]. Cipher suites MAY define their own 577 MACs. 579 In addition, a construction is required to do expansion of secrets 580 into blocks of data for the purposes of key generation or validation. 581 This pseudo-random function (PRF) takes as input a secret, a seed, 582 and an identifying label and produces an output of arbitrary length. 583 We define one PRF, based on HMAC, which is used for all cipher suites 584 in this document. Cipher suites MAY define their own PRFs. 586 First, we define a data expansion function, P_hash(secret, data) that 587 uses a single hash function to expand a secret and seed into an 588 arbitrary quantity of output: 590 P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + 591 HMAC_hash(secret, A(2) + seed) + 592 HMAC_hash(secret, A(3) + seed) + ... 594 Where + indicates concatenation. 596 A() is defined as: 597 A(0) = seed 598 A(i) = HMAC_hash(secret, A(i-1)) 600 P_hash can be iterated as many times as is necessary to produce the 601 required quantity of data. For example, if P_SHA-1 is being used to 602 create 64 bytes of data, it will have to be iterated 4 times (through 603 A(4)), creating 80 bytes of output data; the last 16 bytes of the 604 final iteration will then be discarded, leaving 64 bytes of output 605 data. 607 TLS's PRF is created by applying P_hash to the secret S as: 609 PRF(secret, label, seed) = P_(secret, label + seed) 611 All the cipher suites defined in this document and in TLS documents 612 prior to this document MUST use SHA-256 as the basis for their PRF. 613 New cipher suites MUST specify a PRF and in general SHOULD use the 614 TLS PRF with SHA-256 or a stronger standard hash function. 616 The label is an ASCII string. It should be included in the exact form 617 it is given without a length byte or trailing null character. For 618 example, the label "slithy toves" would be processed by hashing the 619 following bytes: 621 73 6C 69 74 68 79 20 74 6F 76 65 73 622 6. The TLS Record Protocol 624 The TLS Record Protocol is a layered protocol. At each layer, 625 messages may include fields for length, description, and content. 626 The Record Protocol takes messages to be transmitted, fragments the 627 data into manageable blocks, optionally compresses the data, applies 628 a MAC, encrypts, and transmits the result. Received data is 629 decrypted, verified, decompressed, and reassembled, and then 630 delivered to higher-level clients. 632 Four record protocol clients are described in this document: the 633 handshake protocol, the alert protocol, the change cipher spec 634 protocol, and the application data protocol. In order to allow 635 extension of the TLS protocol, additional record types can be 636 supported by the record protocol. New record type values are assigned 637 by IANA as described in Section 11. 639 If a TLS implementation receives a record type it does not 640 understand, it SHOULD just ignore it. Any protocol designed for use 641 over TLS MUST be carefully designed to deal with all possible attacks 642 against it. Note that because the type and length of a record are 643 not protected by encryption, care SHOULD be taken to minimize the 644 value of traffic analysis of these values. Implementations MUST not 645 send record types not defined in this document unless negotiated by 646 some extension. 648 6.1. Connection States 650 A TLS connection state is the operating environment of the TLS Record 651 Protocol. It specifies a compression algorithm, encryption algorithm, 652 and MAC algorithm. In addition, the parameters for these algorithms 653 are known: the MAC secret and the bulk encryption keys for the 654 connection in both the read and the write directions. Logically, 655 there are always four connection states outstanding: the current read 656 and write states, and the pending read and write states. All records 657 are processed under the current read and write states. The security 658 parameters for the pending states can be set by the TLS Handshake 659 Protocol, and the Change Cipher Spec can selectively make either of 660 the pending states current, in which case the appropriate current 661 state is disposed of and replaced with the pending state; the pending 662 state is then reinitialized to an empty state. It is illegal to make 663 a state that has not been initialized with security parameters a 664 current state. The initial current state always specifies that no 665 encryption, compression, or MAC will be used. 667 The security parameters for a TLS Connection read and write state are 668 set by providing the following values: 670 connection end 671 Whether this entity is considered the "client" or the "server" in 672 this connection. 674 bulk encryption algorithm 675 An algorithm to be used for bulk encryption. This specification 676 includes the key size of this algorithm, how much of that key is 677 secret, whether it is a block, stream, or AEAD cipher, and the 678 block size of the cipher (if appropriate). 680 MAC algorithm 681 An algorithm to be used for message authentication. This 682 specification includes the size of the hash that is returned by 683 the MAC algorithm. 685 compression algorithm 686 An algorithm to be used for data compression. This specification 687 must include all information the algorithm requires to do 688 compression. 690 master secret 691 A 48-byte secret shared between the two peers in the connection. 693 client random 694 A 32-byte value provided by the client. 696 server random 697 A 32-byte value provided by the server. 699 These parameters are defined in the presentation language as: 701 enum { server, client } ConnectionEnd; 703 enum { null, rc4, rc2, des, 3des, des40, idea, aes } BulkCipherAlgorithm; 705 enum { stream, block, aead } CipherType; 707 enum { null, md5, sha, sha256, sha384, sha512} MACAlgorithm; 709 /* The use of "sha" above is historical and denotes SHA-1 */ 711 enum { null(0), (255) } CompressionMethod; 713 /* The algorithms specified in CompressionMethod, 714 BulkCipherAlgorithm, and MACAlgorithm may be added to. */ 716 struct { 717 ConnectionEnd entity; 718 BulkCipherAlgorithm bulk_cipher_algorithm; 719 CipherType cipher_type; 720 uint8 enc_key_length; 721 uint8 block_length; 722 uint8 iv_length; 723 MACAlgorithm mac_algorithm; 724 uint8 mac_length; 725 uint8 mac_key_length; 726 CompressionMethod compression_algorithm; 727 opaque master_secret[48]; 728 opaque client_random[32]; 729 opaque server_random[32]; 730 } SecurityParameters; 732 The record layer will use the security parameters to generate the 733 following four items: 735 client write MAC secret 736 server write MAC secret 737 client write key 738 server write key 740 The client write parameters are used by the server when receiving and 741 processing records and vice-versa. The algorithm used for generating 742 these items from the security parameters is described in Section 6.3. 744 Once the security parameters have been set and the keys have been 745 generated, the connection states can be instantiated by making them 746 the current states. These current states MUST be updated for each 747 record processed. Each connection state includes the following 748 elements: 750 compression state 751 The current state of the compression algorithm. 753 cipher state 754 The current state of the encryption algorithm. This will consist 755 of the scheduled key for that connection. For stream ciphers, 756 this will also contain whatever state information is necessary to 757 allow the stream to continue to encrypt or decrypt data. 759 MAC secret 760 The MAC secret for this connection, as generated above. 762 sequence number 763 Each connection state contains a sequence number, which is 764 maintained separately for read and write states. The sequence 765 number MUST be set to zero whenever a connection state is made 766 the active state. Sequence numbers are of type uint64 and may not 767 exceed 2^64-1. Sequence numbers do not wrap. If a TLS 768 implementation would need to wrap a sequence number, it must 769 renegotiate instead. A sequence number is incremented after each 770 record: specifically, the first record transmitted under a 771 particular connection state MUST use sequence number 0. 773 6.2. Record layer 775 The TLS Record Layer receives uninterpreted data from higher layers 776 in non-empty blocks of arbitrary size. 778 6.2.1. Fragmentation 780 The record layer fragments information blocks into TLSPlaintext 781 records carrying data in chunks of 2^14 bytes or less. Client message 782 boundaries are not preserved in the record layer (i.e., multiple 783 client messages of the same ContentType MAY be coalesced into a 784 single TLSPlaintext record, or a single message MAY be fragmented 785 across several records). 787 struct { 788 uint8 major, minor; 789 } ProtocolVersion; 791 enum { 792 change_cipher_spec(20), alert(21), handshake(22), 793 application_data(23), (255) 794 } ContentType; 796 struct { 797 ContentType type; 798 ProtocolVersion version; 799 uint16 length; 800 opaque fragment[TLSPlaintext.length]; 801 } TLSPlaintext; 803 type 804 The higher-level protocol used to process the enclosed fragment. 806 version 807 The version of the protocol being employed. This document 808 describes TLS Version 1.2, which uses the version { 3, 3 }. The 809 version value 3.3 is historical, deriving from the use of 3.1 for 810 TLS 1.0. (See Appendix A.1). Note that a client that supports 811 multiple versions of TLS may not know what version will be 812 employed before it receives ServerHello. See Appendix E for 813 discussion about what record layer version number should be 814 employed for ClientHello. 816 length 817 The length (in bytes) of the following TLSPlaintext.fragment. 818 The length MUST not exceed 2^14. 820 fragment 821 The application data. This data is transparent and treated as an 822 independent block to be dealt with by the higher-level protocol 823 specified by the type field. 825 Implementations MUST not send zero-length fragments of Handshake, 826 Alert, or Change Cipher Spec content types. Zero-length fragments 827 of Application data MAY be sent as they are potentially useful as 828 a traffic analysis countermeasure. 830 Note: Data of different TLS Record layer content types MAY be 831 interleaved. Application data is generally of lower precedence 832 for transmission than other content types. However, records MUST 833 be delivered to the network in the same order as they are 834 protected by the record layer. Recipients MUST receive and 835 process interleaved application layer traffic during handshakes 836 subsequent to the first one on a connection. 838 6.2.2. Record Compression and Decompression 840 All records are compressed using the compression algorithm defined in 841 the current session state. There is always an active compression 842 algorithm; however, initially it is defined as 843 CompressionMethod.null. The compression algorithm translates a 844 TLSPlaintext structure into a TLSCompressed structure. Compression 845 functions are initialized with default state information whenever a 846 connection state is made active. 848 Compression must be lossless and may not increase the content length 849 by more than 1024 bytes. If the decompression function encounters a 850 TLSCompressed.fragment that would decompress to a length in excess of 851 2^14 bytes, it MUST report a fatal decompression failure error. 853 struct { 854 ContentType type; /* same as TLSPlaintext.type */ 855 ProtocolVersion version;/* same as TLSPlaintext.version */ 856 uint16 length; 857 opaque fragment[TLSCompressed.length]; 858 } TLSCompressed; 859 length 860 The length (in bytes) of the following TLSCompressed.fragment. 861 The length should not exceed 2^14 + 1024. 863 fragment 864 The compressed form of TLSPlaintext.fragment. 866 Note: A CompressionMethod.null operation is an identity operation; no 867 fields are altered. 869 Implementation note: 870 Decompression functions are responsible for ensuring that 871 messages cannot cause internal buffer overflows. 873 6.2.3. Record Payload Protection 875 The encryption and MAC functions translate a TLSCompressed structure 876 into a TLSCiphertext. The decryption functions reverse the process. 877 The MAC of the record also includes a sequence number so that 878 missing, extra, or repeated messages are detectable. 880 struct { 881 ContentType type; 882 ProtocolVersion version; 883 uint16 length; 884 select (SecurityParameters.cipher_type) { 885 case stream: GenericStreamCipher; 886 case block: GenericBlockCipher; 887 case aead: GenericAEADCipher; 888 } fragment; 889 } TLSCiphertext; 891 type 892 The type field is identical to TLSCompressed.type. 894 version 895 The version field is identical to TLSCompressed.version. 897 length 898 The length (in bytes) of the following TLSCiphertext.fragment. 899 The length may not exceed 2^14 + 2048. 901 fragment 902 The encrypted form of TLSCompressed.fragment, with the MAC. 904 6.2.3.1. Null or Standard Stream Cipher 906 Stream ciphers (including BulkCipherAlgorithm.null, see Appendix A.6) 907 convert TLSCompressed.fragment structures to and from stream 908 TLSCiphertext.fragment structures. 910 stream-ciphered struct { 911 opaque content[TLSCompressed.length]; 912 opaque MAC[SecurityParameters.mac_length]; 913 } GenericStreamCipher; 915 The MAC is generated as: 917 HMAC_hash(MAC_write_secret, seq_num + TLSCompressed.type + 918 TLSCompressed.version + TLSCompressed.length + 919 TLSCompressed.fragment)); 921 where "+" denotes concatenation. 923 seq_num 924 The sequence number for this record. 926 hash 927 The hashing algorithm specified by 928 SecurityParameters.mac_algorithm. 930 Note that the MAC is computed before encryption. The stream cipher 931 encrypts the entire block, including the MAC. For stream ciphers that 932 do not use a synchronization vector (such as RC4), the stream cipher 933 state from the end of one record is simply used on the subsequent 934 packet. If the CipherSuite is TLS_NULL_WITH_NULL_NULL, encryption 935 consists of the identity operation (i.e., the data is not encrypted, 936 and the MAC size is zero, implying that no MAC is used). 937 TLSCiphertext.length is TLSCompressed.length plus 938 SecurityParameters.mac_length. 940 6.2.3.2. CBC Block Cipher 942 For block ciphers (such as RC2, DES, or AES), the encryption and MAC 943 functions convert TLSCompressed.fragment structures to and from block 944 TLSCiphertext.fragment structures. 946 block-ciphered struct { 947 opaque IV[SecurityParameters.block_length]; 948 opaque content[TLSCompressed.length]; 949 opaque MAC[SecurityParameters.mac_length]; 950 uint8 padding[GenericBlockCipher.padding_length]; 951 uint8 padding_length; 952 } GenericBlockCipher; 954 The MAC is generated as described in Section 6.2.3.1. 956 IV 957 TLS 1.2 uses an explicit IV in order to prevent the attacks 958 described by [CBCATT]. The IV SHOULD be chosen at random and MUST 959 be unpredictable. In order to decrypt, thereceiver decrypts the 960 entire GenericBlockCipher structure and then discards the first 961 cipher block, corresponding to the IV component. 963 padding 964 Padding that is added to force the length of the plaintext to be 965 an integral multiple of the block cipher's block length. The 966 padding MAY be any length up to 255 bytes, as long as it results 967 in the TLSCiphertext.length being an integral multiple of the 968 block length. Lengths longer than necessary might be desirable to 969 frustrate attacks on a protocol based on analysis of the lengths 970 of exchanged messages. Each uint8 in the padding data vector MUST 971 be filled with the padding length value. The receiver MUST check 972 this padding and SHOULD use the bad_record_mac alert to indicate 973 padding errors. 975 padding_length 976 The padding length MUST be such that the total size of the 977 GenericBlockCipher structure is a multiple of the cipher's block 978 length. Legal values range from zero to 255, inclusive. This 979 length specifies the length of the padding field exclusive of the 980 padding_length field itself. 982 The encrypted data length (TLSCiphertext.length) is one more than the 983 sum of TLSCompressed.length, SecurityParameters.mac_length, and 984 padding_length. 986 Example: If the block length is 8 bytes, the content length 987 (TLSCompressed.length) is 61 bytes, and the MAC length is 20 988 bytes, then the length before padding is 82 bytes (this does 989 not include the IV, which may or may not be encrypted, as 990 discussed above). Thus, the padding length modulo 8 must be 991 equal to 6 in order to make the total length an even multiple 992 of 8 bytes (the block length). The padding length can be 6, 993 14, 22, and so on, through 254. If the padding length were the 994 minimum necessary, 6, the padding would be 6 bytes, each 995 containing the value 6. Thus, the last 8 octets of the 996 GenericBlockCipher before block encryption would be xx 06 06 997 06 06 06 06 06, where xx is the last octet of the MAC. 999 Note: With block ciphers in CBC mode (Cipher Block Chaining), 1000 it is critical that the entire plaintext of the record be known 1001 before any ciphertext is transmitted. Otherwise, it is possible 1002 for the attacker to mount the attack described in [CBCATT]. 1004 Implementation Note: Canvel et al. [CBCTIME] have demonstrated a timing 1005 attack on CBC padding based on the time required to compute the 1006 MAC. In order to defend against this attack, implementations MUST 1007 ensure that record processing time is essentially the same 1008 whether or not the padding is correct. In general, the best way 1009 to do this is to compute the MAC even if the padding is 1010 incorrect, and only then reject the packet. For instance, if the 1011 pad appears to be incorrect, the implementation might assume a 1012 zero-length pad and then compute the MAC. This leaves a small 1013 timing channel, since MAC performance depends to some extent on 1014 the size of the data fragment, but it is not believed to be large 1015 enough to be exploitable, due to the large block size of existing 1016 MACs and the small size of the timing signal. 1018 6.2.3.3. AEAD ciphers 1020 For AEAD [AEAD] ciphers (such as [CCM] or [GCM]) the AEAD function 1021 converts TLSCompressed.fragment structures to and from AEAD 1022 TLSCiphertext.fragment structures. 1024 aead-ciphered struct { 1025 opaque IV[SecurityParameters.iv_length]; 1026 opaque aead_output[AEADEncrypted.length]; 1027 } GenericAEADCipher; 1029 AEAD ciphers take as input a single key, a nonce, a plaintext, and 1030 "additional data" to be included in the authentication check, as 1031 described in Section 2.1 of [AEAD]. These inputs are as follows. 1033 The key is either the client_write_key or the server_write_key. The 1034 MAC key will be of length zero. 1036 The nonce supplied to the AEAD operations is determined by the IV in 1037 aead-ciphered struct. Each IV used in distinct invocations of the 1038 AEAD encryption operation MUST be distinct, for any fixed value of 1039 the key. Implementations SHOULD use the recommended nonce formation 1040 method of [AEAD] to generate IVs, and MAY use any other method that 1041 meets this requirement. The length of the IV depends on the AEAD 1042 cipher; that length MAY be zero. Note that in many cases it is 1043 appropriate to use the partially implicit nonce technique of S 3.2.1 1044 of AEAD, in which case the client_write_iv and server_write_iv should 1045 be used as the "fixed-common". 1047 The plaintext is the TLSCompressed.fragment. 1049 The additional authenticated data, which we denote as 1050 additional_data, is defined as follows: 1052 additional_data = seq_num + TLSCompressed.type + 1053 TLSCompressed.version + TLSCompressed.length; 1055 The aead_output consists of the ciphertext output by the AEAD 1056 encryption operation. AEADEncrypted.length will generally be larger 1057 than TLSCompressed.length, but by an amount that varies with the AEAD 1058 cipher. Since the ciphers might incorporate padding, the amount of 1059 overhead could vary with different TLSCompressed.length values. Each 1060 AEAD cipher MUST NOT produce an expansion of greater than 1024 bytes. 1061 Symbolically, 1063 AEADEncrypted = AEAD-Encrypt(key, IV, plaintext, 1064 additional_data) 1066 Where "+" denotes concatenation. 1068 In order to decrypt and verify, the cipher takes as input the key, 1069 IV, the "additional_data", and the AEADEncrypted value. The output is 1070 either the plaintext or an error indicating that the decryption 1071 failed. There is no separate integrity check. I.e., 1073 TLSCompressed.fragment = AEAD-Decrypt(write_key, IV, AEADEncrypted, 1074 TLSCiphertext.type + TLSCiphertext.version + 1075 TLSCiphertext.length); 1077 If the decryption fails, a fatal bad_record_mac alert MUST be 1078 generated. 1080 6.3. Key Calculation 1082 The Record Protocol requires an algorithm to generate keys, and MAC 1083 secrets from the security parameters provided by the handshake 1084 protocol. 1086 The master secret is hashed into a sequence of secure bytes, which 1087 are assigned to the MAC secrets and keys required by the current 1088 connection state (see Appendix A.6). CipherSpecs require a client 1089 write MAC secret, a server write MAC secret, a client write key, and 1090 a server write key, each of which is generated from the master secret 1091 in that order. Unused values are empty. 1093 When keys and MAC secrets are generated, the master secret is used as 1094 an entropy source. 1096 To generate the key material, compute 1098 key_block = PRF(SecurityParameters.master_secret, 1099 "key expansion", 1100 SecurityParameters.server_random + 1101 SecurityParameters.client_random); 1103 until enough output has been generated. Then the key_block is 1104 partitioned as follows: 1106 client_write_MAC_secret[SecurityParameters.mac_key_length] 1107 server_write_MAC_secret[SecurityParameters.mac_key_length] 1108 client_write_key[SecurityParameters.enc_key_length] 1109 server_write_key[SecurityParameters.enc_key_length] 1111 Implementation note: 1112 The currently defined cipher suite which requires the most 1113 material is AES_256_CBC_SHA, defined in [TLSAES]. It requires 2 x 1114 32 byte keys and 2 x 20 byte MAC secrets, for a total 104 bytes 1115 of key material. 1117 7. The TLS Handshaking Protocols 1119 TLS has three subprotocols that are used to allow peers to agree 1120 upon security parameters for the record layer, to authenticate 1121 themselves, to instantiate negotiated security parameters, and to 1122 report error conditions to each other. 1124 The Handshake Protocol is responsible for negotiating a session, 1125 which consists of the following items: 1127 session identifier 1128 An arbitrary byte sequence chosen by the server to identify an 1129 active or resumable session state. 1131 peer certificate 1132 X509v3 [X509] certificate of the peer. This element of the 1133 state may be null. 1135 compression method 1136 The algorithm used to compress data prior to encryption. 1138 cipher spec 1139 Specifies the bulk data encryption algorithm (such as null, 1140 DES, etc.) and a MAC algorithm (such as MD5 or SHA). It also 1141 defines cryptographic attributes such as the hash_size. (See 1142 Appendix A.6 for formal definition,) 1144 master secret 1145 48-byte secret shared between the client and server. 1147 is resumable 1148 A flag indicating whether the session can be used to initiate 1149 new connections. 1151 These items are then used to create security parameters for use by 1152 the Record Layer when protecting application data. Many connections 1153 can be instantiated using the same session through the resumption 1154 feature of the TLS Handshake Protocol. 1156 7.1. Change Cipher Spec Protocol 1158 The change cipher spec protocol exists to signal transitions in 1159 ciphering strategies. The protocol consists of a single message, 1160 which is encrypted and compressed under the current (not the pending) 1161 connection state. The message consists of a single byte of value 1. 1163 struct { 1164 enum { change_cipher_spec(1), (255) } type; 1165 } ChangeCipherSpec; 1167 The change cipher spec message is sent by both the client and the 1168 server to notify the receiving party that subsequent records will be 1169 protected under the newly negotiated CipherSpec and keys. Reception 1170 of this message causes the receiver to instruct the Record Layer to 1171 immediately copy the read pending state into the read current state. 1172 Immediately after sending this message, the sender MUST instruct the 1173 record layer to make the write pending state the write active state. 1174 (See Section 6.1.) The change cipher spec message is sent during the 1175 handshake after the security parameters have been agreed upon, but 1176 before the verifying finished message is sent (see Section 7.4.11 1178 Note: If a rehandshake occurs while data is flowing on a connection, 1179 the communicating parties may continue to send data using the old 1180 CipherSpec. However, once the ChangeCipherSpec has been sent, the new 1181 CipherSpec MUST be used. The first side to send the ChangeCipherSpec 1182 does not know that the other side has finished computing the new 1183 keying material (e.g., if it has to perform a time consuming public 1184 key operation). Thus, a small window of time, during which the 1185 recipient must buffer the data, MAY exist. In practice, with modern 1186 machines this interval is likely to be fairly short. 1188 7.2. Alert Protocol 1190 One of the content types supported by the TLS Record layer is the 1191 alert type. Alert messages convey the severity of the message and a 1192 description of the alert. Alert messages with a level of fatal result 1193 in the immediate termination of the connection. In this case, other 1194 connections corresponding to the session may continue, but the 1195 session identifier MUST be invalidated, preventing the failed session 1196 from being used to establish new connections. Like other messages, 1197 alert messages are encrypted and compressed, as specified by the 1198 current connection state. 1200 enum { warning(1), fatal(2), (255) } AlertLevel; 1202 enum { 1203 close_notify(0), 1204 unexpected_message(10), 1205 bad_record_mac(20), 1206 decryption_failed_RESERVED(21), 1207 record_overflow(22), 1208 decompression_failure(30), 1209 handshake_failure(40), 1210 no_certificate_RESERVED(41), 1211 bad_certificate(42), 1212 unsupported_certificate(43), 1213 certificate_revoked(44), 1214 certificate_expired(45), 1215 certificate_unknown(46), 1216 illegal_parameter(47), 1217 unknown_ca(48), 1218 access_denied(49), 1219 decode_error(50), 1220 decrypt_error(51), 1221 export_restriction_RESERVED(60), 1222 protocol_version(70), 1223 insufficient_security(71), 1224 internal_error(80), 1225 user_canceled(90), 1226 no_renegotiation(100), 1227 unsupported_extension(110), /* new */ 1228 (255) 1229 } AlertDescription; 1231 struct { 1232 AlertLevel level; 1233 AlertDescription description; 1234 } Alert; 1236 7.2.1. Closure Alerts 1238 The client and the server must share knowledge that the connection is 1239 ending in order to avoid a truncation attack. Either party may 1240 initiate the exchange of closing messages. 1242 close_notify 1243 This message notifies the recipient that the sender will not send 1244 any more messages on this connection. Note that as of TLS 1.1, 1245 failure to properly close a connection no longer requires that a 1246 session not be resumed. This is a change from TLS 1.0 to conform 1247 with widespread implementation practice. 1249 Either party may initiate a close by sending a close_notify alert. 1250 Any data received after a closure alert is ignored. 1252 Unless some other fatal alert has been transmitted, each party is 1253 required to send a close_notify alert before closing the write side 1254 of the connection. The other party MUST respond with a close_notify 1255 alert of its own and close down the connection immediately, 1256 discarding any pending writes. It is not required for the initiator 1257 of the close to wait for the responding close_notify alert before 1258 closing the read side of the connection. 1260 If the application protocol using TLS provides that any data may be 1261 carried over the underlying transport after the TLS connection is 1262 closed, the TLS implementation must receive the responding 1263 close_notify alert before indicating to the application layer that 1264 the TLS connection has ended. If the application protocol will not 1265 transfer any additional data, but will only close the underlying 1266 transport connection, then the implementation MAY choose to close the 1267 transport without waiting for the responding close_notify. No part of 1268 this standard should be taken to dictate the manner in which a usage 1269 profile for TLS manages its data transport, including when 1270 connections are opened or closed. 1272 Note: It is assumed that closing a connection reliably delivers 1273 pending data before destroying the transport. 1275 7.2.2. Error Alerts 1277 Error handling in the TLS Handshake protocol is very simple. When an 1278 error is detected, the detecting party sends a message to the other 1279 party. Upon transmission or receipt of a fatal alert message, both 1280 parties immediately close the connection. Servers and clients MUST 1281 forget any session-identifiers, keys, and secrets associated with a 1282 failed connection. Thus, any connection terminated with a fatal alert 1283 MUST NOT be resumed. The following error alerts are defined: 1285 unexpected_message 1286 An inappropriate message was received. This alert is always fatal 1287 and should never be observed in communication between proper 1288 implementations. 1290 bad_record_mac 1291 This alert is returned if a record is received with an incorrect 1292 MAC. This alert also MUST be returned if an alert is sent because 1293 a TLSCiphertext decrypted in an invalid way: either it wasn't an 1294 even multiple of the block length, or its padding values, when 1295 checked, weren't correct. This message is always fatal. 1297 decryption_failed_RESERVED 1298 This alert was used in some earlier versions of TLS, and may have 1299 permitted certain attacks against the CBC mode [CBCATT]. It MUST 1300 NOT be sent by compliant implementations. 1302 record_overflow 1303 A TLSCiphertext record was received that had a length more than 1304 2^14+2048 bytes, or a record decrypted to a TLSCompressed record 1305 with more than 2^14+1024 bytes. This message is always fatal. 1307 decompression_failure 1308 The decompression function received improper input (e.g., data 1309 that would expand to excessive length). This message is always 1310 fatal. 1312 handshake_failure 1313 Reception of a handshake_failure alert message indicates that the 1314 sender was unable to negotiate an acceptable set of security 1315 parameters given the options available. This is a fatal error. 1317 no_certificate_RESERVED 1318 This alert was used in SSLv3 but not any version of TLS. It MUST 1319 NOT be sent by compliant implementations. 1321 bad_certificate 1322 A certificate was corrupt, contained signatures that did not 1323 verify correctly, etc. 1325 unsupported_certificate 1326 A certificate was of an unsupported type. 1328 certificate_revoked 1329 A certificate was revoked by its signer. 1331 certificate_expired 1332 A certificate has expired or is not currently valid. 1334 certificate_unknown 1335 Some other (unspecified) issue arose in processing the 1336 certificate, rendering it unacceptable. 1338 illegal_parameter 1339 A field in the handshake was out of range or inconsistent with 1340 other fields. This is always fatal. 1342 unknown_ca 1343 A valid certificate chain or partial chain was received, but the 1344 certificate was not accepted because the CA certificate could not 1345 be located or couldn't be matched with a known, trusted CA. This 1346 message is always fatal. 1348 access_denied 1349 A valid certificate was received, but when access control was 1350 applied, the sender decided not to proceed with negotiation. 1351 This message is always fatal. 1353 decode_error 1354 A message could not be decoded because some field was out of the 1355 specified range or the length of the message was incorrect. This 1356 message is always fatal. 1358 decrypt_error 1359 A handshake cryptographic operation failed, including being 1360 unable to correctly verify a signature, decrypt a key exchange, 1361 or validate a finished message. 1363 export_restriction_RESERVED 1364 This alert was used in some earlier versions of TLS. It MUST NOT 1365 be sent by compliant implementations. 1367 protocol_version 1368 The protocol version the client has attempted to negotiate is 1369 recognized but not supported. (For example, old protocol versions 1370 might be avoided for security reasons). This message is always 1371 fatal. 1373 insufficient_security 1374 Returned instead of handshake_failure when a negotiation has 1375 failed specifically because the server requires ciphers more 1376 secure than those supported by the client. This message is always 1377 fatal. 1379 internal_error 1380 An internal error unrelated to the peer or the correctness of the 1381 protocol (such as a memory allocation failure) makes it 1382 impossible to continue. This message is always fatal. 1384 user_canceled 1385 This handshake is being canceled for some reason unrelated to a 1386 protocol failure. If the user cancels an operation after the 1387 handshake is complete, just closing the connection by sending a 1388 close_notify is more appropriate. This alert should be followed 1389 by a close_notify. This message is generally a warning. 1391 no_renegotiation 1392 Sent by the client in response to a hello request or by the 1393 server in response to a client hello after initial handshaking. 1394 Either of these would normally lead to renegotiation; when that 1395 is not appropriate, the recipient should respond with this alert. 1396 At that point, the original requester can decide whether to 1397 proceed with the connection. One case where this would be 1398 appropriate is where a server has spawned a process to satisfy a 1399 request; the process might receive security parameters (key 1400 length, authentication, etc.) at startup and it might be 1401 difficult to communicate changes to these parameters after that 1402 point. This message is always a warning. 1404 unsupported_extension 1405 sent by clients that receive an extended server hello containing 1406 an extension that they did not put in the corresponding client 1407 hello (see Section 2.3). This message is always fatal. 1409 For all errors where an alert level is not explicitly specified, the 1410 sending party MAY determine at its discretion whether this is a fatal 1411 error or not; if an alert with a level of warning is received, the 1412 receiving party MAY decide at its discretion whether to treat this as 1413 a fatal error or not. However, all messages which are transmitted 1414 with a level of fatal MUST be treated as fatal messages. 1416 New Alert values are assigned by IANA as described in Section 11. 1418 7.3. Handshake Protocol Overview 1420 The cryptographic parameters of the session state are produced by the 1421 TLS Handshake Protocol, which operates on top of the TLS Record 1422 Layer. When a TLS client and server first start communicating, they 1423 agree on a protocol version, select cryptographic algorithms, 1424 optionally authenticate each other, and use public-key encryption 1425 techniques to generate shared secrets. 1427 The TLS Handshake Protocol involves the following steps: 1429 - Exchange hello messages to agree on algorithms, exchange random 1430 values, and check for session resumption. 1432 - Exchange the necessary cryptographic parameters to allow the 1433 client and server to agree on a premaster secret. 1435 - Exchange certificates and cryptographic information to allow the 1436 client and server to authenticate themselves. 1438 - Generate a master secret from the premaster secret and exchanged 1439 random values. 1441 - Provide security parameters to the record layer. 1443 - Allow the client and server to verify that their peer has 1444 calculated the same security parameters and that the handshake 1445 occurred without tampering by an attacker. 1447 Note that higher layers should not be overly reliant on whether TLS 1448 always negotiates the strongest possible connection between two 1449 peers. There are a number of ways in which a man in the middle 1450 attacker can attempt to make two entities drop down to the least 1451 secure method they support. The protocol has been designed to 1452 minimize this risk, but there are still attacks available: for 1453 example, an attacker could block access to the port a secure service 1454 runs on, or attempt to get the peers to negotiate an unauthenticated 1455 connection. The fundamental rule is that higher levels must be 1456 cognizant of what their security requirements are and never transmit 1457 information over a channel less secure than what they require. The 1458 TLS protocol is secure in that any cipher suite offers its promised 1459 level of security: if you negotiate 3DES with a 1024 bit RSA key 1460 exchange with a host whose certificate you have verified, you can 1461 expect to be that secure. 1463 These goals are achieved by the handshake protocol, which can be 1464 summarized as follows: The client sends a client hello message to 1465 which the server must respond with a server hello message, or else a 1466 fatal error will occur and the connection will fail. The client hello 1467 and server hello are used to establish security enhancement 1468 capabilities between client and server. The client hello and server 1469 hello establish the following attributes: Protocol Version, Session 1470 ID, Cipher Suite, and Compression Method. Additionally, two random 1471 values are generated and exchanged: ClientHello.random and 1472 ServerHello.random. 1474 The actual key exchange uses up to four messages: the server 1475 certificate, the server key exchange, the client certificate, and the 1476 client key exchange. New key exchange methods can be created by 1477 specifying a format for these messages and by defining the use of the 1478 messages to allow the client and server to agree upon a shared 1479 secret. This secret MUST be quite long; currently defined key 1480 exchange methods exchange secrets that range from 48 to 128 bytes in 1481 length. 1483 Following the hello messages, the server will send its certificate, 1484 if it is to be authenticated. Additionally, a server key exchange 1485 message may be sent, if it is required (e.g., if their server has no 1486 certificate, or if its certificate is for signing only). If the 1487 server is authenticated, it may request a certificate from the 1488 client, if that is appropriate to the cipher suite selected. Next, 1489 the server will send the server hello done message, indicating that 1490 the hello-message phase of the handshake is complete. The server will 1491 then wait for a client response. If the server has sent a certificate 1492 request message, the client must send the certificate message. The 1493 client key exchange message is now sent, and the content of that 1494 message will depend on the public key algorithm selected between the 1495 client hello and the server hello. If the client has sent a 1496 certificate with signing ability, a digitally-signed certificate 1497 verify message is sent to explicitly verify possession of the private 1498 key in the certificate. 1500 At this point, a change cipher spec message is sent by the client, 1501 and the client copies the pending Cipher Spec into the current Cipher 1502 Spec. The client then immediately sends the finished message under 1503 the new algorithms, keys, and secrets. In response, the server will 1504 send its own change cipher spec message, transfer the pending to the 1505 current Cipher Spec, and send its finished message under the new 1506 Cipher Spec. At this point, the handshake is complete, and the client 1507 and server may begin to exchange application layer data. (See flow 1508 chart below.) Application data MUST NOT be sent prior to the 1509 completion of the first handshake (before a cipher suite other 1510 TLS_NULL_WITH_NULL_NULL is established). 1512 Client Server 1514 ClientHello --------> 1515 ServerHello 1516 Certificate* 1517 CertificateStatus* 1518 ServerKeyExchange* 1519 CertificateRequest* 1520 <-------- ServerHelloDone 1521 Certificate* 1522 CertificateURL* 1523 ClientKeyExchange 1524 CertificateVerify* 1525 [ChangeCipherSpec] 1526 Finished --------> 1527 [ChangeCipherSpec] 1528 <-------- Finished 1529 Application Data <-------> Application Data 1531 Fig. 1. Message flow for a full handshake 1533 * Indicates optional or situation-dependent messages that are not 1534 always sent. 1536 Note: To help avoid pipeline stalls, ChangeCipherSpec is an 1537 independent TLS Protocol content type, and is not actually a TLS 1538 handshake message. 1540 When the client and server decide to resume a previous session or 1541 duplicate an existing session (instead of negotiating new security 1542 parameters), the message flow is as follows: 1544 The client sends a ClientHello using the Session ID of the session to 1545 be resumed. The server then checks its session cache for a match. If 1546 a match is found, and the server is willing to re-establish the 1547 connection under the specified session state, it will send a 1548 ServerHello with the same Session ID value. At this point, both 1549 client and server MUST send change cipher spec messages and proceed 1550 directly to finished messages. Once the re-establishment is complete, 1551 the client and server MAY begin to exchange application layer data. 1552 (See flow chart below.) If a Session ID match is not found, the 1553 server generates a new session ID and the TLS client and server 1554 perform a full handshake. 1556 Client Server 1558 ClientHello --------> 1559 ServerHello 1560 [ChangeCipherSpec] 1561 <-------- Finished 1562 [ChangeCipherSpec] 1563 Finished --------> 1564 Application Data <-------> Application Data 1566 Fig. 2. Message flow for an abbreviated handshake 1568 The contents and significance of each message will be presented in 1569 detail in the following sections. 1571 7.4. Handshake Protocol 1573 The TLS Handshake Protocol is one of the defined higher-level clients 1574 of the TLS Record Protocol. This protocol is used to negotiate the 1575 secure attributes of a session. Handshake messages are supplied to 1576 the TLS Record Layer, where they are encapsulated within one or more 1577 TLSPlaintext structures, which are processed and transmitted as 1578 specified by the current active session state. 1580 enum { 1581 hello_request(0), client_hello(1), server_hello(2), 1582 certificate(11), server_key_exchange (12), 1583 certificate_request(13), server_hello_done(14), 1584 certificate_verify(15), client_key_exchange(16), 1585 finished(20) 1586 (255) 1587 } HandshakeType; 1589 struct { 1590 HandshakeType msg_type; /* handshake type */ 1591 uint24 length; /* bytes in message */ 1592 select (HandshakeType) { 1593 case hello_request: HelloRequest; 1594 case client_hello: ClientHello; 1595 case server_hello: ServerHello; 1596 case certificate: Certificate; 1597 case server_key_exchange: ServerKeyExchange; 1598 case certificate_request: CertificateRequest; 1599 case server_hello_done: ServerHelloDone; 1600 case certificate_verify: CertificateVerify; 1601 case client_key_exchange: ClientKeyExchange; 1602 case finished: Finished; 1603 } body; 1604 } Handshake; 1606 The handshake protocol messages are presented below in the order they 1607 MUST be sent; sending handshake messages in an unexpected order 1608 results in a fatal error. Unneeded handshake messages can be omitted, 1609 however. Note one exception to the ordering: the Certificate message 1610 is used twice in the handshake (from server to client, then from 1611 client to server), but described only in its first position. The one 1612 message that is not bound by these ordering rules is the Hello 1613 Request message, which can be sent at any time, but which should be 1614 ignored by the client if it arrives in the middle of a handshake. 1616 New Handshake message types are assigned by IANA as described in 1617 Section 11. 1619 7.4.1. Hello Messages 1621 The hello phase messages are used to exchange security enhancement 1622 capabilities between the client and server. When a new session 1623 begins, the Record Layer's connection state encryption, hash, and 1624 compression algorithms are initialized to null. The current 1625 connection state is used for renegotiation messages. 1627 7.4.1.1. Hello Request 1629 When this message will be sent: 1630 The hello request message MAY be sent by the server at any time. 1632 Meaning of this message: 1633 Hello request is a simple notification that the client should 1634 begin the negotiation process anew by sending a client hello 1635 message when convenient. This message is not intended to 1636 establish which side is the client or server but merely to 1637 initiate a new negotiation. Servers SHOULD not send a 1638 HelloRequest immediately upon the client's initial connection. 1639 It is the client's job to send a ClientHello at that time. 1641 This message will be ignored by the client if the client is 1642 currently negotiating a session. This message may be ignored by 1643 the client if it does not wish to renegotiate a session, or the 1644 client may, if it wishes, respond with a no_renegotiation alert. 1645 Since handshake messages are intended to have transmission 1646 precedence over application data, it is expected that the 1647 negotiation will begin before no more than a few records are 1648 received from the client. If the server sends a hello request but 1649 does not receive a client hello in response, it may close the 1650 connection with a fatal alert. 1652 After sending a hello request, servers SHOULD not repeat the request 1653 until the subsequent handshake negotiation is complete. 1655 Structure of this message: 1656 struct { } HelloRequest; 1658 Note: This message MUST NOT be included in the message hashes that are 1659 maintained throughout the handshake and used in the finished 1660 messages and the certificate verify message. 1662 7.4.1.2. Client Hello 1664 When this message will be sent: 1665 When a client first connects to a server it is required to send 1666 the client hello as its first message. The client can also send a 1667 client hello in response to a hello request or on its own 1668 initiative in order to renegotiate the security parameters in an 1669 existing connection. 1671 Structure of this message: 1672 The client hello message includes a random structure, which is 1673 used later in the protocol. 1675 struct { 1676 uint32 gmt_unix_time; 1677 opaque random_bytes[28]; 1678 } Random; 1680 gmt_unix_time 1681 The current time and date in standard UNIX 32-bit format (seconds 1682 since the midnight starting Jan 1, 1970, GMT, ignoring leap 1683 seconds) according to the sender's internal clock. Clocks are not 1684 required to be set correctly by the basic TLS Protocol; higher- 1685 level or application protocols may define additional 1686 requirements. 1688 random_bytes 1689 28 bytes generated by a secure random number generator. 1691 The client hello message includes a variable-length session 1692 identifier. If not empty, the value identifies a session between the 1693 same client and server whose security parameters the client wishes to 1694 reuse. The session identifier MAY be from an earlier connection, this 1695 connection, or from another currently active connection. The second 1696 option is useful if the client only wishes to update the random 1697 structures and derived values of a connection, and the third option 1698 makes it possible to establish several independent secure connections 1699 without repeating the full handshake protocol. These independent 1700 connections may occur sequentially or simultaneously; a SessionID 1701 becomes valid when the handshake negotiating it completes with the 1702 exchange of Finished messages and persists until it is removed due to 1703 aging or because a fatal error was encountered on a connection 1704 associated with the session. The actual contents of the SessionID are 1705 defined by the server. 1707 opaque SessionID<0..32>; 1709 Warning: 1710 Because the SessionID is transmitted without encryption or 1711 immediate MAC protection, servers MUST not place confidential 1712 information in session identifiers or let the contents of fake 1713 session identifiers cause any breach of security. (Note that the 1714 content of the handshake as a whole, including the SessionID, is 1715 protected by the Finished messages exchanged at the end of the 1716 handshake.) 1718 The CipherSuite list, passed from the client to the server in the 1719 client hello message, contains the combinations of cryptographic 1720 algorithms supported by the client in order of the client's 1721 preference (favorite choice first). Each CipherSuite defines a key 1722 exchange algorithm, a bulk encryption algorithm (including secret key 1723 length), a MAC algorithm, and a PRF. The server will select a cipher 1724 suite or, if no acceptable choices are presented, return a handshake 1725 failure alert and close the connection. 1727 uint8 CipherSuite[2]; /* Cryptographic suite selector */ 1729 The client hello includes a list of compression algorithms supported 1730 by the client, ordered according to the client's preference. 1732 enum { null(0), (255) } CompressionMethod; 1734 struct { 1735 ProtocolVersion client_version; 1736 Random random; 1737 SessionID session_id; 1738 CipherSuite cipher_suites<2..2^16-1>; 1739 CompressionMethod compression_methods<1..2^8-1>; 1740 select (extensions_present) { 1741 case false: 1742 struct {}; 1743 case true: 1744 Extension extensions<0..2^16-1>; 1745 } 1746 } ClientHello; 1748 TLS allows extensions to follow the compression_methods field in an 1749 extensions block. The presence of extensions can be detected by 1750 determining whether there are bytes following the compression_methods 1751 at the end of the ClientHello. Note that this method of detecting 1752 optional data differs from the normal TLS method of having a 1753 variable-length field but is used for compatibility with TLS before 1754 extensions were defined. 1756 client_version 1757 The version of the TLS protocol by which the client wishes to 1758 communicate during this session. This SHOULD be the latest 1759 (highest valued) version supported by the client. For this 1760 version of the specification, the version will be 3.3 (See 1761 Appendix E for details about backward compatibility). 1763 random 1764 A client-generated random structure. 1766 session_id 1767 The ID of a session the client wishes to use for this connection. 1768 This field should be empty if no session_id is available, or it 1769 the client wishes to generate new security parameters. 1771 cipher_suites 1772 This is a list of the cryptographic options supported by the 1773 client, with the client's first preference first. If the 1774 session_id field is not empty (implying a session resumption 1775 request) this vector MUST include at least the cipher_suite from 1776 that session. Values are defined in Appendix A.5. 1778 compression_methods 1779 This is a list of the compression methods supported by the 1780 client, sorted by client preference. If the session_id field is 1781 not empty (implying a session resumption request) it MUST include 1782 the compression_method from that session. This vector MUST 1783 contain, and all implementations MUST support, 1784 CompressionMethod.null. Thus, a client and server will always be 1785 able to agree on a compression method. 1787 client_hello_extension_list 1788 Clients MAY request extended functionality from servers by 1789 sending data in the client_hello_extension_list. Here the new 1790 "client_hello_extension_list" field contains a list of 1791 extensions. The actual "Extension" format is defined in Section 1792 7.4.1.4. 1794 In the event that a client requests additional functionality using 1795 extensions, and this functionality is not supplied by the server, the 1796 client MAY abort the handshake. A server that supports the 1797 extensions mechanism MUST accept only client hello messages in either 1798 the original (TLS 1.0/TLS 1.1) ClientHello or the extended 1799 ClientHello format defined in this document, and (as for all other 1800 messages) MUST check that the amount of data in the message precisely 1801 matches one of these formats; if not then it MUST send a fatal 1802 "decode_error" alert. 1804 After sending the client hello message, the client waits for a server 1805 hello message. Any other handshake message returned by the server 1806 except for a hello request is treated as a fatal error. 1808 7.4.1.3. Server Hello 1810 When this message will be sent: 1811 The server will send this message in response to a client hello 1812 message when it was able to find an acceptable set of algorithms. 1813 If it cannot find such a match, it will respond with a handshake 1814 failure alert. 1816 Structure of this message: 1817 struct { 1818 ProtocolVersion server_version; 1819 Random random; 1820 SessionID session_id; 1821 CipherSuite cipher_suite; 1822 CompressionMethod compression_method; 1823 select (extensions_present) { 1824 case false: 1825 struct {}; 1826 case true: 1827 Extension extensions<0..2^16-1>; 1828 } 1829 } ServerHello; 1831 The presence of extensions can be detected by determining whether 1832 there are bytes following the compression_method field at the end of 1833 the ServerHello. 1835 server_version 1836 This field will contain the lower of that suggested by the client 1837 in the client hello and the highest supported by the server. For 1838 this version of the specification, the version is 3.2. (See 1839 Appendix E for details about backward compatibility.) 1840 random 1841 This structure is generated by the server and MUST be 1842 independently generated from the ClientHello.random. 1844 session_id 1845 This is the identity of the session corresponding to this 1846 connection. If the ClientHello.session_id was non-empty, the 1847 server will look in its session cache for a match. If a match is 1848 found and the server is willing to establish the new connection 1849 using the specified session state, the server will respond with 1850 the same value as was supplied by the client. This indicates a 1851 resumed session and dictates that the parties must proceed 1852 directly to the finished messages. Otherwise this field will 1853 contain a different value identifying the new session. The server 1854 may return an empty session_id to indicate that the session will 1855 not be cached and therefore cannot be resumed. If a session is 1856 resumed, it must be resumed using the same cipher suite it was 1857 originally negotiated with. Note that there is no requirement 1858 that the server resume any session even if it had formerly 1859 provided a session_id. Client MUST be prepared to do a full 1860 negotiation -- including negotiating new cipher suites -- during 1861 any handshake. 1863 cipher_suite 1864 The single cipher suite selected by the server from the list in 1865 ClientHello.cipher_suites. For resumed sessions, this field is 1866 the value from the state of the session being resumed. 1868 compression_method 1869 The single compression algorithm selected by the server from the 1870 list in ClientHello.compression_methods. For resumed sessions 1871 this field is the value from the resumed session state. 1873 server_hello_extension_list 1874 A list of extensions. Note that only extensions offered by the 1875 client can appear in the server's list. 1877 7.4.1.4 Hello Extensions 1879 The extension format is: 1881 struct { 1882 ExtensionType extension_type; 1883 opaque extension_data<0..2^16-1>; 1884 } Extension; 1886 enum { 1887 cert_hash_types(TBD-BY-IANA), (65535) 1888 } ExtensionType; 1890 Here: 1892 - "extension_type" identifies the particular extension type. 1894 - "extension_data" contains information specific to the particular 1895 extension type. 1897 The list of extension types, as defined in Section 2.3, is maintained 1898 by the Internet Assigned Numbers Authority (IANA). Thus an 1899 application needs to be made to the IANA in order to obtain a new 1900 extension type value. Since there are subtle (and not so subtle) 1901 interactions that may occur in this protocol between new features and 1902 existing features which may result in a significant reduction in 1903 overall security, new values SHALL be defined only through the IETF 1904 Consensus process specified in [IANA]. (This means that new 1905 assignments can be made only via RFCs approved by the IESG.) The 1906 initial set of extensions is defined in a companion document [TBD]. 1908 The following considerations should be taken into account when 1909 designing new extensions: 1911 - Some cases where a server does not agree to an extension are 1912 error 1913 conditions, and some simply a refusal to support a particular 1914 feature. In general error alerts should be used for the former, 1915 and a field in the server extension response for the latter. 1917 - Extensions should as far as possible be designed to prevent any 1918 attack that forces use (or non-use) of a particular feature by 1919 manipulation of handshake messages. This principle should be 1920 followed regardless of whether the feature is believed to cause a 1921 security problem. 1923 Often the fact that the extension fields are included in the 1924 inputs to the Finished message hashes will be sufficient, but 1925 extreme care is needed when the extension changes the meaning of 1926 messages sent in the handshake phase. Designers and implementors 1927 should be aware of the fact that until the handshake has been 1928 authenticated, active attackers can modify messages and insert, 1929 remove, or replace extensions. 1931 - It would be technically possible to use extensions to change 1932 major aspects of the design of TLS; for example the design of 1933 cipher suite negotiation. This is not recommended; it would be 1934 more appropriate to define a new version of TLS - particularly 1935 since the TLS handshake algorithms have specific protection 1936 against version rollback attacks based on the version number, and 1937 the possibility of version rollback should be a significant 1938 consideration in any major design change. 1940 7.4.1.4.1 Cert Hash Types 1942 The client MAY use the "cert_hash_types" to indicate to the 1943 server which hash functions may be used in the signature on the 1944 server's certificate. The "extension_data" field of this 1945 extension contains: 1947 enum{ 1948 md5(0), sha1(1), sha256(2), sha384(3), sha512(4), (255) 1949 } HashType; 1951 struct { 1952 HashType types<255>; 1953 } CertHashTypes; 1955 These values indicate support for MD5 [MD5], SHA-1, SHA-256, SHA-384, 1956 and SHA-512 [SHA] respectively. The server MUST NOT send this 1957 extension. 1959 Clients SHOULD send this extension if they support any algorithm 1960 other than SHA-1. If this extension is not used, servers SHOULD 1961 assume that the client supports only SHA-1. Note: this is a change 1962 from TLS 1.1 where there are no explicit rules but as a practical 1963 matter one can assume that the peer supports MD5 and SHA-1. 1965 7.4.2. Server Certificate 1967 When this message will be sent: 1968 The server MUST send a certificate whenever the agreed-upon key 1969 exchange method uses certificates for authentication (this 1970 includes all key exchange methods defined in this document except 1971 DH_anon). This message will always immediately follow the server 1972 hello message. 1974 Meaning of this message: 1975 The certificate type MUST be appropriate for the selected cipher 1976 suite's key exchange algorithm, and is generally an X.509v3 1977 certificate. It MUST contain a key that matches the key exchange 1978 method, as follows. Unless otherwise specified, the signing 1979 algorithm for the certificate MUST be the same as the algorithm 1980 for the certificate key. Unless otherwise specified, the public 1981 key MAY be of any length. 1983 Key Exchange Algorithm Certificate Key Type 1985 RSA RSA public key; the certificate MUST 1986 allow the key to be used for encryption. 1988 DHE_DSS DSS public key. 1990 DHE_RSA RSA public key that can be used for 1991 signing. 1993 DH_DSS Diffie-Hellman key. The algorithm used 1994 to sign the certificate MUST be DSS. 1996 DH_RSA Diffie-Hellman key. The algorithm used 1997 to sign the certificate MUST be RSA. 1999 All certificate profiles, and key and cryptographic formats are 2000 defined by the IETF PKIX working group [PKIX]. When a key usage 2001 extension is present, the digitalSignature bit MUST be set for the 2002 key to be eligible for signing, as described above, and the 2003 keyEncipherment bit MUST be present to allow encryption, as described 2004 above. The keyAgreement bit must be set on Diffie-Hellman 2005 certificates. 2007 As CipherSuites that specify new key exchange methods are specified 2008 for the TLS Protocol, they will imply certificate format and the 2009 required encoded keying information. 2011 Structure of this message: 2012 opaque ASN.1Cert<1..2^24-1>; 2014 struct { 2015 ASN.1Cert certificate_list<0..2^24-1>; 2016 } Certificate; 2018 certificate_list 2019 This is a sequence (chain) of X.509v3 certificates. The sender's 2020 certificate must come first in the list. Each following 2021 certificate must directly certify the one preceding it. Because 2022 certificate validation requires that root keys be distributed 2023 independently, the self-signed certificate that specifies the 2024 root certificate authority may optionally be omitted from the 2025 chain, under the assumption that the remote end must already 2026 possess it in order to validate it in any case. 2028 The same message type and structure will be used for the client's 2029 response to a certificate request message. Note that a client MAY 2030 send no certificates if it does not have an appropriate certificate 2031 to send in response to the server's authentication request. 2033 Note: PKCS #7 [PKCS7] is not used as the format for the certificate 2034 vector because PKCS #6 [PKCS6] extended certificates are not 2035 used. Also, PKCS #7 defines a SET rather than a SEQUENCE, making 2036 the task of parsing the list more difficult. 2038 7.4.3. Server Key Exchange Message 2040 When this message will be sent: 2041 This message will be sent immediately after the server 2042 certificate message (or the server hello message, if this is an 2043 anonymous negotiation). 2045 The server key exchange message is sent by the server only when 2046 the server certificate message (if sent) does not contain enough 2047 data to allow the client to exchange a premaster secret. This is 2048 true for the following key exchange methods: 2050 DHE_DSS 2051 DHE_RSA 2052 DH_anon 2054 It is not legal to send the server key exchange message for the 2055 following key exchange methods: 2057 RSA 2058 DH_DSS 2059 DH_RSA 2061 Meaning of this message: 2062 This message conveys cryptographic information to allow the 2063 client to communicate the premaster secret: a Diffie-Hellman 2064 public key with which the client can complete a key exchange 2065 (with the result being the premaster secret) or a public key for 2066 some other algorithm. 2068 As additional CipherSuites are defined for TLS that include new key 2069 exchange algorithms, the server key exchange message will be sent if 2070 and only if the certificate type associated with the key exchange 2071 algorithm does not provide enough information for the client to 2072 exchange a premaster secret. 2074 If the SignatureAlgorithm being used to sign the ServerKeyExchange 2075 message is DSA, the hash function used MUST be SHA-1. If the 2076 SignatureAlgorithm it must be the same hash function used in the 2077 signature of the server's certificate (found in the Certificate) 2078 message. This algorithm is denoted Hash below. Hash.length is the 2079 length of the output of that algorithm. 2081 Structure of this message: 2082 enum { diffie_hellman } KeyExchangeAlgorithm; 2084 struct { 2085 opaque dh_p<1..2^16-1>; 2086 opaque dh_g<1..2^16-1>; 2087 opaque dh_Ys<1..2^16-1>; 2088 } ServerDHParams; /* Ephemeral DH parameters */ 2090 dh_p 2091 The prime modulus used for the Diffie-Hellman operation. 2093 dh_g 2094 The generator used for the Diffie-Hellman operation. 2096 dh_Ys 2097 The server's Diffie-Hellman public value (g^X mod p). 2099 struct { 2100 select (KeyExchangeAlgorithm) { 2101 case diffie_hellman: 2102 ServerDHParams params; 2103 Signature signed_params; 2104 }; 2105 } ServerKeyExchange; 2107 struct { 2108 select (KeyExchangeAlgorithm) { 2109 case diffie_hellman: 2110 ServerDHParams params; 2111 }; 2112 } ServerParams; 2114 params 2115 The server's key exchange parameters. 2117 signed_params 2118 For non-anonymous key exchanges, a hash of the corresponding 2119 params value, with the signature appropriate to that hash 2120 applied. 2122 hash 2123 Hash(ClientHello.random + ServerHello.random + ServerParams) 2125 sha_hash 2126 SHA1(ClientHello.random + ServerHello.random + ServerParams) 2127 enum { anonymous, rsa, dsa } SignatureAlgorithm; 2129 struct { 2130 select (SignatureAlgorithm) { 2131 case anonymous: struct { }; 2132 case rsa: 2133 digitally-signed struct { 2134 opaque hash[Hash.length]; 2135 }; 2136 case dsa: 2137 digitally-signed struct { 2138 opaque sha_hash[20]; 2139 }; 2140 }; 2141 }; 2142 } Signature; 2144 7.4.4. Certificate Request 2146 When this message will be sent: 2147 A non-anonymous server can optionally request a certificate from 2148 the client, if appropriate for the selected cipher suite. This 2149 message, if sent, will immediately follow the Server Key Exchange 2150 message (if it is sent; otherwise, the Server Certificate 2151 message). 2153 Structure of this message: 2154 enum { 2155 rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), 2156 rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), 2157 fortezza_dms_RESERVED(20), 2158 (255) 2159 } ClientCertificateType; 2161 opaque DistinguishedName<1..2^16-1>; 2163 struct { 2164 ClientCertificateType certificate_types<1..2^8-1>; 2165 HashType certificate_hash<1..2^8-1>; 2166 DistinguishedName certificate_authorities<0..2^16-1>; 2167 } CertificateRequest; 2169 certificate_types 2170 This field is a list of the types of certificates requested, 2171 sorted in order of the server's preference. 2173 certificate_types 2174 A list of the types of certificate types which the client may 2175 offer. 2176 rsa_sign a certificate containing an RSA key 2177 dss_sign a certificate containing a DSS key 2178 rsa_fixed_dh a certificate signed with RSA and containing 2179 a static DH key. 2180 dss_fixed_dh a certificate signed with DSS and containing 2181 a static DH key 2183 Certificate types rsa_sign and dss_sign SHOULD contain 2184 certificates signed with the same algorithm. However, this is 2185 not required. This is a holdover from TLS 1.0 and 1.1. 2187 certificate_hash 2188 A list of acceptable hash algorithms to be used in 2189 certificate signatures. 2191 certificate_authorities 2192 A list of the distinguished names of acceptable certificate 2193 authorities. These distinguished names may specify a desired 2194 distinguished name for a root CA or for a subordinate CA; 2195 thus, this message can be used both to describe known roots 2196 and a desired authorization space. If the 2197 certificate_authorities list is empty then the client MAY 2198 send any certificate of the appropriate 2199 ClientCertificateType, unless there is some external 2200 arrangement to the contrary. 2202 New ClientCertificateType values are assigned by IANA as described in 2203 Section 11. 2205 Note: Values listed as RESERVED may not be used. They were 2206 used in SSLv3. 2208 Note: DistinguishedName is derived from [X501]. DistinguishedNames are 2209 represented in DER-encoded format. 2211 Note: It is a fatal handshake_failure alert for an anonymous server to 2212 request client authentication. 2214 7.4.5 Server hello done 2216 When this message will be sent: 2217 The server hello done message is sent by the server to indicate 2218 the end of the server hello and associated messages. After 2219 sending this message, the server will wait for a client response. 2221 Meaning of this message: 2222 This message means that the server is done sending messages to 2223 support the key exchange, and the client can proceed with its 2224 phase of the key exchange. 2226 Upon receipt of the server hello done message, the client SHOULD 2227 verify that the server provided a valid certificate, if required 2228 and check that the server hello parameters are acceptable. 2230 Structure of this message: 2231 struct { } ServerHelloDone; 2233 7.4.6. Client Certificate 2235 When this message will be sent: 2236 This is the first message the client can send after receiving a 2237 server hello done message. This message is only sent if the 2238 server requests a certificate. If no suitable certificate is 2239 available, the client SHOULD send a certificate message 2240 containing no certificates. That is, the certificate_list 2241 structure has a length of zero. If client authentication is 2242 required by the server for the handshake to continue, it may 2243 respond with a fatal handshake failure alert. Client certificates 2244 are sent using the Certificate structure defined in Section 2245 7.4.2. 2247 Note: When using a static Diffie-Hellman based key exchange method 2248 (DH_DSS or DH_RSA), if client authentication is requested, the 2249 Diffie-Hellman group and generator encoded in the client's 2250 certificate MUST match the server specified Diffie-Hellman 2251 parameters if the client's parameters are to be used for the key 2252 exchange. 2254 7.4.7. Client Key Exchange Message 2256 When this message will be sent: 2257 This message is always sent by the client. It MUST immediately 2258 follow the client certificate message, if it is sent. Otherwise 2259 it MUST be the first message sent by the client after it receives 2260 the server hello done message. 2262 Meaning of this message: 2263 With this message, the premaster secret is set, either though 2264 direct transmission of the RSA-encrypted secret, or by the 2265 transmission of Diffie-Hellman parameters that will allow each 2266 side to agree upon the same premaster secret. When the key 2267 exchange method is DH_RSA or DH_DSS, client certification has 2268 been requested, and the client was able to respond with a 2269 certificate that contained a Diffie-Hellman public key whose 2270 parameters (group and generator) matched those specified by the 2271 server in its certificate, this message MUST not contain any 2272 data. 2274 Structure of this message: 2275 The choice of messages depends on which key exchange method has 2276 been selected. See Section 7.4.3 for the KeyExchangeAlgorithm 2277 definition. 2279 struct { 2280 select (KeyExchangeAlgorithm) { 2281 case rsa: EncryptedPreMasterSecret; 2282 case diffie_hellman: ClientDiffieHellmanPublic; 2283 } exchange_keys; 2284 } ClientKeyExchange; 2286 7.4.7.1. RSA Encrypted Premaster Secret Message 2288 Meaning of this message: 2289 If RSA is being used for key agreement and authentication, the 2290 client generates a 48-byte premaster secret, encrypts it using 2291 the public key from the server's certificate and sends the result 2292 in an encrypted premaster secret message. This structure is a 2293 variant of the client key exchange message and is not a message 2294 in itself. 2296 Structure of this message: 2297 struct { 2298 ProtocolVersion client_version; 2299 opaque random[46]; 2300 } PreMasterSecret; 2302 client_version 2303 The latest (newest) version supported by the client. This is 2304 used to detect version roll-back attacks. Upon receiving the 2305 premaster secret, the server SHOULD check that this value 2306 matches the value transmitted by the client in the client 2307 hello message. 2309 random 2310 46 securely-generated random bytes. 2312 struct { 2313 public-key-encrypted PreMasterSecret pre_master_secret; 2314 } EncryptedPreMasterSecret; 2316 pre_master_secret 2317 This random value is generated by the client and is used to 2318 generate the master secret, as specified in Section 8.1. 2320 An attack discovered by Daniel Bleichenbacher [BLEI] can be used to 2321 attack a TLS server which is using PKCS#1 v 1.5 encoded RSA. The 2322 attack takes advantage of the fact that by failing in different ways, 2323 a TLS server can be coerced into revealing whether a particular 2324 message, when decrypted, is properly PKCS#1 v1.5 formatted or not. 2326 In order to avoid this vulnerability, implementations MUST treat 2327 incorrectly formatted messages in a manner indistinguishable from 2328 correctly formatted RSA blocks. Thus, when it receives an incorrectly 2329 formatted RSA block, a server should generate a random 48-byte value 2330 and proceed using it as the premaster secret. Thus, the server will 2331 act identically whether the received RSA block is correctly encoded 2332 or not. 2334 [PKCS1B] defines a newer version of PKCS#1 encoding that is more 2335 secure against the Bleichenbacher attack. However, for maximal 2336 compatibility with TLS 1.0, TLS 1.1 retains the original encoding. No 2337 variants of the Bleichenbacher attack are known to exist provided 2338 that the above recommendations are followed. 2340 Implementation Note: Public-key-encrypted data is represented as an 2341 opaque vector <0..2^16-1> (see Section 4.7). Thus, the RSA-encrypted 2342 PreMasterSecret in a ClientKeyExchange is preceded by two length 2343 bytes. These bytes are redundant in the case of RSA because the 2344 EncryptedPreMasterSecret is the only data in the ClientKeyExchange 2345 and its length can therefore be unambiguously determined. The SSLv3 2346 specification was not clear about the encoding of public-key- 2347 encrypted data, and therefore many SSLv3 implementations do not 2348 include the the length bytes, encoding the RSA encrypted data 2349 directly in the ClientKeyExchange message. 2351 This specification requires correct encoding of the 2352 EncryptedPreMasterSecret complete with length bytes. The resulting 2353 PDU is incompatible with many SSLv3 implementations. Implementors 2354 upgrading from SSLv3 MUST modify their implementations to generate 2355 and accept the correct encoding. Implementors who wish to be 2356 compatible with both SSLv3 and TLS should make their implementation's 2357 behavior dependent on the protocol version. 2359 Implementation Note: It is now known that remote timing-based attacks 2360 on SSL are possible, at least when the client and server are on the 2361 same LAN. Accordingly, implementations that use static RSA keys MUST 2362 use RSA blinding or some other anti-timing technique, as described in 2363 [TIMING]. 2365 Note: The version number in the PreMasterSecret MUST be the version 2366 offered by the client in the ClientHello.version, not the version 2367 negotiated for the connection. This feature is designed to prevent 2368 rollback attacks. Unfortunately, many implementations use the 2369 negotiated version instead and therefore checking the version number 2370 may lead to failure to interoperate with such incorrect client 2371 implementations. Client implementations MUST and Server 2372 implementations MAY check the version number. In practice, since the 2373 TLS handshake MACs prevent downgrade and no good attacks are known on 2374 those MACs, ambiguity is not considered a serious security risk. 2375 Note that if servers choose to to check the version number, they MUST 2376 randomize the PreMasterSecret in case of error, rather than generate 2377 an alert, in order to avoid variants on the Bleichenbacher attack. 2378 [KPR03] 2380 7.4.7.1. Client Diffie-Hellman Public Value 2382 Meaning of this message: 2383 This structure conveys the client's Diffie-Hellman public value 2384 (Yc) if it was not already included in the client's certificate. 2385 The encoding used for Yc is determined by the enumerated 2386 PublicValueEncoding. This structure is a variant of the client 2387 key exchange message, and not a message in itself. 2389 Structure of this message: 2390 enum { implicit, explicit } PublicValueEncoding; 2392 implicit 2393 If the client certificate already contains a suitable Diffie- 2394 Hellman key, then Yc is implicit and does not need to be sent 2395 again. In this case, the client key exchange message will be 2396 sent, but it MUST be empty. 2398 explicit 2399 Yc needs to be sent. 2401 struct { 2402 select (PublicValueEncoding) { 2403 case implicit: struct { }; 2404 case explicit: opaque dh_Yc<1..2^16-1>; 2405 } dh_public; 2406 } ClientDiffieHellmanPublic; 2408 dh_Yc 2409 The client's Diffie-Hellman public value (Yc). 2411 7.4.8. Certificate verify 2413 When this message will be sent: 2414 This message is used to provide explicit verification of a client 2415 certificate. This message is only sent following a client 2416 certificate that has signing capability (i.e. all certificates 2417 except those containing fixed Diffie-Hellman parameters). When 2418 sent, it MUST immediately follow the client key exchange message. 2420 Structure of this message: 2421 struct { 2422 Signature signature; 2423 } CertificateVerify; 2425 The Signature type is defined in 7.4.3. If the SignatureAlgorithm 2426 is DSA, then the sha_hash value must be used. If it is RSA, 2427 the same function (denoted Hash) must be used as was used to 2428 create the signature for the client's certificate. 2430 CertificateVerify.signature.hash 2431 Hash(handshake_messages); 2433 CertificateVerify.signature.sha_hash 2434 SHA(handshake_messages); 2436 Here handshake_messages refers to all handshake messages sent or 2437 received starting at client hello up to but not including this 2438 message, including the type and length fields of the handshake 2439 messages. This is the concatenation of all the Handshake structures 2440 as defined in 7.4 exchanged thus far. 2442 7.4.9. Finished 2444 When this message will be sent: 2445 A finished message is always sent immediately after a change 2446 cipher spec message to verify that the key exchange and 2447 authentication processes were successful. It is essential that a 2448 change cipher spec message be received between the other 2449 handshake messages and the Finished message. 2451 Meaning of this message: 2452 The finished message is the first protected with the just- 2453 negotiated algorithms, keys, and secrets. Recipients of finished 2454 messages MUST verify that the contents are correct. Once a side 2455 has sent its Finished message and received and validated the 2456 Finished message from its peer, it may begin to send and receive 2457 application data over the connection. 2459 struct { 2460 opaque verify_data[12]; 2461 } Finished; 2463 verify_data 2464 PRF(master_secret, finished_label, Hash(handshake_messages))[0..11]; 2466 finished_label 2467 For Finished messages sent by the client, the string "client 2468 finished". For Finished messages sent by the server, the 2469 string "server finished". 2471 Hash denotes the negotiated hash used for the PRF. If a new 2472 PRF is defined, then this hash MUST be specified. 2474 handshake_messages 2475 All of the data from all messages in this handshake (not 2476 including any HelloRequest messages) up to but not including 2477 this message. This is only data visible at the handshake 2478 layer and does not include record layer headers. This is the 2479 concatenation of all the Handshake structures as defined in 2480 7.4, exchanged thus far. 2482 It is a fatal error if a finished message is not preceded by a change 2483 cipher spec message at the appropriate point in the handshake. 2485 The value handshake_messages includes all handshake messages starting 2486 at client hello up to, but not including, this finished message. This 2487 may be different from handshake_messages in Section 7.4.9 because it 2488 would include the certificate verify message (if sent). Also, the 2489 handshake_messages for the finished message sent by the client will 2490 be different from that for the finished message sent by the server, 2491 because the one that is sent second will include the prior one. 2493 Note: Change cipher spec messages, alerts and, any other record types 2494 are not handshake messages and are not included in the hash 2495 computations. Also, Hello Request messages are omitted from 2496 handshake hashes. 2498 8. Cryptographic Computations 2500 In order to begin connection protection, the TLS Record Protocol 2501 requires specification of a suite of algorithms, a master secret, and 2502 the client and server random values. The authentication, encryption, 2503 and MAC algorithms are determined by the cipher_suite selected by the 2504 server and revealed in the server hello message. The compression 2505 algorithm is negotiated in the hello messages, and the random values 2506 are exchanged in the hello messages. All that remains is to calculate 2507 the master secret. 2509 8.1. Computing the Master Secret 2511 For all key exchange methods, the same algorithm is used to convert 2512 the pre_master_secret into the master_secret. The pre_master_secret 2513 should be deleted from memory once the master_secret has been 2514 computed. 2516 master_secret = PRF(pre_master_secret, "master secret", 2517 ClientHello.random + ServerHello.random) 2518 [0..47]; 2520 The master secret is always exactly 48 bytes in length. The length of 2521 the premaster secret will vary depending on key exchange method. 2523 8.1.1. RSA 2525 When RSA is used for server authentication and key exchange, a 2526 48-byte pre_master_secret is generated by the client, encrypted under 2527 the server's public key, and sent to the server. The server uses its 2528 private key to decrypt the pre_master_secret. Both parties then 2529 convert the pre_master_secret into the master_secret, as specified 2530 above. 2532 8.1.2. Diffie-Hellman 2534 A conventional Diffie-Hellman computation is performed. The 2535 negotiated key (Z) is used as the pre_master_secret, and is converted 2536 into the master_secret, as specified above. Leading bytes of Z that 2537 contain all zero bits are stripped before it is used as the 2538 pre_master_secret. 2540 Note: Diffie-Hellman parameters are specified by the server and may 2541 be either ephemeral or contained within the server's certificate. 2543 9. Mandatory Cipher Suites 2545 In the absence of an application profile standard specifying 2546 otherwise, a TLS compliant application MUST implement the cipher 2547 suite TLS_RSA_WITH_3DES_EDE_CBC_SHA. 2549 10. Application Data Protocol 2551 Application data messages are carried by the Record Layer and are 2552 fragmented, compressed and encrypted based on the current connection 2553 state. The messages are treated as transparent data to the record 2554 layer. 2556 11. Security Considerations 2558 Security issues are discussed throughoutthis memo, especially in 2559 Appendices D, E, and F. 2561 12. IANA Considerations 2563 This document uses several registries that were originally created in 2564 [RFC4346]. IANA is requested to update (has updated) these to 2565 reference this document. The registries and their allocation policies 2566 (unchanged from [RFC4346]) are listed below. 2568 o TLS ClientCertificateType Identifiers Registry: Future 2569 values in the range 0-63 (decimal) inclusive are assigned via 2570 Standards Action [RFC2434]. Values in the range 64-223 2571 (decimal) inclusive are assigned Specification Required 2572 [RFC2434]. Values from 224-255 (decimal) inclusive are 2573 reserved for Private Use [RFC2434]. 2575 o TLS Cipher Suite Registry: Future values with the first byte 2576 in the range 0-191 (decimal) inclusive are assigned via 2577 Standards Action [RFC2434]. Values with the first byte in 2578 the range 192-254 (decimal) are assigned via Specification 2579 Required [RFC2434]. Values with the first byte 255 (decimal) 2580 are reserved for Private Use [RFC2434]. 2582 o TLS ContentType Registry: Future values are allocated via 2583 Standards Action [RFC2434]. 2585 o TLS Alert Registry: Future values are allocated via 2586 Standards Action [RFC2434]. 2588 o TLS HandshakeType Registry: Future values are allocated via 2589 Standards Action [RFC2434]. 2591 This document also uses a registry originally created in [RFC4366]. 2592 IANA is requested to update (has updated) it to reference this 2593 document. The registry and its allocation policy (unchanged from 2594 [RFC4366]) is listed below:. 2596 o TLS ExtensionType Registry: Future values are allocated 2597 via IETF Consensus [RFC2434] 2599 In addition, this document defines one new registry to be maintained 2600 by IANA: 2602 o TLS HashType Registry: The registry will be initially 2603 populated with the values described in Section 7.4.1.4.7. 2605 Future values in the range 0-63 (decimal) inclusive are 2606 assigned via Standards Action [RFC2434]. Values in the 2607 range 64-223 (decimal) inclusive are assigned via 2608 Specification Required [RFC2434]. Values from 224-255 2609 (decimal) inclusive are reserved for Private Use [RFC2434]. 2611 This document defines one new TLS extension, cert_hash_type, which is 2612 to be (has been) allocated value TBD-BY-IANA in the TLS ExtensionType 2613 registry. 2615 12.1 Extensions 2617 Section 11 describes a registry of ExtensionType values to be 2618 maintained by the IANA. ExtensionType values are to be assigned via 2619 IETF Consensus as defined in RFC 2434 [IANA]. The initial registry 2620 corresponds to the definition of "ExtensionType" in Section 2.3. 2622 The MIME type "application/pkix-pkipath" has been registered by the 2623 IANA with the following template: 2625 To: ietf-types@iana.org Subject: Registration of MIME media type 2626 application/pkix-pkipath 2628 MIME media type name: application 2629 MIME subtype name: pkix-pkipath 2631 Optional parameters: version (default value is "1") 2633 Encoding considerations: 2634 This MIME type is a DER encoding of the ASN.1 type PkiPath, 2635 defined as follows: 2636 PkiPath ::= SEQUENCE OF Certificate 2637 PkiPath is used to represent a certification path. Within the 2638 sequence, the order of certificates is such that the subject of 2639 the first certificate is the issuer of the second certificate, 2640 etc. 2642 This is identical to the definition published in [X509-4th-TC1]; 2643 note that it is different from that in [X509-4th]. 2645 All Certificates MUST conform to [PKIX]. (This should be 2646 interpreted as a requirement to encode only PKIX-conformant 2647 certificates using this type. It does not necessarily require 2648 that all certificates that are not strictly PKIX-conformant must 2649 be rejected by relying parties, although the security consequences 2650 of accepting any such certificates should be considered 2651 carefully.) 2652 DER (as opposed to BER) encoding MUST be used. If this type is 2653 sent over a 7-bit transport, base64 encoding SHOULD be used. 2655 Security considerations: 2656 The security considerations of [X509-4th] and [PKIX] (or any 2657 updates to them) apply, as well as those of any protocol that uses 2658 this type (e.g., TLS). 2660 Note that this type only specifies a certificate chain that can be 2661 assessed for validity according to the relying party's existing 2662 configuration of trusted CAs; it is not intended to be used to 2663 specify any change to that configuration. 2665 Interoperability considerations: 2666 No specific interoperability problems are known with this type, 2667 but for recommendations relating to X.509 certificates in general, 2668 see [PKIX]. 2670 Published specification: this memo, and [PKIX]. 2672 Applications which use this media type: TLS. It may also be used by 2673 other protocols, or for general interchange of PKIX certificate 2675 Additional information: 2676 Magic number(s): DER-encoded ASN.1 can be easily recognized. 2677 Further parsing is required to distinguish from other ASN.1 2678 types. 2679 File extension(s): .pkipath 2680 Macintosh File Type Code(s): not specified 2682 Person & email address to contact for further information: 2683 Magnus Nystrom 2685 Intended usage: COMMON 2687 Change controller: 2688 IESG 2689 Appendix A. Protocol Constant Values 2691 This section describes protocol types and constants. 2693 A.1. Record Layer 2695 struct { 2696 uint8 major, minor; 2697 } ProtocolVersion; 2699 ProtocolVersion version = { 3, 3 }; /* TLS v1.2*/ 2701 enum { 2702 change_cipher_spec(20), alert(21), handshake(22), 2703 application_data(23), (255) 2704 } ContentType; 2706 struct { 2707 ContentType type; 2708 ProtocolVersion version; 2709 uint16 length; 2710 opaque fragment[TLSPlaintext.length]; 2711 } TLSPlaintext; 2713 struct { 2714 ContentType type; 2715 ProtocolVersion version; 2716 uint16 length; 2717 opaque fragment[TLSCompressed.length]; 2718 } TLSCompressed; 2720 struct { 2721 ContentType type; 2722 ProtocolVersion version; 2723 uint16 length; 2724 select (SecurityParameters.cipher_type) { 2725 case stream: GenericStreamCipher; 2726 case block: GenericBlockCipher; 2727 case aead: GenericAEADCipher; 2728 } fragment; 2729 } TLSCiphertext; 2731 stream-ciphered struct { 2732 opaque content[TLSCompressed.length]; 2733 opaque MAC[SecurityParameters.mac_length]; 2734 } GenericStreamCipher; 2736 block-ciphered struct { 2737 opaque IV[SecurityParameters.block_length]; 2738 opaque content[TLSCompressed.length]; 2739 opaque MAC[SecurityParameters.mac_length]; 2740 uint8 padding[GenericBlockCipher.padding_length]; 2741 uint8 padding_length; 2742 } GenericBlockCipher; 2744 aead-ciphered struct { 2745 opaque IV[SecurityParameters.iv_length]; 2746 opaque aead_output[AEADEncrypted.length]; 2747 } GenericAEADCipher; 2749 A.2. Change Cipher Specs Message 2751 struct { 2752 enum { change_cipher_spec(1), (255) } type; 2753 } ChangeCipherSpec; 2755 A.3. Alert Messages 2757 enum { warning(1), fatal(2), (255) } AlertLevel; 2759 enum { 2760 close_notify(0), 2761 unexpected_message(10), 2762 bad_record_mac(20), 2763 decryption_failed(21), 2764 record_overflow(22), 2765 decompression_failure(30), 2766 handshake_failure(40), 2767 no_certificate_RESERVED (41), 2768 bad_certificate(42), 2769 unsupported_certificate(43), 2770 certificate_revoked(44), 2771 certificate_expired(45), 2772 certificate_unknown(46), 2773 illegal_parameter(47), 2774 unknown_ca(48), 2775 access_denied(49), 2776 decode_error(50), 2777 decrypt_error(51), 2778 export_restriction_RESERVED(60), 2779 protocol_version(70), 2780 insufficient_security(71), 2781 internal_error(80), 2782 user_canceled(90), 2783 no_renegotiation(100), 2784 unsupported_extension(110), /* new */ 2785 (255) 2786 } AlertDescription; 2788 struct { 2789 AlertLevel level; 2790 AlertDescription description; 2791 } Alert; 2792 A.4. Handshake Protocol 2794 enum { 2795 hello_request(0), client_hello(1), server_hello(2), 2796 certificate(11), server_key_exchange (12), 2797 certificate_request(13), server_hello_done(14), 2798 certificate_verify(15), client_key_exchange(16), 2799 finished(20) 2800 (255) 2801 } HandshakeType; 2803 struct { 2804 HandshakeType msg_type; 2805 uint24 length; 2806 select (HandshakeType) { 2807 case hello_request: HelloRequest; 2808 case client_hello: ClientHello; 2809 case server_hello: ServerHello; 2810 case certificate: Certificate; 2811 case server_key_exchange: ServerKeyExchange; 2812 case certificate_request: CertificateRequest; 2813 case server_hello_done: ServerHelloDone; 2814 case certificate_verify: CertificateVerify; 2815 case client_key_exchange: ClientKeyExchange; 2816 case finished: Finished; 2817 } body; 2818 } Handshake; 2820 A.4.1. Hello Messages 2822 struct { } HelloRequest; 2824 struct { 2825 uint32 gmt_unix_time; 2826 opaque random_bytes[28]; 2827 } Random; 2829 opaque SessionID<0..32>; 2831 uint8 CipherSuite[2]; 2833 enum { null(0), (255) } CompressionMethod; 2835 struct { 2836 ProtocolVersion client_version; 2837 Random random; 2838 SessionID session_id; 2839 CipherSuite cipher_suites<2..2^16-1>; 2840 CompressionMethod compression_methods<1..2^8-1>; 2841 Extension client_hello_extension_list<0..2^16-1>; 2842 } ClientHello; 2844 struct { 2845 ProtocolVersion server_version; 2846 Random random; 2847 SessionID session_id; 2848 CipherSuite cipher_suite; 2849 CompressionMethod compression_method; 2850 } ServerHello; 2852 struct { 2853 ExtensionType extension_type; 2854 opaque extension_data<0..2^16-1>; 2855 } Extension; 2857 enum { 2858 cert_hash_types(TBD-BY-IANA), (65535) 2859 } ExtensionType; 2861 A.4.2. Server Authentication and Key Exchange Messages 2863 opaque ASN.1Cert<2^24-1>; 2865 struct { 2866 ASN.1Cert certificate_list<0..2^24-1>; 2867 } Certificate; 2869 struct { 2870 CertificateStatusType status_type; 2871 select (status_type) { 2872 case ocsp: OCSPResponse; 2873 } response; 2874 } CertificateStatus; 2876 opaque OCSPResponse<1..2^24-1>; 2878 enum { diffie_hellman } KeyExchangeAlgorithm; 2880 struct { 2881 opaque dh_p<1..2^16-1>; 2882 opaque dh_g<1..2^16-1>; 2883 opaque dh_Ys<1..2^16-1>; 2884 } ServerDHParams; 2886 struct { 2887 select (KeyExchangeAlgorithm) { 2888 case diffie_hellman: 2889 ServerDHParams params; 2890 Signature signed_params; 2891 } ServerKeyExchange; 2893 enum { anonymous, rsa, dsa } SignatureAlgorithm; 2895 struct { 2896 select (KeyExchangeAlgorithm) { 2897 case diffie_hellman: 2898 ServerDHParams params; 2899 }; 2900 } ServerParams; 2902 struct { 2903 select (SignatureAlgorithm) { 2904 case anonymous: struct { }; 2905 case rsa: 2906 digitally-signed struct { 2907 opaque hash[Hash.length]; 2908 }; 2909 case dsa: 2910 digitally-signed struct { 2911 opaque sha_hash[20]; 2912 }; 2913 }; 2914 }; 2915 } Signature; 2917 enum { 2918 rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), 2919 rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), 2920 fortezza_dms_RESERVED(20), 2921 (255) 2922 } ClientCertificateType; 2924 opaque DistinguishedName<1..2^16-1>; 2926 struct { 2927 ClientCertificateType certificate_types<1..2^8-1>; 2928 DistinguishedName certificate_authorities<0..2^16-1>; 2929 } CertificateRequest; 2931 struct { } ServerHelloDone; 2933 A.4.3. Client Authentication and Key Exchange Messages 2935 struct { 2936 select (KeyExchangeAlgorithm) { 2937 case rsa: EncryptedPreMasterSecret; 2938 case diffie_hellman: ClientDiffieHellmanPublic; 2939 } exchange_keys; 2940 } ClientKeyExchange; 2942 struct { 2943 ProtocolVersion client_version; 2944 opaque random[46]; 2945 } PreMasterSecret; 2947 struct { 2948 public-key-encrypted PreMasterSecret pre_master_secret; 2949 } EncryptedPreMasterSecret; 2951 enum { implicit, explicit } PublicValueEncoding; 2953 struct { 2954 select (PublicValueEncoding) { 2955 case implicit: struct {}; 2956 case explicit: opaque DH_Yc<1..2^16-1>; 2957 } dh_public; 2958 } ClientDiffieHellmanPublic; 2960 struct { 2961 Signature signature; 2962 } CertificateVerify; 2964 A.4.4. Handshake Finalization Message 2966 struct { 2967 opaque verify_data[12]; 2968 } Finished; 2970 A.5. The CipherSuite 2972 The following values define the CipherSuite codes used in the client 2973 hello and server hello messages. 2975 A CipherSuite defines a cipher specification supported in TLS Version 2976 1.1. 2978 TLS_NULL_WITH_NULL_NULL is specified and is the initial state of a 2979 TLS connection during the first handshake on that channel, but MUST 2980 not be negotiated, as it provides no more protection than an 2981 unsecured connection. 2983 CipherSuite TLS_NULL_WITH_NULL_NULL = { 0x00,0x00 }; 2984 The following CipherSuite definitions require that the server provide 2985 an RSA certificate that can be used for key exchange. The server may 2986 request either an RSA or a DSS signature-capable certificate in the 2987 certificate request message. 2989 CipherSuite TLS_RSA_WITH_NULL_MD5 = { 0x00,0x01 }; 2990 CipherSuite TLS_RSA_WITH_NULL_SHA = { 0x00,0x02 }; 2991 CipherSuite TLS_RSA_WITH_RC4_128_MD5 = { 0x00,0x04 }; 2992 CipherSuite TLS_RSA_WITH_RC4_128_SHA = { 0x00,0x05 }; 2993 CipherSuite TLS_RSA_WITH_IDEA_CBC_SHA = { 0x00,0x07 }; 2994 CipherSuite TLS_RSA_WITH_DES_CBC_SHA = { 0x00,0x09 }; 2995 CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x0A }; 2996 CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = { 0x00, 0x2F }; 2997 CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = { 0x00, 0x35 }; 2999 The following CipherSuite definitions are used for server- 3000 authenticated (and optionally client-authenticated) Diffie-Hellman. 3001 DH denotes cipher suites in which the server's certificate contains 3002 the Diffie-Hellman parameters signed by the certificate authority 3003 (CA). DHE denotes ephemeral Diffie-Hellman, where the Diffie-Hellman 3004 parameters are signed by a DSS or RSA certificate, which has been 3005 signed by the CA. The signing algorithm used is specified after the 3006 DH or DHE parameter. The server can request an RSA or DSS signature- 3007 capable certificate from the client for client authentication or it 3008 may request a Diffie-Hellman certificate. Any Diffie-Hellman 3009 certificate provided by the client must use the parameters (group and 3010 generator) described by the server. 3012 CipherSuite TLS_DH_DSS_WITH_DES_CBC_SHA = { 0x00,0x0C }; 3013 CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00,0x0D }; 3014 CipherSuite TLS_DH_RSA_WITH_DES_CBC_SHA = { 0x00,0x0F }; 3015 CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x10 }; 3016 CipherSuite TLS_DHE_DSS_WITH_DES_CBC_SHA = { 0x00,0x12 }; 3017 CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00,0x13 }; 3018 CipherSuite TLS_DHE_RSA_WITH_DES_CBC_SHA = { 0x00,0x15 }; 3019 CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x16 }; 3020 CipherSuite TLS_DH_DSS_WITH_AES_128_CBC_SHA = { 0x00, 0x30 }; 3021 CipherSuite TLS_DH_RSA_WITH_AES_128_CBC_SHA = { 0x00, 0x31 }; 3022 CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = { 0x00, 0x32 }; 3023 CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = { 0x00, 0x33 }; 3024 CipherSuite TLS_DH_DSS_WITH_AES_256_CBC_SHA = { 0x00, 0x36 }; 3025 CipherSuite TLS_DH_RSA_WITH_AES_256_CBC_SHA = { 0x00, 0x37 }; 3026 CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = { 0x00, 0x38 }; 3027 CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = { 0x00, 0x39 }; 3029 The following cipher suites are used for completely anonymous Diffie- 3030 Hellman communications in which neither party is authenticated. Note 3031 that this mode is vulnerable to man-in-the-middle attacks. Using 3032 this mode therefore is of limited use: These ciphersuites MUST NOT be 3033 used by TLS 1.2 implementations unless the application layer has 3034 specifically requested to allow anonymous key exchange. (Anonymous 3035 key exchange may sometimes be acceptable, for example, to support 3036 opportunistic encryption when no set-up for authentication is in 3037 place, or when TLS is used as part of more complex security protocols 3038 that have other means to ensure authentication.) 3040 CipherSuite TLS_DH_anon_WITH_RC4_128_MD5 = { 0x00, 0x18 }; 3041 CipherSuite TLS_DH_anon_WITH_DES_CBC_SHA = { 0x00, 0x1A }; 3042 CipherSuite TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x1B }; 3043 CipherSuite TLS_DH_anon_WITH_AES_128_CBC_SHA = { 0x00, 0x34 }; 3044 CipherSuite TLS_DH_anon_WITH_AES_256_CBC_SHA = { 0x00, 0x3A }; 3046 Note that using non-anonymous key exchange without actually verifying 3047 the key exchange is essentially equivalent to anonymous key exchange, 3048 and the same precautions apply. While non-anonymous key exchange 3049 will generally involve a higher computational and communicational 3050 cost than anonymous key exchange, it may be in the interest of 3051 interoperability not to disable non-anonymous key exchange when the 3052 application layer is allowing anonymous key exchange. 3054 When SSLv3 and TLS 1.0 were designed, the United States restricted 3055 the export of cryptographic software containing certain strong 3056 encryption algorithms. A series of cipher suites were designed to 3057 operate at reduced key lengths in order to comply with those 3058 regulations. Due to advances in computer performance, these 3059 algorithms are now unacceptably weak and export restrictions have 3060 since been loosened. TLS 1.2 implementations MUST NOT negotiate these 3061 cipher suites in TLS 1.2 mode. However, for backward compatibility 3062 they may be offered in the ClientHello for use with TLS 1.0 or SSLv3 3063 only servers. TLS 1.2 clients MUST check that the server did not 3064 choose one of these cipher suites during the handshake. These 3065 ciphersuites are listed below for informational purposes and to 3066 reserve the numbers. 3068 CipherSuite TLS_RSA_EXPORT_WITH_RC4_40_MD5 = { 0x00,0x03 }; 3069 CipherSuite TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = { 0x00,0x06 }; 3070 CipherSuite TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x08 }; 3071 CipherSuite TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x0B }; 3072 CipherSuite TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x0E }; 3073 CipherSuite TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x11 }; 3074 CipherSuite TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x14 }; 3075 CipherSuite TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = { 0x00,0x17 }; 3076 CipherSuite TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = { 0x00,0x19 }; 3078 The following cipher suites were defined in [TLSKRB] and are included 3079 here for completeness. See [TLSKRB] for details: 3081 CipherSuite TLS_KRB5_WITH_DES_CBC_SHA = { 0x00,0x1E }; 3082 CipherSuite TLS_KRB5_WITH_3DES_EDE_CBC_SHA = { 0x00,0x1F }; 3083 CipherSuite TLS_KRB5_WITH_RC4_128_SHA = { 0x00,0x20 }; 3084 CipherSuite TLS_KRB5_WITH_IDEA_CBC_SHA = { 0x00,0x21 }; 3085 CipherSuite TLS_KRB5_WITH_DES_CBC_MD5 = { 0x00,0x22 }; 3086 CipherSuite TLS_KRB5_WITH_3DES_EDE_CBC_MD5 = { 0x00,0x23 }; 3087 CipherSuite TLS_KRB5_WITH_RC4_128_MD5 = { 0x00,0x24 }; 3088 CipherSuite TLS_KRB5_WITH_IDEA_CBC_MD5 = { 0x00,0x25 }; 3090 The following exportable cipher suites were defined in [TLSKRB] and 3091 are included here for completeness. TLS 1.2 implementations MUST NOT 3092 negotiate these cipher suites. 3094 CipherSuite TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA = { 0x00,0x26 3095 }; 3096 CipherSuite TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA = { 0x00,0x27 3097 }; 3098 CipherSuite TLS_KRB5_EXPORT_WITH_RC4_40_SHA = { 0x00,0x28 3099 }; 3100 CipherSuite TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 = { 0x00,0x29 3101 }; 3102 CipherSuite TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 = { 0x00,0x2A 3103 }; 3104 CipherSuite TLS_KRB5_EXPORT_WITH_RC4_40_MD5 = { 0x00,0x2B 3105 }; 3107 New cipher suite values are assigned by IANA as described in Section 3108 11. 3110 Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are 3111 reserved to avoid collision with Fortezza-based cipher suites in SSL 3112 3. 3114 A.6. The Security Parameters 3116 These security parameters are determined by the TLS Handshake 3117 Protocol and provided as parameters to the TLS Record Layer in order 3118 to initialize a connection state. SecurityParameters includes: 3120 enum { null(0), (255) } CompressionMethod; 3122 enum { server, client } ConnectionEnd; 3124 enum { null, rc4, rc2, des, 3des, des40, aes, idea } 3125 BulkCipherAlgorithm; 3127 enum { stream, block } CipherType; 3128 enum { null, md5, sha } MACAlgorithm; 3130 /* The algorithms specified in CompressionMethod, 3131 BulkCipherAlgorithm, and MACAlgorithm may be added to. */ 3133 struct { 3134 ConnectionEnd entity; 3135 BulkCipherAlgorithm bulk_cipher_algorithm; 3136 CipherType cipher_type; 3137 uint8 enc_key_length; 3138 uint8 block_length; 3139 uint8 iv_length; 3140 MACAlgorithm mac_algorithm; 3141 uint8 mac_length; 3142 uint8 mac_key_length; 3143 CompressionMethod compression_algorithm; 3144 opaque master_secret[48]; 3145 opaque client_random[32]; 3146 opaque server_random[32]; 3147 } SecurityParameters; 3148 Appendix B. Glossary 3150 Advanced Encryption Standard (AES) 3151 AES is a widely used symmetric encryption algorithm. AES is a 3152 block cipher with a 128, 192, or 256 bit keys and a 16 byte block 3153 size. [AES] TLS currently only supports the 128 and 256 bit key 3154 sizes. 3156 application protocol 3157 An application protocol is a protocol that normally layers 3158 directly on top of the transport layer (e.g., TCP/IP). Examples 3159 include HTTP, TELNET, FTP, and SMTP. 3161 asymmetric cipher 3162 See public key cryptography. 3164 authenticated encryption with additional data (AEAD) 3165 A symmetric encryption algorithm that simultaneously provides 3166 confidentiality and message integrity. 3168 authentication 3169 Authentication is the ability of one entity to determine the 3170 identity of another entity. 3172 block cipher 3173 A block cipher is an algorithm that operates on plaintext in 3174 groups of bits, called blocks. 64 bits is a common block size. 3176 bulk cipher 3177 A symmetric encryption algorithm used to encrypt large quantities 3178 of data. 3180 cipher block chaining (CBC) 3181 CBC is a mode in which every plaintext block encrypted with a 3182 block cipher is first exclusive-ORed with the previous ciphertext 3183 block (or, in the case of the first block, with the 3184 initialization vector). For decryption, every block is first 3185 decrypted, then exclusive-ORed with the previous ciphertext block 3186 (or IV). 3188 certificate 3189 As part of the X.509 protocol (a.k.a. ISO Authentication 3190 framework), certificates are assigned by a trusted Certificate 3191 Authority and provide a strong binding between a party's identity 3192 or some other attributes and its public key. 3194 client 3195 The application entity that initiates a TLS connection to a 3196 server. This may or may not imply that the client initiated the 3197 underlying transport connection. The primary operational 3198 difference between the server and client is that the server is 3199 generally authenticated, while the client is only optionally 3200 authenticated. 3202 client write key 3203 The key used to encrypt data written by the client. 3205 client write MAC secret 3206 The secret data used to authenticate data written by the client. 3208 connection 3209 A connection is a transport (in the OSI layering model 3210 definition) that provides a suitable type of service. For TLS, 3211 such connections are peer-to-peer relationships. The connections 3212 are transient. Every connection is associated with one session. 3214 Data Encryption Standard 3215 DES is a very widely used symmetric encryption algorithm. DES is 3216 a block cipher with a 56 bit key and an 8 byte block size. Note 3217 that in TLS, for key generation purposes, DES is treated as 3218 having an 8 byte key length (64 bits), but it still only provides 3219 56 bits of protection. (The low bit of each key byte is presumed 3220 to be set to produce odd parity in that key byte.) DES can also 3221 be operated in a mode where three independent keys and three 3222 encryptions are used for each block of data; this uses 168 bits 3223 of key (24 bytes in the TLS key generation method) and provides 3224 the equivalent of 112 bits of security. [DES], [3DES] 3226 Digital Signature Standard (DSS) 3227 A standard for digital signing, including the Digital Signing 3228 Algorithm, approved by the National Institute of Standards and 3229 Technology, defined in NIST FIPS PUB 186, "Digital Signature 3230 Standard", published May, 1994 by the U.S. Dept. of Commerce. 3231 [DSS] 3233 digital signatures 3234 Digital signatures utilize public key cryptography and one-way 3235 hash functions to produce a signature of the data that can be 3236 authenticated, and is difficult to forge or repudiate. 3238 handshake 3239 An initial negotiation between client and server that establishes 3240 the parameters of their transactions. 3242 Initialization Vector (IV) 3243 When a block cipher is used in CBC mode, the initialization 3244 vector is exclusive-ORed with the first plaintext block prior to 3245 encryption. 3247 IDEA 3248 A 64-bit block cipher designed by Xuejia Lai and James Massey. 3249 [IDEA] 3251 Message Authentication Code (MAC) 3252 A Message Authentication Code is a one-way hash computed from a 3253 message and some secret data. It is difficult to forge without 3254 knowing the secret data. Its purpose is to detect if the message 3255 has been altered. 3257 master secret 3258 Secure secret data used for generating encryption keys, MAC 3259 secrets, and IVs. 3261 MD5 3262 MD5 is a secure hashing function that converts an arbitrarily 3263 long data stream into a digest of fixed size (16 bytes). [MD5] 3265 public key cryptography 3266 A class of cryptographic techniques employing two-key ciphers. 3267 Messages encrypted with the public key can only be decrypted with 3268 the associated private key. Conversely, messages signed with the 3269 private key can be verified with the public key. 3271 one-way hash function 3272 A one-way transformation that converts an arbitrary amount of 3273 data into a fixed-length hash. It is computationally hard to 3274 reverse the transformation or to find collisions. MD5 and SHA are 3275 examples of one-way hash functions. 3277 RC2 3278 A block cipher developed by Ron Rivest at RSA Data Security, Inc. 3279 [RSADSI] described in [RC2]. 3281 RC4 3282 A stream cipher invented by Ron Rivest. A compatible cipher is 3283 described in [SCH]. 3285 RSA 3286 A very widely used public-key algorithm that can be used for 3287 either encryption or digital signing. [RSA] 3289 server 3290 The server is the application entity that responds to requests 3291 for connections from clients. See also under client. 3293 session 3294 A TLS session is an association between a client and a server. 3295 Sessions are created by the handshake protocol. Sessions define a 3296 set of cryptographic security parameters that can be shared among 3297 multiple connections. Sessions are used to avoid the expensive 3298 negotiation of new security parameters for each connection. 3300 session identifier 3301 A session identifier is a value generated by a server that 3302 identifies a particular session. 3304 server write key 3305 The key used to encrypt data written by the server. 3307 server write MAC secret 3308 The secret data used to authenticate data written by the server. 3310 SHA 3311 The Secure Hash Algorithm is defined in FIPS PUB 180-2. It 3312 produces a 20-byte output. Note that all references to SHA 3313 actually use the modified SHA-1 algorithm. [SHA] 3315 SSL 3316 Netscape's Secure Socket Layer protocol [SSL3]. TLS is based on 3317 SSL Version 3.0 3319 stream cipher 3320 An encryption algorithm that converts a key into a 3321 cryptographically strong keystream, which is then exclusive-ORed 3322 with the plaintext. 3324 symmetric cipher 3325 See bulk cipher. 3327 Transport Layer Security (TLS) 3328 This protocol; also, the Transport Layer Security working group 3329 of the Internet Engineering Task Force (IETF). See "Comments" at 3330 the end of this document. 3332 Appendix C. CipherSuite Definitions 3334 CipherSuite Key Cipher Hash 3335 Exchange 3337 TLS_NULL_WITH_NULL_NULL NULL NULL NULL 3338 TLS_RSA_WITH_NULL_MD5 RSA NULL MD5 3339 TLS_RSA_WITH_NULL_SHA RSA NULL SHA 3340 TLS_RSA_WITH_RC4_128_MD5 RSA RC4_128 MD5 3341 TLS_RSA_WITH_RC4_128_SHA RSA RC4_128 SHA 3342 TLS_RSA_WITH_IDEA_CBC_SHA RSA IDEA_CBC SHA 3343 TLS_RSA_WITH_DES_CBC_SHA RSA DES_CBC SHA 3344 TLS_RSA_WITH_3DES_EDE_CBC_SHA RSA 3DES_EDE_CBC SHA 3345 TLS_RSA_WITH_AES_128_CBC_SHA RSA AES_128_CBC SHA 3346 TLS_RSA_WITH_AES_256_SHA RSA AES_256_CBC SHA 3347 TLS_DH_DSS_WITH_DES_CBC_SHA DH_DSS DES_CBC SHA 3348 TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA DH_DSS 3DES_EDE_CBC SHA 3349 TLS_DH_RSA_WITH_DES_CBC_SHA DH_RSA DES_CBC SHA 3350 TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA DH_RSA 3DES_EDE_CBC SHA 3351 TLS_DHE_DSS_WITH_DES_CBC_SHA DHE_DSS DES_CBC SHA 3352 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA DHE_DSS 3DES_EDE_CBC SHA 3353 TLS_DHE_RSA_WITH_DES_CBC_SHA DHE_RSA DES_CBC SHA 3354 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA DHE_RSA 3DES_EDE_CBC SHA 3355 TLS_DH_anon_WITH_RC4_128_MD5 DH_anon RC4_128 MD5 3356 TLS_DH_anon_WITH_DES_CBC_SHA DH_anon DES_CBC SHA 3357 TLS_DH_anon_WITH_3DES_EDE_CBC_SHA DH_anon 3DES_EDE_CBC SHA 3358 TLS_DH_DSS_WITH_AES_128_CBC_SHA DH_DSS AES_128_CBC SHA 3359 TLS_DH_RSA_WITH_AES_128_CBC_SHA DH_RSA AES_128_CBC SHA 3360 TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE_DSS AES_128_CBC SHA 3361 TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE_RSA AES_128_CBC SHA 3362 TLS_DH_anon_WITH_AES_128_CBC_SHA DH_anon AES_128_CBC SHA 3363 TLS_DH_DSS_WITH_AES_256_CBC_SHA DH_DSS AES_256_CBC SHA 3364 TLS_DH_RSA_WITH_AES_256_CBC_SHA DH_RSA AES_256_CBC SHA 3365 TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE_DSS AES_256_CBC SHA 3366 TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE_RSA AES_256_CBC SHA 3367 TLS_DH_anon_WITH_AES_256_CBC_SHA DH_anon AES_256_CBC SHA 3369 Key 3370 Exchange 3371 Algorithm Description Key size limit 3373 DHE_DSS Ephemeral DH with DSS signatures None 3374 DHE_RSA Ephemeral DH with RSA signatures None 3375 DH_anon Anonymous DH, no signatures None 3376 DH_DSS DH with DSS-based certificates None 3377 DH_RSA DH with RSA-based certificates None 3378 RSA = none 3379 NULL No key exchange N/A 3380 RSA RSA key exchange None 3382 Key Expanded IV Block 3383 Cipher Type Material Key Material Size Size 3385 NULL Stream 0 0 0 N/A 3386 IDEA_CBC Block 16 16 8 8 3387 RC2_CBC_40 Block 5 16 8 8 3388 RC4_40 Stream 5 16 0 N/A 3389 RC4_128 Stream 16 16 0 N/A 3390 DES40_CBC Block 5 8 8 8 3391 DES_CBC Block 8 8 8 8 3392 3DES_EDE_CBC Block 24 24 8 8 3394 Type 3395 Indicates whether this is a stream cipher or a block cipher 3396 running in CBC mode. 3398 Key Material 3399 The number of bytes from the key_block that are used for 3400 generating the write keys. 3402 Expanded Key Material 3403 The number of bytes actually fed into the encryption algorithm. 3405 IV Size 3406 The amount of data needed to be generated for the initialization 3407 vector. Zero for stream ciphers; equal to the block size for 3408 block ciphers. 3410 Block Size 3411 The amount of data a block cipher enciphers in one chunk; a 3412 block cipher running in CBC mode can only encrypt an even 3413 multiple of its block size. 3415 Hash Hash Padding 3416 function Size Size 3417 NULL 0 0 3418 MD5 16 48 3419 SHA 20 40 3420 Appendix D. Implementation Notes 3422 The TLS protocol cannot prevent many common security mistakes. This 3423 section provides several recommendations to assist implementors. 3425 D.1 Random Number Generation and Seeding 3427 TLS requires a cryptographically secure pseudorandom number generator 3428 (PRNG). Care must be taken in designing and seeding PRNGs. PRNGs 3429 based on secure hash operations, most notably MD5 and/or SHA, are 3430 acceptable, but cannot provide more security than the size of the 3431 random number generator state. (For example, MD5-based PRNGs usually 3432 provide 128 bits of state.) 3434 To estimate the amount of seed material being produced, add the 3435 number of bits of unpredictable information in each seed byte. For 3436 example, keystroke timing values taken from a PC compatible's 18.2 Hz 3437 timer provide 1 or 2 secure bits each, even though the total size of 3438 the counter value is 16 bits or more. Seeding a 128-bit PRNG, one 3439 would thus require approximately 100 such timer values. 3441 [RANDOM] provides guidance on the generation of random values. 3443 D.2 Certificates and Authentication 3445 Implementations are responsible for verifying the integrity of 3446 certificates and should generally support certificate revocation 3447 messages. Certificates should always be verified to ensure proper 3448 signing by a trusted Certificate Authority (CA). The selection and 3449 addition of trusted CAs should be done very carefully. Users should 3450 be able to view information about the certificate and root CA. 3452 D.3 CipherSuites 3454 TLS supports a range of key sizes and security levels, including some 3455 that provide no or minimal security. A proper implementation will 3456 probably not support many cipher suites. For instance, anonymous 3457 Diffie-Hellman is strongly discouraged because it cannot prevent man- 3458 in-the-middle attacks. Applications should also enforce minimum and 3459 maximum key sizes. For example, certificate chains containing 512-bit 3460 RSA keys or signatures are not appropriate for high-security 3461 applications. 3463 Appendix E. Backward Compatibility 3465 E.1 Compatibility with TLS 1.0/1.1 and SSL 3.0 3467 Since there are various versions of TLS (1.0, 1.1, 1.2, and any 3468 future versions) and SSL (2.0 and 3.0), means are needed to negotiate 3469 the specific protocol version to use. The TLS protocol provides a 3470 built-in mechanism for version negotiation so as not to bother other 3471 protocol components with the complexities of version selection. 3473 TLS versions 1.0, 1.1, and 1.2, and SSL 3.0 are very similar, and use 3474 compatible ClientHello messages; thus, supporting all of them is 3475 relatively easy. Similarly, servers can easily handle clients trying 3476 to use future versions of TLS as long as the ClientHello format 3477 remains compatible, and the client support the highest protocol 3478 version available in the server. 3480 A TLS 1.2 client who wishes to negotiate with such older servers will 3481 send a normal TLS 1.2 ClientHello, containing { 3, 3 } (TLS 1.2) in 3482 ClientHello.client_version. If the server does not support this 3483 version, it will respond with ServerHello containing an older version 3484 number. If the client agrees to use this version, the negotiation 3485 will proceed as appropriate for the negotiated protocol. 3487 If the version chosen by the server is not supported by the client 3488 (or not acceptable), the client MUST send a "protocol_version" alert 3489 message and close the connection. 3491 If a TLS server receives a ClientHello containing a version number 3492 greater than the highest version supported by the server, it MUST 3493 reply according to the highest version supported by the server. 3495 A TLS server can also receive a ClientHello containing version number 3496 smaller than the highest supported version. If the server wishes to 3497 negotiate with old clients, it will proceed as appropriate for the 3498 highest version supported by the server that is not greater than 3499 ClientHello.client_version. For example, if the server supports TLS 3500 1.0, 1.1, and 1.2, and client_version is TLS 1.0, the server will 3501 proceed with a TLS 1.0 ServerHello. If server supports (or is willing 3502 to use) only versions greater than client_version, it MUST send a 3503 "protocol_version" alert message and close the connection. 3505 Whenever a client already knows the highest protocol known to a 3506 server (for example, when resuming a session), it SHOULD initiate the 3507 connection in that native protocol. 3509 Note: some server implementations are known to implement version 3510 negotiation incorrectly. For example, there are buggy TLS 1.0 servers 3511 that simply close the connection when the client offers a version 3512 newer than TLS 1.0. Also, it is known that some servers will refuse 3513 connection if any TLS extensions are included in ClientHello. 3514 Interoperability with such buggy servers is a complex topic beyond 3515 the scope of this document, and may require multiple connection 3516 attempts by the client. 3518 Earlier versions of the TLS specification were not fully clear on 3519 what the record layer version number (TLSPlaintext.version) should 3520 contain when sending ClientHello (i.e., before it is known which 3521 version of the protocol will be employed). Thus, TLS servers 3522 compliant with this specification MUST accept any value {03,XX} as 3523 the record layer version number for ClientHello. 3525 TLS clients that wish to negotiate with older servers MAY send any 3526 value {03,XX} as the record layer version number. Typical values 3527 would be {03,00}, the lowest version number supported by the client, 3528 and the value of ClientHello.client_version. No single value will 3529 guarantee interoperability with all old servers, but this is a 3530 complex topic beyond the scope of this document. 3532 E.2 Compatibility with SSL 2.0 3534 TLS 1.2 clients that wish to support SSL 2.0 servers MUST send 3535 version 2.0 CLIENT-HELLO messages defined in [SSL2]. The message MUST 3536 contain the same version number as would be used for ordinary 3537 ClientHello, and MUST encode the supported TLS ciphersuites in the 3538 CIPHER-SPECS-DATA field as described below. 3540 Warning: The ability to send version 2.0 CLIENT-HELLO messages will be 3541 phased out with all due haste, since the newer ClientHello format 3542 provides better mechanisms for moving to newer versions and 3543 negotiating extensions. TLS 1.2 clients SHOULD NOT support SSL 2.0. 3545 However, even TLS servers that do not support SSL 2.0 SHOULD accept 3546 version 2.0 CLIENT-HELLO messages. The message is presented below in 3547 sufficient detail for TLS server implementors; the true definition is 3548 still assumed to be [SSL2]. 3550 For negotiation purposes, 2.0 CLIENT-HELLO is interpreted the same 3551 way as a ClientHello with a "null" compression method and no 3552 extensions. Note that this message MUST be sent directly on the wire, 3553 not wrapped as a TLS record. For the purposes of calculating Finished 3554 and CertificateVerify, the msg_length field is not considered to be a 3555 part of the handshake message. 3557 uint8 V2CipherSpec[3]; 3558 struct { 3559 uint16 msg_length; 3560 uint8 msg_type; 3561 Version version; 3562 uint16 cipher_spec_length; 3563 uint16 session_id_length; 3564 uint16 challenge_length; 3565 V2CipherSpec cipher_specs[V2ClientHello.cipher_spec_length]; 3566 opaque session_id[V2ClientHello.session_id_length]; 3567 opaque challenge[V2ClientHello.challenge_length; 3568 } V2ClientHello; 3570 msg_length 3571 The highest bit MUST be 1; the remaining bits contain the 3572 length of the following data in bytes. 3574 msg_type 3575 This field, in conjunction with the version field, identifies a 3576 version 2 client hello message. The value SHOULD be one (1). 3578 version 3579 Equal to ClientHello.client_version. 3581 cipher_spec_length 3582 This field is the total length of the field cipher_specs. It 3583 cannot be zero and MUST be a multiple of the V2CipherSpec length 3584 (3). 3586 session_id_length 3587 This field MUST have a value of zero. MUST be zero for a client 3588 that claims to support TLS 1.2. 3590 challenge_length 3591 The length in bytes of the client's challenge to the server to 3592 authenticate itself. Historically, permissible values are between 3593 16 and 32 bytes inclusive. When using the SSLv2 backward 3594 compatible handshake the client MUST use a 32-byte challenge. 3596 cipher_specs 3597 This is a list of all CipherSpecs the client is willing and able 3598 to use. In addition to the 2.0 cipher specs defined in [SSL2], 3599 this includes the TLS cipher suites normally sent in 3600 ClientHello.cipher_suites, each cipher suite prefixed by a zero 3601 byte. For example, TLS ciphersuite {0x00,0x0A} would be sent as 3602 {0x00,0x00,0x0A}. 3604 session_id 3605 This field MUST be empty. 3607 challenge 3608 Corresponds to ClientHello.random. If the challenge length is 3609 less than 32, the TLS server will pad the data with leading 3610 (note: not trailing) zero bytes to make it 32 bytes long. 3612 Note: Requests to resume a TLS session MUST use a TLS client hello. 3614 E.2. Avoiding Man-in-the-Middle Version Rollback 3616 When TLS clients fall back to Version 2.0 compatibility mode, they 3617 SHOULD use special PKCS #1 block formatting. This is done so that TLS 3618 servers will reject Version 2.0 sessions with TLS-capable clients. 3620 When TLS clients are in Version 2.0 compatibility mode, they set the 3621 right-hand (least-significant) 8 random bytes of the PKCS padding 3622 (not including the terminal null of the padding) for the RSA 3623 encryption of the ENCRYPTED-KEY-DATA field of the CLIENT-MASTER-KEY 3624 to 0x03 (the other padding bytes are random). After decrypting the 3625 ENCRYPTED-KEY-DATA field, servers that support TLS SHOULD issue an 3626 error if these eight padding bytes are 0x03. Version 2.0 servers 3627 receiving blocks padded in this manner will proceed normally. 3629 Appendix F. Security Analysis 3631 The TLS protocol is designed to establish a secure connection between 3632 a client and a server communicating over an insecure channel. This 3633 document makes several traditional assumptions, including that 3634 attackers have substantial computational resources and cannot obtain 3635 secret information from sources outside the protocol. Attackers are 3636 assumed to have the ability to capture, modify, delete, replay, and 3637 otherwise tamper with messages sent over the communication channel. 3638 This appendix outlines how TLS has been designed to resist a variety 3639 of attacks. 3641 F.1. Handshake Protocol 3643 The handshake protocol is responsible for selecting a CipherSpec and 3644 generating a Master Secret, which together comprise the primary 3645 cryptographic parameters associated with a secure session. The 3646 handshake protocol can also optionally authenticate parties who have 3647 certificates signed by a trusted certificate authority. 3649 F.1.1. Authentication and Key Exchange 3651 TLS supports three authentication modes: authentication of both 3652 parties, server authentication with an unauthenticated client, and 3653 total anonymity. Whenever the server is authenticated, the channel is 3654 secure against man-in-the-middle attacks, but completely anonymous 3655 sessions are inherently vulnerable to such attacks. Anonymous 3656 servers cannot authenticate clients. If the server is authenticated, 3657 its certificate message must provide a valid certificate chain 3658 leading to an acceptable certificate authority. Similarly, 3659 authenticated clients must supply an acceptable certificate to the 3660 server. Each party is responsible for verifying that the other's 3661 certificate is valid and has not expired or been revoked. 3663 The general goal of the key exchange process is to create a 3664 pre_master_secret known to the communicating parties and not to 3665 attackers. The pre_master_secret will be used to generate the 3666 master_secret (see Section 8.1). The master_secret is required to 3667 generate the finished messages, encryption keys, and MAC secrets (see 3668 Sections 7.4.9 and 6.3). By sending a correct finished message, 3669 parties thus prove that they know the correct pre_master_secret. 3671 F.1.1.1. Anonymous Key Exchange 3673 Completely anonymous sessions can be established using RSA or Diffie- 3674 Hellman for key exchange. With anonymous RSA, the client encrypts a 3675 pre_master_secret with the server's uncertified public key extracted 3676 from the server key exchange message. The result is sent in a client 3677 key exchange message. Since eavesdroppers do not know the server's 3678 private key, it will be infeasible for them to decode the 3679 pre_master_secret. 3681 Note: No anonymous RSA Cipher Suites are defined in this document. 3683 With Diffie-Hellman, the server's public parameters are contained in 3684 the server key exchange message and the client's are sent in the 3685 client key exchange message. Eavesdroppers who do not know the 3686 private values should not be able to find the Diffie-Hellman result 3687 (i.e. the pre_master_secret). 3689 Warning: Completely anonymous connections only provide protection 3690 against passive eavesdropping. Unless an independent tamper- 3691 proof channel is used to verify that the finished messages 3692 were not replaced by an attacker, server authentication is 3693 required in environments where active man-in-the-middle 3694 attacks are a concern. 3696 F.1.1.2. RSA Key Exchange and Authentication 3698 With RSA, key exchange and server authentication are combined. The 3699 public key is contained in the server's certificate. Note that 3700 compromise of the server's static RSA key results in a loss of 3701 confidentiality for all sessions protected under that static key. TLS 3702 users desiring Perfect Forward Secrecy should use DHE cipher suites. 3703 The damage done by exposure of a private key can be limited by 3704 changing one's private key (and certificate) frequently. 3706 After verifying the server's certificate, the client encrypts a 3707 pre_master_secret with the server's public key. By successfully 3708 decoding the pre_master_secret and producing a correct finished 3709 message, the server demonstrates that it knows the private key 3710 corresponding to the server certificate. 3712 When RSA is used for key exchange, clients are authenticated using 3713 the certificate verify message (see Section 7.4.9). The client signs 3714 a value derived from the master_secret and all preceding handshake 3715 messages. These handshake messages include the server certificate, 3716 which binds the signature to the server, and ServerHello.random, 3717 which binds the signature to the current handshake process. 3719 F.1.1.3. Diffie-Hellman Key Exchange with Authentication 3721 When Diffie-Hellman key exchange is used, the server can either 3722 supply a certificate containing fixed Diffie-Hellman parameters or 3723 use the server key exchange message to send a set of temporary 3724 Diffie-Hellman parameters signed with a DSS or RSA certificate. 3726 Temporary parameters are hashed with the hello.random values before 3727 signing to ensure that attackers do not replay old parameters. In 3728 either case, the client can verify the certificate or signature to 3729 ensure that the parameters belong to the server. 3731 If the client has a certificate containing fixed Diffie-Hellman 3732 parameters, its certificate contains the information required to 3733 complete the key exchange. Note that in this case the client and 3734 server will generate the same Diffie-Hellman result (i.e., 3735 pre_master_secret) every time they communicate. To prevent the 3736 pre_master_secret from staying in memory any longer than necessary, 3737 it should be converted into the master_secret as soon as possible. 3738 Client Diffie-Hellman parameters must be compatible with those 3739 supplied by the server for the key exchange to work. 3741 If the client has a standard DSS or RSA certificate or is 3742 unauthenticated, it sends a set of temporary parameters to the server 3743 in the client key exchange message, then optionally uses a 3744 certificate verify message to authenticate itself. 3746 If the same DH keypair is to be used for multiple handshakes, either 3747 because the client or server has a certificate containing a fixed DH 3748 keypair or because the server is reusing DH keys, care must be taken 3749 to prevent small subgroup attacks. Implementations SHOULD follow the 3750 guidelines found in [SUBGROUP]. 3752 Small subgroup attacks are most easily avoided by using one of the 3753 DHE ciphersuites and generating a fresh DH private key (X) for each 3754 handshake. If a suitable base (such as 2) is chosen, g^X mod p can be 3755 computed very quickly, therefore the performance cost is minimized. 3756 Additionally, using a fresh key for each handshake provides Perfect 3757 Forward Secrecy. Implementations SHOULD generate a new X for each 3758 handshake when using DHE ciphersuites. 3760 F.1.2. Version Rollback Attacks 3762 Because TLS includes substantial improvements over SSL Version 2.0, 3763 attackers may try to make TLS-capable clients and servers fall back 3764 to Version 2.0. This attack can occur if (and only if) two TLS- 3765 capable parties use an SSL 2.0 handshake. 3767 Although the solution using non-random PKCS #1 block type 2 message 3768 padding is inelegant, it provides a reasonably secure way for Version 3769 3.0 servers to detect the attack. This solution is not secure against 3770 attackers who can brute force the key and substitute a new ENCRYPTED- 3771 KEY-DATA message containing the same key (but with normal padding) 3772 before the application specified wait threshold has expired. Altering 3773 the padding of the least significant 8 bytes of the PKCS padding does 3774 not impact security for the size of the signed hashes and RSA key 3775 lengths used in the protocol, since this is essentially equivalent to 3776 increasing the input block size by 8 bytes. 3778 F.1.3. Detecting Attacks Against the Handshake Protocol 3780 An attacker might try to influence the handshake exchange to make the 3781 parties select different encryption algorithms than they would 3782 normally chooses. 3784 For this attack, an attacker must actively change one or more 3785 handshake messages. If this occurs, the client and server will 3786 compute different values for the handshake message hashes. As a 3787 result, the parties will not accept each others' finished messages. 3788 Without the master_secret, the attacker cannot repair the finished 3789 messages, so the attack will be discovered. 3791 F.1.4. Resuming Sessions 3793 When a connection is established by resuming a session, new 3794 ClientHello.random and ServerHello.random values are hashed with the 3795 session's master_secret. Provided that the master_secret has not been 3796 compromised and that the secure hash operations used to produce the 3797 encryption keys and MAC secrets are secure, the connection should be 3798 secure and effectively independent from previous connections. 3799 Attackers cannot use known encryption keys or MAC secrets to 3800 compromise the master_secret without breaking the secure hash 3801 operations (which use both SHA and MD5). 3803 Sessions cannot be resumed unless both the client and server agree. 3804 If either party suspects that the session may have been compromised, 3805 or that certificates may have expired or been revoked, it should 3806 force a full handshake. An upper limit of 24 hours is suggested for 3807 session ID lifetimes, since an attacker who obtains a master_secret 3808 may be able to impersonate the compromised party until the 3809 corresponding session ID is retired. Applications that may be run in 3810 relatively insecure environments should not write session IDs to 3811 stable storage. 3813 F.1.5 Extensions 3815 Security considerations for the extension mechanism in general, and 3816 the design of new extensions, are described in the previous section. 3817 A security analysis of each of the extensions defined in this 3818 document is given below. 3820 In general, implementers should continue to monitor the state of the 3821 art, and address any weaknesses identified. 3823 F.2. Protecting Application Data 3825 The master_secret is hashed with the ClientHello.random and 3826 ServerHello.random to produce unique data encryption keys and MAC 3827 secrets for each connection. 3829 Outgoing data is protected with a MAC before transmission. To prevent 3830 message replay or modification attacks, the MAC is computed from the 3831 MAC secret, the sequence number, the message length, the message 3832 contents, and two fixed character strings. The message type field is 3833 necessary to ensure that messages intended for one TLS Record Layer 3834 client are not redirected to another. The sequence number ensures 3835 that attempts to delete or reorder messages will be detected. Since 3836 sequence numbers are 64 bits long, they should never overflow. 3837 Messages from one party cannot be inserted into the other's output, 3838 since they use independent MAC secrets. Similarly, the server-write 3839 and client-write keys are independent, so stream cipher keys are used 3840 only once. 3842 If an attacker does break an encryption key, all messages encrypted 3843 with it can be read. Similarly, compromise of a MAC key can make 3844 message modification attacks possible. Because MACs are also 3845 encrypted, message-alteration attacks generally require breaking the 3846 encryption algorithm as well as the MAC. 3848 Note: MAC secrets may be larger than encryption keys, so messages can 3849 remain tamper resistant even if encryption keys are broken. 3851 F.3. Explicit IVs 3853 [CBCATT] describes a chosen plaintext attack on TLS that depends 3854 on knowing the IV for a record. Previous versions of TLS [TLS1.0] 3855 used the CBC residue of the previous record as the IV and 3856 therefore enabled this attack. This version uses an explicit IV 3857 in order to protect against this attack. 3859 F.4. Security of Composite Cipher Modes 3861 TLS secures transmitted application data via the use of symmetric 3862 encryption and authentication functions defined in the negotiated 3863 ciphersuite. The objective is to protect both the integrity and 3864 confidentiality of the transmitted data from malicious actions by 3865 active attackers in the network. It turns out that the order in 3866 which encryption and authentication functions are applied to the 3867 data plays an important role for achieving this goal [ENCAUTH]. 3869 The most robust method, called encrypt-then-authenticate, first 3870 applies encryption to the data and then applies a MAC to the 3871 ciphertext. This method ensures that the integrity and 3872 confidentiality goals are obtained with ANY pair of encryption 3873 and MAC functions, provided that the former is secure against 3874 chosen plaintext attacks and the MAC is secure against chosen- 3875 message attacks. TLS uses another method, called authenticate- 3876 then-encrypt, in which first a MAC is computed on the plaintext 3877 and then the concatenation of plaintext and MAC is encrypted. 3878 This method has been proven secure for CERTAIN combinations of 3879 encryption functions and MAC functions, but is not guaranteed to 3880 be secure in general. In particular, it has been shown that there 3881 exist perfectly secure encryption functions (secure even in the 3882 information-theoretic sense) that combined with any secure MAC 3883 function, fail to provide the confidentiality goal against an 3884 active attack. Therefore, new ciphersuites and operation modes 3885 adopted into TLS need to be analyzed under the authenticate-then- 3886 encrypt method to verify that they achieve the stated integrity 3887 and confidentiality goals. 3889 Currently, the security of the authenticate-then-encrypt method 3890 has been proven for some important cases. One is the case of 3891 stream ciphers in which a computationally unpredictable pad of 3892 the length of the message, plus the length of the MAC tag, is 3893 produced using a pseudo-random generator and this pad is xor-ed 3894 with the concatenation of plaintext and MAC tag. The other is 3895 the case of CBC mode using a secure block cipher. In this case, 3896 security can be shown if one applies one CBC encryption pass to 3897 the concatenation of plaintext and MAC and uses a new, 3898 independent, and unpredictable, IV for each new pair of plaintext 3899 and MAC. In previous versions of SSL, CBC mode was used properly 3900 EXCEPT that it used a predictable IV in the form of the last 3901 block of the previous ciphertext. This made TLS open to chosen 3902 plaintext attacks. This verson of the protocol is immune to 3903 those attacks. For exact details in the encryption modes proven 3904 secure see [ENCAUTH]. 3906 F.5 Denial of Service 3908 TLS is susceptible to a number of denial of service (DoS) attacks. 3909 In particular, an attacker who initiates a large number of TCP 3910 connections can cause a server to consume large amounts of CPU doing 3911 RSA decryption. However, because TLS is generally used over TCP, it 3912 is difficult for the attacker to hide his point of origin if proper 3913 TCP SYN randomization is used [SEQNUM] by the TCP stack. 3915 Because TLS runs over TCP, it is also susceptible to a number of 3916 denial of service attacks on individual connections. In particular, 3917 attackers can forge RSTs, thereby terminating connections, or forge 3918 partial TLS records, thereby causing the connection to stall. These 3919 attacks cannot in general be defended against by a TCP-using 3920 protocol. Implementors or users who are concerned with this class of 3921 attack should use IPsec AH [AH] or ESP [ESP]. 3923 F.6. Final Notes 3925 For TLS to be able to provide a secure connection, both the client 3926 and server systems, keys, and applications must be secure. In 3927 addition, the implementation must be free of security errors. 3929 The system is only as strong as the weakest key exchange and 3930 authentication algorithm supported, and only trustworthy 3931 cryptographic functions should be used. Short public keys and 3932 anonymous servers should be used with great caution. Implementations 3933 and users must be careful when deciding which certificates and 3934 certificate authorities are acceptable; a dishonest certificate 3935 authority can do tremendous damage. 3937 Security Considerations 3939 Security issues are discussed throughout this memo, especially in 3940 Appendices D, E, and F. 3942 Changes in This Version 3944 [RFC Editor: Please delete this] 3946 - Forbid decryption_failed [issue 5] 3948 - Fix CertHashTypes declaration [issue 20] 3950 - Fix client_version in 7.4.1.2 [issue 19] 3952 - Require Bleichenbacher and timing attack protection [issues 17 3953 and 3954 12]. 3956 - Merged RFC-editor changes back in. 3958 - Editorial changes from NIST [issue 8] 3960 - Clarified the meaning of HelloRequest [issue 39] 3962 - Editorial nits from Peter Williams [issue 35] 3964 - Made maximum fragment size a MUST [issue 9] 3966 - Clarified that resumption is not mandatory and servers may 3967 refuse [issue 37] 3969 - Fixed identifier for cert_hash_types [issue 38] 3971 - Forbid sending unknown record types [issue 11] 3973 - Clarify that DH parameters and other integers are unsigned [issue 3974 28] 3976 - Clarify when a server Certificate is sent [isssue 29] 3978 - Prohibit zero-length fragments [issue 10] 3980 - Fix reference for DES/3DES [issue 18] 3982 - Clean up some notes on deprecated alerts [issue 6] 3983 - Remove ephemeral RSA [issue 3] 3985 - Stripped out discussion of how to generate the IV and replaced it 3986 with a randomness/unpredictability requirement [issue 7] 3988 - Replaced the PKCS#1 text with references to PKCS#1 v2. This also 3989 includes DigestInfo encoding [issues 1 and 22] 3991 - Removed extension definitions and merged the ExtendedHello 3992 definitions [issues 31 and 32] 3994 - Replaced CipherSpec references with SecurityParameters references 3995 [issue 2] 3997 - Cleaned up IANA text [issues 33 and 34] 3999 - Cleaned up backward compatibility text [issue 25] 4001 Normative References 4002 [AES] National Institute of Standards and Technology, 4003 "Specification for the Advanced Encryption Standard (AES)" 4004 FIPS 197. November 26, 2001. 4006 [3DES] National Institute of Standards and Tecnology, 4007 "Recommendation for the Triple Data Encryption Algorithm 4008 (TDEA) Block Cipher", NIST Special Publication 800-67, May 4009 2004. 4011 [DES] National Institute of Standards and Technology, "Data 4012 Encryption Standard (DES)", FIPS PUB 46-3, October 1999. 4014 [DSS] NIST FIPS PUB 186-2, "Digital Signature Standard," National 4015 Institute of Standards and Technology, U.S. Department of 4016 Commerce, 2000. 4018 [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 4019 Hashing for Message Authentication", RFC 2104, February 4020 1997. 4022 [HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, 4023 L., Leach, P. and T. Berners-Lee, "Hypertext Transfer 4024 Protocol -- HTTP/1.1", RFC 2616, June 1999. 4026 [IDEA] X. Lai, "On the Design and Security of Block Ciphers," ETH 4027 Series in Information Processing, v. 1, Konstanz: Hartung- 4028 Gorre Verlag, 1992. 4030 [IDNA] Faltstrom, P., Hoffman, P. and A. Costello, 4031 "Internationalizing Domain Names in Applications (IDNA)", 4032 RFC 3490, March 2003. 4034 [MD5] Rivest, R., "The MD5 Message Digest Algorithm", RFC 1321, 4035 April 1992. 4037 [OCSP] Myers, M., Ankney, R., Malpani, A., Galperin, S. and C. 4038 Adams, "Internet X.509 Public Key Infrastructure: Online 4039 Certificate Status Protocol - OCSP", RFC 2560, June 1999. 4041 [PKCS1B] J. Jonsson, B. Kaliski, "Public-Key Cryptography Standards 4042 (PKCS) #1: RSA Cryptography Specifications Version 2.1", RFC 4043 3447, February 2003. 4045 [PKIOP] Housley, R. and P. Hoffman, "Internet X.509 Public Key 4046 Infrastructure - Operation Protocols: FTP and HTTP", RFC 4047 2585, May 1999. 4049 [PKIX] Housley, R., Ford, W., Polk, W. and D. Solo, "Internet 4050 Public Key Infrastructure: Part I: X.509 Certificate and CRL 4051 Profile", RFC 3280, April 2002. 4053 [RC2] Rivest, R., "A Description of the RC2(r) Encryption 4054 Algorithm", RFC 2268, March 1998. 4056 [SCH] B. Schneier. "Applied Cryptography: Protocols, Algorithms, 4057 and Source Code in C, 2ed", Published by John Wiley & Sons, 4058 Inc. 1996. 4060 [SHA] NIST FIPS PUB 180-2, "Secure Hash Standard," National 4061 Institute of Standards and Technology, U.S. Department of 4062 Commerce., August 2001. 4064 [REQ] Bradner, S., "Key words for use in RFCs to Indicate 4065 Requirement Levels", BCP 14, RFC 2119, March 1997. 4067 [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an 4068 IANA Considerations Section in RFCs", BCP 25, RFC 2434, 4069 October 1998. 4071 [TLSAES] Chown, P., "Advanced Encryption Standard (AES) Ciphersuites 4072 for Transport Layer Security (TLS)", RFC 3268, June 2002. 4074 [TLSEXT] Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, J., 4075 Wright, T., "Transport Layer Security (TLS) Extensions", RFC 4076 3546, June 2003. 4078 [TLSKRB] Medvinsky, A. and M. Hur, "Addition of Kerberos Cipher 4079 Suites to Transport Layer Security (TLS)", RFC 2712, October 4080 1999. 4082 [URI] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform 4083 Resource Identifiers (URI): Generic Syntax", RFC 2396, 4084 August 1998. 4086 [UTF8] Yergeau, F., "UTF-8, a transformation format of ISO 10646", 4087 RFC 3629, November 2003. 4089 [X509-4th] ITU-T Recommendation X.509 (2000) | ISO/IEC 9594- 8:2001, 4090 "Information Systems - Open Systems Interconnection - The 4091 Directory: Public key and Attribute certificate 4092 frameworks." 4094 [X509-4th-TC1] ITU-T Recommendation X.509(2000) Corrigendum 1(2001) | 4095 ISO/IEC 9594-8:2001/Cor.1:2002, Technical Corrigendum 1 to 4096 ISO/IEC 9594:8:2001. 4098 Informative References 4100 [AEAD] Mcgrew, D., "Authenticated Encryption", July 2006, draft- 4101 mcgrew-auth-enc-00.txt. 4103 [AH] Kent, S., and Atkinson, R., "IP Authentication Header", RFC 4104 4302, December 2005. 4106 [BLEI] Bleichenbacher D., "Chosen Ciphertext Attacks against 4107 Protocols Based on RSA Encryption Standard PKCS #1" in 4108 Advances in Cryptology -- CRYPTO'98, LNCS vol. 1462, pages: 4109 1-12, 1998. 4111 [CBCATT] Moeller, B., "Security of CBC Ciphersuites in SSL/TLS: 4112 Problems and Countermeasures", 4113 http://www.openssl.org/~bodo/tls-cbc.txt. 4115 [CBCTIME] Canvel, B., "Password Interception in a SSL/TLS Channel", 4116 http://lasecwww.epfl.ch/memo_ssl.shtml, 2003. 4118 [CCM] "NIST Special Publication 800-38C: The CCM Mode for 4119 Authentication and Confidentiality", 4120 http://csrc.nist.gov/publications/nistpubs/SP800-38C.pdf. 4122 [ENCAUTH] Krawczyk, H., "The Order of Encryption and Authentication 4123 for Protecting Communications (Or: How Secure is SSL?)", 4124 Crypto 2001. 4126 [ESP] Kent, S., and Atkinson, R., "IP Encapsulating Security 4127 Payload (ESP)", RFC 4303, December 2005. 4129 [GCM] "NIST Special Publication 800-38C: The CCM Mode for 4130 Authentication and Confidentiality", 4131 http://csrc.nist.gov/publications/nistpubs/SP800-38C.pdf. 4133 [KPR03] Klima, V., Pokorny, O., Rosa, T., "Attacking RSA-based 4134 Sessions in SSL/TLS", http://eprint.iacr.org/2003/052/, 4135 March 2003. 4137 [PKCS6] RSA Laboratories, "PKCS #6: RSA Extended Certificate Syntax 4138 Standard," version 1.5, November 1993. 4140 [PKCS7] RSA Laboratories, "PKCS #7: RSA Cryptographic Message Syntax 4141 Standard," version 1.5, November 1993. 4143 [RANDOM] Eastlake, D., 3rd, Schiller, J., and S. Crocker, "Randomness 4144 Requirements for Security", BCP 106, RFC 4086, June 2005. 4146 [RSA] R. Rivest, A. Shamir, and L. M. Adleman, "A Method for 4147 Obtaining Digital Signatures and Public-Key Cryptosystems," 4148 Communications of the ACM, v. 21, n. 2, Feb 1978, pp. 4149 120-126. 4151 [SEQNUM] Bellovin. S., "Defending Against Sequence Number Attacks", 4152 RFC 1948, May 1996. 4154 [SSL2] Hickman, Kipp, "The SSL Protocol", Netscape Communications 4155 Corp., Feb 9, 1995. 4157 [SSL3] A. Frier, P. Karlton, and P. Kocher, "The SSL 3.0 Protocol", 4158 Netscape Communications Corp., Nov 18, 1996. 4160 [SUBGROUP] Zuccherato, R., "Methods for Avoiding the "Small-Subgroup" 4161 Attacks on the Diffie-Hellman Key Agreement Method for 4162 S/MIME", RFC 2785, March 2000. 4164 [TCP] Postel, J., "Transmission Control Protocol," STD 7, RFC 793, 4165 September 1981. 4167 [TIMING] Boneh, D., Brumley, D., "Remote timing attacks are 4168 practical", USENIX Security Symposium 2003. 4170 [TLS1.0] Dierks, T., and C. Allen, "The TLS Protocol, Version 1.0", 4171 RFC 2246, January 1999. 4173 [TLS1.1] Dierks, T., and E. Rescorla, "The TLS Protocol, Version 4174 1.1", RFC 4346, April, 2006. 4176 [X501] ITU-T Recommendation X.501: Information Technology - Open 4177 Systems Interconnection - The Directory: Models, 1993. 4179 [X509] ITU-T Recommendation X.509 (1997 E): Information Technology - 4180 Open Systems Interconnection - "The Directory - 4181 Authentication Framework". 1988. 4183 [XDR] Srinivansan, R., Sun Microsystems, "XDR: External Data 4184 Representation Standard", RFC 1832, August 1995. 4186 Credits 4188 Working Group Chairs 4189 Eric Rescorla 4190 EMail: ekr@networkresonance.com 4192 Pasi Eronen 4193 pasi.eronen@nokia.com 4195 Editors 4197 Tim Dierks Eric Rescorla 4198 Independent Network Resonance, Inc. 4200 EMail: tim@dierks.org EMail: ekr@networkresonance.com 4202 Other contributors 4204 Christopher Allen (co-editor of TLS 1.0) 4205 Alacrity Ventures 4206 ChristopherA@AlacrityManagement.com 4208 Martin Abadi 4209 University of California, Santa Cruz 4210 abadi@cs.ucsc.edu 4212 Steven M. Bellovin 4213 Columbia University 4214 smb@cs.columbia.edu 4216 Simon Blake-Wilson 4217 BCI 4218 EMail: sblakewilson@bcisse.com 4220 Ran Canetti 4221 IBM 4222 canetti@watson.ibm.com 4224 Pete Chown 4225 Skygate Technology Ltd 4226 pc@skygate.co.uk 4228 Taher Elgamal 4229 taher@securify.com 4230 Securify 4232 Anil Gangolli 4233 anil@busybuddha.org 4235 Kipp Hickman 4237 David Hopwood 4238 Independent Consultant 4239 EMail: david.hopwood@blueyonder.co.uk 4241 Phil Karlton (co-author of SSLv3) 4243 Paul Kocher (co-author of SSLv3) 4244 Cryptography Research 4245 paul@cryptography.com 4247 Hugo Krawczyk 4248 Technion Israel Institute of Technology 4249 hugo@ee.technion.ac.il 4251 Jan Mikkelsen 4252 Transactionware 4253 EMail: janm@transactionware.com 4255 Magnus Nystrom 4256 RSA Security 4257 EMail: magnus@rsasecurity.com 4259 Robert Relyea 4260 Netscape Communications 4261 relyea@netscape.com 4263 Jim Roskind 4264 Netscape Communications 4265 jar@netscape.com 4266 Michael Sabin 4268 Dan Simon 4269 Microsoft, Inc. 4270 dansimon@microsoft.com 4272 Tom Weinstein 4274 Tim Wright 4275 Vodafone 4276 EMail: timothy.wright@vodafone.com 4278 Comments 4280 The discussion list for the IETF TLS working group is located at the 4281 e-mail address . Information on the group and 4282 information on how to subscribe to the list is at 4283 4285 Archives of the list can be found at: 4286 4287 Full Copyright Statement 4289 Copyright (C) The IETF Trust (2007). 4291 This document is subject to the rights, licenses and restrictions 4292 contained in BCP 78, and except as set forth therein, the authors 4293 retain all their rights. 4295 This document and the information contained herein are provided on an 4296 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 4297 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 4298 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 4299 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 4300 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 4301 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 4303 Intellectual Property 4305 The IETF takes no position regarding the validity or scope of any 4306 Intellectual Property Rights or other rights that might be claimed to 4307 pertain to the implementation or use of the technology described in 4308 this document or the extent to which any license under such rights 4309 might or might not be available; nor does it represent that it has 4310 made any independent effort to identify any such rights. Information 4311 on the procedures with respect to rights in RFC documents can be 4312 found in BCP 78 and BCP 79. 4314 Copies of IPR disclosures made to the IETF Secretariat and any 4315 assurances of licenses to be made available, or the result of an 4316 attempt made to obtain a general license or permission for the use of 4317 such proprietary rights by implementers or users of this 4318 specification can be obtained from the IETF on-line IPR repository at 4319 http://www.ietf.org/ipr. 4321 The IETF invites any interested party to bring to its attention any 4322 copyrights, patents or patent applications, or other proprietary 4323 rights that may cover technology that may be required to implement 4324 this standard. Please address the information to the IETF at 4325 ietf-ipr@ietf.org. 4327 Acknowledgment 4329 Funding for the RFC Editor function is provided by the IETF 4330 Administrative Support Activity (IASA).