1 INTERNET-DRAFT Tim Dierks
\r
2 Obsoletes (if approved): RFC 3268, 4346, 4366 Independent
\r
3 Updates (if approved): RFC 4492 Eric Rescorla
\r
4 Intended status: Proposed Standard Network Resonance, Inc.
\r
5 <draft-ietf-tls-rfc4346-bis-09.txt> February 2008 (Expires August 2008)
\r
8 The Transport Layer Security (TLS) Protocol
\r
13 By submitting this Internet-Draft, each author represents that any
\r
14 applicable patent or other IPR claims of which he or she is aware
\r
15 have been or will be disclosed, and any of which he or she becomes
\r
16 aware will be disclosed, in accordance with Section 6 of BCP 79.
\r
18 Internet-Drafts are working documents of the Internet Engineering
\r
19 Task Force (IETF), its areas, and its working groups. Note that
\r
20 other groups may also distribute working documents as Internet-
\r
23 Internet-Drafts are draft documents valid for a maximum of six months
\r
24 and may be updated, replaced, or obsoleted by other documents at any
\r
25 time. It is inappropriate to use Internet-Drafts as reference
\r
26 material or to cite them other than as "work in progress."
\r
28 The list of current Internet-Drafts can be accessed at
\r
29 http://www.ietf.org/ietf/1id-abstracts.txt.
\r
31 The list of Internet-Draft Shadow Directories can be accessed at
\r
32 http://www.ietf.org/shadow.html.
\r
36 Copyright (C) The IETF Trust (2008).
\r
40 This document specifies Version 1.2 of the Transport Layer Security
\r
41 (TLS) protocol. The TLS protocol provides communications security
\r
42 over the Internet. The protocol allows client/server applications to
\r
43 communicate in a way that is designed to prevent eavesdropping,
\r
44 tampering, or message forgery.
\r
52 Dierks & Rescorla Standards Track [Page 1]
\r
54 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
60 1.1. Requirements Terminology 5
\r
61 1.2. Major Differences from TLS 1.1 5
\r
63 3. Goals of This Document 7
\r
64 4. Presentation Language 7
\r
65 4.1. Basic Block Size 7
\r
66 4.2. Miscellaneous 7
\r
70 4.6. Constructed Types 10
\r
72 4.7. Cryptographic Attributes 11
\r
74 5. HMAC and the Pseudorandom Function 14
\r
75 6. The TLS Record Protocol 15
\r
76 6.1. Connection States 16
\r
77 6.2. Record layer 18
\r
78 6.2.1. Fragmentation 19
\r
79 6.2.2. Record Compression and Decompression 20
\r
80 6.2.3. Record Payload Protection 21
\r
81 6.2.3.1. Null or Standard Stream Cipher 21
\r
82 6.2.3.2. CBC Block Cipher 22
\r
83 6.2.3.3. AEAD ciphers 24
\r
84 6.3. Key Calculation 25
\r
85 7. The TLS Handshaking Protocols 26
\r
86 7.1. Change Cipher Spec Protocol 27
\r
87 7.2. Alert Protocol 27
\r
88 7.2.1. Closure Alerts 28
\r
89 7.2.2. Error Alerts 29
\r
90 7.3. Handshake Protocol Overview 33
\r
91 7.4. Handshake Protocol 36
\r
92 7.4.1. Hello Messages 37
\r
93 7.4.1.1. Hello Request 37
\r
94 7.4.1.2. Client Hello 38
\r
95 7.4.1.3. Server Hello 41
\r
96 7.4.1.4 Hello Extensions 42
\r
97 7.4.1.4.1 Signature Algorithms 43
\r
98 7.4.2. Server Certificate 45
\r
99 7.4.3. Server Key Exchange Message 47
\r
100 7.4.4. Certificate Request 50
\r
101 7.4.5 Server hello done 51
\r
102 7.4.6. Client Certificate 52
\r
103 7.4.7. Client Key Exchange Message 54
\r
104 7.4.7.1. RSA Encrypted Premaster Secret Message 54
\r
108 Dierks & Rescorla Standards Track [Page 2]
\r
110 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
113 7.4.7.2. Client Diffie-Hellman Public Value 57
\r
114 7.4.8. Certificate verify 58
\r
116 8. Cryptographic Computations 60
\r
117 8.1. Computing the Master Secret 60
\r
119 8.1.2. Diffie-Hellman 61
\r
120 9. Mandatory Cipher Suites 61
\r
121 10. Application Data Protocol 61
\r
122 11. Security Considerations 61
\r
123 12. IANA Considerations 61
\r
124 A. Protocol Constant Values 64
\r
125 A.1. Record Layer 64
\r
126 A.2. Change Cipher Specs Message 65
\r
127 A.3. Alert Messages 65
\r
128 A.4. Handshake Protocol 66
\r
129 A.4.1. Hello Messages 66
\r
130 A.4.2. Server Authentication and Key Exchange Messages 68
\r
131 A.4.3. Client Authentication and Key Exchange Messages 69
\r
132 A.4.4. Handshake Finalization Message 70
\r
133 A.5. The Cipher Suite 70
\r
134 A.6. The Security Parameters 72
\r
135 A.7. Changes to RFC 4492 73
\r
137 C. Cipher Suite Definitions 78
\r
138 D. Implementation Notes 80
\r
139 D.1 Random Number Generation and Seeding 80
\r
140 D.2 Certificates and Authentication 80
\r
141 D.3 Cipher Suites 80
\r
142 D.4 Implementation Pitfalls 80
\r
143 E. Backward Compatibility 83
\r
144 E.1 Compatibility with TLS 1.0/1.1 and SSL 3.0 83
\r
145 E.2 Compatibility with SSL 2.0 84
\r
146 E.3. Avoiding Man-in-the-Middle Version Rollback 86
\r
147 F. Security Analysis 87
\r
148 F.1. Handshake Protocol 87
\r
149 F.1.1. Authentication and Key Exchange 87
\r
150 F.1.1.1. Anonymous Key Exchange 87
\r
151 F.1.1.2. RSA Key Exchange and Authentication 88
\r
152 F.1.1.3. Diffie-Hellman Key Exchange with Authentication 88
\r
153 F.1.2. Version Rollback Attacks 89
\r
154 F.1.3. Detecting Attacks Against the Handshake Protocol 90
\r
155 F.1.4. Resuming Sessions 90
\r
156 F.2. Protecting Application Data 90
\r
157 F.3. Explicit IVs 91
\r
158 F.4. Security of Composite Cipher Modes 91
\r
159 F.5 Denial of Service 92
\r
164 Dierks & Rescorla Standards Track [Page 3]
\r
166 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
171 The primary goal of the TLS Protocol is to provide privacy and data
\r
172 integrity between two communicating applications. The protocol is
\r
173 composed of two layers: the TLS Record Protocol and the TLS Handshake
\r
174 Protocol. At the lowest level, layered on top of some reliable
\r
175 transport protocol (e.g., TCP[TCP]), is the TLS Record Protocol. The
\r
176 TLS Record Protocol provides connection security that has two basic
\r
179 - The connection is private. Symmetric cryptography is used for
\r
180 data encryption (e.g., DES [DES], RC4 [SCH] etc.). The keys for
\r
181 this symmetric encryption are generated uniquely for each
\r
182 connection and are based on a secret negotiated by another
\r
183 protocol (such as the TLS Handshake Protocol). The Record Protocol
\r
184 can also be used without encryption.
\r
186 - The connection is reliable. Message transport includes a message
\r
187 integrity check using a keyed MAC. Secure hash functions (e.g.,
\r
188 SHA, MD5, etc.) are used for MAC computations. The Record Protocol
\r
189 can operate without a MAC, but is generally only used in this mode
\r
190 while another protocol is using the Record Protocol as a transport
\r
191 for negotiating security parameters.
\r
193 The TLS Record Protocol is used for encapsulation of various higher-
\r
194 level protocols. One such encapsulated protocol, the TLS Handshake
\r
195 Protocol, allows the server and client to authenticate each other and
\r
196 to negotiate an encryption algorithm and cryptographic keys before
\r
197 the application protocol transmits or receives its first byte of
\r
198 data. The TLS Handshake Protocol provides connection security that
\r
199 has three basic properties:
\r
201 - The peer's identity can be authenticated using asymmetric, or
\r
202 public key, cryptography (e.g., RSA [RSA], DSS [DSS], etc.). This
\r
203 authentication can be made optional, but is generally required for
\r
204 at least one of the peers.
\r
206 - The negotiation of a shared secret is secure: the negotiated
\r
207 secret is unavailable to eavesdroppers, and for any authenticated
\r
208 connection the secret cannot be obtained, even by an attacker who
\r
209 can place himself in the middle of the connection.
\r
211 - The negotiation is reliable: no attacker can modify the
\r
212 negotiation communication without being detected by the parties to
\r
215 One advantage of TLS is that it is application protocol independent.
\r
216 Higher-level protocols can layer on top of the TLS Protocol
\r
220 Dierks & Rescorla Standards Track [Page 4]
\r
222 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
225 transparently. The TLS standard, however, does not specify how
\r
226 protocols add security with TLS; the decisions on how to initiate TLS
\r
227 handshaking and how to interpret the authentication certificates
\r
228 exchanged are left to the judgment of the designers and implementors
\r
229 of protocols that run on top of TLS.
\r
231 1.1. Requirements Terminology
\r
233 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
\r
234 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
\r
235 document are to be interpreted as described in RFC 2119 [REQ].
\r
237 1.2. Major Differences from TLS 1.1
\r
239 This document is a revision of the TLS 1.1 [TLS1.1] protocol which
\r
240 contains improved flexibility, particularly for negotiation of
\r
241 cryptographic algorithms. The major changes are:
\r
243 - The MD5/SHA-1 combination in the PRF has been replaced with cipher
\r
244 suite specified PRFs. All cipher suites in this document use
\r
247 - The MD5/SHA-1 combination in the digitally-signed element has been
\r
248 replaced with a single hash. Signed elements now include a field
\r
249 that explicitly specifies the hash algorithm used.
\r
251 - Substantial cleanup to the clients and servers ability to specify
\r
252 which hash and signature algorithms they will accept. Note that
\r
253 this also relaxes some of the constraints on signature and hash
\r
254 algorithms from previous versions of TLS.
\r
256 - Addition of support for authenticated encryption with additional
\r
259 - TLS Extensions definition and AES Cipher Suites were merged in
\r
260 from external [TLSEXT] and [TLSAES].
\r
262 - Tighter checking of EncryptedPreMasterSecret version numbers.
\r
264 - Tightened up a number of requirements.
\r
266 - Verify_data length now depends on the cipher suite (default is
\r
269 - Cleaned up description of Bleichenbacher/Klima attack defenses.
\r
271 - Alerts MUST now be sent in many cases.
\r
276 Dierks & Rescorla Standards Track [Page 5]
\r
278 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
281 - After a certificate_request, if no certificates are available,
\r
282 clients now MUST send an empty certificate list.
\r
284 - TLS_RSA_WITH_AES_128_CBC_SHA is now the mandatory to implement
\r
287 - Added HMAC-SHA256 cipher suites
\r
289 - Removed IDEA and DES cipher suites. They are now deprecated and
\r
290 will be documented in a separate document.
\r
292 - Support for the SSLv2 backward-compatible hello is now a MAY, not
\r
293 a SHOULD, with sending it a SHOULD not. Support will probably
\r
294 become a SHOULD NOT in the future.
\r
296 - Added limited "fall-through" to the presentation language to allow
\r
297 multiple case arms to have the same encoding.
\r
299 - Added an Implementation Pitfalls sections
\r
301 - The usual clarifications and editorial work.
\r
305 The goals of TLS Protocol, in order of their priority, are as
\r
308 1. Cryptographic security: TLS should be used to establish a secure
\r
309 connection between two parties.
\r
311 2. Interoperability: Independent programmers should be able to
\r
312 develop applications utilizing TLS that can successfully exchange
\r
313 cryptographic parameters without knowledge of one another's code.
\r
315 3. Extensibility: TLS seeks to provide a framework into which new
\r
316 public key and bulk encryption methods can be incorporated as
\r
317 necessary. This will also accomplish two sub-goals: preventing the
\r
318 need to create a new protocol (and risking the introduction of
\r
319 possible new weaknesses) and avoiding the need to implement an
\r
320 entire new security library.
\r
322 4. Relative efficiency: Cryptographic operations tend to be highly
\r
323 CPU intensive, particularly public key operations. For this
\r
324 reason, the TLS protocol has incorporated an optional session
\r
325 caching scheme to reduce the number of connections that need to be
\r
326 established from scratch. Additionally, care has been taken to
\r
327 reduce network activity.
\r
332 Dierks & Rescorla Standards Track [Page 6]
\r
334 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
337 3. Goals of This Document
\r
339 This document and the TLS protocol itself are based on the SSL 3.0
\r
340 Protocol Specification as published by Netscape. The differences
\r
341 between this protocol and SSL 3.0 are not dramatic, but they are
\r
342 significant enough that the various versions of TLS and SSL 3.0 do
\r
343 not interoperate (although each protocol incorporates a mechanism by
\r
344 which an implementation can back down to prior versions). This
\r
345 document is intended primarily for readers who will be implementing
\r
346 the protocol and for those doing cryptographic analysis of it. The
\r
347 specification has been written with this in mind, and it is intended
\r
348 to reflect the needs of those two groups. For that reason, many of
\r
349 the algorithm-dependent data structures and rules are included in the
\r
350 body of the text (as opposed to in an appendix), providing easier
\r
353 This document is not intended to supply any details of service
\r
354 definition or of interface definition, although it does cover select
\r
355 areas of policy as they are required for the maintenance of solid
\r
359 4. Presentation Language
\r
361 This document deals with the formatting of data in an external
\r
362 representation. The following very basic and somewhat casually
\r
363 defined presentation syntax will be used. The syntax draws from
\r
364 several sources in its structure. Although it resembles the
\r
365 programming language "C" in its syntax and XDR [XDR] in both its
\r
366 syntax and intent, it would be risky to draw too many parallels. The
\r
367 purpose of this presentation language is to document TLS only; it has
\r
368 no general application beyond that particular goal.
\r
370 4.1. Basic Block Size
\r
372 The representation of all data items is explicitly specified. The
\r
373 basic data block size is one byte (i.e., 8 bits). Multiple byte data
\r
374 items are concatenations of bytes, from left to right, from top to
\r
375 bottom. From the bytestream, a multi-byte item (a numeric in the
\r
376 example) is formed (using C notation) by:
\r
378 value = (byte[0] << 8*(n-1)) | (byte[1] << 8*(n-2)) |
\r
381 This byte ordering for multi-byte values is the commonplace network
\r
382 byte order or big endian format.
\r
388 Dierks & Rescorla Standards Track [Page 7]
\r
390 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
393 Comments begin with "/*" and end with "*/".
\r
395 Optional components are denoted by enclosing them in "[[ ]]" double
\r
398 Single-byte entities containing uninterpreted data are of type
\r
403 A vector (single dimensioned array) is a stream of homogeneous data
\r
404 elements. The size of the vector may be specified at documentation
\r
405 time or left unspecified until runtime. In either case, the length
\r
406 declares the number of bytes, not the number of elements, in the
\r
407 vector. The syntax for specifying a new type, T', that is a fixed-
\r
408 length vector of type T is
\r
412 Here, T' occupies n bytes in the data stream, where n is a multiple
\r
413 of the size of T. The length of the vector is not included in the
\r
416 In the following example, Datum is defined to be three consecutive
\r
417 bytes that the protocol does not interpret, while Data is three
\r
418 consecutive Datum, consuming a total of nine bytes.
\r
420 opaque Datum[3]; /* three uninterpreted bytes */
\r
421 Datum Data[9]; /* 3 consecutive 3 byte vectors */
\r
423 Variable-length vectors are defined by specifying a subrange of legal
\r
424 lengths, inclusively, using the notation <floor..ceiling>. When
\r
425 these are encoded, the actual length precedes the vector's contents
\r
426 in the byte stream. The length will be in the form of a number
\r
427 consuming as many bytes as required to hold the vector's specified
\r
428 maximum (ceiling) length. A variable-length vector with an actual
\r
429 length field of zero is referred to as an empty vector.
\r
431 T T'<floor..ceiling>;
\r
433 In the following example, mandatory is a vector that must contain
\r
434 between 300 and 400 bytes of type opaque. It can never be empty. The
\r
435 actual length field consumes two bytes, a uint16, sufficient to
\r
436 represent the value 400 (see Section 4.4). On the other hand, longer
\r
437 can represent up to 800 bytes of data, or 400 uint16 elements, and it
\r
438 may be empty. Its encoding will include a two-byte actual length
\r
439 field prepended to the vector. The length of an encoded vector must
\r
440 be an even multiple of the length of a single element (for example, a
\r
444 Dierks & Rescorla Standards Track [Page 8]
\r
446 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
449 17-byte vector of uint16 would be illegal).
\r
451 opaque mandatory<300..400>;
\r
452 /* length field is 2 bytes, cannot be empty */
\r
453 uint16 longer<0..800>;
\r
454 /* zero to 400 16-bit unsigned integers */
\r
458 The basic numeric data type is an unsigned byte (uint8). All larger
\r
459 numeric data types are formed from fixed-length series of bytes
\r
460 concatenated as described in Section 4.1 and are also unsigned. The
\r
461 following numeric types are predefined.
\r
468 All values, here and elsewhere in the specification, are stored in
\r
469 "network" or "big-endian" order; the uint32 represented by the hex
\r
470 bytes 01 02 03 04 is equivalent to the decimal value 16909060.
\r
472 Note that in some cases (e.g., DH parameters) it is necessary to
\r
473 represent integers as opaque vectors. In such cases, they are
\r
474 represented as unsigned integers (i.e., leading zero octets are not
\r
475 required even if the most significant bit is set).
\r
479 An additional sparse data type is available called enum. A field of
\r
480 type enum can only assume the values declared in the definition.
\r
481 Each definition is a different type. Only enumerateds of the same
\r
482 type may be assigned or compared. Every element of an enumerated must
\r
483 be assigned a value, as demonstrated in the following example. Since
\r
484 the elements of the enumerated are not ordered, they can be assigned
\r
485 any unique value, in any order.
\r
487 enum { e1(v1), e2(v2), ... , en(vn) [[, (n)]] } Te;
\r
489 Enumerateds occupy as much space in the byte stream as would its
\r
490 maximal defined ordinal value. The following definition would cause
\r
491 one byte to be used to carry fields of type Color.
\r
493 enum { red(3), blue(5), white(7) } Color;
\r
495 One may optionally specify a value without its associated tag to
\r
496 force the width definition without defining a superfluous element.
\r
500 Dierks & Rescorla Standards Track [Page 9]
\r
502 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
505 In the following example, Taste will consume two bytes in the data
\r
506 stream but can only assume the values 1, 2, or 4.
\r
508 enum { sweet(1), sour(2), bitter(4), (32000) } Taste;
\r
510 The names of the elements of an enumeration are scoped within the
\r
511 defined type. In the first example, a fully qualified reference to
\r
512 the second element of the enumeration would be Color.blue. Such
\r
513 qualification is not required if the target of the assignment is well
\r
516 Color color = Color.blue; /* overspecified, legal */
\r
517 Color color = blue; /* correct, type implicit */
\r
519 For enumerateds that are never converted to external representation,
\r
520 the numerical information may be omitted.
\r
522 enum { low, medium, high } Amount;
\r
524 4.6. Constructed Types
\r
526 Structure types may be constructed from primitive types for
\r
527 convenience. Each specification declares a new, unique type. The
\r
528 syntax for definition is much like that of C.
\r
537 The fields within a structure may be qualified using the type's name,
\r
538 with a syntax much like that available for enumerateds. For example,
\r
539 T.f2 refers to the second field of the previous declaration.
\r
540 Structure definitions may be embedded.
\r
544 Defined structures may have variants based on some knowledge that is
\r
545 available within the environment. The selector must be an enumerated
\r
546 type that defines the possible variants the structure defines. There
\r
547 must be a case arm for every element of the enumeration declared in
\r
548 the select. Case arms have limited fall-through: if two case arms
\r
549 follow in immediate succession with no fields in between, then they
\r
550 both contain the same fields. Thus, in the example below, "orange"
\r
551 and "banana" both contain V2. Note that this is a new piece of syntax
\r
556 Dierks & Rescorla Standards Track [Page 10]
\r
558 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
561 The body of the variant structure may be given a label for reference.
\r
562 The mechanism by which the variant is selected at runtime is not
\r
563 prescribed by the presentation language.
\r
573 case e3: case e4: Te3;
\r
581 enum { apple, orange, banana } VariantTag;
\r
585 opaque string<0..10>; /* variable length */
\r
590 opaque string[10]; /* fixed length */
\r
594 select (VariantTag) { /* value of selector is implicit */
\r
596 V1; /* VariantBody, tag = apple */
\r
599 V2; /* VariantBody, tag = orange or banana */
\r
600 } variant_body; /* optional label on variant */
\r
604 4.7. Cryptographic Attributes
\r
606 The five cryptographic operations digital signing, stream cipher
\r
607 encryption, block cipher encryption, authenticated encryption with
\r
608 additional data (AEAD) encryption and public key encryption are
\r
612 Dierks & Rescorla Standards Track [Page 11]
\r
614 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
617 designated digitally-signed, stream-ciphered, block-ciphered, aead-
\r
618 ciphered, and public-key-encrypted, respectively. A field's
\r
619 cryptographic processing is specified by prepending an appropriate
\r
620 key word designation before the field's type specification.
\r
621 Cryptographic keys are implied by the current session state (see
\r
624 A digitally-signed element is encoded as a struct DigitallySigned:
\r
627 SignatureAndHashAlgorithm algorithm;
\r
628 opaque signature<0..2^16-1>;
\r
631 The algorithm field specifies the algorithm used (see Section
\r
632 7.4.1.4.1 for the definition of this field.) Note that the
\r
633 introduction of the algorithm field is a change from previous
\r
634 versions. The signature is a digital signature using those
\r
635 algorithms over the contents of the element. The contents themselves
\r
636 do not appear on the wire but are simply calculated. The length of
\r
637 the signature is specified by the signing algorithm and key.
\r
639 In RSA signing, the opaque vector contains the signature generated
\r
640 using the RSASSA-PKCS1-v1_5 signature scheme defined in [PKCS1]. As
\r
641 discussed in [PKCS1], the DigestInfo MUST be DER encoded and for hash
\r
642 algorithms without parameters (which include SHA-1) the
\r
643 DigestInfo.AlgorithmIdentifier.parameters field MUST be NULL but
\r
644 implementations MUST accept both without parameters and with NULL
\r
645 parameters. Note that earlier versions of TLS used a different RSA
\r
646 signature scheme which did not include a DigestInfo encoding.
\r
648 In DSS, the 20 bytes of the SHA-1 hash are run directly through the
\r
649 Digital Signing Algorithm with no additional hashing. This produces
\r
650 two values, r and s. The DSS signature is an opaque vector, as above,
\r
651 the contents of which are the DER encoding of:
\r
653 Dss-Sig-Value ::= SEQUENCE {
\r
658 Note: In current terminology, DSA refers to the Digital Signature
\r
659 Algorithm and DSS refers to the NIST standard. For historical
\r
660 reasons, this document uses DSS and DSA interchangeably
\r
661 to refer to the DSA algorithm, as was done in SSLv3.
\r
663 In stream cipher encryption, the plaintext is exclusive-ORed with an
\r
664 identical amount of output generated from a cryptographically secure
\r
668 Dierks & Rescorla Standards Track [Page 12]
\r
670 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
673 keyed pseudorandom number generator.
\r
675 In block cipher encryption, every block of plaintext encrypts to a
\r
676 block of ciphertext. All block cipher encryption is done in CBC
\r
677 (Cipher Block Chaining) mode, and all items that are block-ciphered
\r
678 will be an exact multiple of the cipher block length.
\r
680 In AEAD encryption, the plaintext is simultaneously encrypted and
\r
681 integrity protected. The input may be of any length and aead-ciphered
\r
682 output is generally larger than the input in order to accomodate the
\r
683 integrity check value.
\r
685 In public key encryption, a public key algorithm is used to encrypt
\r
686 data in such a way that it can be decrypted only with the matching
\r
687 private key. A public-key-encrypted element is encoded as an opaque
\r
688 vector <0..2^16-1>, where the length is specified by the encryption
\r
691 RSA encryption is done using the RSAES-PKCS1-v1_5 encryption scheme
\r
692 defined in [PKCS1].
\r
694 In the following example
\r
696 stream-ciphered struct {
\r
699 digitally-signed opaque {
\r
700 uint8 field3<0..255>;
\r
706 The contents of the inner struct (field3 and field4) are used as
\r
707 input for the signature/hash algorithm, and then the entire structure
\r
708 is encrypted with a stream cipher. The length of this structure, in
\r
709 bytes, would be equal to two bytes for field1 and field2, plus two
\r
710 bytes for the signature and hash algorithm, plus two bytes for the
\r
711 length of the signature, plus the length of the output of the signing
\r
712 algorithm. This is known because the algorithm and key used for the
\r
713 signing are known prior to encoding or decoding this structure.
\r
717 Typed constants can be defined for purposes of specification by
\r
718 declaring a symbol of the desired type and assigning values to it.
\r
719 Under-specified types (opaque, variable length vectors, and
\r
720 structures that contain opaque) cannot be assigned values. No fields
\r
724 Dierks & Rescorla Standards Track [Page 13]
\r
726 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
729 of a multi-element structure or vector may be elided.
\r
738 Example1 ex1 = {1, 4}; /* assigns f1 = 1, f2 = 4 */
\r
741 5. HMAC and the Pseudorandom Function
\r
743 The TLS record layer uses a keyed Message Authentication Code (MAC)
\r
744 to protect message integrity. The cipher suites defined in this
\r
745 document use a construction known as HMAC, described in [HMAC], which
\r
746 is based on a hash function. Other cipher suites MAY define their own
\r
747 MAC constructions, if needed.
\r
749 In addition, a construction is required to do expansion of secrets
\r
750 into blocks of data for the purposes of key generation or validation.
\r
751 This pseudo-random function (PRF) takes as input a secret, a seed,
\r
752 and an identifying label and produces an output of arbitrary length.
\r
754 In this section, we define one PRF, based on HMAC. This PRF with the
\r
755 SHA-256 hash function is used for all cipher suites defined in this
\r
756 document and in TLS documents published prior to this document when
\r
757 TLS 1.2 is negotiated. New cipher suites MUST explicitly specify a
\r
758 PRF and in general SHOULD use the TLS PRF with SHA-256 or a stronger
\r
759 standard hash function.
\r
761 First, we define a data expansion function, P_hash(secret, data) that
\r
762 uses a single hash function to expand a secret and seed into an
\r
763 arbitrary quantity of output:
\r
765 P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) +
\r
766 HMAC_hash(secret, A(2) + seed) +
\r
767 HMAC_hash(secret, A(3) + seed) + ...
\r
769 Where + indicates concatenation.
\r
774 A(i) = HMAC_hash(secret, A(i-1))
\r
776 P_hash can be iterated as many times as is necessary to produce the
\r
780 Dierks & Rescorla Standards Track [Page 14]
\r
782 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
785 required quantity of data. For example, if P_SHA256 is being used to
\r
786 create 80 bytes of data, it will have to be iterated three times
\r
787 (through A(3)), creating 96 bytes of output data; the last 16 bytes
\r
788 of the final iteration will then be discarded, leaving 80 bytes of
\r
791 TLS's PRF is created by applying P_hash to the secret as:
\r
793 PRF(secret, label, seed) = P_<hash>(secret, label + seed)
\r
795 The label is an ASCII string. It should be included in the exact form
\r
796 it is given without a length byte or trailing null character. For
\r
797 example, the label "slithy toves" would be processed by hashing the
\r
800 73 6C 69 74 68 79 20 74 6F 76 65 73
\r
803 6. The TLS Record Protocol
\r
805 The TLS Record Protocol is a layered protocol. At each layer,
\r
806 messages may include fields for length, description, and content.
\r
807 The Record Protocol takes messages to be transmitted, fragments the
\r
808 data into manageable blocks, optionally compresses the data, applies
\r
809 a MAC, encrypts, and transmits the result. Received data is
\r
810 decrypted, verified, decompressed, reassembled, and then delivered to
\r
811 higher-level clients.
\r
813 Four record protocol clients are described in this document: the
\r
814 handshake protocol, the alert protocol, the change cipher spec
\r
815 protocol, and the application data protocol. In order to allow
\r
816 extension of the TLS protocol, additional record types can be
\r
817 supported by the record protocol. New record type values are assigned
\r
818 by IANA as described in Section 12.
\r
820 Implementations MUST NOT send record types not defined in this
\r
821 document unless negotiated by some extension. If a TLS
\r
822 implementation receives an unexpected record type, it MUST send an
\r
823 unexpected_message alert.
\r
825 Any protocol designed for use over TLS MUST be carefully designed to
\r
826 deal with all possible attacks against it. Note that because the
\r
827 type and length of a record are not protected by encryption, care
\r
828 SHOULD be taken to minimize the value of traffic analysis of these
\r
836 Dierks & Rescorla Standards Track [Page 15]
\r
838 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
841 6.1. Connection States
\r
843 A TLS connection state is the operating environment of the TLS Record
\r
844 Protocol. It specifies a compression algorithm, an encryption
\r
845 algorithm, and a MAC algorithm. In addition, the parameters for these
\r
846 algorithms are known: the MAC key and the bulk encryption keys for
\r
847 the connection in both the read and the write directions. Logically,
\r
848 there are always four connection states outstanding: the current read
\r
849 and write states, and the pending read and write states. All records
\r
850 are processed under the current read and write states. The security
\r
851 parameters for the pending states can be set by the TLS Handshake
\r
852 Protocol, and the Change Cipher Spec can selectively make either of
\r
853 the pending states current, in which case the appropriate current
\r
854 state is disposed of and replaced with the pending state; the pending
\r
855 state is then reinitialized to an empty state. It is illegal to make
\r
856 a state that has not been initialized with security parameters a
\r
857 current state. The initial current state always specifies that no
\r
858 encryption, compression, or MAC will be used.
\r
860 The security parameters for a TLS Connection read and write state are
\r
861 set by providing the following values:
\r
864 Whether this entity is considered the "client" or the "server" in
\r
868 An algorithm used to generate keys from the master secret (see
\r
869 Sections 5 and 6.3).
\r
871 bulk encryption algorithm
\r
872 An algorithm to be used for bulk encryption. This specification
\r
873 includes the key size of this algorithm, whether it is a block,
\r
874 stream, or AEAD cipher, the block size of the cipher (if
\r
875 appropriate), and the lengths of explicit and implicit
\r
876 initialization vectors (or nonces).
\r
879 An algorithm to be used for message authentication. This
\r
880 specification includes the size of the value returned by the MAC
\r
883 compression algorithm
\r
884 An algorithm to be used for data compression. This specification
\r
885 must include all information the algorithm requires to do
\r
892 Dierks & Rescorla Standards Track [Page 16]
\r
894 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
897 A 48-byte secret shared between the two peers in the connection.
\r
900 A 32-byte value provided by the client.
\r
903 A 32-byte value provided by the server.
\r
905 These parameters are defined in the presentation language as:
\r
907 enum { server, client } ConnectionEnd;
\r
909 enum { tls_prf_sha256 } PRFAlgorithm;
\r
911 enum { null, rc4, 3des, aes }
\r
912 BulkCipherAlgorithm;
\r
914 enum { stream, block, aead } CipherType;
\r
916 enum { null, hmac_md5, hmac_sha, hmac_sha256, hmac_sha384,
\r
917 hmac_sha512} MACAlgorithm;
\r
919 /* The use of "sha" above is historical and denotes SHA-1 */
\r
921 enum { null(0), (255) } CompressionMethod;
\r
923 /* The algorithms specified in CompressionMethod,
\r
924 BulkCipherAlgorithm, and MACAlgorithm may be added to. */
\r
927 ConnectionEnd entity;
\r
928 PRFAlgorithm prf_algorithm;
\r
929 BulkCipherAlgorithm bulk_cipher_algorithm;
\r
930 CipherType cipher_type;
\r
931 uint8 enc_key_length;
\r
932 uint8 block_length;
\r
933 uint8 fixed_iv_length;
\r
934 uint8 record_iv_length;
\r
935 MACAlgorithm mac_algorithm;
\r
937 uint8 mac_key_length;
\r
938 CompressionMethod compression_algorithm;
\r
939 opaque master_secret[48];
\r
940 opaque client_random[32];
\r
941 opaque server_random[32];
\r
942 } SecurityParameters;
\r
944 The record layer will use the security parameters to generate the
\r
948 Dierks & Rescorla Standards Track [Page 17]
\r
950 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
953 following six items (some of which are not required by all ciphers,
\r
954 and are thus empty):
\r
956 client write MAC key
\r
957 server write MAC key
\r
958 client write encryption key
\r
959 server write encryption key
\r
963 The client write parameters are used by the server when receiving and
\r
964 processing records and vice-versa. The algorithm used for generating
\r
965 these items from the security parameters is described in Section 6.3.
\r
967 Once the security parameters have been set and the keys have been
\r
968 generated, the connection states can be instantiated by making them
\r
969 the current states. These current states MUST be updated for each
\r
970 record processed. Each connection state includes the following
\r
974 The current state of the compression algorithm.
\r
977 The current state of the encryption algorithm. This will consist
\r
978 of the scheduled key for that connection. For stream ciphers, this
\r
979 will also contain whatever state information is necessary to allow
\r
980 the stream to continue to encrypt or decrypt data.
\r
983 The MAC key for this connection, as generated above.
\r
986 Each connection state contains a sequence number, which is
\r
987 maintained separately for read and write states. The sequence
\r
988 number MUST be set to zero whenever a connection state is made the
\r
989 active state. Sequence numbers are of type uint64 and may not
\r
990 exceed 2^64-1. Sequence numbers do not wrap. If a TLS
\r
991 implementation would need to wrap a sequence number, it must
\r
992 renegotiate instead. A sequence number is incremented after each
\r
993 record: specifically, the first record transmitted under a
\r
994 particular connection state MUST use sequence number 0.
\r
998 The TLS Record Layer receives uninterpreted data from higher layers
\r
999 in non-empty blocks of arbitrary size.
\r
1004 Dierks & Rescorla Standards Track [Page 18]
\r
1006 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1009 6.2.1. Fragmentation
\r
1011 The record layer fragments information blocks into TLSPlaintext
\r
1012 records carrying data in chunks of 2^14 bytes or less. Client message
\r
1013 boundaries are not preserved in the record layer (i.e., multiple
\r
1014 client messages of the same ContentType MAY be coalesced into a
\r
1015 single TLSPlaintext record, or a single message MAY be fragmented
\r
1016 across several records).
\r
1021 } ProtocolVersion;
\r
1024 change_cipher_spec(20), alert(21), handshake(22),
\r
1025 application_data(23), (255)
\r
1030 ProtocolVersion version;
\r
1032 opaque fragment[TLSPlaintext.length];
\r
1036 The higher-level protocol used to process the enclosed fragment.
\r
1039 The version of the protocol being employed. This document
\r
1040 describes TLS Version 1.2, which uses the version { 3, 3 }. The
\r
1041 version value 3.3 is historical, deriving from the use of 3.1 for
\r
1042 TLS 1.0. (See Appendix A.1). Note that a client that supports
\r
1043 multiple versions of TLS may not know what version will be
\r
1044 employed before it receives the ServerHello. See Appendix E for
\r
1045 discussion about what record layer version number should be
\r
1046 employed for ClientHello.
\r
1049 The length (in bytes) of the following TLSPlaintext.fragment. The
\r
1050 length MUST NOT exceed 2^14.
\r
1053 The application data. This data is transparent and treated as an
\r
1054 independent block to be dealt with by the higher-level protocol
\r
1055 specified by the type field.
\r
1060 Dierks & Rescorla Standards Track [Page 19]
\r
1062 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1065 Implementations MUST NOT send zero-length fragments of Handshake,
\r
1066 Alert, or Change Cipher Spec content types. Zero-length fragments of
\r
1067 Application data MAY be sent as they are potentially useful as a
\r
1068 traffic analysis countermeasure.
\r
1070 Note: Data of different TLS Record layer content types MAY be
\r
1071 interleaved. Application data is generally of lower precedence for
\r
1072 transmission than other content types. However, records MUST be
\r
1073 delivered to the network in the same order as they are protected by
\r
1074 the record layer. Recipients MUST receive and process interleaved
\r
1075 application layer traffic during handshakes subsequent to the first
\r
1076 one on a connection.
\r
1078 6.2.2. Record Compression and Decompression
\r
1080 All records are compressed using the compression algorithm defined in
\r
1081 the current session state. There is always an active compression
\r
1082 algorithm; however, initially it is defined as
\r
1083 CompressionMethod.null. The compression algorithm translates a
\r
1084 TLSPlaintext structure into a TLSCompressed structure. Compression
\r
1085 functions are initialized with default state information whenever a
\r
1086 connection state is made active.
\r
1088 Compression must be lossless and may not increase the content length
\r
1089 by more than 1024 bytes. If the decompression function encounters a
\r
1090 TLSCompressed.fragment that would decompress to a length in excess of
\r
1091 2^14 bytes, it MUST report a fatal decompression failure error.
\r
1094 ContentType type; /* same as TLSPlaintext.type */
\r
1095 ProtocolVersion version;/* same as TLSPlaintext.version */
\r
1097 opaque fragment[TLSCompressed.length];
\r
1101 The length (in bytes) of the following TLSCompressed.fragment.
\r
1102 The length MUST NOT exceed 2^14 + 1024.
\r
1105 The compressed form of TLSPlaintext.fragment.
\r
1107 Note: A CompressionMethod.null operation is an identity operation; no
\r
1108 fields are altered.
\r
1110 Implementation note: Decompression functions are responsible for
\r
1111 ensuring that messages cannot cause internal buffer overflows.
\r
1116 Dierks & Rescorla Standards Track [Page 20]
\r
1118 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1121 6.2.3. Record Payload Protection
\r
1123 The encryption and MAC functions translate a TLSCompressed structure
\r
1124 into a TLSCiphertext. The decryption functions reverse the process.
\r
1125 The MAC of the record also includes a sequence number so that
\r
1126 missing, extra, or repeated messages are detectable.
\r
1130 ProtocolVersion version;
\r
1132 select (SecurityParameters.cipher_type) {
\r
1133 case stream: GenericStreamCipher;
\r
1134 case block: GenericBlockCipher;
\r
1135 case aead: GenericAEADCipher;
\r
1140 The type field is identical to TLSCompressed.type.
\r
1143 The version field is identical to TLSCompressed.version.
\r
1146 The length (in bytes) of the following TLSCiphertext.fragment.
\r
1147 The length MUST NOT exceed 2^14 + 2048.
\r
1150 The encrypted form of TLSCompressed.fragment, with the MAC.
\r
1152 6.2.3.1. Null or Standard Stream Cipher
\r
1154 Stream ciphers (including BulkCipherAlgorithm.null, see Appendix A.6)
\r
1155 convert TLSCompressed.fragment structures to and from stream
\r
1156 TLSCiphertext.fragment structures.
\r
1158 stream-ciphered struct {
\r
1159 opaque content[TLSCompressed.length];
\r
1160 opaque MAC[SecurityParameters.mac_length];
\r
1161 } GenericStreamCipher;
\r
1163 The MAC is generated as:
\r
1165 MAC(MAC_write_key, seq_num +
\r
1166 TLSCompressed.type +
\r
1167 TLSCompressed.version +
\r
1168 TLSCompressed.length +
\r
1172 Dierks & Rescorla Standards Track [Page 21]
\r
1174 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1177 TLSCompressed.fragment);
\r
1179 where "+" denotes concatenation.
\r
1182 The sequence number for this record.
\r
1185 The MAC algorithm specified by SecurityParameters.mac_algorithm.
\r
1187 Note that the MAC is computed before encryption. The stream cipher
\r
1188 encrypts the entire block, including the MAC. For stream ciphers that
\r
1189 do not use a synchronization vector (such as RC4), the stream cipher
\r
1190 state from the end of one record is simply used on the subsequent
\r
1191 packet. If the cipher suite is TLS_NULL_WITH_NULL_NULL, encryption
\r
1192 consists of the identity operation (i.e., the data is not encrypted,
\r
1193 and the MAC size is zero, implying that no MAC is used).
\r
1194 TLSCiphertext.length is TLSCompressed.length plus
\r
1195 SecurityParameters.mac_length.
\r
1197 6.2.3.2. CBC Block Cipher
\r
1199 For block ciphers (such as 3DES, or AES), the encryption and MAC
\r
1200 functions convert TLSCompressed.fragment structures to and from block
\r
1201 TLSCiphertext.fragment structures.
\r
1204 opaque IV[SecurityParameters.record_iv_length];
\r
1205 block-ciphered struct {
\r
1206 opaque content[TLSCompressed.length];
\r
1207 opaque MAC[SecurityParameters.mac_length];
\r
1208 uint8 padding[GenericBlockCipher.padding_length];
\r
1209 uint8 padding_length;
\r
1211 } GenericBlockCipher;
\r
1213 The MAC is generated as described in Section 6.2.3.1.
\r
1216 The Initialization Vector (IV) SHOULD be chosen at random, and
\r
1217 MUST be unpredictable. Note that in versions of TLS prior to 1.1,
\r
1218 there was no IV field, and the last ciphertext block of the
\r
1219 previous record (the "CBC residue") was used as the IV. This was
\r
1220 changed to prevent the attacks described in [CBCATT]. For block
\r
1221 ciphers, the IV length is of length
\r
1222 SecurityParameters.record_iv_length which is equal to the
\r
1223 SecurityParameters.block_size.
\r
1228 Dierks & Rescorla Standards Track [Page 22]
\r
1230 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1234 Padding that is added to force the length of the plaintext to be
\r
1235 an integral multiple of the block cipher's block length. The
\r
1236 padding MAY be any length up to 255 bytes, as long as it results
\r
1237 in the TLSCiphertext.length being an integral multiple of the
\r
1238 block length. Lengths longer than necessary might be desirable to
\r
1239 frustrate attacks on a protocol that are based on analysis of the
\r
1240 lengths of exchanged messages. Each uint8 in the padding data
\r
1241 vector MUST be filled with the padding length value. The receiver
\r
1242 MUST check this padding and MUST use the bad_record_mac alert to
\r
1243 indicate padding errors.
\r
1246 The padding length MUST be such that the total size of the
\r
1247 GenericBlockCipher structure is a multiple of the cipher's block
\r
1248 length. Legal values range from zero to 255, inclusive. This
\r
1249 length specifies the length of the padding field exclusive of the
\r
1250 padding_length field itself.
\r
1252 The encrypted data length (TLSCiphertext.length) is one more than the
\r
1253 sum of SecurityParameters.block_length, TLSCompressed.length,
\r
1254 SecurityParameters.mac_length, and padding_length.
\r
1256 Example: If the block length is 8 bytes, the content length
\r
1257 (TLSCompressed.length) is 61 bytes, and the MAC length is 20 bytes,
\r
1258 then the length before padding is 82 bytes (this does not include the
\r
1259 IV. Thus, the padding length modulo 8 must be equal to 6 in order to
\r
1260 make the total length an even multiple of 8 bytes (the block length).
\r
1261 The padding length can be 6, 14, 22, and so on, through 254. If the
\r
1262 padding length were the minimum necessary, 6, the padding would be 6
\r
1263 bytes, each containing the value 6. Thus, the last 8 octets of the
\r
1264 GenericBlockCipher before block encryption would be xx 06 06 06 06 06
\r
1265 06 06, where xx is the last octet of the MAC.
\r
1267 Note: With block ciphers in CBC mode (Cipher Block Chaining), it is
\r
1268 critical that the entire plaintext of the record be known before any
\r
1269 ciphertext is transmitted. Otherwise, it is possible for the attacker
\r
1270 to mount the attack described in [CBCATT].
\r
1272 Implementation Note: Canvel et al. [CBCTIME] have demonstrated a
\r
1273 timing attack on CBC padding based on the time required to compute
\r
1274 the MAC. In order to defend against this attack, implementations MUST
\r
1275 ensure that record processing time is essentially the same whether or
\r
1276 not the padding is correct. In general, the best way to do this is
\r
1277 to compute the MAC even if the padding is incorrect, and only then
\r
1278 reject the packet. For instance, if the pad appears to be incorrect,
\r
1279 the implementation might assume a zero-length pad and then compute
\r
1280 the MAC. This leaves a small timing channel, since MAC performance
\r
1284 Dierks & Rescorla Standards Track [Page 23]
\r
1286 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1289 depends to some extent on the size of the data fragment, but it is
\r
1290 not believed to be large enough to be exploitable, due to the large
\r
1291 block size of existing MACs and the small size of the timing signal.
\r
1293 6.2.3.3. AEAD ciphers
\r
1295 For AEAD [AEAD] ciphers (such as [CCM] or [GCM]) the AEAD function
\r
1296 converts TLSCompressed.fragment structures to and from AEAD
\r
1297 TLSCiphertext.fragment structures.
\r
1300 opaque nonce_explicit[SecurityParameters.record_iv_length];
\r
1301 aead-ciphered struct {
\r
1302 opaque content[TLSCompressed.length];
\r
1304 } GenericAEADCipher;
\r
1306 AEAD ciphers take as input a single key, a nonce, a plaintext, and
\r
1307 "additional data" to be included in the authentication check, as
\r
1308 described in Section 2.1 of [AEAD]. The key is either the
\r
1309 client_write_key or the server_write_key. No MAC key is used.
\r
1311 Each AEAD cipher suite MUST specify how the nonce supplied to the
\r
1312 AEAD operation is constructed, and what is the length of the
\r
1313 GenericAEADCipher.nonce_explicit part. In many cases, it is
\r
1314 appropriate to use the partially implicit nonce technique described
\r
1315 in Section 3.2.1 of [AEAD]; with record_iv_length being the length of
\r
1316 the explicit part. In this case, the implicit part SHOULD be derived
\r
1317 from key_block as client_write_iv and server_write_iv (as described
\r
1318 in Section 6.3), and the explicit part is included in
\r
1319 GenericAEAEDCipher.nonce_explicit.
\r
1321 The plaintext is the TLSCompressed.fragment.
\r
1323 The additional authenticated data, which we denote as
\r
1324 additional_data, is defined as follows:
\r
1326 additional_data = seq_num + TLSCompressed.type +
\r
1327 TLSCompressed.version + TLSCompressed.length;
\r
1329 Where "+" denotes concatenation.
\r
1331 The aead_output consists of the ciphertext output by the AEAD
\r
1332 encryption operation. The length will generally be larger than
\r
1333 TLSCompressed.length, but by an amount that varies with the AEAD
\r
1334 cipher. Since the ciphers might incorporate padding, the amount of
\r
1335 overhead could vary with different TLSCompressed.length values. Each
\r
1336 AEAD cipher MUST NOT produce an expansion of greater than 1024 bytes.
\r
1340 Dierks & Rescorla Standards Track [Page 24]
\r
1342 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1347 AEADEncrypted = AEAD-Encrypt(key, nonce, plaintext,
\r
1350 In order to decrypt and verify, the cipher takes as input the key,
\r
1351 nonce, the "additional_data", and the AEADEncrypted value. The output
\r
1352 is either the plaintext or an error indicating that the decryption
\r
1353 failed. There is no separate integrity check. I.e.,
\r
1355 TLSCompressed.fragment = AEAD-Decrypt(write_key, nonce,
\r
1360 If the decryption fails, a fatal bad_record_mac alert MUST be
\r
1363 6.3. Key Calculation
\r
1365 The Record Protocol requires an algorithm to generates keys required
\r
1366 by the current connection state (see Appendix A.6) from the security
\r
1367 parameters provided by the handshake protocol.
\r
1369 The master secret is expanded into a sequence of secure bytes, which
\r
1370 is then split to a client write MAC key, a server write MAC key, a
\r
1371 client write encryption key, and a server write encryption key. Each
\r
1372 of these is generated from the byte sequence in that order. Unused
\r
1373 values are empty. Some AEAD ciphers may additionally require a
\r
1374 client write IV and a server write IV (see Section 6.2.3.3).
\r
1376 When keys and MAC keys are generated, the master secret is used as an
\r
1379 To generate the key material, compute
\r
1381 key_block = PRF(SecurityParameters.master_secret,
\r
1383 SecurityParameters.server_random +
\r
1384 SecurityParameters.client_random);
\r
1386 until enough output has been generated. Then the key_block is
\r
1387 partitioned as follows:
\r
1389 client_write_MAC_key[SecurityParameters.mac_key_length]
\r
1390 server_write_MAC_key[SecurityParameters.mac_key_length]
\r
1391 client_write_key[SecurityParameters.enc_key_length]
\r
1392 server_write_key[SecurityParameters.enc_key_length]
\r
1396 Dierks & Rescorla Standards Track [Page 25]
\r
1398 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1401 client_write_IV[SecurityParameters.fixed_iv_length]
\r
1402 server_write_IV[SecurityParameters.fixed_iv_length]
\r
1404 Currently, the client_write_IV and server_write_IV are only generated
\r
1405 for implicit nonce techniques as described in Section 3.2.1 of
\r
1408 Implementation note: The currently defined cipher suite which
\r
1409 requires the most material is AES_256_CBC_SHA256. It requires 2 x 32
\r
1410 byte keys and 2 x 32 byte MAC keys, for a total 128 bytes of key
\r
1413 7. The TLS Handshaking Protocols
\r
1415 TLS has three subprotocols that are used to allow peers to agree upon
\r
1416 security parameters for the record layer, to authenticate themselves,
\r
1417 to instantiate negotiated security parameters, and to report error
\r
1418 conditions to each other.
\r
1420 The Handshake Protocol is responsible for negotiating a session,
\r
1421 which consists of the following items:
\r
1423 session identifier
\r
1424 An arbitrary byte sequence chosen by the server to identify an
\r
1425 active or resumable session state.
\r
1428 X509v3 [PKIX] certificate of the peer. This element of the state
\r
1431 compression method
\r
1432 The algorithm used to compress data prior to encryption.
\r
1435 Specifies the bulk data encryption algorithm (such as null, DES,
\r
1436 etc.) and a MAC algorithm (such as MD5 or SHA). It also defines
\r
1437 cryptographic attributes such as the mac_length. (See Appendix A.6
\r
1438 for formal definition.)
\r
1441 48-byte secret shared between the client and server.
\r
1444 A flag indicating whether the session can be used to initiate new
\r
1447 These items are then used to create security parameters for use by
\r
1448 the Record Layer when protecting application data. Many connections
\r
1452 Dierks & Rescorla Standards Track [Page 26]
\r
1454 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1457 can be instantiated using the same session through the resumption
\r
1458 feature of the TLS Handshake Protocol.
\r
1460 7.1. Change Cipher Spec Protocol
\r
1462 The change cipher spec protocol exists to signal transitions in
\r
1463 ciphering strategies. The protocol consists of a single message,
\r
1464 which is encrypted and compressed under the current (not the pending)
\r
1465 connection state. The message consists of a single byte of value 1.
\r
1468 enum { change_cipher_spec(1), (255) } type;
\r
1469 } ChangeCipherSpec;
\r
1471 The change cipher spec message is sent by both the client and the
\r
1472 server to notify the receiving party that subsequent records will be
\r
1473 protected under the newly negotiated CipherSpec and keys. Reception
\r
1474 of this message causes the receiver to instruct the Record Layer to
\r
1475 immediately copy the read pending state into the read current state.
\r
1476 Immediately after sending this message, the sender MUST instruct the
\r
1477 record layer to make the write pending state the write active state.
\r
1478 (See Section 6.1.) The change cipher spec message is sent during the
\r
1479 handshake after the security parameters have been agreed upon, but
\r
1480 before the verifying finished message is sent.
\r
1482 Note: If a rehandshake occurs while data is flowing on a connection,
\r
1483 the communicating parties may continue to send data using the old
\r
1484 CipherSpec. However, once the ChangeCipherSpec has been sent, the new
\r
1485 CipherSpec MUST be used. The first side to send the ChangeCipherSpec
\r
1486 does not know that the other side has finished computing the new
\r
1487 keying material (e.g., if it has to perform a time consuming public
\r
1488 key operation). Thus, a small window of time, during which the
\r
1489 recipient must buffer the data, MAY exist. In practice, with modern
\r
1490 machines this interval is likely to be fairly short.
\r
1492 7.2. Alert Protocol
\r
1494 One of the content types supported by the TLS Record layer is the
\r
1495 alert type. Alert messages convey the severity of the message and a
\r
1496 description of the alert. Alert messages with a level of fatal result
\r
1497 in the immediate termination of the connection. In this case, other
\r
1498 connections corresponding to the session may continue, but the
\r
1499 session identifier MUST be invalidated, preventing the failed session
\r
1500 from being used to establish new connections. Like other messages,
\r
1501 alert messages are encrypted and compressed, as specified by the
\r
1502 current connection state.
\r
1504 enum { warning(1), fatal(2), (255) } AlertLevel;
\r
1508 Dierks & Rescorla Standards Track [Page 27]
\r
1510 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1515 unexpected_message(10),
\r
1516 bad_record_mac(20),
\r
1517 decryption_failed_RESERVED(21),
\r
1518 record_overflow(22),
\r
1519 decompression_failure(30),
\r
1520 handshake_failure(40),
\r
1521 no_certificate_RESERVED(41),
\r
1522 bad_certificate(42),
\r
1523 unsupported_certificate(43),
\r
1524 certificate_revoked(44),
\r
1525 certificate_expired(45),
\r
1526 certificate_unknown(46),
\r
1527 illegal_parameter(47),
\r
1529 access_denied(49),
\r
1531 decrypt_error(51),
\r
1532 export_restriction_RESERVED(60),
\r
1533 protocol_version(70),
\r
1534 insufficient_security(71),
\r
1535 internal_error(80),
\r
1536 user_canceled(90),
\r
1537 no_renegotiation(100),
\r
1538 unsupported_extension(110),
\r
1540 } AlertDescription;
\r
1544 AlertDescription description;
\r
1547 7.2.1. Closure Alerts
\r
1549 The client and the server must share knowledge that the connection is
\r
1550 ending in order to avoid a truncation attack. Either party may
\r
1551 initiate the exchange of closing messages.
\r
1554 This message notifies the recipient that the sender will not send
\r
1555 any more messages on this connection. Note that as of TLS 1.1,
\r
1556 failure to properly close a connection no longer requires that a
\r
1557 session not be resumed. This is a change from TLS 1.0 to conform
\r
1558 with widespread implementation practice.
\r
1560 Either party may initiate a close by sending a close_notify alert.
\r
1564 Dierks & Rescorla Standards Track [Page 28]
\r
1566 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1569 Any data received after a closure alert is ignored.
\r
1571 Unless some other fatal alert has been transmitted, each party is
\r
1572 required to send a close_notify alert before closing the write side
\r
1573 of the connection. The other party MUST respond with a close_notify
\r
1574 alert of its own and close down the connection immediately,
\r
1575 discarding any pending writes. It is not required for the initiator
\r
1576 of the close to wait for the responding close_notify alert before
\r
1577 closing the read side of the connection.
\r
1579 If the application protocol using TLS provides that any data may be
\r
1580 carried over the underlying transport after the TLS connection is
\r
1581 closed, the TLS implementation must receive the responding
\r
1582 close_notify alert before indicating to the application layer that
\r
1583 the TLS connection has ended. If the application protocol will not
\r
1584 transfer any additional data, but will only close the underlying
\r
1585 transport connection, then the implementation MAY choose to close the
\r
1586 transport without waiting for the responding close_notify. No part of
\r
1587 this standard should be taken to dictate the manner in which a usage
\r
1588 profile for TLS manages its data transport, including when
\r
1589 connections are opened or closed.
\r
1591 Note: It is assumed that closing a connection reliably delivers
\r
1592 pending data before destroying the transport.
\r
1594 7.2.2. Error Alerts
\r
1596 Error handling in the TLS Handshake protocol is very simple. When an
\r
1597 error is detected, the detecting party sends a message to the other
\r
1598 party. Upon transmission or receipt of a fatal alert message, both
\r
1599 parties immediately close the connection. Servers and clients MUST
\r
1600 forget any session-identifiers, keys, and secrets associated with a
\r
1601 failed connection. Thus, any connection terminated with a fatal alert
\r
1602 MUST NOT be resumed.
\r
1604 Whenever an implementation encounters a condition which is defined as
\r
1605 a fatal alert, it MUST send the appropriate alert prior to closing
\r
1606 the connection. For all errors where an alert level is not explicitly
\r
1607 specified, the sending party MAY determine at its discretion whether
\r
1608 to treat this as a fatal error or not. If the implementation chooses
\r
1609 to send an alert but intends to close the connection immediately
\r
1610 afterwards, it MUST send that alert at the fatal alert level.
\r
1612 If an alert with a level of warning is sent and received, generally
\r
1613 the connection can continue normally. If the receiving party decides
\r
1614 not to proceed with the connection (e.g., after having received a
\r
1615 no_renegotiation alert that it is not willing to accept), it SHOULD
\r
1616 send a fatal alert to terminate the connection. Given this, the
\r
1620 Dierks & Rescorla Standards Track [Page 29]
\r
1622 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1625 sending party cannot, in general, know how the receiving party will
\r
1626 behave. Therefore, warning alerts are not very useful when the
\r
1627 sending party wants to continue the connection, and thus are
\r
1628 sometimes omitted. For example, if a peer decides to accept an
\r
1629 expired certificate (perhaps after confirming this with the user) and
\r
1630 wants to continue the connection, it would not generally send a
\r
1631 certificate_expired alert.
\r
1633 The following error alerts are defined:
\r
1635 unexpected_message
\r
1636 An inappropriate message was received. This alert is always fatal
\r
1637 and should never be observed in communication between proper
\r
1641 This alert is returned if a record is received with an incorrect
\r
1642 MAC. This alert also MUST be returned if an alert is sent because
\r
1643 a TLSCiphertext decrypted in an invalid way: either it wasn't an
\r
1644 even multiple of the block length, or its padding values, when
\r
1645 checked, weren't correct. This message is always fatal and should
\r
1646 never be observed in communication between proper implementations
\r
1647 (except when messages were corrupted in the network).
\r
1649 decryption_failed_RESERVED
\r
1650 This alert was used in some earlier versions of TLS, and may have
\r
1651 permitted certain attacks against the CBC mode [CBCATT]. It MUST
\r
1652 NOT be sent by compliant implementations.
\r
1655 A TLSCiphertext record was received that had a length more than
\r
1656 2^14+2048 bytes, or a record decrypted to a TLSCompressed record
\r
1657 with more than 2^14+1024 bytes. This message is always fatal and
\r
1658 should never be observed in communication between proper
\r
1659 implementations (except when messages were corrupted in the
\r
1662 decompression_failure
\r
1663 The decompression function received improper input (e.g., data
\r
1664 that would expand to excessive length). This message is always
\r
1665 fatal and should never be observed in communication between proper
\r
1669 Reception of a handshake_failure alert message indicates that the
\r
1670 sender was unable to negotiate an acceptable set of security
\r
1671 parameters given the options available. This is a fatal error.
\r
1676 Dierks & Rescorla Standards Track [Page 30]
\r
1678 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1681 no_certificate_RESERVED
\r
1682 This alert was used in SSLv3 but not any version of TLS. It MUST
\r
1683 NOT be sent by compliant implementations.
\r
1686 A certificate was corrupt, contained signatures that did not
\r
1687 verify correctly, etc.
\r
1689 unsupported_certificate
\r
1690 A certificate was of an unsupported type.
\r
1692 certificate_revoked
\r
1693 A certificate was revoked by its signer.
\r
1695 certificate_expired
\r
1696 A certificate has expired or is not currently valid.
\r
1698 certificate_unknown
\r
1699 Some other (unspecified) issue arose in processing the
\r
1700 certificate, rendering it unacceptable.
\r
1703 A field in the handshake was out of range or inconsistent with
\r
1704 other fields. This message is always fatal.
\r
1707 A valid certificate chain or partial chain was received, but the
\r
1708 certificate was not accepted because the CA certificate could not
\r
1709 be located or couldn't be matched with a known, trusted CA. This
\r
1710 message is always fatal.
\r
1713 A valid certificate was received, but when access control was
\r
1714 applied, the sender decided not to proceed with negotiation. This
\r
1715 message is always fatal.
\r
1718 A message could not be decoded because some field was out of the
\r
1719 specified range or the length of the message was incorrect. This
\r
1720 message is always fatal and should never be observed in
\r
1721 communication between proper implementations (except when messages
\r
1722 were corrupted in the network).
\r
1726 A handshake cryptographic operation failed, including being unable
\r
1727 to correctly verify a signature or validate a finished message.
\r
1728 This message is always fatal.
\r
1732 Dierks & Rescorla Standards Track [Page 31]
\r
1734 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1737 export_restriction_RESERVED
\r
1738 This alert was used in some earlier versions of TLS. It MUST NOT
\r
1739 be sent by compliant implementations.
\r
1742 The protocol version the client has attempted to negotiate is
\r
1743 recognized but not supported. (For example, old protocol versions
\r
1744 might be avoided for security reasons). This message is always
\r
1747 insufficient_security
\r
1748 Returned instead of handshake_failure when a negotiation has
\r
1749 failed specifically because the server requires ciphers more
\r
1750 secure than those supported by the client. This message is always
\r
1754 An internal error unrelated to the peer or the correctness of the
\r
1755 protocol (such as a memory allocation failure) makes it impossible
\r
1756 to continue. This message is always fatal.
\r
1759 This handshake is being canceled for some reason unrelated to a
\r
1760 protocol failure. If the user cancels an operation after the
\r
1761 handshake is complete, just closing the connection by sending a
\r
1762 close_notify is more appropriate. This alert should be followed by
\r
1763 a close_notify. This message is generally a warning.
\r
1766 Sent by the client in response to a hello request or by the server
\r
1767 in response to a client hello after initial handshaking. Either
\r
1768 of these would normally lead to renegotiation; when that is not
\r
1769 appropriate, the recipient should respond with this alert. At
\r
1770 that point, the original requester can decide whether to proceed
\r
1771 with the connection. One case where this would be appropriate is
\r
1772 where a server has spawned a process to satisfy a request; the
\r
1773 process might receive security parameters (key length,
\r
1774 authentication, etc.) at startup and it might be difficult to
\r
1775 communicate changes to these parameters after that point. This
\r
1776 message is always a warning.
\r
1778 unsupported_extension
\r
1779 sent by clients that receive an extended server hello containing
\r
1780 an extension that they did not put in the corresponding client
\r
1781 hello. This message is always fatal.
\r
1783 New Alert values are assigned by IANA as described in Section 12.
\r
1788 Dierks & Rescorla Standards Track [Page 32]
\r
1790 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1793 7.3. Handshake Protocol Overview
\r
1795 The cryptographic parameters of the session state are produced by the
\r
1796 TLS Handshake Protocol, which operates on top of the TLS Record
\r
1797 Layer. When a TLS client and server first start communicating, they
\r
1798 agree on a protocol version, select cryptographic algorithms,
\r
1799 optionally authenticate each other, and use public-key encryption
\r
1800 techniques to generate shared secrets.
\r
1802 The TLS Handshake Protocol involves the following steps:
\r
1804 - Exchange hello messages to agree on algorithms, exchange random
\r
1805 values, and check for session resumption.
\r
1807 - Exchange the necessary cryptographic parameters to allow the
\r
1808 client and server to agree on a premaster secret.
\r
1810 - Exchange certificates and cryptographic information to allow the
\r
1811 client and server to authenticate themselves.
\r
1813 - Generate a master secret from the premaster secret and exchanged
\r
1816 - Provide security parameters to the record layer.
\r
1818 - Allow the client and server to verify that their peer has
\r
1819 calculated the same security parameters and that the handshake
\r
1820 occurred without tampering by an attacker.
\r
1822 Note that higher layers should not be overly reliant on whether TLS
\r
1823 always negotiates the strongest possible connection between two
\r
1824 peers. There are a number of ways in which a man in the middle
\r
1825 attacker can attempt to make two entities drop down to the least
\r
1826 secure method they support. The protocol has been designed to
\r
1827 minimize this risk, but there are still attacks available: for
\r
1828 example, an attacker could block access to the port a secure service
\r
1829 runs on, or attempt to get the peers to negotiate an unauthenticated
\r
1830 connection. The fundamental rule is that higher levels must be
\r
1831 cognizant of what their security requirements are and never transmit
\r
1832 information over a channel less secure than what they require. The
\r
1833 TLS protocol is secure in that any cipher suite offers its promised
\r
1834 level of security: if you negotiate 3DES with a 1024 bit RSA key
\r
1835 exchange with a host whose certificate you have verified, you can
\r
1836 expect to be that secure.
\r
1838 These goals are achieved by the handshake protocol, which can be
\r
1839 summarized as follows: The client sends a client hello message to
\r
1840 which the server must respond with a server hello message, or else a
\r
1844 Dierks & Rescorla Standards Track [Page 33]
\r
1846 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1849 fatal error will occur and the connection will fail. The client hello
\r
1850 and server hello are used to establish security enhancement
\r
1851 capabilities between client and server. The client hello and server
\r
1852 hello establish the following attributes: Protocol Version, Session
\r
1853 ID, Cipher Suite, and Compression Method. Additionally, two random
\r
1854 values are generated and exchanged: ClientHello.random and
\r
1855 ServerHello.random.
\r
1857 The actual key exchange uses up to four messages: the server
\r
1858 certificate, the server key exchange, the client certificate, and the
\r
1859 client key exchange. New key exchange methods can be created by
\r
1860 specifying a format for these messages and by defining the use of the
\r
1861 messages to allow the client and server to agree upon a shared
\r
1862 secret. This secret MUST be quite long; currently defined key
\r
1863 exchange methods exchange secrets that range from 46 bytes upwards.
\r
1865 Following the hello messages, the server will send its certificate,
\r
1866 if it is to be authenticated. Additionally, a server key exchange
\r
1867 message may be sent, if it is required (e.g., if their server has no
\r
1868 certificate, or if its certificate is for signing only). If the
\r
1869 server is authenticated, it may request a certificate from the
\r
1870 client, if that is appropriate to the cipher suite selected. Next,
\r
1871 the server will send the server hello done message, indicating that
\r
1872 the hello-message phase of the handshake is complete. The server will
\r
1873 then wait for a client response. If the server has sent a certificate
\r
1874 request message, the client MUST send the certificate message. The
\r
1875 client key exchange message is now sent, and the content of that
\r
1876 message will depend on the public key algorithm selected between the
\r
1877 client hello and the server hello. If the client has sent a
\r
1878 certificate with signing ability, a digitally-signed certificate
\r
1879 verify message is sent to explicitly verify possession of the private
\r
1880 key in the certificate.
\r
1882 At this point, a change cipher spec message is sent by the client,
\r
1883 and the client copies the pending Cipher Spec into the current Cipher
\r
1884 Spec. The client then immediately sends the finished message under
\r
1885 the new algorithms, keys, and secrets. In response, the server will
\r
1886 send its own change cipher spec message, transfer the pending to the
\r
1887 current Cipher Spec, and send its finished message under the new
\r
1888 Cipher Spec. At this point, the handshake is complete, and the client
\r
1889 and server may begin to exchange application layer data. (See flow
\r
1890 chart below.) Application data MUST NOT be sent prior to the
\r
1891 completion of the first handshake (before a cipher suite other than
\r
1892 TLS_NULL_WITH_NULL_NULL is established).
\r
1896 ClientHello -------->
\r
1900 Dierks & Rescorla Standards Track [Page 34]
\r
1902 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1907 ServerKeyExchange*
\r
1908 CertificateRequest*
\r
1909 <-------- ServerHelloDone
\r
1912 CertificateVerify*
\r
1913 [ChangeCipherSpec]
\r
1914 Finished -------->
\r
1915 [ChangeCipherSpec]
\r
1916 <-------- Finished
\r
1917 Application Data <-------> Application Data
\r
1919 Fig. 1. Message flow for a full handshake
\r
1921 * Indicates optional or situation-dependent messages that are not
\r
1924 Note: To help avoid pipeline stalls, ChangeCipherSpec is an
\r
1925 independent TLS Protocol content type, and is not actually a TLS
\r
1926 handshake message.
\r
1928 When the client and server decide to resume a previous session or
\r
1929 duplicate an existing session (instead of negotiating new security
\r
1930 parameters), the message flow is as follows:
\r
1932 The client sends a ClientHello using the Session ID of the session to
\r
1933 be resumed. The server then checks its session cache for a match. If
\r
1934 a match is found, and the server is willing to re-establish the
\r
1935 connection under the specified session state, it will send a
\r
1936 ServerHello with the same Session ID value. At this point, both
\r
1937 client and server MUST send change cipher spec messages and proceed
\r
1938 directly to finished messages. Once the re-establishment is complete,
\r
1939 the client and server MAY begin to exchange application layer data.
\r
1940 (See flow chart below.) If a Session ID match is not found, the
\r
1941 server generates a new session ID and the TLS client and server
\r
1942 perform a full handshake.
\r
1946 ClientHello -------->
\r
1948 [ChangeCipherSpec]
\r
1949 <-------- Finished
\r
1950 [ChangeCipherSpec]
\r
1951 Finished -------->
\r
1952 Application Data <-------> Application Data
\r
1956 Dierks & Rescorla Standards Track [Page 35]
\r
1958 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
1961 Fig. 2. Message flow for an abbreviated handshake
\r
1963 The contents and significance of each message will be presented in
\r
1964 detail in the following sections.
\r
1966 7.4. Handshake Protocol
\r
1968 The TLS Handshake Protocol is one of the defined higher-level clients
\r
1969 of the TLS Record Protocol. This protocol is used to negotiate the
\r
1970 secure attributes of a session. Handshake messages are supplied to
\r
1971 the TLS Record Layer, where they are encapsulated within one or more
\r
1972 TLSPlaintext structures, which are processed and transmitted as
\r
1973 specified by the current active session state.
\r
1976 hello_request(0), client_hello(1), server_hello(2),
\r
1977 certificate(11), server_key_exchange (12),
\r
1978 certificate_request(13), server_hello_done(14),
\r
1979 certificate_verify(15), client_key_exchange(16),
\r
1980 finished(20), (255)
\r
1984 HandshakeType msg_type; /* handshake type */
\r
1985 uint24 length; /* bytes in message */
\r
1986 select (HandshakeType) {
\r
1987 case hello_request: HelloRequest;
\r
1988 case client_hello: ClientHello;
\r
1989 case server_hello: ServerHello;
\r
1990 case certificate: Certificate;
\r
1991 case server_key_exchange: ServerKeyExchange;
\r
1992 case certificate_request: CertificateRequest;
\r
1993 case server_hello_done: ServerHelloDone;
\r
1994 case certificate_verify: CertificateVerify;
\r
1995 case client_key_exchange: ClientKeyExchange;
\r
1996 case finished: Finished;
\r
2000 The handshake protocol messages are presented below in the order they
\r
2001 MUST be sent; sending handshake messages in an unexpected order
\r
2002 results in a fatal error. Unneeded handshake messages can be omitted,
\r
2003 however. Note one exception to the ordering: the Certificate message
\r
2004 is used twice in the handshake (from server to client, then from
\r
2005 client to server), but described only in its first position. The one
\r
2006 message that is not bound by these ordering rules is the Hello
\r
2007 Request message, which can be sent at any time, but which SHOULD be
\r
2008 ignored by the client if it arrives in the middle of a handshake.
\r
2012 Dierks & Rescorla Standards Track [Page 36]
\r
2014 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2017 New Handshake message types are assigned by IANA as described in
\r
2020 7.4.1. Hello Messages
\r
2022 The hello phase messages are used to exchange security enhancement
\r
2023 capabilities between the client and server. When a new session
\r
2024 begins, the Record Layer's connection state encryption, hash, and
\r
2025 compression algorithms are initialized to null. The current
\r
2026 connection state is used for renegotiation messages.
\r
2028 7.4.1.1. Hello Request
\r
2030 When this message will be sent:
\r
2032 The hello request message MAY be sent by the server at any time.
\r
2034 Meaning of this message:
\r
2036 Hello request is a simple notification that the client should
\r
2037 begin the negotiation process anew by sending a client hello
\r
2038 message when convenient. This message is not intended to establish
\r
2039 which side is the client or server but merely to initiate a new
\r
2040 negotiation. Servers SHOULD NOT send a HelloRequest immediately
\r
2041 upon the client's initial connection. It is the client's job to
\r
2042 send a ClientHello at that time.
\r
2044 This message will be ignored by the client if the client is
\r
2045 currently negotiating a session. This message may be ignored by
\r
2046 the client if it does not wish to renegotiate a session, or the
\r
2047 client may, if it wishes, respond with a no_renegotiation alert.
\r
2048 Since handshake messages are intended to have transmission
\r
2049 precedence over application data, it is expected that the
\r
2050 negotiation will begin before no more than a few records are
\r
2051 received from the client. If the server sends a hello request but
\r
2052 does not receive a client hello in response, it may close the
\r
2053 connection with a fatal alert.
\r
2055 After sending a hello request, servers SHOULD NOT repeat the
\r
2056 request until the subsequent handshake negotiation is complete.
\r
2058 Structure of this message:
\r
2060 struct { } HelloRequest;
\r
2062 Note: This message MUST NOT be included in the message hashes that
\r
2063 are maintained throughout the handshake and used in the finished
\r
2064 messages and the certificate verify message.
\r
2068 Dierks & Rescorla Standards Track [Page 37]
\r
2070 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2073 7.4.1.2. Client Hello
\r
2075 When this message will be sent:
\r
2077 When a client first connects to a server it is required to send
\r
2078 the client hello as its first message. The client can also send a
\r
2079 client hello in response to a hello request or on its own
\r
2080 initiative in order to renegotiate the security parameters in an
\r
2081 existing connection.
\r
2083 Structure of this message:
\r
2085 The client hello message includes a random structure, which is
\r
2086 used later in the protocol.
\r
2089 uint32 gmt_unix_time;
\r
2090 opaque random_bytes[28];
\r
2094 The current time and date in standard UNIX 32-bit format
\r
2095 (seconds since the midnight starting Jan 1, 1970, GMT, ignoring
\r
2096 leap seconds) according to the sender's internal clock. Clocks
\r
2097 are not required to be set correctly by the basic TLS Protocol;
\r
2098 higher-level or application protocols may define additional
\r
2102 28 bytes generated by a secure random number generator.
\r
2104 The client hello message includes a variable-length session
\r
2105 identifier. If not empty, the value identifies a session between the
\r
2106 same client and server whose security parameters the client wishes to
\r
2107 reuse. The session identifier MAY be from an earlier connection, this
\r
2108 connection, or from another currently active connection. The second
\r
2109 option is useful if the client only wishes to update the random
\r
2110 structures and derived values of a connection, and the third option
\r
2111 makes it possible to establish several independent secure connections
\r
2112 without repeating the full handshake protocol. These independent
\r
2113 connections may occur sequentially or simultaneously; a SessionID
\r
2114 becomes valid when the handshake negotiating it completes with the
\r
2115 exchange of Finished messages and persists until it is removed due to
\r
2116 aging or because a fatal error was encountered on a connection
\r
2117 associated with the session. The actual contents of the SessionID are
\r
2118 defined by the server.
\r
2120 opaque SessionID<0..32>;
\r
2124 Dierks & Rescorla Standards Track [Page 38]
\r
2126 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2129 Warning: Because the SessionID is transmitted without encryption or
\r
2130 immediate MAC protection, servers MUST NOT place confidential
\r
2131 information in session identifiers or let the contents of fake
\r
2132 session identifiers cause any breach of security. (Note that the
\r
2133 content of the handshake as a whole, including the SessionID, is
\r
2134 protected by the Finished messages exchanged at the end of the
\r
2137 The cipher suite list, passed from the client to the server in the
\r
2138 client hello message, contains the combinations of cryptographic
\r
2139 algorithms supported by the client in order of the client's
\r
2140 preference (favorite choice first). Each cipher suite defines a key
\r
2141 exchange algorithm, a bulk encryption algorithm (including secret key
\r
2142 length), a MAC algorithm, and a PRF. The server will select a cipher
\r
2143 suite or, if no acceptable choices are presented, return a handshake
\r
2144 failure alert and close the connection. If the list contains cipher
\r
2145 suites the server does not recognize, support, or wish to use, the
\r
2146 server MUST ignore those cipher suites, and process the remaining
\r
2149 uint8 CipherSuite[2]; /* Cryptographic suite selector */
\r
2151 The client hello includes a list of compression algorithms supported
\r
2152 by the client, ordered according to the client's preference.
\r
2154 enum { null(0), (255) } CompressionMethod;
\r
2157 ProtocolVersion client_version;
\r
2159 SessionID session_id;
\r
2160 CipherSuite cipher_suites<2..2^16-2>;
\r
2161 CompressionMethod compression_methods<1..2^8-1>;
\r
2162 select (extensions_present) {
\r
2166 Extension extensions<0..2^16-1>;
\r
2170 TLS allows extensions to follow the compression_methods field in an
\r
2171 extensions block. The presence of extensions can be detected by
\r
2172 determining whether there are bytes following the compression_methods
\r
2173 at the end of the ClientHello. Note that this method of detecting
\r
2174 optional data differs from the normal TLS method of having a
\r
2175 variable-length field but is used for compatibility with TLS before
\r
2176 extensions were defined.
\r
2180 Dierks & Rescorla Standards Track [Page 39]
\r
2182 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2186 The version of the TLS protocol by which the client wishes to
\r
2187 communicate during this session. This SHOULD be the latest
\r
2188 (highest valued) version supported by the client. For this version
\r
2189 of the specification, the version will be 3.3 (See Appendix E for
\r
2190 details about backward compatibility).
\r
2193 A client-generated random structure.
\r
2196 The ID of a session the client wishes to use for this connection.
\r
2197 This field is empty if no session_id is available, or it the
\r
2198 client wishes to generate new security parameters.
\r
2201 This is a list of the cryptographic options supported by the
\r
2202 client, with the client's first preference first. If the
\r
2203 session_id field is not empty (implying a session resumption
\r
2204 request) this vector MUST include at least the cipher_suite from
\r
2205 that session. Values are defined in Appendix A.5.
\r
2207 compression_methods
\r
2208 This is a list of the compression methods supported by the client,
\r
2209 sorted by client preference. If the session_id field is not empty
\r
2210 (implying a session resumption request) it MUST include the
\r
2211 compression_method from that session. This vector MUST contain,
\r
2212 and all implementations MUST support, CompressionMethod.null.
\r
2213 Thus, a client and server will always be able to agree on a
\r
2214 compression method.
\r
2217 Clients MAY request extended functionality from servers by sending
\r
2218 data in the extensions Here the new "extensions" field contains a
\r
2219 list of extensions. The actual "Extension" format is defined in
\r
2222 In the event that a client requests additional functionality using
\r
2223 extensions, and this functionality is not supplied by the server, the
\r
2224 client MAY abort the handshake. A server MUST accept client hello
\r
2225 messages both with and without the extensions field, and (as for all
\r
2226 other messages) MUST check that the amount of data in the message
\r
2227 precisely matches one of these formats; if not, then it MUST send a
\r
2228 fatal "decode_error" alert.
\r
2230 After sending the client hello message, the client waits for a server
\r
2231 hello message. Any other handshake message returned by the server
\r
2232 except for a hello request is treated as a fatal error.
\r
2236 Dierks & Rescorla Standards Track [Page 40]
\r
2238 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2241 7.4.1.3. Server Hello
\r
2243 When this message will be sent:
\r
2245 The server will send this message in response to a client hello
\r
2246 message when it was able to find an acceptable set of algorithms.
\r
2247 If it cannot find such a match, it will respond with a handshake
\r
2250 Structure of this message:
\r
2253 ProtocolVersion server_version;
\r
2255 SessionID session_id;
\r
2256 CipherSuite cipher_suite;
\r
2257 CompressionMethod compression_method;
\r
2258 select (extensions_present) {
\r
2262 Extension extensions<0..2^16-1>;
\r
2266 The presence of extensions can be detected by determining whether
\r
2267 there are bytes following the compression_method field at the end of
\r
2271 This field will contain the lower of that suggested by the client
\r
2272 in the client hello and the highest supported by the server. For
\r
2273 this version of the specification, the version is 3.3. (See
\r
2274 Appendix E for details about backward compatibility.)
\r
2277 This structure is generated by the server and MUST be
\r
2278 independently generated from the ClientHello.random.
\r
2281 This is the identity of the session corresponding to this
\r
2282 connection. If the ClientHello.session_id was non-empty, the
\r
2283 server will look in its session cache for a match. If a match is
\r
2284 found and the server is willing to establish the new connection
\r
2285 using the specified session state, the server will respond with
\r
2286 the same value as was supplied by the client. This indicates a
\r
2287 resumed session and dictates that the parties must proceed
\r
2288 directly to the finished messages. Otherwise this field will
\r
2292 Dierks & Rescorla Standards Track [Page 41]
\r
2294 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2297 contain a different value identifying the new session. The server
\r
2298 may return an empty session_id to indicate that the session will
\r
2299 not be cached and therefore cannot be resumed. If a session is
\r
2300 resumed, it must be resumed using the same cipher suite it was
\r
2301 originally negotiated with. Note that there is no requirement that
\r
2302 the server resume any session even if it had formerly provided a
\r
2303 session_id. Client MUST be prepared to do a full negotiation --
\r
2304 including negotiating new cipher suites -- during any handshake.
\r
2307 The single cipher suite selected by the server from the list in
\r
2308 ClientHello.cipher_suites. For resumed sessions, this field is the
\r
2309 value from the state of the session being resumed.
\r
2311 compression_method
\r
2312 The single compression algorithm selected by the server from the
\r
2313 list in ClientHello.compression_methods. For resumed sessions this
\r
2314 field is the value from the resumed session state.
\r
2317 A list of extensions. Note that only extensions offered by the
\r
2318 client can appear in the server's list.
\r
2320 7.4.1.4 Hello Extensions
\r
2322 The extension format is:
\r
2325 ExtensionType extension_type;
\r
2326 opaque extension_data<0..2^16-1>;
\r
2330 signature_algorithms(TBD-BY-IANA), (65535)
\r
2335 - "extension_type" identifies the particular extension type.
\r
2337 - "extension_data" contains information specific to the particular
\r
2340 The initial set of extensions is defined in a companion document
\r
2341 [TLSEXT]. The list of extension types is maintained by IANA as
\r
2342 described in Section 12.
\r
2344 There are subtle (and not so subtle) interactions that may occur in
\r
2348 Dierks & Rescorla Standards Track [Page 42]
\r
2350 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2353 this protocol between new features and existing features which may
\r
2354 result in a significant reduction in overall security, The following
\r
2355 considerations should be taken into account when designing new
\r
2358 - Some cases where a server does not agree to an extension are error
\r
2359 conditions, and some simply a refusal to support a particular
\r
2360 feature. In general error alerts should be used for the former,
\r
2361 and a field in the server extension response for the latter.
\r
2363 - Extensions should as far as possible be designed to prevent any
\r
2364 attack that forces use (or non-use) of a particular feature by
\r
2365 manipulation of handshake messages. This principle should be
\r
2366 followed regardless of whether the feature is believed to cause a
\r
2369 Often the fact that the extension fields are included in the
\r
2370 inputs to the Finished message hashes will be sufficient, but
\r
2371 extreme care is needed when the extension changes the meaning of
\r
2372 messages sent in the handshake phase. Designers and implementors
\r
2373 should be aware of the fact that until the handshake has been
\r
2374 authenticated, active attackers can modify messages and insert,
\r
2375 remove, or replace extensions.
\r
2377 - It would be technically possible to use extensions to change major
\r
2378 aspects of the design of TLS; for example the design of cipher
\r
2379 suite negotiation. This is not recommended; it would be more
\r
2380 appropriate to define a new version of TLS - particularly since
\r
2381 the TLS handshake algorithms have specific protection against
\r
2382 version rollback attacks based on the version number, and the
\r
2383 possibility of version rollback should be a significant
\r
2384 consideration in any major design change.
\r
2386 7.4.1.4.1 Signature Algorithms
\r
2388 The client uses the "signature_algorithms" extension to indicate to
\r
2389 the server which signature/hash algorithm pairs may be used in
\r
2390 digital signatures. The "extension_data" field of this extension
\r
2391 contains a "supported_signature_algorithms" value.
\r
2394 none(0), md5(1), sha1(2), sha256(3), sha384(4),
\r
2398 enum { anonymous(0), rsa(1), dsa(2), ecdsa(3), (255) }
\r
2399 SignatureAlgorithm;
\r
2404 Dierks & Rescorla Standards Track [Page 43]
\r
2406 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2410 HashAlgorithm hash;
\r
2411 SignatureAlgorithm signature;
\r
2412 } SignatureAndHashAlgorithm;
\r
2414 SignatureAndHashAlgorithm
\r
2415 supported_signature_algorithms<2..2^16-2>;
\r
2417 Each SignatureAndHashAlgorithm value lists a single hash/signature
\r
2418 pair which the client is willing to verify. The values are indicated
\r
2419 in descending order of preference.
\r
2421 Note: Because not all signature algorithms and hash algorithms may be
\r
2422 accepted by an implementation (e.g., DSA with SHA-1, but not
\r
2423 SHA-256), algorithms here are listed in pairs.
\r
2426 This field indicates the hash algorithm which may be used. The
\r
2427 values indicate support for unhashed data, MD5 [MD5], SHA-1,
\r
2428 SHA-256, SHA-384, and SHA-512 [SHA] respectively. The "none" value
\r
2429 is provided for future extensibility, in case of a signature
\r
2430 algorithm which does not require hashing before signing.
\r
2433 This field indicates the signature algorithm which may be used.
\r
2434 The values indicate anonymous signatures, RSASSA-PKCS1-v1_5
\r
2435 [PKCS1] and DSA [DSS] respectively. The "anonymous" value is
\r
2436 meaningless in this context but used in Section 7.4.3. It MUST NOT
\r
2437 appear in this extension.
\r
2439 The semantics of this extension are somewhat complicated because the
\r
2440 cipher suite indicates permissible signature algorithms but not hash
\r
2441 algorithm. Sections 7.4.2 and 7.4.3 describe the appropriate rules.
\r
2443 If the client supports only the default hash and signature algorithms
\r
2444 (listed in this section), it MAY omit the signature_algorithms
\r
2445 extension. If the client does not support the default algorithms, or
\r
2446 supports other hash and signature algorithms (and it is willing to
\r
2447 use them for verifying messages sent by server; server certificates
\r
2448 and server key exchange), it MUST send the signature_algorithms
\r
2449 extension listing the algorithms it is willing to accept.
\r
2451 If the client does not send the signature_algorithms extension, the
\r
2452 server MUST assume the following:
\r
2454 - If the negotiated key exchange algorithm is one of (RSA, DHE_RSA,
\r
2455 DH_RSA, RSA_PSK, ECDH_RSA, ECDHE_RSA), behave as if client had sent
\r
2456 the value (sha1,rsa).
\r
2460 Dierks & Rescorla Standards Track [Page 44]
\r
2462 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2465 - If the negotiated key exchange algorithm is one of (DHE_DSS,
\r
2466 DH_DSS), behave as if the client had sent the value (sha1,dsa).
\r
2468 - If the negotiated key exchange algorithm is one of (ECDH_ECDSA,
\r
2469 ECDHE_ECDSA), behave as if the client had sent value (sha1,ecdsa).
\r
2471 Note: this is a change from TLS 1.1 where there are no explicit rules
\r
2472 but as a practical matter one can assume that the peer supports MD5
\r
2475 Note: this extension is not meaningful for TLS versions prior to 1.2.
\r
2476 Clients MUST NOT offer it if they are offering prior versions.
\r
2477 However, even if clients do offer it, the rules specified in [TLSEXT]
\r
2478 require servers to ignore extensions they do not understand.
\r
2480 Servers MUST NOT send this extension. TLS servers MUST support
\r
2481 receiving this extension.
\r
2484 7.4.2. Server Certificate
\r
2486 When this message will be sent:
\r
2488 The server MUST send a certificate whenever the agreed-upon key
\r
2489 exchange method uses certificates for authentication (this
\r
2490 includes all key exchange methods defined in this document except
\r
2491 DH_anon). This message will always immediately follow the server
\r
2494 Meaning of this message:
\r
2496 This message conveys the server's certificate chain to the client.
\r
2497 The certificate MUST be appropriate for the negotiated cipher
\r
2498 suite's key exchange algorithm, and any negotiated extensions.
\r
2500 Structure of this message:
\r
2502 opaque ASN.1Cert<1..2^24-1>;
\r
2505 ASN.1Cert certificate_list<0..2^24-1>;
\r
2509 This is a sequence (chain) of certificates. The sender's
\r
2510 certificate MUST come first in the list. Each following
\r
2511 certificate MUST directly certify the one preceding it. Because
\r
2512 certificate validation requires that root keys be distributed
\r
2516 Dierks & Rescorla Standards Track [Page 45]
\r
2518 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2521 independently, the self-signed certificate that specifies the root
\r
2522 certificate authority MAY optionally be omitted from the chain,
\r
2523 under the assumption that the remote end must already possess it
\r
2524 in order to validate it in any case.
\r
2526 The same message type and structure will be used for the client's
\r
2527 response to a certificate request message. Note that a client MAY
\r
2528 send no certificates if it does not have an appropriate certificate
\r
2529 to send in response to the server's authentication request.
\r
2531 Note: PKCS #7 [PKCS7] is not used as the format for the certificate
\r
2532 vector because PKCS #6 [PKCS6] extended certificates are not used.
\r
2533 Also, PKCS #7 defines a SET rather than a SEQUENCE, making the task
\r
2534 of parsing the list more difficult.
\r
2536 The following rules apply to the certificates sent by the server:
\r
2538 - The certificate type MUST be X.509v3, unless explicitly negotiated
\r
2539 otherwise (e.g., [TLSPGP]).
\r
2541 - The end entity certificate's public key (and associated
\r
2542 restrictions) MUST be compatible with the selected key exchange
\r
2545 Key Exchange Alg. Certificate Key Type
\r
2547 RSA RSA public key; the certificate MUST
\r
2548 RSA_PSK allow the key to be used for encryption
\r
2549 (the keyEncipherment bit MUST be set
\r
2550 if the key usage extension is present).
\r
2551 Note: RSA_PSK is defined in [TLSPSK].
\r
2553 DHE_RSA RSA public key; the certificate MUST
\r
2554 ECDHE_RSA allow the key to be used for signing
\r
2555 (the digitalSignature bit MUST be set
\r
2556 if the key usage extension is present)
\r
2557 with the signature scheme and hash
\r
2558 algorithm that will be employed in the
\r
2559 server key exchange message.
\r
2561 DHE_DSS DSA public key; the certificate MUST
\r
2562 allow the key to be used for signing with
\r
2563 the hash algorithm that will be employed
\r
2564 in the server key exchange message.
\r
2566 DH_DSS Diffie-Hellman public key; the
\r
2567 DH_RSA keyAgreement bit MUST be set if the
\r
2568 key usage extension is present.
\r
2572 Dierks & Rescorla Standards Track [Page 46]
\r
2574 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2577 ECDH_ECDSA ECDH-capable public key; the public key
\r
2578 ECDH_RSA MUST use a curve and point format supported
\r
2579 by the client, as described in [TLSECC].
\r
2581 ECDHE_ECDSA ECDSA-capable public key; the certificate
\r
2582 MUST allow the key to be used for signing
\r
2583 with the hash algorithm that will be
\r
2584 employed in the server key exchange
\r
2585 message. The public key MUST use a curve
\r
2586 and point format supported by the client,
\r
2587 as described in [TLSECC].
\r
2589 - The "server_name" and "trusted_ca_keys" extensions [TLSEXT] are
\r
2590 used to guide certificate selection.
\r
2592 If the client provided a "signature_algorithms" extension, then all
\r
2593 certificates provided by the server MUST be signed by a
\r
2594 hash/signature algorithm pair that appears in that extension. Note
\r
2595 that this implies that a certificate containing a key for one
\r
2596 signature algorithm MAY be signed using a different signature
\r
2597 algorithm (for instance, an RSA key signed with a DSA key.) This is a
\r
2598 departure from TLS 1.1, which required that the algorithms be the
\r
2599 same. Note that this also implies that the DH_DSS, DH_RSA,
\r
2600 ECDH_ECDSA, and ECDH_RSA key exchange algorithms do not restrict the
\r
2601 algorithm used to sign the certificate. Fixed DH certificates MAY be
\r
2602 signed with any hash/signature algorithm pair appearing in the
\r
2603 extension. The naming is historical.
\r
2605 If the server has multiple certificates, it chooses one of them based
\r
2606 on the above-mentioned criteria (in addition to other criteria, such
\r
2607 as transport layer endpoint, local configuration and preferences,
\r
2608 etc.). If the server has a single certificate it SHOULD attempt to
\r
2609 validate that it meets these criteria.
\r
2611 Note that there are certificates that use algorithms and/or algorithm
\r
2612 combinations that cannot be currently used with TLS. For example, a
\r
2613 certificate with RSASSA-PSS signature key (id-RSASSA-PSS OID in
\r
2614 SubjectPublicKeyInfo) cannot be used because TLS defines no
\r
2615 corresponding signature algorithm.
\r
2617 As cipher suites that specify new key exchange methods are specified
\r
2618 for the TLS Protocol, they will imply certificate format and the
\r
2619 required encoded keying information.
\r
2621 7.4.3. Server Key Exchange Message
\r
2623 When this message will be sent:
\r
2628 Dierks & Rescorla Standards Track [Page 47]
\r
2630 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2633 This message will be sent immediately after the server certificate
\r
2634 message (or the server hello message, if this is an anonymous
\r
2637 The server key exchange message is sent by the server only when
\r
2638 the server certificate message (if sent) does not contain enough
\r
2639 data to allow the client to exchange a premaster secret. This is
\r
2640 true for the following key exchange methods:
\r
2646 It is not legal to send the server key exchange message for the
\r
2647 following key exchange methods:
\r
2653 Meaning of this message:
\r
2655 This message conveys cryptographic information to allow the client
\r
2656 to communicate the premaster secret: a Diffie-Hellman public key
\r
2657 with which the client can complete a key exchange (with the result
\r
2658 being the premaster secret) or a public key for some other
\r
2661 Structure of this message:
\r
2663 enum { dhe_dss, dhe_rsa, dh_anon, rsa, dh_dss, dh_rsa }
\r
2664 KeyExchangeAlgorithm;
\r
2667 opaque dh_p<1..2^16-1>;
\r
2668 opaque dh_g<1..2^16-1>;
\r
2669 opaque dh_Ys<1..2^16-1>;
\r
2670 } ServerDHParams; /* Ephemeral DH parameters */
\r
2673 The prime modulus used for the Diffie-Hellman operation.
\r
2676 The generator used for the Diffie-Hellman operation.
\r
2679 The server's Diffie-Hellman public value (g^X mod p).
\r
2684 Dierks & Rescorla Standards Track [Page 48]
\r
2686 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2690 select (KeyExchangeAlgorithm) {
\r
2692 ServerDHParams params;
\r
2695 ServerDHParams params;
\r
2696 digitally-signed struct {
\r
2697 opaque client_random[32];
\r
2698 opaque server_random[32];
\r
2699 ServerDHParams params;
\r
2705 /* message is omitted for rsa, dh_dss, and dh_rsa */
\r
2707 } ServerKeyExchange;
\r
2710 The server's key exchange parameters.
\r
2713 For non-anonymous key exchanges, a signature over the
\r
2714 server's key exchange parameters.
\r
2716 If the client has offered the "signature_algorithms" extension, the
\r
2717 signature algorithm and hash algorithm MUST be a pair listed in that
\r
2718 extension. Note that there is a possibility for inconsistencies here.
\r
2719 For instance, the client might offer DHE_DSS key exchange but omit
\r
2720 any DSS pairs from its "signature_algorithms" extension. In order to
\r
2721 negotiate correctly, the server MUST check any candidate cipher
\r
2722 suites against the "signature_algorithms" extension before selecting
\r
2723 them. This is somewhat inelegant but is a compromise designed to
\r
2724 minimize changes to the original cipher suite design.
\r
2726 In addition, the hash and signature algorithms MUST be compatible
\r
2727 with the key in the server's end-entity certificate. RSA keys MAY be
\r
2728 used with any permitted hash algorithm, subject to restrictions in
\r
2729 the certificate, if any.
\r
2731 Because DSA signatures do not contain any secure indication of hash
\r
2732 algorithm, there is a risk of hash substitution if multiple hashes
\r
2733 may be used with any key. Currently, DSS [DSS] may only be used with
\r
2734 SHA-1. Future revisions of DSS [DSS-3] are expected to allow other
\r
2735 digest algorithms, as well as guidance as to which digest algorithms
\r
2736 should be used with each key size. In addition, future revisions of
\r
2740 Dierks & Rescorla Standards Track [Page 49]
\r
2742 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2745 [PKIX] may specify mechanisms for certificates to indicate which
\r
2746 digest algorithms are to be used with DSA.
\r
2748 As additional cipher suites are defined for TLS that include new key
\r
2749 exchange algorithms, the server key exchange message will be sent if
\r
2750 and only if the certificate type associated with the key exchange
\r
2751 algorithm does not provide enough information for the client to
\r
2752 exchange a premaster secret.
\r
2754 7.4.4. Certificate Request
\r
2756 When this message will be sent:
\r
2758 A non-anonymous server can optionally request a certificate from
\r
2759 the client, if appropriate for the selected cipher suite. This
\r
2760 message, if sent, will immediately follow the Server Key Exchange
\r
2761 message (if it is sent; otherwise, the Server Certificate
\r
2764 Structure of this message:
\r
2767 rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),
\r
2768 rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6),
\r
2769 fortezza_dms_RESERVED(20), (255)
\r
2770 } ClientCertificateType;
\r
2772 opaque DistinguishedName<1..2^16-1>;
\r
2775 ClientCertificateType certificate_types<1..2^8-1>;
\r
2776 SignatureAndHashAlgorithm
\r
2777 supported_signature_algorithms<2^16-1>;
\r
2778 DistinguishedName certificate_authorities<0..2^16-1>;
\r
2779 } CertificateRequest;
\r
2782 A list of the types of certificate types which the client may
\r
2785 rsa_sign a certificate containing an RSA key
\r
2786 dss_sign a certificate containing a DSS key
\r
2787 rsa_fixed_dh a certificate containing a static DH key.
\r
2788 dss_fixed_dh a certificate containing a static DH key
\r
2790 supported_signature_algorithms
\r
2791 A list of the hash/signature algorithm pairs that the server is
\r
2792 able to verify, listed in descending order of preference.
\r
2796 Dierks & Rescorla Standards Track [Page 50]
\r
2798 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2801 certificate_authorities
\r
2802 A list of the distinguished names [X501] of acceptable
\r
2803 certificate_authorities, represented in DER-encoded format. These
\r
2804 distinguished names may specify a desired distinguished name for a
\r
2805 root CA or for a subordinate CA; thus, this message can be used
\r
2806 both to describe known roots and a desired authorization space. If
\r
2807 the certificate_authorities list is empty then the client MAY send
\r
2808 any certificate of the appropriate ClientCertificateType, unless
\r
2809 there is some external arrangement to the contrary.
\r
2811 The interaction of the certificate_types and
\r
2812 supported_signature_algorithms fields is somewhat complicated.
\r
2813 certificate_types has been present in TLS since SSLv3, but was
\r
2814 somewhat underspecified. Much of its functionality is superseded by
\r
2815 supported_signature_algorithms. The following rules apply:
\r
2817 - Any certificates provided by the client MUST be signed using a
\r
2818 hash/signature algorithm pair found in
\r
2819 supported_signature_algorithms.
\r
2821 - The end-entity certificate provided by the client MUST contain a
\r
2822 key which is compatible with certificate_types. If the key is a
\r
2823 signature key, it MUST be usable with some hash/signature
\r
2824 algorithm pair in supported_signature_algorithms.
\r
2826 - For historical reasons, the names of some client certificate types
\r
2827 include the algorithm used to sign the certificate. For example,
\r
2828 in earlier versions of TLS, rsa_fixed_dh meant a certificate
\r
2829 signed with RSA and containing a static DH key. In TLS 1.2, this
\r
2830 functionality has been obsoleted by the
\r
2831 supported_signature_algorithms, and the certificate type no longer
\r
2832 restricts the algorithm used to sign the certificate. For
\r
2833 example, if the server sends dss_fixed_dh certificate type and
\r
2834 {{sha1, dsa}, {sha1, rsa}} signature types, the client MAY reply
\r
2835 with a certificate containing a static DH key, signed with RSA-
\r
2838 New ClientCertificateType values are assigned by IANA as described in
\r
2841 Note: Values listed as RESERVED may not be used. They were used in
\r
2844 Note: It is a fatal handshake_failure alert for an anonymous server
\r
2845 to request client authentication.
\r
2847 7.4.5 Server hello done
\r
2852 Dierks & Rescorla Standards Track [Page 51]
\r
2854 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2857 When this message will be sent:
\r
2859 The server hello done message is sent by the server to indicate
\r
2860 the end of the server hello and associated messages. After sending
\r
2861 this message, the server will wait for a client response.
\r
2863 Meaning of this message:
\r
2865 This message means that the server is done sending messages to
\r
2866 support the key exchange, and the client can proceed with its
\r
2867 phase of the key exchange.
\r
2869 Upon receipt of the server hello done message, the client SHOULD
\r
2870 verify that the server provided a valid certificate, if required
\r
2871 and check that the server hello parameters are acceptable.
\r
2873 Structure of this message:
\r
2875 struct { } ServerHelloDone;
\r
2877 7.4.6. Client Certificate
\r
2879 When this message will be sent:
\r
2881 This is the first message the client can send after receiving a
\r
2882 server hello done message. This message is only sent if the server
\r
2883 requests a certificate. If no suitable certificate is available,
\r
2884 the client MUST send a certificate message containing no
\r
2885 certificates. That is, the certificate_list structure has a length
\r
2886 of zero. If the client does not send any certificates, the server
\r
2887 MAY at its discretion either continue the handshake without client
\r
2888 authentication, or respond with a fatal handshake_failure alert.
\r
2889 Also, if some aspect of the certificate chain was unacceptable
\r
2890 (e.g., it was not signed by a known, trusted CA), the server MAY
\r
2891 at its discretion either continue the handshake (considering the
\r
2892 client unauthenticated) or send a fatal alert.
\r
2894 Client certificates are sent using the Certificate structure
\r
2895 defined in Section 7.4.2.
\r
2897 Meaning of this message:
\r
2899 This message conveys the client's certificate chain to the server;
\r
2900 the server will use it when verifying the certificate verify
\r
2901 message (when the client authentication is based on signing), or
\r
2902 calculate the premaster secret (for non-ephemeral Diffie-Hellman).
\r
2903 The certificate MUST be appropriate for the negotiated cipher
\r
2904 suite's key exchange algorithm, and any negotiated extensions.
\r
2908 Dierks & Rescorla Standards Track [Page 52]
\r
2910 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2915 - The certificate type MUST be X.509v3, unless explicitly negotiated
\r
2916 otherwise (e.g. [TLSPGP]).
\r
2918 - The end-entity certificate's public key (and associated
\r
2919 restrictions) has to be compatible with the certificate types
\r
2920 listed in CertificateRequest:
\r
2922 Client Cert. Type Certificate Key Type
\r
2924 rsa_sign RSA public key; the certificate MUST allow
\r
2925 the key to be used for signing with the
\r
2926 signature scheme and hash algorithm that
\r
2927 will be employed in the certificate verify
\r
2930 dss_sign DSA public key; the certificate MUST allow
\r
2931 the key to be used for signing with the
\r
2932 hash algorithm that will be employed in
\r
2933 the certificate verify message.
\r
2935 ecdsa_sign ECDSA-capable public key; the certificate
\r
2936 MUST allow the key to be used for signing
\r
2937 with the hash algorithm that will be
\r
2938 employed in the certificate verify
\r
2939 message; the public key MUST use a
\r
2940 curve and point format supported by the
\r
2943 rsa_fixed_dh Diffie-Hellman public key; MUST use
\r
2944 dss_fixed_dh the same parameters as server's key.
\r
2946 rsa_fixed_ecdh ECDH-capable public key; MUST use
\r
2947 ecdsa_fixed_ecdh the same curve as server's key, and
\r
2948 MUST use a point format supported by
\r
2951 - If the certificate_authorities list in the certificate request
\r
2952 message was non-empty, one of the certificates in the certificate
\r
2953 chain SHOULD be issued by one of the listed CAs.
\r
2955 - The certificates MUST be signed using an acceptable hash/
\r
2956 signature algorithm pair, as described in Section 7.4.4. Note that
\r
2957 this relaxes the constraints on certificate signing algorithms
\r
2958 found in prior versions of TLS.
\r
2960 Note that as with the server certificate, there are certificates that
\r
2964 Dierks & Rescorla Standards Track [Page 53]
\r
2966 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
2969 use algorithms/algorithm combinations that cannot be currently used
\r
2972 7.4.7. Client Key Exchange Message
\r
2974 When this message will be sent:
\r
2976 This message is always sent by the client. It MUST immediately
\r
2977 follow the client certificate message, if it is sent. Otherwise it
\r
2978 MUST be the first message sent by the client after it receives the
\r
2979 server hello done message.
\r
2981 Meaning of this message:
\r
2983 With this message, the premaster secret is set, either though
\r
2984 direct transmission of the RSA-encrypted secret, or by the
\r
2985 transmission of Diffie-Hellman parameters that will allow each
\r
2986 side to agree upon the same premaster secret.
\r
2988 When the client is using an ephemeral Diffie-Hellman exponent,
\r
2989 then this message contains the client's Diffie-Hellman public
\r
2990 value. If the client is sending a certificate containing a static
\r
2991 DH exponent (i.e., it is doing fixed_dh client authentication)
\r
2992 then this message MUST be sent but MUST be empty.
\r
2995 Structure of this message:
\r
2997 The choice of messages depends on which key exchange method has
\r
2998 been selected. See Section 7.4.3 for the KeyExchangeAlgorithm
\r
3002 select (KeyExchangeAlgorithm) {
\r
3004 EncryptedPreMasterSecret;
\r
3010 ClientDiffieHellmanPublic;
\r
3012 } ClientKeyExchange;
\r
3014 7.4.7.1. RSA Encrypted Premaster Secret Message
\r
3016 Meaning of this message:
\r
3020 Dierks & Rescorla Standards Track [Page 54]
\r
3022 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3025 If RSA is being used for key agreement and authentication, the
\r
3026 client generates a 48-byte premaster secret, encrypts it using the
\r
3027 public key from the server's certificate and sends the result in
\r
3028 an encrypted premaster secret message. This structure is a variant
\r
3029 of the client key exchange message and is not a message in itself.
\r
3031 Structure of this message:
\r
3034 ProtocolVersion client_version;
\r
3035 opaque random[46];
\r
3036 } PreMasterSecret;
\r
3039 The latest (newest) version supported by the client. This is
\r
3040 used to detect version roll-back attacks.
\r
3043 46 securely-generated random bytes.
\r
3046 public-key-encrypted PreMasterSecret pre_master_secret;
\r
3047 } EncryptedPreMasterSecret;
\r
3050 This random value is generated by the client and is used to
\r
3051 generate the master secret, as specified in Section 8.1.
\r
3053 Note: The version number in the PreMasterSecret is the version
\r
3054 offered by the client in the ClientHello.client_version, not the
\r
3055 version negotiated for the connection. This feature is designed to
\r
3056 prevent rollback attacks. Unfortunately, some old implementations
\r
3057 use the negotiated version instead and therefore checking the version
\r
3058 number may lead to failure to interoperate with such incorrect client
\r
3061 Client implementations MUST always send the correct version number in
\r
3062 PreMasterSecret. If ClientHello.client_version is TLS 1.1 or higher,
\r
3063 server implementations MUST check the version number as described in
\r
3064 the note below. If the version number is 1.0 or earlier, server
\r
3065 implementations SHOULD check the version number, but MAY have a
\r
3066 configuration option to disable the check. Note that if the check
\r
3067 fails, the PreMasterSecret SHOULD be randomized as described below.
\r
3069 Note: Attacks discovered by Bleichenbacher [BLEI] and Klima et al.
\r
3070 [KPR03] can be used to attack a TLS server that reveals whether a
\r
3071 particular message, when decrypted, is properly PKCS#1 formatted,
\r
3072 contains a valid PreMasterSecret structure, or has the correct
\r
3076 Dierks & Rescorla Standards Track [Page 55]
\r
3078 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3083 The best way to avoid these vulnerabilities is to treat incorrectly
\r
3084 formatted messages in a manner indistinguishable from correctly
\r
3085 formatted RSA blocks. In other words:
\r
3087 1. Generate a string R of 46 random bytes
\r
3089 2. Decrypt the message M
\r
3091 3. If the PKCS#1 padding is not correct, or the length of
\r
3092 message M is not exactly 48 bytes:
\r
3093 premaster secret = ClientHello.client_version || R
\r
3094 else If ClientHello.client_version <= TLS 1.0, and
\r
3095 version number check is explicitly disabled:
\r
3096 premaster secret = M
\r
3098 premaster secret = ClientHello.client_version || M[2..47]
\r
3100 Note that explicitly constructing the premaster_secret with the
\r
3101 ClientHello.client_version produces an invalid master_secret if the
\r
3102 client has sent the wrong version in the original premaster_secret.
\r
3104 In any case, a TLS server MUST NOT generate an alert if processing an
\r
3105 RSA-encrypted premaster secret message fails, or the version number
\r
3106 is not as expected. Instead, it MUST continue the handshake with a
\r
3107 randomly generated premaster secret. It may be useful to log the
\r
3108 real cause of failure for troubleshooting purposes; however, care
\r
3109 must be taken to avoid leaking the information to an attacker
\r
3110 (through, e.g., timing, log files, or other channels.)
\r
3112 The RSAES-OAEP encryption scheme defined in [PKCS1] is more secure
\r
3113 against the Bleichenbacher attack. However, for maximal compatibility
\r
3114 with earlier versions of TLS, this specification uses the RSAES-
\r
3115 PKCS1-v1_5 scheme. No variants of the Bleichenbacher attack are known
\r
3116 to exist provided that the above recommendations are followed.
\r
3118 Implementation Note: Public-key-encrypted data is represented as an
\r
3119 opaque vector <0..2^16-1> (see Section 4.7). Thus, the RSA-encrypted
\r
3120 PreMasterSecret in a ClientKeyExchange is preceded by two length
\r
3121 bytes. These bytes are redundant in the case of RSA because the
\r
3122 EncryptedPreMasterSecret is the only data in the ClientKeyExchange
\r
3123 and its length can therefore be unambiguously determined. The SSLv3
\r
3124 specification was not clear about the encoding of public-key-
\r
3125 encrypted data, and therefore many SSLv3 implementations do not
\r
3126 include the the length bytes, encoding the RSA encrypted data
\r
3127 directly in the ClientKeyExchange message.
\r
3132 Dierks & Rescorla Standards Track [Page 56]
\r
3134 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3137 This specification requires correct encoding of the
\r
3138 EncryptedPreMasterSecret complete with length bytes. The resulting
\r
3139 PDU is incompatible with many SSLv3 implementations. Implementors
\r
3140 upgrading from SSLv3 MUST modify their implementations to generate
\r
3141 and accept the correct encoding. Implementors who wish to be
\r
3142 compatible with both SSLv3 and TLS should make their implementation's
\r
3143 behavior dependent on the protocol version.
\r
3145 Implementation Note: It is now known that remote timing-based attacks
\r
3146 on TLS are possible, at least when the client and server are on the
\r
3147 same LAN. Accordingly, implementations that use static RSA keys MUST
\r
3148 use RSA blinding or some other anti-timing technique, as described in
\r
3152 7.4.7.2. Client Diffie-Hellman Public Value
\r
3154 Meaning of this message:
\r
3156 This structure conveys the client's Diffie-Hellman public value
\r
3157 (Yc) if it was not already included in the client's certificate.
\r
3158 The encoding used for Yc is determined by the enumerated
\r
3159 PublicValueEncoding. This structure is a variant of the client key
\r
3160 exchange message, and not a message in itself.
\r
3162 Structure of this message:
\r
3164 enum { implicit, explicit } PublicValueEncoding;
\r
3167 If the client has sent a certificate which contains a suitable
\r
3168 Diffie-Hellman key (for fixed_dh client authentication) then Yc
\r
3169 is implicit and does not need to be sent again. In this case,
\r
3170 the client key exchange message will be sent, but it MUST be
\r
3174 Yc needs to be sent.
\r
3177 select (PublicValueEncoding) {
\r
3178 case implicit: struct { };
\r
3179 case explicit: opaque dh_Yc<1..2^16-1>;
\r
3181 } ClientDiffieHellmanPublic;
\r
3184 The client's Diffie-Hellman public value (Yc).
\r
3188 Dierks & Rescorla Standards Track [Page 57]
\r
3190 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3193 7.4.8. Certificate verify
\r
3195 When this message will be sent:
\r
3197 This message is used to provide explicit verification of a client
\r
3198 certificate. This message is only sent following a client
\r
3199 certificate that has signing capability (i.e. all certificates
\r
3200 except those containing fixed Diffie-Hellman parameters). When
\r
3201 sent, it MUST immediately follow the client key exchange message.
\r
3203 Structure of this message:
\r
3206 digitally-signed struct {
\r
3207 opaque handshake_messages[handshake_messages_length];
\r
3209 } CertificateVerify;
\r
3211 Here handshake_messages refers to all handshake messages sent or
\r
3212 received starting at client hello up to but not including this
\r
3213 message, including the type and length fields of the handshake
\r
3214 messages. This is the concatenation of all the Handshake
\r
3215 structures as defined in 7.4 exchanged thus far. Note that this
\r
3216 requires both sides to either buffer the messages or compute
\r
3217 running hashes for all potential hash algorithms up to the time of
\r
3218 the CertificateVerify computation. Servers can minimize this
\r
3219 computation cost by offering a restricted set of digest algorithms
\r
3220 in the CertificateRequest message.
\r
3222 The hash and signature algorithms used in the signature MUST be
\r
3223 one of those present in the supported_signature_algorithms field
\r
3224 of the CertificateRequest message. In addition, the hash and
\r
3225 signature algorithms MUST be compatible with the key in the
\r
3226 client's end-entity certificate. RSA keys MAY be used with any
\r
3227 permitted hash algorith, subject to restrictions in the
\r
3228 certificate, if any.
\r
3230 Because DSA signatures do not contain any secure indication of
\r
3231 hash algorithm, there is a risk of hash substitution if multiple
\r
3232 hashes may be used with any key. Currently, DSS [DSS] may only be
\r
3233 used with SHA-1. Future revisions of DSS [DSS-3] are expected to
\r
3234 allow other digest algorithms, as well as guidance as to which
\r
3235 digest algorithms should be used with each key size. In addition,
\r
3236 future revisions of [PKIX] may specify mechanisms for certificates
\r
3237 to indicate which digest algorithms are to be used with DSA.
\r
3244 Dierks & Rescorla Standards Track [Page 58]
\r
3246 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3249 When this message will be sent:
\r
3251 A finished message is always sent immediately after a change
\r
3252 cipher spec message to verify that the key exchange and
\r
3253 authentication processes were successful. It is essential that a
\r
3254 change cipher spec message be received between the other handshake
\r
3255 messages and the Finished message.
\r
3257 Meaning of this message:
\r
3259 The finished message is the first protected with the just-
\r
3260 negotiated algorithms, keys, and secrets. Recipients of finished
\r
3261 messages MUST verify that the contents are correct. Once a side
\r
3262 has sent its Finished message and received and validated the
\r
3263 Finished message from its peer, it may begin to send and receive
\r
3264 application data over the connection.
\r
3266 Structure of this message:
\r
3269 opaque verify_data[verify_data_length];
\r
3273 PRF(master_secret, finished_label, Hash(handshake_messages))
\r
3274 [0..verify_data_length-1];
\r
3277 For Finished messages sent by the client, the string "client
\r
3278 finished". For Finished messages sent by the server, the string
\r
3279 "server finished".
\r
3281 Hash denotes a Hash of the handshake messages. For the PRF defined
\r
3282 in Section 5, the Hash MUST be the Hash used as the basis for the
\r
3283 PRF. Any cipher suite which defines a different PRF MUST also
\r
3284 define the Hash to use in the Finished computation.
\r
3286 In previous versions of TLS, the verify_data was always 12 octets
\r
3287 long. In the current version of TLS, it depends on the cipher
\r
3288 suite. Any cipher suite which does not explicitly specify
\r
3289 verify_data_length has a verify_data_length equal to 12. This
\r
3290 includes all existing cipher suites. Note that this
\r
3291 representation has the same encoding as with previous versions.
\r
3292 Future cipher suites MAY specify other lengths but such length
\r
3293 MUST be at least 12 bytes.
\r
3295 handshake_messages
\r
3296 All of the data from all messages in this handshake (not
\r
3300 Dierks & Rescorla Standards Track [Page 59]
\r
3302 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3305 including any HelloRequest messages) up to but not including
\r
3306 this message. This is only data visible at the handshake layer
\r
3307 and does not include record layer headers. This is the
\r
3308 concatenation of all the Handshake structures as defined in
\r
3309 7.4, exchanged thus far.
\r
3311 It is a fatal error if a finished message is not preceded by a change
\r
3312 cipher spec message at the appropriate point in the handshake.
\r
3314 The value handshake_messages includes all handshake messages starting
\r
3315 at client hello up to, but not including, this finished message. This
\r
3316 may be different from handshake_messages in Section 7.4.8 because it
\r
3317 would include the certificate verify message (if sent). Also, the
\r
3318 handshake_messages for the finished message sent by the client will
\r
3319 be different from that for the finished message sent by the server,
\r
3320 because the one that is sent second will include the prior one.
\r
3322 Note: Change cipher spec messages, alerts, and any other record types
\r
3323 are not handshake messages and are not included in the hash
\r
3324 computations. Also, Hello Request messages are omitted from handshake
\r
3327 8. Cryptographic Computations
\r
3329 In order to begin connection protection, the TLS Record Protocol
\r
3330 requires specification of a suite of algorithms, a master secret, and
\r
3331 the client and server random values. The authentication, encryption,
\r
3332 and MAC algorithms are determined by the cipher_suite selected by the
\r
3333 server and revealed in the server hello message. The compression
\r
3334 algorithm is negotiated in the hello messages, and the random values
\r
3335 are exchanged in the hello messages. All that remains is to calculate
\r
3336 the master secret.
\r
3338 8.1. Computing the Master Secret
\r
3340 For all key exchange methods, the same algorithm is used to convert
\r
3341 the pre_master_secret into the master_secret. The pre_master_secret
\r
3342 should be deleted from memory once the master_secret has been
\r
3345 master_secret = PRF(pre_master_secret, "master secret",
\r
3346 ClientHello.random + ServerHello.random)
\r
3349 The master secret is always exactly 48 bytes in length. The length of
\r
3350 the premaster secret will vary depending on key exchange method.
\r
3356 Dierks & Rescorla Standards Track [Page 60]
\r
3358 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3363 When RSA is used for server authentication and key exchange, a
\r
3364 48-byte pre_master_secret is generated by the client, encrypted under
\r
3365 the server's public key, and sent to the server. The server uses its
\r
3366 private key to decrypt the pre_master_secret. Both parties then
\r
3367 convert the pre_master_secret into the master_secret, as specified
\r
3370 8.1.2. Diffie-Hellman
\r
3372 A conventional Diffie-Hellman computation is performed. The
\r
3373 negotiated key (Z) is used as the pre_master_secret, and is converted
\r
3374 into the master_secret, as specified above. Leading bytes of Z that
\r
3375 contain all zero bits are stripped before it is used as the
\r
3376 pre_master_secret.
\r
3378 Note: Diffie-Hellman parameters are specified by the server and may
\r
3379 be either ephemeral or contained within the server's certificate.
\r
3381 9. Mandatory Cipher Suites
\r
3383 In the absence of an application profile standard specifying
\r
3384 otherwise, a TLS compliant application MUST implement the cipher
\r
3385 suite TLS_RSA_WITH_AES_128_CBC_SHA.
\r
3387 10. Application Data Protocol
\r
3389 Application data messages are carried by the Record Layer and are
\r
3390 fragmented, compressed, and encrypted based on the current connection
\r
3391 state. The messages are treated as transparent data to the record
\r
3394 11. Security Considerations
\r
3396 Security issues are discussed throughout this memo, especially in
\r
3397 Appendices D, E, and F.
\r
3399 12. IANA Considerations
\r
3401 This document uses several registries that were originally created in
\r
3402 [TLS1.1]. IANA is requested to update (has updated) these to
\r
3403 reference this document. The registries and their allocation policies
\r
3404 (unchanged from [TLS1.1]) are listed below.
\r
3406 - TLS ClientCertificateType Identifiers Registry: Future values in
\r
3407 the range 0-63 (decimal) inclusive are assigned via Standards
\r
3408 Action [RFC2434]. Values in the range 64-223 (decimal) inclusive
\r
3412 Dierks & Rescorla Standards Track [Page 61]
\r
3414 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3417 are assigned Specification Required [RFC2434]. Values from 224-255
\r
3418 (decimal) inclusive are reserved for Private Use [RFC2434].
\r
3420 - TLS Cipher Suite Registry: Future values with the first byte in
\r
3421 the range 0-191 (decimal) inclusive are assigned via Standards
\r
3422 Action [RFC2434]. Values with the first byte in the range 192-254
\r
3423 (decimal) are assigned via Specification Required [RFC2434].
\r
3424 Values with the first byte 255 (decimal) are reserved for Private
\r
3427 - This document defines several new HMAC-SHA256 based cipher suites,
\r
3428 whose values (in Appendix A.5) are to be (have been) allocated
\r
3429 from the TLS Cipher Suite registry.
\r
3431 - TLS ContentType Registry: Future values are allocated via
\r
3432 Standards Action [RFC2434].
\r
3434 - TLS Alert Registry: Future values are allocated via Standards
\r
3437 - TLS HandshakeType Registry: Future values are allocated via
\r
3438 Standards Action [RFC2434].
\r
3440 This document also uses a registry originally created in [RFC4366].
\r
3441 IANA is requested to update (has updated) it to reference this
\r
3442 document. The registry and its allocation policy (unchanged from
\r
3443 [RFC4366]) is listed below:
\r
3445 - TLS ExtensionType Registry: Future values are allocated via IETF
\r
3446 Consensus [RFC2434]
\r
3448 In addition, this document defines two new registries to be
\r
3449 maintained by IANA:
\r
3451 - TLS SignatureAlgorithm Registry: The registry will be initially
\r
3452 populated with the values described in Section 7.4.1.4.1. Future
\r
3453 values in the range 0-63 (decimal) inclusive are assigned via
\r
3454 Standards Action [RFC2434]. Values in the range 64-223 (decimal)
\r
3455 inclusive are assigned via Specification Required [RFC2434].
\r
3456 Values from 224-255 (decimal) inclusive are reserved for Private
\r
3459 - TLS HashAlgorithm Registry: The registry will be initially
\r
3460 populated with the values described in Section 7.4.1.4.1. Future
\r
3461 values in the range 0-63 (decimal) inclusive are assigned via
\r
3462 Standards Action [RFC2434]. Values in the range 64-223 (decimal)
\r
3463 inclusive are assigned via Specification Required [RFC2434].
\r
3464 Values from 224-255 (decimal) inclusive are reserved for Private
\r
3468 Dierks & Rescorla Standards Track [Page 62]
\r
3470 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3475 This document defines one new TLS extension, signature_algorithms,
\r
3476 which is to be (has been) allocated value TBD-BY-IANA in the TLS
\r
3477 ExtensionType registry.
\r
3479 This document also uses the TLS Compression Method Identifiers
\r
3480 Registry, defined in [RFC3749]. IANA is requested to allocate value
\r
3481 0 for the "null" compression method.
\r
3524 Dierks & Rescorla Standards Track [Page 63]
\r
3526 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3529 Appendix A. Protocol Constant Values
\r
3531 This section describes protocol types and constants.
\r
3538 } ProtocolVersion;
\r
3540 ProtocolVersion version = { 3, 3 }; /* TLS v1.2*/
\r
3543 change_cipher_spec(20), alert(21), handshake(22),
\r
3544 application_data(23), (255)
\r
3549 ProtocolVersion version;
\r
3551 opaque fragment[TLSPlaintext.length];
\r
3556 ProtocolVersion version;
\r
3558 opaque fragment[TLSCompressed.length];
\r
3563 ProtocolVersion version;
\r
3565 select (SecurityParameters.cipher_type) {
\r
3566 case stream: GenericStreamCipher;
\r
3567 case block: GenericBlockCipher;
\r
3568 case aead: GenericAEADCipher;
\r
3572 stream-ciphered struct {
\r
3573 opaque content[TLSCompressed.length];
\r
3574 opaque MAC[SecurityParameters.mac_length];
\r
3575 } GenericStreamCipher;
\r
3580 Dierks & Rescorla Standards Track [Page 64]
\r
3582 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3586 opaque IV[SecurityParameters.record_iv_length];
\r
3587 block-ciphered struct {
\r
3588 opaque content[TLSCompressed.length];
\r
3589 opaque MAC[SecurityParameters.mac_length];
\r
3590 uint8 padding[GenericBlockCipher.padding_length];
\r
3591 uint8 padding_length;
\r
3593 } GenericBlockCipher;
\r
3595 aead-ciphered struct {
\r
3596 opaque IV[SecurityParameters.record_iv_length];
\r
3597 opaque aead_output[AEADEncrypted.length];
\r
3598 } GenericAEADCipher;
\r
3600 A.2. Change Cipher Specs Message
\r
3603 enum { change_cipher_spec(1), (255) } type;
\r
3604 } ChangeCipherSpec;
\r
3606 A.3. Alert Messages
\r
3608 enum { warning(1), fatal(2), (255) } AlertLevel;
\r
3612 unexpected_message(10),
\r
3613 bad_record_mac(20),
\r
3614 decryption_failed_RESERVED(21),
\r
3615 record_overflow(22),
\r
3616 decompression_failure(30),
\r
3617 handshake_failure(40),
\r
3618 no_certificate_RESERVED(41),
\r
3619 bad_certificate(42),
\r
3620 unsupported_certificate(43),
\r
3621 certificate_revoked(44),
\r
3622 certificate_expired(45),
\r
3623 certificate_unknown(46),
\r
3624 illegal_parameter(47),
\r
3626 access_denied(49),
\r
3628 decrypt_error(51),
\r
3629 export_restriction_RESERVED(60),
\r
3630 protocol_version(70),
\r
3631 insufficient_security(71),
\r
3632 internal_error(80),
\r
3636 Dierks & Rescorla Standards Track [Page 65]
\r
3638 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3641 user_canceled(90),
\r
3642 no_renegotiation(100),
\r
3643 unsupported_extension(110), /* new */
\r
3645 } AlertDescription;
\r
3649 AlertDescription description;
\r
3652 A.4. Handshake Protocol
\r
3655 hello_request(0), client_hello(1), server_hello(2),
\r
3656 certificate(11), server_key_exchange (12),
\r
3657 certificate_request(13), server_hello_done(14),
\r
3658 certificate_verify(15), client_key_exchange(16),
\r
3664 HandshakeType msg_type;
\r
3666 select (HandshakeType) {
\r
3667 case hello_request: HelloRequest;
\r
3668 case client_hello: ClientHello;
\r
3669 case server_hello: ServerHello;
\r
3670 case certificate: Certificate;
\r
3671 case server_key_exchange: ServerKeyExchange;
\r
3672 case certificate_request: CertificateRequest;
\r
3673 case server_hello_done: ServerHelloDone;
\r
3674 case certificate_verify: CertificateVerify;
\r
3675 case client_key_exchange: ClientKeyExchange;
\r
3676 case finished: Finished;
\r
3680 A.4.1. Hello Messages
\r
3682 struct { } HelloRequest;
\r
3685 uint32 gmt_unix_time;
\r
3686 opaque random_bytes[28];
\r
3692 Dierks & Rescorla Standards Track [Page 66]
\r
3694 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3697 opaque SessionID<0..32>;
\r
3699 uint8 CipherSuite[2];
\r
3701 enum { null(0), (255) } CompressionMethod;
\r
3704 ProtocolVersion client_version;
\r
3706 SessionID session_id;
\r
3707 CipherSuite cipher_suites<2..2^16-2>;
\r
3708 CompressionMethod compression_methods<1..2^8-1>;
\r
3709 select (extensions_present) {
\r
3713 Extension extensions<0..2^16-1>;
\r
3718 ProtocolVersion server_version;
\r
3720 SessionID session_id;
\r
3721 CipherSuite cipher_suite;
\r
3722 CompressionMethod compression_method;
\r
3723 select (extensions_present) {
\r
3727 Extension extensions<0..2^16-1>;
\r
3732 ExtensionType extension_type;
\r
3733 opaque extension_data<0..2^16-1>;
\r
3737 signature_algorithms(TBD-BY-IANA), (65535)
\r
3741 none(0), md5(1), sha1(2), sha256(3), sha384(4),
\r
3748 Dierks & Rescorla Standards Track [Page 67]
\r
3750 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3753 enum { anonymous(0), rsa(1), dsa(2), (255) } SignatureAlgorithm;
\r
3756 HashAlgorithm hash;
\r
3757 SignatureAlgorithm signature;
\r
3758 } SignatureAndHashAlgorithm;
\r
3760 SignatureAndHashAlgorithm
\r
3761 supported_signature_algorithms<2..2^16-1>;
\r
3763 A.4.2. Server Authentication and Key Exchange Messages
\r
3765 opaque ASN.1Cert<2^24-1>;
\r
3768 ASN.1Cert certificate_list<0..2^24-1>;
\r
3771 enum { dhe_dss, dhe_rsa, dh_anon, rsa,dh_dss, dh_rsa}
\r
3772 KeyExchangeAlgorithm;
\r
3775 opaque dh_p<1..2^16-1>;
\r
3776 opaque dh_g<1..2^16-1>;
\r
3777 opaque dh_Ys<1..2^16-1>;
\r
3778 } ServerDHParams; /* Ephemeral DH parameters */
\r
3781 select (KeyExchangeAlgorithm) {
\r
3783 ServerDHParams params;
\r
3786 ServerDHParams params;
\r
3787 digitally-signed struct {
\r
3788 opaque client_random[32];
\r
3789 opaque server_random[32];
\r
3790 ServerDHParams params;
\r
3796 /* message is omitted for rsa, dh_dss, and dh_rsa */
\r
3798 } ServerKeyExchange;
\r
3804 Dierks & Rescorla Standards Track [Page 68]
\r
3806 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3810 rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),
\r
3811 rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6),
\r
3812 fortezza_dms_RESERVED(20),
\r
3814 } ClientCertificateType;
\r
3816 opaque DistinguishedName<1..2^16-1>;
\r
3819 ClientCertificateType certificate_types<1..2^8-1>;
\r
3820 DistinguishedName certificate_authorities<0..2^16-1>;
\r
3821 } CertificateRequest;
\r
3823 struct { } ServerHelloDone;
\r
3825 A.4.3. Client Authentication and Key Exchange Messages
\r
3828 select (KeyExchangeAlgorithm) {
\r
3830 EncryptedPreMasterSecret;
\r
3836 ClientDiffieHellmanPublic;
\r
3838 } ClientKeyExchange;
\r
3841 ProtocolVersion client_version;
\r
3842 opaque random[46];
\r
3843 } PreMasterSecret;
\r
3846 public-key-encrypted PreMasterSecret pre_master_secret;
\r
3847 } EncryptedPreMasterSecret;
\r
3849 enum { implicit, explicit } PublicValueEncoding;
\r
3852 select (PublicValueEncoding) {
\r
3853 case implicit: struct {};
\r
3854 case explicit: opaque DH_Yc<1..2^16-1>;
\r
3856 } ClientDiffieHellmanPublic;
\r
3860 Dierks & Rescorla Standards Track [Page 69]
\r
3862 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3866 digitally-signed struct {
\r
3867 opaque handshake_messages[handshake_messages_length];
\r
3869 } CertificateVerify;
\r
3871 A.4.4. Handshake Finalization Message
\r
3874 opaque verify_data[verify_data_length];
\r
3877 A.5. The Cipher Suite
\r
3879 The following values define the cipher suite codes used in the client
\r
3880 hello and server hello messages.
\r
3882 A cipher suite defines a cipher specification supported in TLS
\r
3885 TLS_NULL_WITH_NULL_NULL is specified and is the initial state of a
\r
3886 TLS connection during the first handshake on that channel, but MUST
\r
3887 NOT be negotiated, as it provides no more protection than an
\r
3888 unsecured connection.
\r
3890 CipherSuite TLS_NULL_WITH_NULL_NULL = { 0x00,0x00 };
\r
3892 The following CipherSuite definitions require that the server provide
\r
3893 an RSA certificate that can be used for key exchange. The server may
\r
3894 request any signature-capable certificate in the certificate request
\r
3897 CipherSuite TLS_RSA_WITH_NULL_MD5 = { 0x00,0x01 };
\r
3898 CipherSuite TLS_RSA_WITH_NULL_SHA = { 0x00,0x02 };
\r
3899 CipherSuite TLS_RSA_WITH_NULL_SHA256 = { 0x00,TBD1 };
\r
3900 CipherSuite TLS_RSA_WITH_RC4_128_MD5 = { 0x00,0x04 };
\r
3901 CipherSuite TLS_RSA_WITH_RC4_128_SHA = { 0x00,0x05 };
\r
3902 CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x0A };
\r
3903 CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = { 0x00,0x2F };
\r
3904 CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = { 0x00,0x35 };
\r
3905 CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = { 0x00,TBD2 };
\r
3906 CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = { 0x00,TBD3 };
\r
3909 The following cipher suite definitions are used for server-
\r
3910 authenticated (and optionally client-authenticated) Diffie-Hellman.
\r
3911 DH denotes cipher suites in which the server's certificate contains
\r
3912 the Diffie-Hellman parameters signed by the certificate authority
\r
3916 Dierks & Rescorla Standards Track [Page 70]
\r
3918 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3921 (CA). DHE denotes ephemeral Diffie-Hellman, where the Diffie-Hellman
\r
3922 parameters are signed by a a signature-capable certificate, which has
\r
3923 been signed by the CA. The signing algorithm used by the server is
\r
3924 specified after the DHE parameter. The server can request any
\r
3925 signature-capable certificate from the client for client
\r
3926 authentication or it may request a Diffie-Hellman certificate. Any
\r
3927 Diffie-Hellman certificate provided by the client must use the
\r
3928 parameters (group and generator) described by the server.
\r
3931 CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00,0x0D };
\r
3932 CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x10 };
\r
3933 CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00,0x13 };
\r
3934 CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x16 };
\r
3935 CipherSuite TLS_DH_DSS_WITH_AES_128_CBC_SHA = { 0x00,0x30 };
\r
3936 CipherSuite TLS_DH_RSA_WITH_AES_128_CBC_SHA = { 0x00,0x31 };
\r
3937 CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = { 0x00,0x32 };
\r
3938 CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = { 0x00,0x33 };
\r
3939 CipherSuite TLS_DH_DSS_WITH_AES_256_CBC_SHA = { 0x00,0x36 };
\r
3940 CipherSuite TLS_DH_RSA_WITH_AES_256_CBC_SHA = { 0x00,0x37 };
\r
3941 CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = { 0x00,0x38 };
\r
3942 CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = { 0x00,0x39 };
\r
3943 CipherSuite TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = { 0x00, TBD4};
\r
3944 CipherSuite TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = { 0x00, TBD5};
\r
3945 CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = { 0x00, TBD6};
\r
3946 CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = { 0x00, TBD7};
\r
3947 CipherSuite TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = { 0x00, TBD8};
\r
3948 CipherSuite TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = { 0x00, TBD9};
\r
3949 CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = { 0x00, TBDA};
\r
3950 CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = { 0x00, TBDB};
\r
3952 The following cipher suites are used for completely anonymous Diffie-
\r
3953 Hellman communications in which neither party is authenticated. Note
\r
3954 that this mode is vulnerable to man-in-the-middle attacks. Using
\r
3955 this mode therefore is of limited use: These cipher suites MUST NOT
\r
3956 be used by TLS 1.2 implementations unless the application layer has
\r
3957 specifically requested to allow anonymous key exchange. (Anonymous
\r
3958 key exchange may sometimes be acceptable, for example, to support
\r
3959 opportunistic encryption when no set-up for authentication is in
\r
3960 place, or when TLS is used as part of more complex security protocols
\r
3961 that have other means to ensure authentication.)
\r
3963 CipherSuite TLS_DH_anon_WITH_RC4_128_MD5 = { 0x00,0x18 };
\r
3964 CipherSuite TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = { 0x00,0x1B };
\r
3965 CipherSuite TLS_DH_anon_WITH_AES_128_CBC_SHA = { 0x00,0x34 };
\r
3966 CipherSuite TLS_DH_anon_WITH_AES_256_CBC_SHA = { 0x00,0x3A };
\r
3967 CipherSuite TLS_DH_anon_WITH_AES_128_CBC_SHA256 = { 0x00, TBDC};
\r
3968 CipherSuite TLS_DH_anon_WITH_AES_256_CBC_SHA256 = { 0x00, TBDD};
\r
3972 Dierks & Rescorla Standards Track [Page 71]
\r
3974 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
3977 Note that using non-anonymous key exchange without actually verifying
\r
3978 the key exchange is essentially equivalent to anonymous key exchange,
\r
3979 and the same precautions apply. While non-anonymous key exchange
\r
3980 will generally involve a higher computational and communicational
\r
3981 cost than anonymous key exchange, it may be in the interest of
\r
3982 interoperability not to disable non-anonymous key exchange when the
\r
3983 application layer is allowing anonymous key exchange.
\r
3985 New cipher suite values are assigned by IANA as described in Section
\r
3988 Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are
\r
3989 reserved to avoid collision with Fortezza-based cipher suites in SSL
\r
3992 A.6. The Security Parameters
\r
3994 These security parameters are determined by the TLS Handshake
\r
3995 Protocol and provided as parameters to the TLS Record Layer in order
\r
3996 to initialize a connection state. SecurityParameters includes:
\r
3998 enum { null(0), (255) } CompressionMethod;
\r
4000 enum { server, client } ConnectionEnd;
\r
4002 enum { tls_prf_sha256 } PRFAlgorithm;
\r
4004 enum { null, rc4, 3des, aes }
\r
4005 BulkCipherAlgorithm;
\r
4007 enum { stream, block, aead } CipherType;
\r
4009 enum { null, hmac_md5, hmac_sha, hmac_sha256, hmac_sha384,
\r
4010 hmac_sha512} MACAlgorithm;
\r
4012 /* The algorithms specified in CompressionMethod,
\r
4013 BulkCipherAlgorithm, and MACAlgorithm may be added to. */
\r
4016 ConnectionEnd entity;
\r
4017 PRFAlgorithm prf_algorithm;
\r
4018 BulkCipherAlgorithm bulk_cipher_algorithm;
\r
4019 CipherType cipher_type;
\r
4020 uint8 enc_key_length;
\r
4021 uint8 block_length;
\r
4022 uint8 fixed_iv_length;
\r
4023 uint8 record_iv_length;
\r
4024 MACAlgorithm mac_algorithm;
\r
4028 Dierks & Rescorla Standards Track [Page 72]
\r
4030 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4034 uint8 mac_key_length;
\r
4035 CompressionMethod compression_algorithm;
\r
4036 opaque master_secret[48];
\r
4037 opaque client_random[32];
\r
4038 opaque server_random[32];
\r
4039 } SecurityParameters;
\r
4041 A.7. Changes to RFC 4492
\r
4043 RFC 4492 [TLSECC] adds Elliptic Curve cipher suites to TLS. This
\r
4044 document changes some of the structures used in that document. This
\r
4045 section details the required changes for implementors of both RFC
\r
4046 4492 and TLS 1.2. Implementors of TLS 1.2 who are not implementing
\r
4047 RFC 4492 do not need to read this section.
\r
4049 This document adds a "signature_algorithm" field to the digitally-
\r
4050 signed element in order to identify the signature and digest
\r
4051 algorithms used to create a signature. This change applies to digital
\r
4052 signatures formed using ECDSA as well, thus allowing ECDSA signatures
\r
4053 to be used and digest algorithms other than SHA-1, provided such use
\r
4054 is compatible with the certificate and any restrictions imposed by
\r
4055 future revisions of [PKIX].
\r
4057 As described in Sections 7.4.2 and 7.4.6, the restrictions on the
\r
4058 signature algorithms used to sign certificates are no longer tied to
\r
4059 the cipher suite (when used by the server) or the
\r
4060 ClientCertificateType (when used by the client). Thus, the
\r
4061 restrictions on the algorithm used to sign certificates specified in
\r
4062 Sections 2 and 3 of RFC 4492 are also relaxed. As in this document
\r
4063 the restrictions on the keys in the end-entity certificate remain.
\r
4065 Appendix B. Glossary
\r
4067 Advanced Encryption Standard (AES)
\r
4068 AES is a widely used symmetric encryption algorithm. AES is a
\r
4069 block cipher with a 128, 192, or 256 bit keys and a 16 byte block
\r
4070 size. [AES] TLS currently only supports the 128 and 256 bit key
\r
4073 application protocol
\r
4074 An application protocol is a protocol that normally layers
\r
4075 directly on top of the transport layer (e.g., TCP/IP). Examples
\r
4076 include HTTP, TELNET, FTP, and SMTP.
\r
4079 See public key cryptography.
\r
4084 Dierks & Rescorla Standards Track [Page 73]
\r
4086 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4089 authenticated encryption with additional data (AEAD)
\r
4090 A symmetric encryption algorithm that simultaneously provides
\r
4091 confidentiality and message integrity.
\r
4094 Authentication is the ability of one entity to determine the
\r
4095 identity of another entity.
\r
4098 A block cipher is an algorithm that operates on plaintext in
\r
4099 groups of bits, called blocks. 64 bits is a common block size.
\r
4102 A symmetric encryption algorithm used to encrypt large quantities
\r
4105 cipher block chaining (CBC)
\r
4106 CBC is a mode in which every plaintext block encrypted with a
\r
4107 block cipher is first exclusive-ORed with the previous ciphertext
\r
4108 block (or, in the case of the first block, with the initialization
\r
4109 vector). For decryption, every block is first decrypted, then
\r
4110 exclusive-ORed with the previous ciphertext block (or IV).
\r
4113 As part of the X.509 protocol (a.k.a. ISO Authentication
\r
4114 framework), certificates are assigned by a trusted Certificate
\r
4115 Authority and provide a strong binding between a party's identity
\r
4116 or some other attributes and its public key.
\r
4119 The application entity that initiates a TLS connection to a
\r
4120 server. This may or may not imply that the client initiated the
\r
4121 underlying transport connection. The primary operational
\r
4122 difference between the server and client is that the server is
\r
4123 generally authenticated, while the client is only optionally
\r
4127 The key used to encrypt data written by the client.
\r
4129 client write MAC key
\r
4130 The secret data used to authenticate data written by the client.
\r
4133 A connection is a transport (in the OSI layering model definition)
\r
4134 that provides a suitable type of service. For TLS, such
\r
4135 connections are peer-to-peer relationships. The connections are
\r
4136 transient. Every connection is associated with one session.
\r
4140 Dierks & Rescorla Standards Track [Page 74]
\r
4142 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4145 Data Encryption Standard
\r
4146 DES is a very widely used symmetric encryption algorithm. DES is a
\r
4147 block cipher with a 56 bit key and an 8 byte block size. Note that
\r
4148 in TLS, for key generation purposes, DES is treated as having an 8
\r
4149 byte key length (64 bits), but it still only provides 56 bits of
\r
4150 protection. (The low bit of each key byte is presumed to be set to
\r
4151 produce odd parity in that key byte.) DES can also be operated in
\r
4152 a mode where three independent keys and three encryptions are used
\r
4153 for each block of data; this uses 168 bits of key (24 bytes in the
\r
4154 TLS key generation method) and provides the equivalent of 112 bits
\r
4155 of security. [DES], [3DES]
\r
4157 Digital Signature Standard (DSS)
\r
4158 A standard for digital signing, including the Digital Signing
\r
4159 Algorithm, approved by the National Institute of Standards and
\r
4160 Technology, defined in NIST FIPS PUB 186, "Digital Signature
\r
4161 Standard", published May, 1994 by the U.S. Dept. of Commerce.
\r
4164 digital signatures
\r
4165 Digital signatures utilize public key cryptography and one-way
\r
4166 hash functions to produce a signature of the data that can be
\r
4167 authenticated, and is difficult to forge or repudiate.
\r
4170 An initial negotiation between client and server that establishes
\r
4171 the parameters of their transactions.
\r
4173 Initialization Vector (IV)
\r
4174 When a block cipher is used in CBC mode, the initialization vector
\r
4175 is exclusive-ORed with the first plaintext block prior to
\r
4178 Message Authentication Code (MAC)
\r
4179 A Message Authentication Code is a one-way hash computed from a
\r
4180 message and some secret data. It is difficult to forge without
\r
4181 knowing the secret data. Its purpose is to detect if the message
\r
4185 Secure secret data used for generating encryption keys, MAC
\r
4189 MD5 is a secure hashing function that converts an arbitrarily long
\r
4190 data stream into a hash of fixed size (16 bytes). [MD5]
\r
4192 public key cryptography
\r
4196 Dierks & Rescorla Standards Track [Page 75]
\r
4198 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4201 A class of cryptographic techniques employing two-key ciphers.
\r
4202 Messages encrypted with the public key can only be decrypted with
\r
4203 the associated private key. Conversely, messages signed with the
\r
4204 private key can be verified with the public key.
\r
4206 one-way hash function
\r
4207 A one-way transformation that converts an arbitrary amount of data
\r
4208 into a fixed-length hash. It is computationally hard to reverse
\r
4209 the transformation or to find collisions. MD5 and SHA are examples
\r
4210 of one-way hash functions.
\r
4213 A stream cipher invented by Ron Rivest. A compatible cipher is
\r
4214 described in [SCH].
\r
4217 A very widely used public-key algorithm that can be used for
\r
4218 either encryption or digital signing. [RSA]
\r
4221 The server is the application entity that responds to requests for
\r
4222 connections from clients. See also under client.
\r
4225 A TLS session is an association between a client and a server.
\r
4226 Sessions are created by the handshake protocol. Sessions define a
\r
4227 set of cryptographic security parameters that can be shared among
\r
4228 multiple connections. Sessions are used to avoid the expensive
\r
4229 negotiation of new security parameters for each connection.
\r
4231 session identifier
\r
4232 A session identifier is a value generated by a server that
\r
4233 identifies a particular session.
\r
4236 The key used to encrypt data written by the server.
\r
4238 server write MAC key
\r
4239 The secret data used to authenticate data written by the server.
\r
4242 The Secure Hash Algorithm is defined in FIPS PUB 180-2. It
\r
4243 produces a 20-byte output. Note that all references to SHA
\r
4244 actually use the modified SHA-1 algorithm. [SHA]
\r
4247 The 256-bit Secure Hash Algorithm is defined in FIPS PUB 180-2. It
\r
4248 produces a 32-byte output.
\r
4252 Dierks & Rescorla Standards Track [Page 76]
\r
4254 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4258 Netscape's Secure Socket Layer protocol [SSL3]. TLS is based on
\r
4262 An encryption algorithm that converts a key into a
\r
4263 cryptographically strong keystream, which is then exclusive-ORed
\r
4264 with the plaintext.
\r
4269 Transport Layer Security (TLS)
\r
4270 This protocol; also, the Transport Layer Security working group of
\r
4271 the Internet Engineering Task Force (IETF). See "Comments" at the
\r
4272 end of this document.
\r
4308 Dierks & Rescorla Standards Track [Page 77]
\r
4310 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4313 Appendix C. Cipher Suite Definitions
\r
4315 Cipher Suite Key Cipher Mac
\r
4318 TLS_NULL_WITH_NULL_NULL NULL NULL NULL
\r
4319 TLS_RSA_WITH_NULL_MD5 RSA NULL MD5
\r
4320 TLS_RSA_WITH_NULL_SHA RSA NULL SHA
\r
4321 TLS_RSA_WITH_NULL_SHA256 RSA NULL SHA256
\r
4322 TLS_RSA_WITH_RC4_128_MD5 RSA RC4_128 MD5
\r
4323 TLS_RSA_WITH_RC4_128_SHA RSA RC4_128 SHA
\r
4324 TLS_RSA_WITH_3DES_EDE_CBC_SHA RSA 3DES_EDE_CBC SHA
\r
4325 TLS_RSA_WITH_AES_128_CBC_SHA RSA AES_128_CBC SHA
\r
4326 TLS_RSA_WITH_AES_256_CBC_SHA RSA AES_256_CBC SHA
\r
4327 TLS_RSA_WITH_AES_128_CBC_SHA256 RSA AES_128_CBC SHA256
\r
4328 TLS_RSA_WITH_AES_256_CBC_SHA256 RSA AES_256_CBC SHA256
\r
4329 TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA DH_DSS 3DES_EDE_CBC SHA
\r
4330 TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA DH_RSA 3DES_EDE_CBC SHA
\r
4331 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA DHE_DSS 3DES_EDE_CBC SHA
\r
4332 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA DHE_RSA 3DES_EDE_CBC SHA
\r
4333 TLS_DH_anon_WITH_RC4_128_MD5 DH_anon RC4_128 MD5
\r
4334 TLS_DH_anon_WITH_3DES_EDE_CBC_SHA DH_anon 3DES_EDE_CBC SHA
\r
4335 TLS_DH_DSS_WITH_AES_128_CBC_SHA DH_DSS AES_128_CBC SHA
\r
4336 TLS_DH_RSA_WITH_AES_128_CBC_SHA DH_RSA AES_128_CBC SHA
\r
4337 TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE_DSS AES_128_CBC SHA
\r
4338 TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE_RSA AES_128_CBC SHA
\r
4339 TLS_DH_anon_WITH_AES_128_CBC_SHA DH_anon AES_128_CBC SHA
\r
4340 TLS_DH_DSS_WITH_AES_256_CBC_SHA DH_DSS AES_256_CBC SHA
\r
4341 TLS_DH_RSA_WITH_AES_256_CBC_SHA DH_RSA AES_256_CBC SHA
\r
4342 TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE_DSS AES_256_CBC SHA
\r
4343 TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE_RSA AES_256_CBC SHA
\r
4344 TLS_DH_anon_WITH_AES_256_CBC_SHA DH_anon AES_256_CBC SHA
\r
4345 TLS_DH_DSS_WITH_AES_128_CBC_SHA256 DH_DSS AES_128_CBC SHA256
\r
4346 TLS_DH_RSA_WITH_AES_128_CBC_SHA256 DH_RSA AES_128_CBC SHA256
\r
4347 TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 DHE_DSS AES_128_CBC SHA256
\r
4348 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 DHE_RSA AES_128_CBC SHA256
\r
4349 TLS_DH_anon_WITH_AES_128_CBC_SHA256 DH_anon AES_128_CBC SHA256
\r
4350 TLS_DH_DSS_WITH_AES_256_CBC_SHA256 DH_DSS AES_256_CBC SHA256
\r
4351 TLS_DH_RSA_WITH_AES_256_CBC_SHA256 DH_RSA AES_256_CBC SHA256
\r
4352 TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 DHE_DSS AES_256_CBC SHA256
\r
4353 TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 DHE_RSA AES_256_CBC SHA256
\r
4354 TLS_DH_anon_WITH_AES_256_CBC_SHA256 DH_anon AES_256_CBC SHA256
\r
4357 Key Expanded IV Block
\r
4358 Cipher Type Material Key Material Size Size
\r
4360 NULL Stream 0 0 0 N/A
\r
4364 Dierks & Rescorla Standards Track [Page 78]
\r
4366 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4369 RC4_128 Stream 16 16 0 N/A
\r
4370 3DES_EDE_CBC Block 24 24 8 8
\r
4371 AES_128_CBC Block 16 16 16 16
\r
4372 AES_256_CBC Block 32 32 16 16
\r
4375 MAC Algorithm mac_length mac_key_length
\r
4378 MD5 HMAC-MD5 16 16
\r
4379 SHA HMAC-SHA1 20 20
\r
4380 SHA256 HMAC-SHA256 32 32
\r
4383 Indicates whether this is a stream cipher or a block cipher
\r
4384 running in CBC mode.
\r
4387 The number of bytes from the key_block that are used for
\r
4388 generating the write keys.
\r
4390 Expanded Key Material
\r
4391 The number of bytes actually fed into the encryption algorithm.
\r
4394 The amount of data needed to be generated for the initialization
\r
4395 vector. Zero for stream ciphers; equal to the block size for block
\r
4396 ciphers (this is equal to SecurityParameters.record_iv_length).
\r
4399 The amount of data a block cipher enciphers in one chunk; a block
\r
4400 cipher running in CBC mode can only encrypt an even multiple of
\r
4420 Dierks & Rescorla Standards Track [Page 79]
\r
4422 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4425 Appendix D. Implementation Notes
\r
4427 The TLS protocol cannot prevent many common security mistakes. This
\r
4428 section provides several recommendations to assist implementors.
\r
4430 D.1 Random Number Generation and Seeding
\r
4432 TLS requires a cryptographically secure pseudorandom number generator
\r
4433 (PRNG). Care must be taken in designing and seeding PRNGs. PRNGs
\r
4434 based on secure hash operations, most notably SHA-1, are acceptable,
\r
4435 but cannot provide more security than the size of the random number
\r
4438 To estimate the amount of seed material being produced, add the
\r
4439 number of bits of unpredictable information in each seed byte. For
\r
4440 example, keystroke timing values taken from a PC compatible's 18.2 Hz
\r
4441 timer provide 1 or 2 secure bits each, even though the total size of
\r
4442 the counter value is 16 bits or more. Seeding a 128-bit PRNG would
\r
4443 thus require approximately 100 such timer values.
\r
4445 [RANDOM] provides guidance on the generation of random values.
\r
4447 D.2 Certificates and Authentication
\r
4449 Implementations are responsible for verifying the integrity of
\r
4450 certificates and should generally support certificate revocation
\r
4451 messages. Certificates should always be verified to ensure proper
\r
4452 signing by a trusted Certificate Authority (CA). The selection and
\r
4453 addition of trusted CAs should be done very carefully. Users should
\r
4454 be able to view information about the certificate and root CA.
\r
4458 TLS supports a range of key sizes and security levels, including some
\r
4459 that provide no or minimal security. A proper implementation will
\r
4460 probably not support many cipher suites. For instance, anonymous
\r
4461 Diffie-Hellman is strongly discouraged because it cannot prevent man-
\r
4462 in-the-middle attacks. Applications should also enforce minimum and
\r
4463 maximum key sizes. For example, certificate chains containing 512-bit
\r
4464 RSA keys or signatures are not appropriate for high-security
\r
4467 D.4 Implementation Pitfalls
\r
4469 Implementation experience has shown that certain parts of earlier TLS
\r
4470 specifications are not easy to understand, and have been a source of
\r
4471 interoperability and security problems. Many of these areas have been
\r
4472 clarified in this document, but this appendix contains a short list
\r
4476 Dierks & Rescorla Standards Track [Page 80]
\r
4478 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4481 of the most important things that require special attention from
\r
4484 TLS protocol issues:
\r
4486 - Do you correctly handle handshake messages that are fragmented
\r
4487 to multiple TLS records (see Section 6.2.1)? Including corner
\r
4488 cases like a ClientHello that is split to several small
\r
4489 fragments? Do you fragment handshake messages that exceed the
\r
4490 maximum fragment size? In particular, the certificate and
\r
4491 certificate request handshake messages can be large enough to
\r
4492 require fragmentation.
\r
4494 - Do you ignore the TLS record layer version number in all TLS
\r
4495 records before ServerHello (see Appendix E.1)?
\r
4497 - Do you handle TLS extensions in ClientHello correctly,
\r
4498 including omitting the extensions field completely?
\r
4500 - Do you support renegotiation, both client and server initiated?
\r
4501 While renegotiation is an optional feature, supporting
\r
4502 it is highly recommended.
\r
4504 - When the server has requested a client certificate, but no
\r
4505 suitable certificate is available, do you correctly send
\r
4506 an empty Certificate message, instead of omitting the whole
\r
4507 message (see Section 7.4.6)?
\r
4509 Cryptographic details:
\r
4511 - In RSA-encrypted Premaster Secret, do you correctly send and
\r
4512 verify the version number? When an error is encountered, do
\r
4513 you continue the handshake to avoid the Bleichenbacher
\r
4514 attack (see Section 7.4.7.1)?
\r
4516 - What countermeasures do you use to prevent timing attacks against
\r
4517 RSA decryption and signing operations (see Section 7.4.7.1)?
\r
4519 - When verifying RSA signatures, do you accept both NULL and
\r
4520 missing parameters (see Section 4.7)? Do you verify that the
\r
4521 RSA padding doesn't have additional data after the hash value?
\r
4524 - When using Diffie-Hellman key exchange, do you correctly strip
\r
4525 leading zero bytes from the negotiated key (see Section 8.1.2)?
\r
4527 - Does your TLS client check that the Diffie-Hellman parameters
\r
4528 sent by the server are acceptable (see Section F.1.1.3)?
\r
4532 Dierks & Rescorla Standards Track [Page 81]
\r
4534 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4537 - How do you generate unpredictable IVs for CBC mode ciphers
\r
4538 (see Section 6.2.3.2)?
\r
4540 - Do you accept long CBC mode padding (up to 255 bytes; see
\r
4543 - How do you address CBC mode timing attacks (Section 6.2.3.2)?
\r
4545 - Do you use a strong and, most importantly, properly seeded
\r
4546 random number generator (see Appendix D.1) for generating the
\r
4547 premaster secret (for RSA key exchange), Diffie-Hellman private
\r
4548 values, the DSA "k" parameter, and other security-critical
\r
4588 Dierks & Rescorla Standards Track [Page 82]
\r
4590 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4593 Appendix E. Backward Compatibility
\r
4595 E.1 Compatibility with TLS 1.0/1.1 and SSL 3.0
\r
4597 Since there are various versions of TLS (1.0, 1.1, 1.2, and any
\r
4598 future versions) and SSL (2.0 and 3.0), means are needed to negotiate
\r
4599 the specific protocol version to use. The TLS protocol provides a
\r
4600 built-in mechanism for version negotiation so as not to bother other
\r
4601 protocol components with the complexities of version selection.
\r
4603 TLS versions 1.0, 1.1, and 1.2, and SSL 3.0 are very similar, and use
\r
4604 compatible ClientHello messages; thus, supporting all of them is
\r
4605 relatively easy. Similarly, servers can easily handle clients trying
\r
4606 to use future versions of TLS as long as the ClientHello format
\r
4607 remains compatible, and the client support the highest protocol
\r
4608 version available in the server.
\r
4610 A TLS 1.2 client who wishes to negotiate with such older servers will
\r
4611 send a normal TLS 1.2 ClientHello, containing { 3, 3 } (TLS 1.2) in
\r
4612 ClientHello.client_version. If the server does not support this
\r
4613 version, it will respond with ServerHello containing an older version
\r
4614 number. If the client agrees to use this version, the negotiation
\r
4615 will proceed as appropriate for the negotiated protocol.
\r
4617 If the version chosen by the server is not supported by the client
\r
4618 (or not acceptable), the client MUST send a "protocol_version" alert
\r
4619 message and close the connection.
\r
4621 If a TLS server receives a ClientHello containing a version number
\r
4622 greater than the highest version supported by the server, it MUST
\r
4623 reply according to the highest version supported by the server.
\r
4625 A TLS server can also receive a ClientHello containing version number
\r
4626 smaller than the highest supported version. If the server wishes to
\r
4627 negotiate with old clients, it will proceed as appropriate for the
\r
4628 highest version supported by the server that is not greater than
\r
4629 ClientHello.client_version. For example, if the server supports TLS
\r
4630 1.0, 1.1, and 1.2, and client_version is TLS 1.0, the server will
\r
4631 proceed with a TLS 1.0 ServerHello. If server supports (or is willing
\r
4632 to use) only versions greater than client_version, it MUST send a
\r
4633 "protocol_version" alert message and close the connection.
\r
4635 Whenever a client already knows the highest protocol known to a
\r
4636 server (for example, when resuming a session), it SHOULD initiate the
\r
4637 connection in that native protocol.
\r
4639 Note: some server implementations are known to implement version
\r
4640 negotiation incorrectly. For example, there are buggy TLS 1.0 servers
\r
4644 Dierks & Rescorla Standards Track [Page 83]
\r
4646 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4649 that simply close the connection when the client offers a version
\r
4650 newer than TLS 1.0. Also, it is known that some servers will refuse
\r
4651 connection if any TLS extensions are included in ClientHello.
\r
4652 Interoperability with such buggy servers is a complex topic beyond
\r
4653 the scope of this document, and may require multiple connection
\r
4654 attempts by the client.
\r
4656 Earlier versions of the TLS specification were not fully clear on
\r
4657 what the record layer version number (TLSPlaintext.version) should
\r
4658 contain when sending ClientHello (i.e., before it is known which
\r
4659 version of the protocol will be employed). Thus, TLS servers
\r
4660 compliant with this specification MUST accept any value {03,XX} as
\r
4661 the record layer version number for ClientHello.
\r
4663 TLS clients that wish to negotiate with older servers MAY send any
\r
4664 value {03,XX} as the record layer version number. Typical values
\r
4665 would be {03,00}, the lowest version number supported by the client,
\r
4666 and the value of ClientHello.client_version. No single value will
\r
4667 guarantee interoperability with all old servers, but this is a
\r
4668 complex topic beyond the scope of this document.
\r
4670 E.2 Compatibility with SSL 2.0
\r
4672 TLS 1.2 clients that wish to support SSL 2.0 servers MUST send
\r
4673 version 2.0 CLIENT-HELLO messages defined in [SSL2]. The message MUST
\r
4674 contain the same version number as would be used for ordinary
\r
4675 ClientHello, and MUST encode the supported TLS cipher suites in the
\r
4676 CIPHER-SPECS-DATA field as described below.
\r
4678 Warning: The ability to send version 2.0 CLIENT-HELLO messages will
\r
4679 be phased out with all due haste, since the newer ClientHello format
\r
4680 provides better mechanisms for moving to newer versions and
\r
4681 negotiating extensions. TLS 1.2 clients SHOULD NOT support SSL 2.0.
\r
4683 However, even TLS servers that do not support SSL 2.0 MAY accept
\r
4684 version 2.0 CLIENT-HELLO messages. The message is presented below in
\r
4685 sufficient detail for TLS server implementors; the true definition is
\r
4686 still assumed to be [SSL2].
\r
4688 For negotiation purposes, 2.0 CLIENT-HELLO is interpreted the same
\r
4689 way as a ClientHello with a "null" compression method and no
\r
4690 extensions. Note that this message MUST be sent directly on the wire,
\r
4691 not wrapped as a TLS record. For the purposes of calculating Finished
\r
4692 and CertificateVerify, the msg_length field is not considered to be a
\r
4693 part of the handshake message.
\r
4695 uint8 V2CipherSpec[3];
\r
4700 Dierks & Rescorla Standards Track [Page 84]
\r
4702 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4706 uint16 msg_length;
\r
4709 uint16 cipher_spec_length;
\r
4710 uint16 session_id_length;
\r
4711 uint16 challenge_length;
\r
4712 V2CipherSpec cipher_specs[V2ClientHello.cipher_spec_length];
\r
4713 opaque session_id[V2ClientHello.session_id_length];
\r
4714 opaque challenge[V2ClientHello.challenge_length;
\r
4718 The highest bit MUST be 1; the remaining bits contain the length
\r
4719 of the following data in bytes.
\r
4722 This field, in conjunction with the version field, identifies a
\r
4723 version 2 client hello message. The value MUST be one (1).
\r
4726 Equal to ClientHello.client_version.
\r
4728 cipher_spec_length
\r
4729 This field is the total length of the field cipher_specs. It
\r
4730 cannot be zero and MUST be a multiple of the V2CipherSpec length
\r
4734 This field MUST have a value of zero for a client that claims to
\r
4738 The length in bytes of the client's challenge to the server to
\r
4739 authenticate itself. Historically, permissible values are between
\r
4740 16 and 32 bytes inclusive. When using the SSLv2 backward
\r
4741 compatible handshake the client SHOULD use a 32 byte challenge.
\r
4744 This is a list of all CipherSpecs the client is willing and able
\r
4745 to use. In addition to the 2.0 cipher specs defined in [SSL2],
\r
4746 this includes the TLS cipher suites normally sent in
\r
4747 ClientHello.cipher_suites, each cipher suite prefixed by a zero
\r
4748 byte. For example, TLS cipher suite {0x00,0x0A} would be sent as
\r
4752 This field MUST be empty.
\r
4756 Dierks & Rescorla Standards Track [Page 85]
\r
4758 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4762 Corresponds to ClientHello.random. If the challenge length is less
\r
4763 than 32, the TLS server will pad the data with leading (note: not
\r
4764 trailing) zero bytes to make it 32 bytes long.
\r
4766 Note: Requests to resume a TLS session MUST use a TLS client hello.
\r
4768 E.3. Avoiding Man-in-the-Middle Version Rollback
\r
4770 When TLS clients fall back to Version 2.0 compatibility mode, they
\r
4771 MUST use special PKCS#1 block formatting. This is done so that TLS
\r
4772 servers will reject Version 2.0 sessions with TLS-capable clients.
\r
4774 When a client negotiates SSL 2.0 but also supports TLS, it MUST set
\r
4775 the right-hand (least-significant) 8 random bytes of the PKCS padding
\r
4776 (not including the terminal null of the padding) for the RSA
\r
4777 encryption of the ENCRYPTED-KEY-DATA field of the CLIENT-MASTER-KEY
\r
4778 to 0x03 (the other padding bytes are random).
\r
4780 When a TLS-capable server negotiates SSL 2.0 it SHOULD, after
\r
4781 decrypting the ENCRYPTED-KEY-DATA field, check that these eight
\r
4782 padding bytes are 0x03. If they are not, the server SHOULD generate a
\r
4783 random value for SECRET-KEY-DATA, and continue the handshake (which
\r
4784 will eventually fail since the keys will not match). Note that
\r
4785 reporting the error situation to the client could make the server
\r
4786 vulnerable to attacks described in [BLEI].
\r
4812 Dierks & Rescorla Standards Track [Page 86]
\r
4814 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4817 Appendix F. Security Analysis
\r
4819 The TLS protocol is designed to establish a secure connection between
\r
4820 a client and a server communicating over an insecure channel. This
\r
4821 document makes several traditional assumptions, including that
\r
4822 attackers have substantial computational resources and cannot obtain
\r
4823 secret information from sources outside the protocol. Attackers are
\r
4824 assumed to have the ability to capture, modify, delete, replay, and
\r
4825 otherwise tamper with messages sent over the communication channel.
\r
4826 This appendix outlines how TLS has been designed to resist a variety
\r
4829 F.1. Handshake Protocol
\r
4831 The handshake protocol is responsible for selecting a CipherSpec and
\r
4832 generating a Master Secret, which together comprise the primary
\r
4833 cryptographic parameters associated with a secure session. The
\r
4834 handshake protocol can also optionally authenticate parties who have
\r
4835 certificates signed by a trusted certificate authority.
\r
4837 F.1.1. Authentication and Key Exchange
\r
4839 TLS supports three authentication modes: authentication of both
\r
4840 parties, server authentication with an unauthenticated client, and
\r
4841 total anonymity. Whenever the server is authenticated, the channel is
\r
4842 secure against man-in-the-middle attacks, but completely anonymous
\r
4843 sessions are inherently vulnerable to such attacks. Anonymous
\r
4844 servers cannot authenticate clients. If the server is authenticated,
\r
4845 its certificate message must provide a valid certificate chain
\r
4846 leading to an acceptable certificate authority. Similarly,
\r
4847 authenticated clients must supply an acceptable certificate to the
\r
4848 server. Each party is responsible for verifying that the other's
\r
4849 certificate is valid and has not expired or been revoked.
\r
4851 The general goal of the key exchange process is to create a
\r
4852 pre_master_secret known to the communicating parties and not to
\r
4853 attackers. The pre_master_secret will be used to generate the
\r
4854 master_secret (see Section 8.1). The master_secret is required to
\r
4855 generate the finished messages, encryption keys, and MAC keys (see
\r
4856 Sections 7.4.9 and 6.3). By sending a correct finished message,
\r
4857 parties thus prove that they know the correct pre_master_secret.
\r
4859 F.1.1.1. Anonymous Key Exchange
\r
4861 Completely anonymous sessions can be established using Diffie-Hellman
\r
4862 for key exchange. The server's public parameters are contained in the
\r
4863 server key exchange message and the client's are sent in the client
\r
4864 key exchange message. Eavesdroppers who do not know the private
\r
4868 Dierks & Rescorla Standards Track [Page 87]
\r
4870 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4873 values should not be able to find the Diffie-Hellman result (i.e. the
\r
4874 pre_master_secret).
\r
4876 Warning: Completely anonymous connections only provide protection
\r
4877 against passive eavesdropping. Unless an independent tamper-proof
\r
4878 channel is used to verify that the finished messages were not
\r
4879 replaced by an attacker, server authentication is required in
\r
4880 environments where active man-in-the-middle attacks are a concern.
\r
4882 F.1.1.2. RSA Key Exchange and Authentication
\r
4884 With RSA, key exchange and server authentication are combined. The
\r
4885 public key is contained in the server's certificate. Note that
\r
4886 compromise of the server's static RSA key results in a loss of
\r
4887 confidentiality for all sessions protected under that static key. TLS
\r
4888 users desiring Perfect Forward Secrecy should use DHE cipher suites.
\r
4889 The damage done by exposure of a private key can be limited by
\r
4890 changing one's private key (and certificate) frequently.
\r
4892 After verifying the server's certificate, the client encrypts a
\r
4893 pre_master_secret with the server's public key. By successfully
\r
4894 decoding the pre_master_secret and producing a correct finished
\r
4895 message, the server demonstrates that it knows the private key
\r
4896 corresponding to the server certificate.
\r
4898 When RSA is used for key exchange, clients are authenticated using
\r
4899 the certificate verify message (see Section 7.4.8). The client signs
\r
4900 a value derived from all preceding handshake messages. These
\r
4901 handshake messages include the server certificate, which binds the
\r
4902 signature to the server, and ServerHello.random, which binds the
\r
4903 signature to the current handshake process.
\r
4905 F.1.1.3. Diffie-Hellman Key Exchange with Authentication
\r
4907 When Diffie-Hellman key exchange is used, the server can either
\r
4908 supply a certificate containing fixed Diffie-Hellman parameters or
\r
4909 use the server key exchange message to send a set of temporary
\r
4910 Diffie-Hellman parameters signed with a DSS or RSA certificate.
\r
4911 Temporary parameters are hashed with the hello.random values before
\r
4912 signing to ensure that attackers do not replay old parameters. In
\r
4913 either case, the client can verify the certificate or signature to
\r
4914 ensure that the parameters belong to the server.
\r
4916 If the client has a certificate containing fixed Diffie-Hellman
\r
4917 parameters, its certificate contains the information required to
\r
4918 complete the key exchange. Note that in this case the client and
\r
4919 server will generate the same Diffie-Hellman result (i.e.,
\r
4920 pre_master_secret) every time they communicate. To prevent the
\r
4924 Dierks & Rescorla Standards Track [Page 88]
\r
4926 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4929 pre_master_secret from staying in memory any longer than necessary,
\r
4930 it should be converted into the master_secret as soon as possible.
\r
4931 Client Diffie-Hellman parameters must be compatible with those
\r
4932 supplied by the server for the key exchange to work.
\r
4934 If the client has a standard DSS or RSA certificate or is
\r
4935 unauthenticated, it sends a set of temporary parameters to the server
\r
4936 in the client key exchange message, then optionally uses a
\r
4937 certificate verify message to authenticate itself.
\r
4939 If the same DH keypair is to be used for multiple handshakes, either
\r
4940 because the client or server has a certificate containing a fixed DH
\r
4941 keypair or because the server is reusing DH keys, care must be taken
\r
4942 to prevent small subgroup attacks. Implementations SHOULD follow the
\r
4943 guidelines found in [SUBGROUP].
\r
4945 Small subgroup attacks are most easily avoided by using one of the
\r
4946 DHE cipher suites and generating a fresh DH private key (X) for each
\r
4947 handshake. If a suitable base (such as 2) is chosen, g^X mod p can be
\r
4948 computed very quickly, therefore the performance cost is minimized.
\r
4949 Additionally, using a fresh key for each handshake provides Perfect
\r
4950 Forward Secrecy. Implementations SHOULD generate a new X for each
\r
4951 handshake when using DHE cipher suites.
\r
4953 Because TLS allows the server to provide arbitrary DH groups, the
\r
4954 client should verify that the DH group is of suitable size as defined
\r
4955 by local policy. The client SHOULD also verify that the DH public
\r
4956 exponent appears to be of adequate size. [KEYSIZ] provides a useful
\r
4957 guide to the strength of various group sizes. The server MAY choose
\r
4958 to assist the client by providing a known group, such as those
\r
4959 defined in [IKEALG] or [MODP]. These can be verified by simple
\r
4962 F.1.2. Version Rollback Attacks
\r
4964 Because TLS includes substantial improvements over SSL Version 2.0,
\r
4965 attackers may try to make TLS-capable clients and servers fall back
\r
4966 to Version 2.0. This attack can occur if (and only if) two TLS-
\r
4967 capable parties use an SSL 2.0 handshake.
\r
4969 Although the solution using non-random PKCS #1 block type 2 message
\r
4970 padding is inelegant, it provides a reasonably secure way for Version
\r
4971 3.0 servers to detect the attack. This solution is not secure against
\r
4972 attackers who can brute force the key and substitute a new ENCRYPTED-
\r
4973 KEY-DATA message containing the same key (but with normal padding)
\r
4974 before the application specified wait threshold has expired. Altering
\r
4975 the padding of the least significant 8 bytes of the PKCS padding does
\r
4976 not impact security for the size of the signed hashes and RSA key
\r
4980 Dierks & Rescorla Standards Track [Page 89]
\r
4982 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
4985 lengths used in the protocol, since this is essentially equivalent to
\r
4986 increasing the input block size by 8 bytes.
\r
4988 F.1.3. Detecting Attacks Against the Handshake Protocol
\r
4990 An attacker might try to influence the handshake exchange to make the
\r
4991 parties select different encryption algorithms than they would
\r
4994 For this attack, an attacker must actively change one or more
\r
4995 handshake messages. If this occurs, the client and server will
\r
4996 compute different values for the handshake message hashes. As a
\r
4997 result, the parties will not accept each others' finished messages.
\r
4998 Without the master_secret, the attacker cannot repair the finished
\r
4999 messages, so the attack will be discovered.
\r
5001 F.1.4. Resuming Sessions
\r
5003 When a connection is established by resuming a session, new
\r
5004 ClientHello.random and ServerHello.random values are hashed with the
\r
5005 session's master_secret. Provided that the master_secret has not been
\r
5006 compromised and that the secure hash operations used to produce the
\r
5007 encryption keys and MAC keys are secure, the connection should be
\r
5008 secure and effectively independent from previous connections.
\r
5009 Attackers cannot use known encryption keys or MAC secrets to
\r
5010 compromise the master_secret without breaking the secure hash
\r
5013 Sessions cannot be resumed unless both the client and server agree.
\r
5014 If either party suspects that the session may have been compromised,
\r
5015 or that certificates may have expired or been revoked, it should
\r
5016 force a full handshake. An upper limit of 24 hours is suggested for
\r
5017 session ID lifetimes, since an attacker who obtains a master_secret
\r
5018 may be able to impersonate the compromised party until the
\r
5019 corresponding session ID is retired. Applications that may be run in
\r
5020 relatively insecure environments should not write session IDs to
\r
5023 F.2. Protecting Application Data
\r
5025 The master_secret is hashed with the ClientHello.random and
\r
5026 ServerHello.random to produce unique data encryption keys and MAC
\r
5027 secrets for each connection.
\r
5029 Outgoing data is protected with a MAC before transmission. To prevent
\r
5030 message replay or modification attacks, the MAC is computed from the
\r
5031 MAC key, the sequence number, the message length, the message
\r
5032 contents, and two fixed character strings. The message type field is
\r
5036 Dierks & Rescorla Standards Track [Page 90]
\r
5038 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5041 necessary to ensure that messages intended for one TLS Record Layer
\r
5042 client are not redirected to another. The sequence number ensures
\r
5043 that attempts to delete or reorder messages will be detected. Since
\r
5044 sequence numbers are 64 bits long, they should never overflow.
\r
5045 Messages from one party cannot be inserted into the other's output,
\r
5046 since they use independent MAC keys. Similarly, the server-write and
\r
5047 client-write keys are independent, so stream cipher keys are used
\r
5050 If an attacker does break an encryption key, all messages encrypted
\r
5051 with it can be read. Similarly, compromise of a MAC key can make
\r
5052 message modification attacks possible. Because MACs are also
\r
5053 encrypted, message-alteration attacks generally require breaking the
\r
5054 encryption algorithm as well as the MAC.
\r
5056 Note: MAC keys may be larger than encryption keys, so messages can
\r
5057 remain tamper resistant even if encryption keys are broken.
\r
5061 [CBCATT] describes a chosen plaintext attack on TLS that depends on
\r
5062 knowing the IV for a record. Previous versions of TLS [TLS1.0] used
\r
5063 the CBC residue of the previous record as the IV and therefore
\r
5064 enabled this attack. This version uses an explicit IV in order to
\r
5065 protect against this attack.
\r
5067 F.4. Security of Composite Cipher Modes
\r
5069 TLS secures transmitted application data via the use of symmetric
\r
5070 encryption and authentication functions defined in the negotiated
\r
5071 cipher suite. The objective is to protect both the integrity and
\r
5072 confidentiality of the transmitted data from malicious actions by
\r
5073 active attackers in the network. It turns out that the order in
\r
5074 which encryption and authentication functions are applied to the data
\r
5075 plays an important role for achieving this goal [ENCAUTH].
\r
5077 The most robust method, called encrypt-then-authenticate, first
\r
5078 applies encryption to the data and then applies a MAC to the
\r
5079 ciphertext. This method ensures that the integrity and
\r
5080 confidentiality goals are obtained with ANY pair of encryption and
\r
5081 MAC functions, provided that the former is secure against chosen
\r
5082 plaintext attacks and that the MAC is secure against chosen-message
\r
5083 attacks. TLS uses another method, called authenticate-then-encrypt,
\r
5084 in which first a MAC is computed on the plaintext and then the
\r
5085 concatenation of plaintext and MAC is encrypted. This method has
\r
5086 been proven secure for CERTAIN combinations of encryption functions
\r
5087 and MAC functions, but it is not guaranteed to be secure in general.
\r
5088 In particular, it has been shown that there exist perfectly secure
\r
5092 Dierks & Rescorla Standards Track [Page 91]
\r
5094 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5097 encryption functions (secure even in the information-theoretic sense)
\r
5098 that combined with any secure MAC function, fail to provide the
\r
5099 confidentiality goal against an active attack. Therefore, new cipher
\r
5100 suites and operation modes adopted into TLS need to be analyzed under
\r
5101 the authenticate-then-encrypt method to verify that they achieve the
\r
5102 stated integrity and confidentiality goals.
\r
5104 Currently, the security of the authenticate-then-encrypt method has
\r
5105 been proven for some important cases. One is the case of stream
\r
5106 ciphers in which a computationally unpredictable pad of the length of
\r
5107 the message, plus the length of the MAC tag, is produced using a
\r
5108 pseudo-random generator and this pad is xor-ed with the concatenation
\r
5109 of plaintext and MAC tag. The other is the case of CBC mode using a
\r
5110 secure block cipher. In this case, security can be shown if one
\r
5111 applies one CBC encryption pass to the concatenation of plaintext and
\r
5112 MAC and uses a new, independent, and unpredictable IV for each new
\r
5113 pair of plaintext and MAC. In versions of TLS prior to 1.1, CBC mode
\r
5114 was used properly EXCEPT that it used a predictable IV in the form of
\r
5115 the last block of the previous ciphertext. This made TLS open to
\r
5116 chosen plaintext attacks. This version of the protocol is immune to
\r
5117 those attacks. For exact details in the encryption modes proven
\r
5118 secure, see [ENCAUTH].
\r
5120 F.5 Denial of Service
\r
5122 TLS is susceptible to a number of denial of service (DoS) attacks.
\r
5123 In particular, an attacker who initiates a large number of TCP
\r
5124 connections can cause a server to consume large amounts of CPU doing
\r
5125 RSA decryption. However, because TLS is generally used over TCP, it
\r
5126 is difficult for the attacker to hide his point of origin if proper
\r
5127 TCP SYN randomization is used [SEQNUM] by the TCP stack.
\r
5129 Because TLS runs over TCP, it is also susceptible to a number of
\r
5130 denial of service attacks on individual connections. In particular,
\r
5131 attackers can forge RSTs, thereby terminating connections, or forge
\r
5132 partial TLS records, thereby causing the connection to stall. These
\r
5133 attacks cannot in general be defended against by a TCP-using
\r
5134 protocol. Implementors or users who are concerned with this class of
\r
5135 attack should use IPsec AH [AH] or ESP [ESP].
\r
5139 For TLS to be able to provide a secure connection, both the client
\r
5140 and server systems, keys, and applications must be secure. In
\r
5141 addition, the implementation must be free of security errors.
\r
5143 The system is only as strong as the weakest key exchange and
\r
5144 authentication algorithm supported, and only trustworthy
\r
5148 Dierks & Rescorla Standards Track [Page 92]
\r
5150 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5153 cryptographic functions should be used. Short public keys and
\r
5154 anonymous servers should be used with great caution. Implementations
\r
5155 and users must be careful when deciding which certificates and
\r
5156 certificate authorities are acceptable; a dishonest certificate
\r
5157 authority can do tremendous damage.
\r
5159 Changes in This Version
\r
5160 [RFC Editor: Please delete this]
\r
5162 - Added a new pitfall about fragmenting messages when necessary
\r
5165 - Added Updates: RFC 4492 [Issue #83]
\r
5167 - Long CBC padding pitfall [Issue #73]
\r
5169 - Fixed ProtocolVersion structure [Issue #79]
\r
5171 - Cleaned up extensions text [Issue #78]
\r
5173 - Clarified alerts some [Issue #85]
\r
5175 - Added AES to the table in Appendix C [Issue #72]
\r
5177 - Tightened up when signature_algorithms is used
\r
5178 (it is now a MUST if you support other than SHA-1)
\r
5179 and the interpretation when it is absent is also a MUST
\r
5182 - Cleaned up "cipher suite" so it's always two words outside
\r
5183 of when it refers to the syntactic type [Issue #68]
\r
5187 - Added support for SHA256 cipher suites
\r
5189 - Clarified warning alert behavior and client certificate omission
\r
5190 behavior [Issue #84]
\r
5192 - Removed IDEA and DES entirely for documentation in a separate doc
\r
5195 - Changed the presentation language to allow fall-through to simplify
\r
5198 - Cleaned up KeyExchangeAlgorithm ClientKeyExchange to use values
\r
5199 that match Appendix C.
\r
5204 Dierks & Rescorla Standards Track [Page 93]
\r
5206 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5209 - Changed digitally-signed to include SignatureAndHashAlgorithm
\r
5210 (another simplification)
\r
5212 - Considerations for RFC 4492
\r
5214 Normative References
\r
5216 [AES] National Institute of Standards and Technology,
\r
5217 "Specification for the Advanced Encryption Standard (AES)"
\r
5218 FIPS 197. November 26, 2001.
\r
5220 [3DES] National Institute of Standards and Technology,
\r
5221 "Recommendation for the Triple Data Encryption Algorithm
\r
5222 (TDEA) Block Cipher", NIST Special Publication 800-67, May
\r
5225 [DES] National Institute of Standards and Technology, "Data
\r
5226 Encryption Standard (DES)", FIPS PUB 46-3, October 1999.
\r
5228 [DSS] NIST FIPS PUB 186-2, "Digital Signature Standard," National
\r
5229 Institute of Standards and Technology, U.S. Department of
\r
5232 [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
\r
5233 Hashing for Message Authentication", RFC 2104, February
\r
5236 [MD5] Rivest, R., "The MD5 Message Digest Algorithm", RFC 1321,
\r
5239 [PKCS1] J. Jonsson, B. Kaliski, "Public-Key Cryptography Standards
\r
5240 (PKCS) #1: RSA Cryptography Specifications Version 2.1", RFC
\r
5241 3447, February 2003.
\r
5243 [PKIX] Housley, R., Ford, W., Polk, W. and D. Solo, "Internet X.509
\r
5244 Public Key Infrastructure Certificate and Certificate
\r
5245 Revocation List (CRL) Profile", RFC 3280, April 2002.
\r
5248 [SCH] B. Schneier. "Applied Cryptography: Protocols, Algorithms,
\r
5249 and Source Code in C, 2nd ed.", Published by John Wiley &
\r
5252 [SHA] NIST FIPS PUB 180-2, "Secure Hash Standard," National
\r
5253 Institute of Standards and Technology, U.S. Department of
\r
5254 Commerce., August 2001.
\r
5256 [REQ] Bradner, S., "Key words for use in RFCs to Indicate
\r
5260 Dierks & Rescorla Standards Track [Page 94]
\r
5262 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5265 Requirement Levels", BCP 14, RFC 2119, March 1997.
\r
5267 [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an
\r
5268 IANA Considerations Section in RFCs", BCP 25, RFC 2434,
\r
5271 Informative References
\r
5273 [AEAD] Mcgrew, D., "Authenticated Encryption", July 2007, draft-
\r
5274 mcgrew-auth-enc-05.txt.
\r
5276 [AH] Kent, S., and Atkinson, R., "IP Authentication Header", RFC
\r
5277 4302, December 2005.
\r
5279 [BLEI] Bleichenbacher D., "Chosen Ciphertext Attacks against
\r
5280 Protocols Based on RSA Encryption Standard PKCS #1" in
\r
5281 Advances in Cryptology -- CRYPTO'98, LNCS vol. 1462, pages:
\r
5284 [CBCATT] Moeller, B., "Security of CBC Ciphersuites in SSL/TLS:
\r
5285 Problems and Countermeasures",
\r
5286 http://www.openssl.org/~bodo/tls-cbc.txt.
\r
5288 [CBCTIME] Canvel, B., Hiltgen, A., Vaudenay, S., and M. Vuagnoux,
\r
5289 "Password Interception in a SSL/TLS Channel", Advances in
\r
5290 Cryptology -- CRYPTO 2003, LNCS vol. 2729, 2003.
\r
5292 [CCM] "NIST Special Publication 800-38C: The CCM Mode for
\r
5293 Authentication and Confidentiality",
\r
5294 http://csrc.nist.gov/publications/nistpubs/800-38C/
\r
5297 [DSS-3] NIST FIPS PUB 186-3 Draft, "Digital Signature Standard,"
\r
5298 National Institute of Standards and Technology, U.S.
\r
5299 Department of Commerce, 2006.
\r
5301 [ENCAUTH] Krawczyk, H., "The Order of Encryption and Authentication
\r
5302 for Protecting Communications (Or: How Secure is SSL?)",
\r
5305 [ESP] Kent, S., and Atkinson, R., "IP Encapsulating Security
\r
5306 Payload (ESP)", RFC 4303, December 2005.
\r
5308 [FI06] Hal Finney, "Bleichenbacher's RSA signature forgery based on
\r
5309 implementation error", ietf-openpgp@imc.org mailing list, 27
\r
5310 August 2006, http://www.imc.org/ietf-openpgp/mail-
\r
5311 archive/msg14307.html.
\r
5316 Dierks & Rescorla Standards Track [Page 95]
\r
5318 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5321 [GCM] "NIST Special Publication 800-38D DRAFT (June, 2007):
\r
5322 Recommendation for Block Cipher Modes of Operation:
\r
5323 Galois/Counter Mode (GCM) and GMAC"
\r
5325 [IKEALG] Schiller, J., "Cryptographic Algorithms for Use in the
\r
5326 Internet Key Exchange Version 2 (IKEv2)", RFC 4307, December
\r
5329 [KEYSIZ] Orman, H., and Hoffman, P., "Determining Strengths For
\r
5330 Public Keys Used For Exchanging Symmetric Keys" RFC 3766,
\r
5333 [KPR03] Klima, V., Pokorny, O., Rosa, T., "Attacking RSA-based
\r
5334 Sessions in SSL/TLS", http://eprint.iacr.org/2003/052/,
\r
5337 [MODP] Kivinen, T. and M. Kojo, "More Modular Exponential (MODP)
\r
5338 Diffie-Hellman groups for Internet Key Exchange (IKE)", RFC
\r
5341 [PKCS6] RSA Laboratories, "PKCS #6: RSA Extended Certificate Syntax
\r
5342 Standard," version 1.5, November 1993.
\r
5344 [PKCS7] RSA Laboratories, "PKCS #7: RSA Cryptographic Message Syntax
\r
5345 Standard," version 1.5, November 1993.
\r
5347 [RANDOM] Eastlake, D., 3rd, Schiller, J., and S. Crocker, "Randomness
\r
5348 Requirements for Security", BCP 106, RFC 4086, June 2005.
\r
5350 [RFC3749] Hollenbeck, S., "Transport Layer Security Protocol
\r
5351 Compression Methods", RFC 3749, May 2004.
\r
5353 [RFC4366] Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, J.,
\r
5354 Wright, T., "Transport Layer Security (TLS) Extensions", RFC
\r
5357 [RSA] R. Rivest, A. Shamir, and L. M. Adleman, "A Method for
\r
5358 Obtaining Digital Signatures and Public-Key Cryptosystems,"
\r
5359 Communications of the ACM, v. 21, n. 2, Feb 1978, pp.
\r
5362 [SEQNUM] Bellovin. S., "Defending Against Sequence Number Attacks",
\r
5363 RFC 1948, May 1996.
\r
5365 [SSL2] Hickman, Kipp, "The SSL Protocol", Netscape Communications
\r
5366 Corp., Feb 9, 1995.
\r
5368 [SSL3] A. Freier, P. Karlton, and P. Kocher, "The SSL 3.0
\r
5372 Dierks & Rescorla Standards Track [Page 96]
\r
5374 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5377 Protocol", Netscape Communications Corp., Nov 18, 1996.
\r
5379 [SUBGROUP] Zuccherato, R., "Methods for Avoiding the "Small-Subgroup"
\r
5380 Attacks on the Diffie-Hellman Key Agreement Method for
\r
5381 S/MIME", RFC 2785, March 2000.
\r
5383 [TCP] Postel, J., "Transmission Control Protocol," STD 7, RFC 793,
\r
5386 [TIMING] Boneh, D., Brumley, D., "Remote timing attacks are
\r
5387 practical", USENIX Security Symposium 2003.
\r
5389 [TLSAES] Chown, P., "Advanced Encryption Standard (AES) Ciphersuites
\r
5390 for Transport Layer Security (TLS)", RFC 3268, June 2002.
\r
5392 [TLSECC] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and
\r
5393 Moeller, B., "Elliptic Curve Cryptography (ECC) Cipher
\r
5394 Suites for Transport Layer Security (TLS)", RFC 4492, May
\r
5397 [TLSEXT] Eastlake, D.E., "Transport Layer Security (TLS) Extensions:
\r
5398 Extension Definitions", January 2008, draft-ietf-tls-
\r
5399 rfc4366-bis-01.txt.
\r
5401 [TLSPGP] Mavrogiannopoulos, N., "Using OpenPGP keys for TLS
\r
5402 authentication", RFC 5081, November 2007.
\r
5404 [TLSPSK] Eronen, P., Tschofenig, H., "Pre-Shared Key Ciphersuites for
\r
5405 Transport Layer Security (TLS)", RFC 4279, December 2005.
\r
5407 [TLS1.0] Dierks, T., and C. Allen, "The TLS Protocol, Version 1.0",
\r
5408 RFC 2246, January 1999.
\r
5410 [TLS1.1] Dierks, T., and E. Rescorla, "The TLS Protocol, Version
\r
5411 1.1", RFC 4346, April, 2006.
\r
5413 [X501] ITU-T Recommendation X.501: Information Technology - Open
\r
5414 Systems Interconnection - The Directory: Models, 1993.
\r
5416 [XDR] Eisler, M., "External Data Representation Standard", RFC
\r
5422 Working Group Chairs
\r
5428 Dierks & Rescorla Standards Track [Page 97]
\r
5430 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5433 EMail: ekr@networkresonance.com
\r
5436 pasi.eronen@nokia.com
\r
5441 Tim Dierks Eric Rescorla
\r
5442 Independent Network Resonance, Inc.
\r
5443 EMail: tim@dierks.org EMail: ekr@networkresonance.com
\r
5446 Other contributors
\r
5448 Christopher Allen (co-editor of TLS 1.0)
\r
5450 ChristopherA@AlacrityManagement.com
\r
5453 University of California, Santa Cruz
\r
5456 Steven M. Bellovin
\r
5457 Columbia University
\r
5458 smb@cs.columbia.edu
\r
5460 Simon Blake-Wilson
\r
5462 EMail: sblakewilson@bcisse.com
\r
5466 canetti@watson.ibm.com
\r
5469 Skygate Technology Ltd
\r
5473 taher@securify.com
\r
5477 pasi.eronen@nokia.com
\r
5484 Dierks & Rescorla Standards Track [Page 98]
\r
5486 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5489 anil@busybuddha.org
\r
5496 Independent Consultant
\r
5497 EMail: david.hopwood@blueyonder.co.uk
\r
5499 Phil Karlton (co-author of SSLv3)
\r
5501 Paul Kocher (co-author of SSLv3)
\r
5502 Cryptography Research
\r
5503 paul@cryptography.com
\r
5507 hugo@ee.technion.ac.il
\r
5511 EMail: janm@transactionware.com
\r
5515 EMail: magnus@rsasecurity.com
\r
5518 Netscape Communications
\r
5519 relyea@netscape.com
\r
5522 Netscape Communications
\r
5529 dansimon@microsoft.com
\r
5535 EMail: timothy.wright@vodafone.com
\r
5540 Dierks & Rescorla Standards Track [Page 99]
\r
5542 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5547 The discussion list for the IETF TLS working group is located at the
\r
5548 e-mail address <tls@ietf.org>. Information on the group and
\r
5549 information on how to subscribe to the list is at
\r
5550 <https://www1.ietf.org/mailman/listinfo/tls>
\r
5552 Archives of the list can be found at:
\r
5553 <http://www.ietf.org/mail-archive/web/tls/current/index.html>
\r
5596 Dierks & Rescorla Standards Track [Page 100]
\r
5598 draft-ietf-tls-rfc4346-bis-09.txt TLS February, 2008
\r
5601 Full Copyright Statement
\r
5603 Copyright (C) The IETF Trust (2008).
\r
5605 This document is subject to the rights, licenses and restrictions
\r
5606 contained in BCP 78, and except as set forth therein, the authors
\r
5607 retain all their rights.
\r
5609 This document and the information contained herein are provided on an
\r
5610 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
\r
5611 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
\r
5612 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
\r
5613 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
\r
5614 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
\r
5615 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
\r
5618 Intellectual Property
\r
5620 The IETF takes no position regarding the validity or scope of any
\r
5621 Intellectual Property Rights or other rights that might be claimed to
\r
5622 pertain to the implementation or use of the technology described in
\r
5623 this document or the extent to which any license under such rights
\r
5624 might or might not be available; nor does it represent that it has
\r
5625 made any independent effort to identify any such rights. Information
\r
5626 on the procedures with respect to rights in RFC documents can be
\r
5627 found in BCP 78 and BCP 79.
\r
5629 Copies of IPR disclosures made to the IETF Secretariat and any
\r
5630 assurances of licenses to be made available, or the result of an
\r
5631 attempt made to obtain a general license or permission for the use of
\r
5632 such proprietary rights by implementers or users of this
\r
5633 specification can be obtained from the IETF on-line IPR repository at
\r
5634 http://www.ietf.org/ipr.
\r
5636 The IETF invites any interested party to bring to its attention any
\r
5637 copyrights, patents or patent applications, or other proprietary
\r
5638 rights that may cover technology that may be required to implement
\r
5639 this standard. Please address the information to the IETF at
\r
5640 ietf-ipr@ietf.org.
\r
5645 Funding for the RFC Editor function is provided by the IETF
\r
5646 Administrative Support Activity (IASA).
\r
5652 Dierks & Rescorla Standards Track [Page 101]
\r