draft-ietf-tls-tls13-01.txt   draft-ietf-tls-tls13-02.txt 
Network Working Group T. Dierks Network Working Group T. Dierks
Internet-Draft Independent Internet-Draft Independent
Obsoletes: 3268, 4346, 4366, 5246 E. Rescorla Obsoletes: 3268, 4346, 4366, 5246 E. Rescorla
(if approved) RTFM, Inc. (if approved) RTFM, Inc.
Updates: 4492 (if approved) April 17, 2014 Updates: 4492 (if approved) July 7, 2014
Intended status: Standards Track Intended status: Standards Track
Expires: October 19, 2014 Expires: January 8, 2015
The Transport Layer Security (TLS) Protocol Version 1.3 The Transport Layer Security (TLS) Protocol Version 1.3
draft-ietf-tls-tls13-01 draft-ietf-tls-tls13-02
Abstract Abstract
This document specifies Version 1.3 of the Transport Layer Security This document specifies Version 1.3 of the Transport Layer Security
(TLS) protocol. The TLS protocol provides communications security (TLS) protocol. The TLS protocol provides communications security
over the Internet. The protocol allows client/server applications to over the Internet. The protocol allows client/server applications to
communicate in a way that is designed to prevent eavesdropping, communicate in a way that is designed to prevent eavesdropping,
tampering, or message forgery. tampering, or message forgery.
Status of This Memo Status of This Memo
skipping to change at page 1, line 37 skipping to change at page 1, line 37
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 19, 2014. This Internet-Draft will expire on January 8, 2015.
Copyright Notice Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 22 skipping to change at page 2, line 22
modifications of such material outside the IETF Standards Process. modifications of such material outside the IETF Standards Process.
Without obtaining an adequate license from the person(s) controlling Without obtaining an adequate license from the person(s) controlling
the copyright in such materials, this document may not be modified the copyright in such materials, this document may not be modified
outside the IETF Standards Process, and derivative works of it may outside the IETF Standards Process, and derivative works of it may
not be created outside the IETF Standards Process, except to format not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other it for publication as an RFC or to translate it into languages other
than English. than English.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1. Requirements Terminology . . . . . . . . . . . . . . . . 6 1.1. Requirements Terminology . . . . . . . . . . . . . . . . . 6
1.2. Major Differences from TLS 1.1 . . . . . . . . . . . . . 6 1.2. Major Differences from TLS 1.2 . . . . . . . . . . . . . . 6
2. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3. Major Differences from TLS 1.1 . . . . . . . . . . . . . . 6
3. Goals of This Document . . . . . . . . . . . . . . . . . . . 8 2. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4. Presentation Language . . . . . . . . . . . . . . . . . . . . 8 3. Goals of This Document . . . . . . . . . . . . . . . . . . . . 8
4.1. Basic Block Size . . . . . . . . . . . . . . . . . . . . 8 4. Presentation Language . . . . . . . . . . . . . . . . . . . . 9
4.2. Miscellaneous . . . . . . . . . . . . . . . . . . . . . . 9 4.1. Basic Block Size . . . . . . . . . . . . . . . . . . . . . 9
4.3. Vectors . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.2. Miscellaneous . . . . . . . . . . . . . . . . . . . . . . 9
4.4. Numbers . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.3. Vectors . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.5. Enumerateds . . . . . . . . . . . . . . . . . . . . . . . 10 4.4. Numbers . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.6. Constructed Types . . . . . . . . . . . . . . . . . . . . 11 4.5. Enumerateds . . . . . . . . . . . . . . . . . . . . . . . 11
4.6.1. Variants . . . . . . . . . . . . . . . . . . . . . . 12 4.6. Constructed Types . . . . . . . . . . . . . . . . . . . . 12
4.7. Cryptographic Attributes . . . . . . . . . . . . . . . . 13 4.6.1. Variants . . . . . . . . . . . . . . . . . . . . . . . 12
4.8. Constants . . . . . . . . . . . . . . . . . . . . . . . . 15 4.7. Cryptographic Attributes . . . . . . . . . . . . . . . . . 13
5. HMAC and the Pseudorandom Function . . . . . . . . . . . . . 15 4.8. Constants . . . . . . . . . . . . . . . . . . . . . . . . 15
6. The TLS Record Protocol . . . . . . . . . . . . . . . . . . . 17 5. The Pseudorandom Function . . . . . . . . . . . . . . . . . . 15
6.1. Connection States . . . . . . . . . . . . . . . . . . . . 17 6. The TLS Record Protocol . . . . . . . . . . . . . . . . . . . 16
6.2. Record Layer . . . . . . . . . . . . . . . . . . . . . . 20 6.1. Connection States . . . . . . . . . . . . . . . . . . . . 17
6.2.1. Fragmentation . . . . . . . . . . . . . . . . . . . . 20 6.2. Record Layer . . . . . . . . . . . . . . . . . . . . . . . 19
6.2.2. Record Compression and Decompression . . . . . . . . 22 6.2.1. Fragmentation . . . . . . . . . . . . . . . . . . . . 19
6.2.3. Record Payload Protection . . . . . . . . . . . . . . 22 6.2.2. Record Payload Protection . . . . . . . . . . . . . . 20
6.3. Key Calculation . . . . . . . . . . . . . . . . . . . . . 27 6.3. Key Calculation . . . . . . . . . . . . . . . . . . . . . 22
7. The TLS Handshaking Protocols . . . . . . . . . . . . . . . . 28 7. The TLS Handshaking Protocols . . . . . . . . . . . . . . . . 23
7.1. Change Cipher Spec Protocol . . . . . . . . . . . . . . . 29 7.1. Change Cipher Spec Protocol . . . . . . . . . . . . . . . 24
7.2. Alert Protocol . . . . . . . . . . . . . . . . . . . . . 29 7.2. Alert Protocol . . . . . . . . . . . . . . . . . . . . . . 24
7.2.1. Closure Alerts . . . . . . . . . . . . . . . . . . . 30 7.2.1. Closure Alerts . . . . . . . . . . . . . . . . . . . . 25
7.2.2. Error Alerts . . . . . . . . . . . . . . . . . . . . 31 7.2.2. Error Alerts . . . . . . . . . . . . . . . . . . . . . 26
7.3. Handshake Protocol Overview . . . . . . . . . . . . . . . 35 7.3. Handshake Protocol Overview . . . . . . . . . . . . . . . 30
7.4. Handshake Protocol . . . . . . . . . . . . . . . . . . . 38 7.4. Handshake Protocol . . . . . . . . . . . . . . . . . . . . 34
7.4.1. Hello Messages . . . . . . . . . . . . . . . . . . . 39 7.4.1. Hello Messages . . . . . . . . . . . . . . . . . . . . 35
7.4.2. Server Certificate . . . . . . . . . . . . . . . . . 49 7.4.2. Client Key Exchange Message . . . . . . . . . . . . . 39
7.4.3. Server Key Exchange Message . . . . . . . . . . . . . 51 7.4.3. Server Key Exchange Message . . . . . . . . . . . . . 47
7.4.4. Certificate Request . . . . . . . . . . . . . . . . . 54 7.4.4. Encrypted Extensions . . . . . . . . . . . . . . . . . 48
7.4.5. Server Hello Done . . . . . . . . . . . . . . . . . . 56 7.4.5. Server Certificate . . . . . . . . . . . . . . . . . . 49
7.4.6. Client Certificate . . . . . . . . . . . . . . . . . 57 7.4.6. Certificate Request . . . . . . . . . . . . . . . . . 52
7.4.7. Client Key Exchange Message . . . . . . . . . . . . . 58 7.4.7. Server Certificate Verify . . . . . . . . . . . . . . 53
7.4.8. Certificate Verify . . . . . . . . . . . . . . . . . 63 7.4.8. Server Finished . . . . . . . . . . . . . . . . . . . 55
7.4.9. Finished . . . . . . . . . . . . . . . . . . . . . . 64 7.4.9. Client Certificate . . . . . . . . . . . . . . . . . . 56
8. Cryptographic Computations . . . . . . . . . . . . . . . . . 66 7.4.10. Client Certificate Verify . . . . . . . . . . . . . . 58
8.1. Computing the Master Secret . . . . . . . . . . . . . . . 66 8. Cryptographic Computations . . . . . . . . . . . . . . . . . . 58
8.1.1. RSA . . . . . . . . . . . . . . . . . . . . . . . . . 66 8.1. Computing the Master Secret . . . . . . . . . . . . . . . 59
8.1.2. Diffie-Hellman . . . . . . . . . . . . . . . . . . . 67 8.1.1. Diffie-Hellman . . . . . . . . . . . . . . . . . . . . 59
9. Mandatory Cipher Suites . . . . . . . . . . . . . . . . . . . 67 9. Mandatory Cipher Suites . . . . . . . . . . . . . . . . . . . 59
10. Application Data Protocol . . . . . . . . . . . . . . . . . . 67 10. Application Data Protocol . . . . . . . . . . . . . . . . . . 59
11. Security Considerations . . . . . . . . . . . . . . . . . . . 67 11. Security Considerations . . . . . . . . . . . . . . . . . . . 59
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 67 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 59
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 69 13. References . . . . . . . . . . . . . . . . . . . . . . . . . . 61
13.1. Normative References . . . . . . . . . . . . . . . . . . 69 13.1. Normative References . . . . . . . . . . . . . . . . . . . 61
13.2. Informative References . . . . . . . . . . . . . . . . . 70 13.2. Informative References . . . . . . . . . . . . . . . . . . 63
Appendix A. Protocol Data Structures and Constant Values . . . . 73 Appendix A. Protocol Data Structures and Constant Values . . . . 67
A.1. Record Layer . . . . . . . . . . . . . . . . . . . . . . 73 A.1. Record Layer . . . . . . . . . . . . . . . . . . . . . . . 67
A.2. Change Cipher Specs Message . . . . . . . . . . . . . . . 74 A.2. Change Cipher Specs Message . . . . . . . . . . . . . . . 67
A.3. Alert Messages . . . . . . . . . . . . . . . . . . . . . 75 A.3. Alert Messages . . . . . . . . . . . . . . . . . . . . . . 68
A.4. Handshake Protocol . . . . . . . . . . . . . . . . . . . 76 A.4. Handshake Protocol . . . . . . . . . . . . . . . . . . . . 69
A.4.1. Hello Messages . . . . . . . . . . . . . . . . . . . 76 A.4.1. Hello Messages . . . . . . . . . . . . . . . . . . . . 69
A.4.2. Server Authentication and Key Exchange Messages . . . 78 A.4.2. Server Authentication and Key Exchange Messages . . . 71
A.4.3. Client Authentication and Key Exchange Messages . . . 79 A.4.3. Client Authentication and Key Exchange Messages . . . 72
A.4.4. Handshake Finalization Message . . . . . . . . . . . 80 A.4.4. Handshake Finalization Message . . . . . . . . . . . . 72
A.5. The Cipher Suite . . . . . . . . . . . . . . . . . . . . 80 A.5. The Cipher Suite . . . . . . . . . . . . . . . . . . . . . 72
A.6. The Security Parameters . . . . . . . . . . . . . . . . . 82 A.6. The Security Parameters . . . . . . . . . . . . . . . . . 74
A.7. Changes to RFC 4492 . . . . . . . . . . . . . . . . . . . 83 A.7. Changes to RFC 4492 . . . . . . . . . . . . . . . . . . . 74
Appendix B. Glossary . . . . . . . . . . . . . . . . . . . . . . 83 Appendix B. Glossary . . . . . . . . . . . . . . . . . . . . . . 75
Appendix C. Cipher Suite Definitions . . . . . . . . . . . . . . 87 Appendix C. Cipher Suite Definitions . . . . . . . . . . . . . . 78
Appendix D. Implementation Notes . . . . . . . . . . . . . . . . 89 Appendix D. Implementation Notes . . . . . . . . . . . . . . . . 79
D.1. Random Number Generation and Seeding . . . . . . . . . . 89 D.1. Random Number Generation and Seeding . . . . . . . . . . . 79
D.2. Certificates and Authentication . . . . . . . . . . . . . 89 D.2. Certificates and Authentication . . . . . . . . . . . . . 79
D.3. Cipher Suites . . . . . . . . . . . . . . . . . . . . . . 90 D.3. Cipher Suites . . . . . . . . . . . . . . . . . . . . . . 79
D.4. Implementation Pitfalls . . . . . . . . . . . . . . . . . 90 D.4. Implementation Pitfalls . . . . . . . . . . . . . . . . . 79
Appendix E. Backward Compatibility . . . . . . . . . . . . . . . 91 Appendix E. Backward Compatibility . . . . . . . . . . . . . . . 81
E.1. Compatibility with TLS 1.0/1.1 and SSL 3.0 . . . . . . . 91 E.1. Compatibility with TLS 1.0/1.1 and SSL 3.0 . . . . . . . . 81
E.2. Compatibility with SSL 2.0 . . . . . . . . . . . . . . . 93 E.2. Compatibility with SSL 2.0 . . . . . . . . . . . . . . . . 82
E.3. Avoiding Man-in-the-Middle Version Rollback . . . . . . . 94 E.3. Avoiding Man-in-the-Middle Version Rollback . . . . . . . 84
Appendix F. Security Analysis . . . . . . . . . . . . . . . . . 95 Appendix F. Security Analysis . . . . . . . . . . . . . . . . . . 84
F.1. Handshake Protocol . . . . . . . . . . . . . . . . . . . 95 F.1. Handshake Protocol . . . . . . . . . . . . . . . . . . . . 84
F.1.1. Authentication and Key Exchange . . . . . . . . . . . 95 F.1.1. Authentication and Key Exchange . . . . . . . . . . . 85
F.1.2. Version Rollback Attacks . . . . . . . . . . . . . . 98 F.1.2. Version Rollback Attacks . . . . . . . . . . . . . . . 86
F.1.3. Detecting Attacks Against the Handshake Protocol . . 98 F.1.3. Detecting Attacks Against the Handshake Protocol . . . 87
F.1.4. Resuming Sessions . . . . . . . . . . . . . . . . . . 98 F.1.4. Resuming Sessions . . . . . . . . . . . . . . . . . . 87
F.2. Protecting Application Data . . . . . . . . . . . . . . . 99 F.2. Protecting Application Data . . . . . . . . . . . . . . . 88
F.3. Explicit IVs . . . . . . . . . . . . . . . . . . . . . . 99 F.3. Denial of Service . . . . . . . . . . . . . . . . . . . . 88
F.4. Security of Composite Cipher Modes . . . . . . . . . . . 99 F.4. Final Notes . . . . . . . . . . . . . . . . . . . . . . . 88
F.5. Denial of Service . . . . . . . . . . . . . . . . . . . . 100 Appendix G. Working Group Information . . . . . . . . . . . . . . 89
F.6. Final Notes . . . . . . . . . . . . . . . . . . . . . . . 101 Appendix H. Contributors . . . . . . . . . . . . . . . . . . . . 89
Appendix G. Working Group Information . . . . . . . . . . . . . 101
Appendix H. Contributors . . . . . . . . . . . . . . . . . . . . 101
1. Introduction 1. Introduction
DISCLAIMER: This document is simply a copy of RFC 5246 translated DISCLAIMER: This is a WIP draft of TLS 1.3 and has not yet seen
into markdown format with no intentional technical or editorial significant security analysis.
changes beyond updating the references and minor reformatting
introduced by the translation. It is being submitted as-is to create RFC EDITOR: PLEASE REMOVE THE FOLLOWING PARAGRAPH The source for this
a clearer revision history for future versions. Any errata in TLS draft is maintained in GitHub. Suggested changes should be submitted
1.2 remain in this version. Thanks to Mark Nottingham for doing the as pull requests at https://github.com/tlswg/tls13-spec.
markdown translation. Instructions are on that page as well. Editorial changes can be
managed in GitHub, but any substantive change should be discussed on
the TLS mailing list.
The primary goal of the TLS protocol is to provide privacy and data The primary goal of the TLS protocol is to provide privacy and data
integrity between two communicating applications. The protocol is integrity between two communicating applications. The protocol is
composed of two layers: the TLS Record Protocol and the TLS Handshake composed of two layers: the TLS Record Protocol and the TLS Handshake
Protocol. At the lowest level, layered on top of some reliable Protocol. At the lowest level, layered on top of some reliable
transport protocol (e.g., TCP [RFC0793]), is the TLS Record Protocol. transport protocol (e.g., TCP [RFC0793]), is the TLS Record Protocol.
The TLS Record Protocol provides connection security that has two The TLS Record Protocol provides connection security that has two
basic properties: basic properties:
- The connection is private. Symmetric cryptography is used for - The connection is private. Symmetric cryptography is used for
data encryption (e.g., AES [AES], RC4 [SCH], etc.). The keys for data encryption (e.g., AES [AES], etc.). The keys for this
this symmetric encryption are generated uniquely for each symmetric encryption are generated uniquely for each connection
connection and are based on a secret negotiated by another and are based on a secret negotiated by another protocol (such as
protocol (such as the TLS Handshake Protocol). The Record the TLS Handshake Protocol). The Record Protocol can also be used
Protocol can also be used without encryption. without encryption, i.e., in integrity-only modes.
- The connection is reliable. Message transport includes a message - The connection is reliable. Messages include an authentication
integrity check using a keyed MAC. Secure hash functions (e.g., tag which protects them against modification.
SHA-1, etc.) are used for MAC computations. The Record Protocol
can operate without a MAC, but is generally only used in this mode - The Record Protocol can operate in an insecure mode but is
while another protocol is using the Record Protocol as a transport generally only used in this mode while another protocol is using
for negotiating security parameters. the Record Protocol as a transport for negotiating security
parameters.
The TLS Record Protocol is used for encapsulation of various higher- The TLS Record Protocol is used for encapsulation of various higher-
level protocols. One such encapsulated protocol, the TLS Handshake level protocols. One such encapsulated protocol, the TLS Handshake
Protocol, allows the server and client to authenticate each other and Protocol, allows the server and client to authenticate each other and
to negotiate an encryption algorithm and cryptographic keys before to negotiate an encryption algorithm and cryptographic keys before
the application protocol transmits or receives its first byte of the application protocol transmits or receives its first byte of
data. The TLS Handshake Protocol provides connection security that data. The TLS Handshake Protocol provides connection security that
has three basic properties: has three basic properties:
- The peer's identity can be authenticated using asymmetric, or - The peer's identity can be authenticated using asymmetric, or
skipping to change at page 6, line 24 skipping to change at page 6, line 28
handshaking and how to interpret the authentication certificates handshaking and how to interpret the authentication certificates
exchanged are left to the judgment of the designers and implementors exchanged are left to the judgment of the designers and implementors
of protocols that run on top of TLS. of protocols that run on top of TLS.
1.1. Requirements Terminology 1.1. Requirements Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
1.2. Major Differences from TLS 1.1 1.2. Major Differences from TLS 1.2
draft-02
- Increment version number.
- Reworked handshake to provide 1-RTT mode.
- Remove custom DHE groups.
- Removed support for compression.
- Removed support for static RSA and DH key exchange.
- Removed support for non-AEAD ciphers
1.3. Major Differences from TLS 1.1
This document is a revision of the TLS 1.1 [RFC4346] protocol which This document is a revision of the TLS 1.1 [RFC4346] protocol which
contains improved flexibility, particularly for negotiation of contains improved flexibility, particularly for negotiation of
cryptographic algorithms. The major changes are: cryptographic algorithms. The major changes are:
- The MD5/SHA-1 combination in the pseudorandom function (PRF) has - The MD5/SHA-1 combination in the pseudorandom function (PRF) has
been replaced with cipher-suite-specified PRFs. All cipher suites been replaced with cipher-suite-specified PRFs. All cipher suites
in this document use P_SHA256. in this document use P_SHA256.
- The MD5/SHA-1 combination in the digitally-signed element has been - The MD5/SHA-1 combination in the digitally-signed element has been
skipping to change at page 7, line 48 skipping to change at page 8, line 17
The goals of the TLS protocol, in order of priority, are as follows: The goals of the TLS protocol, in order of priority, are as follows:
1. Cryptographic security: TLS should be used to establish a secure 1. Cryptographic security: TLS should be used to establish a secure
connection between two parties. connection between two parties.
2. Interoperability: Independent programmers should be able to 2. Interoperability: Independent programmers should be able to
develop applications utilizing TLS that can successfully exchange develop applications utilizing TLS that can successfully exchange
cryptographic parameters without knowledge of one another's code. cryptographic parameters without knowledge of one another's code.
3. Extensibility: TLS seeks to provide a framework into which new 3. Extensibility: TLS seeks to provide a framework into which new
public key and bulk encryption methods can be incorporated as public key and record protection methods can be incorporated as
necessary. This will also accomplish two sub-goals: preventing necessary. This will also accomplish two sub-goals: preventing
the need to create a new protocol (and risking the introduction the need to create a new protocol (and risking the introduction
of possible new weaknesses) and avoiding the need to implement an of possible new weaknesses) and avoiding the need to implement an
entire new security library. entire new security library.
4. Relative efficiency: Cryptographic operations tend to be highly 4. Relative efficiency: Cryptographic operations tend to be highly
CPU intensive, particularly public key operations. For this CPU intensive, particularly public key operations. For this
reason, the TLS protocol has incorporated an optional session reason, the TLS protocol has incorporated an optional session
caching scheme to reduce the number of connections that need to caching scheme to reduce the number of connections that need to
be established from scratch. Additionally, care has been taken be established from scratch. Additionally, care has been taken
skipping to change at page 13, line 29 skipping to change at page 13, line 31
case apple: case apple:
V1; /* VariantBody, tag = apple */ V1; /* VariantBody, tag = apple */
case orange: case orange:
case banana: case banana:
V2; /* VariantBody, tag = orange or banana */ V2; /* VariantBody, tag = orange or banana */
} variant_body; /* optional label on variant */ } variant_body; /* optional label on variant */
} VariantRecord; } VariantRecord;
4.7. Cryptographic Attributes 4.7. Cryptographic Attributes
The five cryptographic operations -- digital signing, stream cipher The two cryptographic operations -- digital signing, and
encryption, block cipher encryption, authenticated encryption with authenticated encryption with additional data (AEAD) -- are
additional data (AEAD) encryption, and public key encryption -- are designated digitally-signed, and aead-ciphered, respectively. A
designated digitally-signed, stream-ciphered, block-ciphered, aead- field's cryptographic processing is specified by prepending an
ciphered, and public-key-encrypted, respectively. A field's appropriate key word designation before the field's type
cryptographic processing is specified by prepending an appropriate specification. Cryptographic keys are implied by the current session
key word designation before the field's type specification. state (see Section 6.1).
Cryptographic keys are implied by the current session state (see
Section 6.1).
A digitally-signed element is encoded as a struct DigitallySigned: A digitally-signed element is encoded as a struct DigitallySigned:
struct { struct {
SignatureAndHashAlgorithm algorithm; SignatureAndHashAlgorithm algorithm;
opaque signature<0..2^16-1>; opaque signature<0..2^16-1>;
} DigitallySigned; } DigitallySigned;
The algorithm field specifies the algorithm used (see The algorithm field specifies the algorithm used (see
Section 7.4.1.4.1 for the definition of this field). Note that the Section 7.4.2.3.1 for the definition of this field). Note that the
introduction of the algorithm field is a change from previous algorithm field was introduced in TLS 1.2, and is not in earlier
versions. The signature is a digital signature using those versions. The signature is a digital signature using those
algorithms over the contents of the element. The contents themselves algorithms over the contents of the element. The contents themselves
do not appear on the wire but are simply calculated. The length of do not appear on the wire but are simply calculated. The length of
the signature is specified by the signing algorithm and key. the signature is specified by the signing algorithm and key.
In RSA signing, the opaque vector contains the signature generated In RSA signing, the opaque vector contains the signature generated
using the RSASSA-PKCS1-v1_5 signature scheme defined in [RFC3447]. using the RSASSA-PKCS1-v1_5 signature scheme defined in [RFC3447].
As discussed in [RFC3447], the DigestInfo MUST be DER-encoded [X680] As discussed in [RFC3447], the DigestInfo MUST be DER-encoded [X680]
[X690]. For hash algorithms without parameters (which includes [X690]. For hash algorithms without parameters (which includes
SHA-1), the DigestInfo.AlgorithmIdentifier.parameters field MUST be SHA-1), the DigestInfo.AlgorithmIdentifier.parameters field MUST be
skipping to change at page 14, line 31 skipping to change at page 14, line 31
r INTEGER, r INTEGER,
s INTEGER s INTEGER
} }
Note: In current terminology, DSA refers to the Digital Signature Note: In current terminology, DSA refers to the Digital Signature
Algorithm and DSS refers to the NIST standard. In the original SSL Algorithm and DSS refers to the NIST standard. In the original SSL
and TLS specs, "DSS" was used universally. This document uses "DSA" and TLS specs, "DSS" was used universally. This document uses "DSA"
to refer to the algorithm, "DSS" to refer to the standard, and it to refer to the algorithm, "DSS" to refer to the standard, and it
uses "DSS" in the code point definitions for historical continuity. uses "DSS" in the code point definitions for historical continuity.
In stream cipher encryption, the plaintext is exclusive-ORed with an
identical amount of output generated from a cryptographically secure
keyed pseudorandom number generator.
In block cipher encryption, every block of plaintext encrypts to a
block of ciphertext. All block cipher encryption is done in CBC
(Cipher Block Chaining) mode, and all items that are block-ciphered
will be an exact multiple of the cipher block length.
In AEAD encryption, the plaintext is simultaneously encrypted and In AEAD encryption, the plaintext is simultaneously encrypted and
integrity protected. The input may be of any length, and aead- integrity protected. The input may be of any length, and aead-
ciphered output is generally larger than the input in order to ciphered output is generally larger than the input in order to
accommodate the integrity check value. accommodate the integrity check value.
In public key encryption, a public key algorithm is used to encrypt
data in such a way that it can be decrypted only with the matching
private key. A public-key-encrypted element is encoded as an opaque
vector <0..2^16-1>, where the length is specified by the encryption
algorithm and key.
RSA encryption is done using the RSAES-PKCS1-v1_5 encryption scheme
defined in [RFC3447].
In the following example In the following example
stream-ciphered struct { struct {
uint8 field1; uint8 field1;
uint8 field2; uint8 field2;
digitally-signed opaque { digitally-signed opaque {
uint8 field3<0..255>; uint8 field3<0..255>;
uint8 field4; uint8 field4;
}; };
} UserType; } UserType;
The contents of the inner struct (field3 and field4) are used as The contents of the inner struct (field3 and field4) are used as
input for the signature/hash algorithm, and then the entire structure input for the signature/hash algorithm. The length of the structure,
is encrypted with a stream cipher. The length of this structure, in in bytes, would be equal to two bytes for field1 and field2, plus two
bytes, would be equal to two bytes for field1 and field2, plus two
bytes for the signature and hash algorithm, plus two bytes for the bytes for the signature and hash algorithm, plus two bytes for the
length of the signature, plus the length of the output of the signing length of the signature, plus the length of the output of the signing
algorithm. The length of the signature is known because the algorithm. The length of the signature is known because the
algorithm and key used for the signing are known prior to encoding or algorithm and key used for the signing are known prior to encoding or
decoding this structure. decoding this structure.
4.8. Constants 4.8. Constants
Typed constants can be defined for purposes of specification by Typed constants can be defined for purposes of specification by
declaring a symbol of the desired type and assigning values to it. declaring a symbol of the desired type and assigning values to it.
skipping to change at page 15, line 44 skipping to change at page 15, line 25
For example: For example:
struct { struct {
uint8 f1; uint8 f1;
uint8 f2; uint8 f2;
} Example1; } Example1;
Example1 ex1 = {1, 4}; /* assigns f1 = 1, f2 = 4 */ Example1 ex1 = {1, 4}; /* assigns f1 = 1, f2 = 4 */
5. HMAC and the Pseudorandom Function 5. The Pseudorandom Function
The TLS record layer uses a keyed Message Authentication Code (MAC)
to protect message integrity. The cipher suites defined in this
document use a construction known as HMAC, described in [RFC2104],
which is based on a hash function. Other cipher suites MAY define
their own MAC constructions, if needed.
In addition, a construction is required to do expansion of secrets A construction is required to do expansion of secrets into blocks of
into blocks of data for the purposes of key generation or validation. data for the purposes of key generation or validation. This
This pseudorandom function (PRF) takes as input a secret, a seed, and pseudorandom function (PRF) takes as input a secret, a seed, and an
an identifying label and produces an output of arbitrary length. identifying label and produces an output of arbitrary length.
In this section, we define one PRF, based on HMAC. This PRF with the In this section, we define one PRF, based on HMAC [RFC2104]. This
SHA-256 hash function is used for all cipher suites defined in this PRF with the SHA-256 hash function is used for all cipher suites
document and in TLS documents published prior to this document when defined in this document and in TLS documents published prior to this
TLS 1.2 is negotiated. New cipher suites MUST explicitly specify a document when TLS 1.2 is negotiated. New cipher suites MUST
PRF and, in general, SHOULD use the TLS PRF with SHA-256 or a explicitly specify a PRF and, in general, SHOULD use the TLS PRF with
stronger standard hash function. SHA-256 or a stronger standard hash function.
First, we define a data expansion function, P_hash(secret, data), First, we define a data expansion function, P_hash(secret, data),
that uses a single hash function to expand a secret and seed into an that uses a single hash function to expand a secret and seed into an
arbitrary quantity of output: arbitrary quantity of output:
P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) +
HMAC_hash(secret, A(2) + seed) + HMAC_hash(secret, A(2) + seed) +
HMAC_hash(secret, A(3) + seed) + ... HMAC_hash(secret, A(3) + seed) + ...
where + indicates concatenation. where + indicates concatenation.
skipping to change at page 17, line 10 skipping to change at page 16, line 29
For example, the label "slithy toves" would be processed by hashing For example, the label "slithy toves" would be processed by hashing
the following bytes: the following bytes:
73 6C 69 74 68 79 20 74 6F 76 65 73 73 6C 69 74 68 79 20 74 6F 76 65 73
6. The TLS Record Protocol 6. The TLS Record Protocol
The TLS Record Protocol is a layered protocol. At each layer, The TLS Record Protocol is a layered protocol. At each layer,
messages may include fields for length, description, and content. messages may include fields for length, description, and content.
The Record Protocol takes messages to be transmitted, fragments the The Record Protocol takes messages to be transmitted, fragments the
data into manageable blocks, optionally compresses the data, applies data into manageable blocks, protects the records, and transmits the
a MAC, encrypts, and transmits the result. Received data is result. Received data is decrypted and verified, reassembled, and
decrypted, verified, decompressed, reassembled, and then delivered to then delivered to higher-level clients.
higher-level clients.
Four protocols that use the record protocol are described in this Four protocols that use the record protocol are described in this
document: the handshake protocol, the alert protocol, the change document: the handshake protocol, the alert protocol, the change
cipher spec protocol, and the application data protocol. In order to cipher spec protocol, and the application data protocol. In order to
allow extension of the TLS protocol, additional record content types allow extension of the TLS protocol, additional record content types
can be supported by the record protocol. New record content type can be supported by the record protocol. New record content type
values are assigned by IANA in the TLS Content Type Registry as values are assigned by IANA in the TLS Content Type Registry as
described in Section 12. described in Section 12.
Implementations MUST NOT send record types not defined in this Implementations MUST NOT send record types not defined in this
skipping to change at page 17, line 42 skipping to change at page 17, line 13
the latter. the latter.
Note in particular that type and length of a record are not protected Note in particular that type and length of a record are not protected
by encryption. If this information is itself sensitive, application by encryption. If this information is itself sensitive, application
designers may wish to take steps (padding, cover traffic) to minimize designers may wish to take steps (padding, cover traffic) to minimize
information leakage. information leakage.
6.1. Connection States 6.1. Connection States
A TLS connection state is the operating environment of the TLS Record A TLS connection state is the operating environment of the TLS Record
Protocol. It specifies a compression algorithm, an encryption Protocol. It specifies a record protection algorithm and its
algorithm, and a MAC algorithm. In addition, the parameters for parameters as well as the record protection keys and IVs for the
these algorithms are known: the MAC key and the bulk encryption keys connection in both the read and the write directions. Logically,
for the connection in both the read and the write directions. there are always four connection states outstanding: the current read
Logically, there are always four connection states outstanding: the and write states, and the pending read and write states. All records
current read and write states, and the pending read and write states. are processed under the current read and write states. The security
All records are processed under the current read and write states. parameters for the pending states can be set by the TLS Handshake
The security parameters for the pending states can be set by the TLS Protocol, and the ChangeCipherSpec can selectively make either of the
Handshake Protocol, and the ChangeCipherSpec can selectively make pending states current, in which case the appropriate current state
either of the pending states current, in which case the appropriate is disposed of and replaced with the pending state; the pending state
current state is disposed of and replaced with the pending state; the is then reinitialized to an empty state. It is illegal to make a
pending state is then reinitialized to an empty state. It is illegal state that has not been initialized with security parameters a
to make a state that has not been initialized with security current state. The initial current state always specifies that
parameters a current state. The initial current state always records are not protected.
specifies that no encryption, compression, or MAC will be used.
The security parameters for a TLS Connection read and write state are The security parameters for a TLS Connection read and write state are
set by providing the following values: set by providing the following values:
connection end connection end
Whether this entity is considered the "client" or the "server" in Whether this entity is considered the "client" or the "server" in
this connection. this connection.
PRF algorithm PRF algorithm
An algorithm used to generate keys from the master secret (see An algorithm used to generate keys from the master secret (see
Section 5 and Section 6.3). Section 5 and Section 6.3).
bulk encryption algorithm record protection algorithm
An algorithm to be used for bulk encryption. This specification The algorithm to be used for record protection. This algorithm
includes the key size of this algorithm, whether it is a block, must be of the AEAD type and thus provides integrity and
stream, or AEAD cipher, the block size of the cipher (if confidentiality as a single primitive. It is possible to have
appropriate), and the lengths of explicit and implicit AEAD algorithms which do not provide any confidentiality and
Section 6.2.2 defines a special NULL_NULL AEAD algorithm for use
in the initial handshake). This specification includes the key
size of this algorithm and the lengths of explicit and implicit
initialization vectors (or nonces). initialization vectors (or nonces).
MAC algorithm
An algorithm to be used for message authentication. This
specification includes the size of the value returned by the MAC
algorithm.
compression algorithm
An algorithm to be used for data compression. This specification
must include all information the algorithm requires to do
compression.
master secret master secret
A 48-byte secret shared between the two peers in the connection. A 48-byte secret shared between the two peers in the connection.
client random client random
A 32-byte value provided by the client. A 32-byte value provided by the client.
server random server random
A 32-byte value provided by the server. A 32-byte value provided by the server.
These parameters are defined in the presentation language as: These parameters are defined in the presentation language as:
enum { server, client } ConnectionEnd; enum { server, client } ConnectionEnd;
enum { tls_prf_sha256 } PRFAlgorithm; enum { tls_prf_sha256 } PRFAlgorithm;
enum { null, rc4, 3des, aes } enum { aes_gcm } RecordProtAlgorithm;
BulkCipherAlgorithm;
enum { stream, block, aead } CipherType;
enum { null, hmac_md5, hmac_sha1, hmac_sha256,
hmac_sha384, hmac_sha512} MACAlgorithm;
enum { null(0), (255) } CompressionMethod;
/* The algorithms specified in CompressionMethod, PRFAlgorithm, /* The algorithms specified in PRFAlgorithm and
BulkCipherAlgorithm, and MACAlgorithm may be added to. */ RecordProtAlgorithm may be added to. */
struct { struct {
ConnectionEnd entity; ConnectionEnd entity;
PRFAlgorithm prf_algorithm; PRFAlgorithm prf_algorithm;
BulkCipherAlgorithm bulk_cipher_algorithm; RecordProtAlgorithm record_prot_algorithm;
CipherType cipher_type;
uint8 enc_key_length; uint8 enc_key_length;
uint8 block_length; uint8 block_length;
uint8 fixed_iv_length; uint8 fixed_iv_length;
uint8 record_iv_length; uint8 record_iv_length;
MACAlgorithm mac_algorithm;
uint8 mac_length;
uint8 mac_key_length;
CompressionMethod compression_algorithm;
opaque master_secret[48]; opaque master_secret[48];
opaque client_random[32]; opaque client_random[32];
opaque server_random[32]; opaque server_random[32];
} SecurityParameters; } SecurityParameters;
The record layer will use the security parameters to generate the The record layer will use the security parameters to generate the
following six items (some of which are not required by all ciphers, following four items (some of which are not required by all ciphers,
and are thus empty): and are thus empty):
client write MAC key client write key
server write MAC key server write key
client write encryption key
server write encryption key
client write IV client write IV
server write IV server write IV
The client write parameters are used by the server when receiving and The client write parameters are used by the server when receiving and
processing records and vice versa. The algorithm used for generating processing records and vice versa. The algorithm used for generating
these items from the security parameters is described in Section 6.3 these items from the security parameters is described in Section 6.3
Once the security parameters have been set and the keys have been Once the security parameters have been set and the keys have been
generated, the connection states can be instantiated by making them generated, the connection states can be instantiated by making them
the current states. These current states MUST be updated for each the current states. These current states MUST be updated for each
record processed. Each connection state includes the following record processed. Each connection state includes the following
elements: elements:
compression state
The current state of the compression algorithm.
cipher state cipher state
The current state of the encryption algorithm. This will consist The current state of the encryption algorithm. This will consist
of the scheduled key for that connection. For stream ciphers, of the scheduled key for that connection.
this will also contain whatever state information is necessary to
allow the stream to continue to encrypt or decrypt data.
MAC key
The MAC key for this connection, as generated above.
sequence number sequence number
Each connection state contains a sequence number, which is Each connection state contains a sequence number, which is
maintained separately for read and write states. The sequence maintained separately for read and write states. The sequence
number MUST be set to zero whenever a connection state is made the number MUST be set to zero whenever a connection state is made the
active state. Sequence numbers are of type uint64 and may not active state. Sequence numbers are of type uint64 and may not
exceed 2^64-1. Sequence numbers do not wrap. If a TLS exceed 2^64-1. Sequence numbers do not wrap. If a TLS
implementation would need to wrap a sequence number, it must implementation would need to wrap a sequence number, it must
renegotiate instead. A sequence number is incremented after each renegotiate instead. A sequence number is incremented after each
record: specifically, the first record transmitted under a record: specifically, the first record transmitted under a
skipping to change at page 21, line 27 skipping to change at page 20, line 10
ProtocolVersion version; ProtocolVersion version;
uint16 length; uint16 length;
opaque fragment[TLSPlaintext.length]; opaque fragment[TLSPlaintext.length];
} TLSPlaintext; } TLSPlaintext;
type type
The higher-level protocol used to process the enclosed fragment. The higher-level protocol used to process the enclosed fragment.
version version
The version of the protocol being employed. This document The version of the protocol being employed. This document
describes TLS Version 1.2, which uses the version { 3, 3 }. The describes TLS Version 1.3, which uses the version { 3, 4 }. The
version value 3.3 is historical, deriving from the use of {3, 1} version value 3.4 is historical, deriving from the use of {3, 1}
for TLS 1.0. (See Appendix A.1.) Note that a client that for TLS 1.0. (See Appendix A.1.) Note that a client that
supports multiple versions of TLS may not know what version will supports multiple versions of TLS may not know what version will
be employed before it receives the ServerHello. See Appendix E be employed before it receives the ServerHello. See Appendix E
for discussion about what record layer version number should be for discussion about what record layer version number should be
employed for ClientHello. employed for ClientHello.
length length
The length (in bytes) of the following TLSPlaintext.fragment. The The length (in bytes) of the following TLSPlaintext.fragment. The
length MUST NOT exceed 2^14. length MUST NOT exceed 2^14.
skipping to change at page 22, line 8 skipping to change at page 20, line 40
traffic analysis countermeasure. traffic analysis countermeasure.
Note: Data of different TLS record layer content types MAY be Note: Data of different TLS record layer content types MAY be
interleaved. Application data is generally of lower precedence for interleaved. Application data is generally of lower precedence for
transmission than other content types. However, records MUST be transmission than other content types. However, records MUST be
delivered to the network in the same order as they are protected by delivered to the network in the same order as they are protected by
the record layer. Recipients MUST receive and process interleaved the record layer. Recipients MUST receive and process interleaved
application layer traffic during handshakes subsequent to the first application layer traffic during handshakes subsequent to the first
one on a connection. one on a connection.
6.2.2. Record Compression and Decompression 6.2.2. Record Payload Protection
All records are compressed using the compression algorithm defined in
the current session state. There is always an active compression
algorithm; however, initially it is defined as
CompressionMethod.null. The compression algorithm translates a
TLSPlaintext structure into a TLSCompressed structure. Compression
functions are initialized with default state information whenever a
connection state is made active. [RFC3749] describes compression
algorithms for TLS.
Compression must be lossless and may not increase the content length
by more than 1024 bytes. If the decompression function encounters a
TLSCompressed.fragment that would decompress to a length in excess of
2^14 bytes, it MUST report a fatal decompression failure error.
struct {
ContentType type; /* same as TLSPlaintext.type */
ProtocolVersion version;/* same as TLSPlaintext.version */
uint16 length;
opaque fragment[TLSCompressed.length];
} TLSCompressed;
length
The length (in bytes) of the following TLSCompressed.fragment.
The length MUST NOT exceed 2^14 + 1024.
fragment
The compressed form of TLSPlaintext.fragment.
Note: A CompressionMethod.null operation is an identity operation; no
fields are altered.
Implementation note: Decompression functions are responsible for
ensuring that messages cannot cause internal buffer overflows.
6.2.3. Record Payload Protection The record protection functions translate a TLSPlaintext structure
into a TLSCiphertext. The deprotection functions reverse the
process. In TLS 1.3 as opposed to previous versions of TLS, all
ciphers are modelled as "Authenticated Encryption with Additional
Data" (AEAD) [RFC5116]. AEAD functions provide a unified encryption
and authentication operation which turns plaintext into authenticated
ciphertext and back again.
The encryption and MAC functions translate a TLSCompressed structure AEAD ciphers take as input a single key, a nonce, a plaintext, and
into a TLSCiphertext. The decryption functions reverse the process. "additional data" to be included in the authentication check, as
The MAC of the record also includes a sequence number so that described in Section 2.1 of [RFC5116]. The key is either the
missing, extra, or repeated messages are detectable. client_write_key or the server_write_key.
struct { struct {
ContentType type; ContentType type;
ProtocolVersion version; ProtocolVersion version;
uint16 length; uint16 length;
select (SecurityParameters.cipher_type) { opaque nonce_explicit[SecurityParameters.record_iv_length];
case stream: GenericStreamCipher; aead-ciphered struct {
case block: GenericBlockCipher; opaque content[TLSPlaintext.length];
case aead: GenericAEADCipher;
} fragment; } fragment;
} TLSCiphertext; } TLSCiphertext;
type type
The type field is identical to TLSCompressed.type. The type field is identical to TLSPlaintext.type.
version version
The version field is identical to TLSCompressed.version. The version field is identical to TLSPlaintext.version.
length length
The length (in bytes) of the following TLSCiphertext.fragment. The length (in bytes) of the following TLSCiphertext.fragment.
The length MUST NOT exceed 2^14 + 2048. The length MUST NOT exceed 2^14 + 2048.
fragment fragment
The encrypted form of TLSCompressed.fragment, with the MAC. The AEAD encrypted form of TLSPlaintext.fragment.
6.2.3.1. Null or Standard Stream Cipher
Stream ciphers (including BulkCipherAlgorithm.null; see Appendix A.6)
convert TLSCompressed.fragment structures to and from stream
TLSCiphertext.fragment structures.
stream-ciphered struct {
opaque content[TLSCompressed.length];
opaque MAC[SecurityParameters.mac_length];
} GenericStreamCipher;
The MAC is generated as:
MAC(MAC_write_key, seq_num +
TLSCompressed.type +
TLSCompressed.version +
TLSCompressed.length +
TLSCompressed.fragment);
where "+" denotes concatenation.
seq_num
The sequence number for this record.
MAC
The MAC algorithm specified by SecurityParameters.mac_algorithm.
Note that the MAC is computed before encryption. The stream cipher
encrypts the entire block, including the MAC. For stream ciphers
that do not use a synchronization vector (such as RC4), the stream
cipher state from the end of one record is simply used on the
subsequent packet. If the cipher suite is TLS_NULL_WITH_NULL_NULL,
encryption consists of the identity operation (i.e., the data is not
encrypted, and the MAC size is zero, implying that no MAC is used).
For both null and stream ciphers, TLSCiphertext.length is
TLSCompressed.length plus SecurityParameters.mac_length.
6.2.3.2. CBC Block Cipher
For block ciphers (such as 3DES or AES), the encryption and MAC
functions convert TLSCompressed.fragment structures to and from block
TLSCiphertext.fragment structures.
struct {
opaque IV[SecurityParameters.record_iv_length];
block-ciphered struct {
opaque content[TLSCompressed.length];
opaque MAC[SecurityParameters.mac_length];
uint8 padding[GenericBlockCipher.padding_length];
uint8 padding_length;
};
} GenericBlockCipher;
The MAC is generated as described in Section 6.2.3.1.
IV
The Initialization Vector (IV) SHOULD be chosen at random, and
MUST be unpredictable. Note that in versions of TLS prior to 1.1,
there was no IV field, and the last ciphertext block of the
previous record (the "CBC residue") was used as the IV. This was
changed to prevent the attacks described in [CBCATT]. For block
ciphers, the IV length is of length
SecurityParameters.record_iv_length, which is equal to the
SecurityParameters.block_size.
padding
Padding that is added to force the length of the plaintext to be
an integral multiple of the block cipher's block length. The
padding MAY be any length up to 255 bytes, as long as it results
in the TLSCiphertext.length being an integral multiple of the
block length. Lengths longer than necessary might be desirable to
frustrate attacks on a protocol that are based on analysis of the
lengths of exchanged messages. Each uint8 in the padding data
vector MUST be filled with the padding length value. The receiver
MUST check this padding and MUST use the bad_record_mac alert to
indicate padding errors.
padding_length
The padding length MUST be such that the total size of the
GenericBlockCipher structure is a multiple of the cipher's block
length. Legal values range from zero to 255, inclusive. This
length specifies the length of the padding field exclusive of the
padding_length field itself.
The encrypted data length (TLSCiphertext.length) is one more than the
sum of SecurityParameters.block_length, TLSCompressed.length,
SecurityParameters.mac_length, and padding_length.
Example: If the block length is 8 bytes, the content length
(TLSCompressed.length) is 61 bytes, and the MAC length is 20 bytes,
then the length before padding is 82 bytes (this does not include the
IV. Thus, the padding length modulo 8 must be equal to 6 in order to
make the total length an even multiple of 8 bytes (the block length).
The padding length can be 6, 14, 22, and so on, through 254. If the
padding length were the minimum necessary, 6, the padding would be 6
bytes, each containing the value 6. Thus, the last 8 octets of the
GenericBlockCipher before block encryption would be xx 06 06 06 06 06
06 06, where xx is the last octet of the MAC.
Note: With block ciphers in CBC mode (Cipher Block Chaining), it is
critical that the entire plaintext of the record be known before any
ciphertext is transmitted. Otherwise, it is possible for the
attacker to mount the attack described in [CBCATT].
Implementation note: Canvel et al. [CBCTIME] have demonstrated a
timing attack on CBC padding based on the time required to compute
the MAC. In order to defend against this attack, implementations
MUST ensure that record processing time is essentially the same
whether or not the padding is correct. In general, the best way to
do this is to compute the MAC even if the padding is incorrect, and
only then reject the packet. For instance, if the pad appears to be
incorrect, the implementation might assume a zero-length pad and then
compute the MAC. This leaves a small timing channel, since MAC
performance depends to some extent on the size of the data fragment,
but it is not believed to be large enough to be exploitable, due to
the large block size of existing MACs and the small size of the
timing signal.
6.2.3.3. AEAD Ciphers
For AEAD [RFC5116] ciphers (such as [CCM] or [GCM]), the AEAD
function converts TLSCompressed.fragment structures to and from AEAD
TLSCiphertext.fragment structures.
struct {
opaque nonce_explicit[SecurityParameters.record_iv_length];
aead-ciphered struct {
opaque content[TLSCompressed.length];
};
} GenericAEADCipher;
AEAD ciphers take as input a single key, a nonce, a plaintext, and
"additional data" to be included in the authentication check, as
described in Section 2.1 of [RFC5116]. The key is either the
client_write_key or the server_write_key. No MAC key is used.
Each AEAD cipher suite MUST specify how the nonce supplied to the Each AEAD cipher suite MUST specify how the nonce supplied to the
AEAD operation is constructed, and what is the length of the AEAD operation is constructed, and what is the length of the
GenericAEADCipher.nonce_explicit part. In many cases, it is TLSCiphertext.nonce_explicit part. In many cases, it is appropriate
appropriate to use the partially implicit nonce technique described to use the partially implicit nonce technique described in Section
in Section 3.2.1 of [RFC5116]; with record_iv_length being the length 3.2.1 of [RFC5116]; with record_iv_length being the length of the
of the explicit part. In this case, the implicit part SHOULD be explicit part. In this case, the implicit part SHOULD be derived
derived from key_block as client_write_iv and server_write_iv (as from key_block as client_write_iv and server_write_iv (as described
described in Section 6.3), and the explicit part is included in in Section 6.3), and the explicit part is included in
GenericAEAEDCipher.nonce_explicit. GenericAEAEDCipher.nonce_explicit.
The plaintext is the TLSCompressed.fragment. The plaintext is the TLSPlaintext.fragment.
The additional authenticated data, which we denote as The additional authenticated data, which we denote as
additional_data, is defined as follows: additional_data, is defined as follows:
additional_data = seq_num + TLSCompressed.type + additional_data = seq_num + TLSPlaintext.type +
TLSCompressed.version + TLSCompressed.length; TLSPlaintext.version + TLSPlaintext.length;
[[OPEN ISSUE: Fix length which gives us a problem here for algorithms
which pad. See: https://github.com/tlswg/tls13-spec/issues/47]]
where "+" denotes concatenation. where "+" denotes concatenation.
The aead_output consists of the ciphertext output by the AEAD The AEAD output consists of the ciphertext output by the AEAD
encryption operation. The length will generally be larger than encryption operation. The length will generally be larger than
TLSCompressed.length, but by an amount that varies with the AEAD TLSPlaintext.length, but by an amount that varies with the AEAD
cipher. Since the ciphers might incorporate padding, the amount of cipher. Since the ciphers might incorporate padding, the amount of
overhead could vary with different TLSCompressed.length values. Each overhead could vary with different TLSPlaintext.length values. Each
AEAD cipher MUST NOT produce an expansion of greater than 1024 bytes. AEAD cipher MUST NOT produce an expansion of greater than 1024 bytes.
Symbolically, Symbolically,
AEADEncrypted = AEAD-Encrypt(write_key, nonce, plaintext, AEADEncrypted = AEAD-Encrypt(write_key, nonce, plaintext,
additional_data) additional_data)
[[OPEN ISSUE: Reduce these values?
https://github.com/tlswg/tls13-spec/issues/55]]
In order to decrypt and verify, the cipher takes as input the key, In order to decrypt and verify, the cipher takes as input the key,
nonce, the "additional_data", and the AEADEncrypted value. The nonce, the "additional_data", and the AEADEncrypted value. The
output is either the plaintext or an error indicating that the output is either the plaintext or an error indicating that the
decryption failed. There is no separate integrity check. That is: decryption failed. There is no separate integrity check. That is:
TLSCompressed.fragment = AEAD-Decrypt(write_key, nonce, TLSPlaintext.fragment = AEAD-Decrypt(write_key, nonce,
AEADEncrypted, AEADEncrypted,
additional_data) additional_data)
If the decryption fails, a fatal bad_record_mac alert MUST be If the decryption fails, a fatal bad_record_mac alert MUST be
generated. generated.
As a special case, we define the NULL_NULL AEAD cipher which is
simply the identity operation and thus provides no security. This
cipher MUST ONLY be used with the initial TLS_NULL_WITH_NULL_NULL
cipher suite.
6.3. Key Calculation 6.3. Key Calculation
The Record Protocol requires an algorithm to generate keys required [[OPEN ISSUE: This may be revised. See
by the current connection state (see Appendix A.6) from the security https://github.com/tlswg/tls13-spec/issues/5]] The Record Protocol
parameters provided by the handshake protocol. requires an algorithm to generate keys required by the current
connection state (see Appendix A.6) from the security parameters
provided by the handshake protocol.
The master secret is expanded into a sequence of secure bytes, which The master secret is expanded into a sequence of secure bytes, which
is then split to a client write MAC key, a server write MAC key, a is then split to a client write encryption key and a server write
client write encryption key, and a server write encryption key. Each encryption key. Each of these is generated from the byte sequence in
of these is generated from the byte sequence in that order. Unused that order. Unused values are empty. Some ciphers may additionally
values are empty. Some AEAD ciphers may additionally require a require a client write IV and a server write IV.
client write IV and a server write IV (see Section 6.2.3.3).
When keys and MAC keys are generated, the master secret is used as an When keys are generated, the master secret is used as an entropy
entropy source. source.
To generate the key material, compute To generate the key material, compute
key_block = PRF(SecurityParameters.master_secret, key_block = PRF(SecurityParameters.master_secret,
"key expansion", "key expansion",
SecurityParameters.server_random + SecurityParameters.server_random +
SecurityParameters.client_random); SecurityParameters.client_random);
until enough output has been generated. Then, the key_block is until enough output has been generated. Then, the key_block is
partitioned as follows: partitioned as follows:
client_write_MAC_key[SecurityParameters.mac_key_length]
server_write_MAC_key[SecurityParameters.mac_key_length]
client_write_key[SecurityParameters.enc_key_length] client_write_key[SecurityParameters.enc_key_length]
server_write_key[SecurityParameters.enc_key_length] server_write_key[SecurityParameters.enc_key_length]
client_write_IV[SecurityParameters.fixed_iv_length] client_write_IV[SecurityParameters.fixed_iv_length]
server_write_IV[SecurityParameters.fixed_iv_length] server_write_IV[SecurityParameters.fixed_iv_length]
Currently, the client_write_IV and server_write_IV are only generated Currently, the client_write_IV and server_write_IV are only generated
for implicit nonce techniques as described in Section 3.2.1 of for implicit nonce techniques as described in Section 3.2.1 of
[RFC5116]. [RFC5116].
Implementation note: The currently defined cipher suite which
requires the most material is AES_256_CBC_SHA256. It requires 2 x 32
byte keys and 2 x 32 byte MAC keys, for a total 128 bytes of key
material.
7. The TLS Handshaking Protocols 7. The TLS Handshaking Protocols
TLS has three subprotocols that are used to allow peers to agree upon TLS has three subprotocols that are used to allow peers to agree upon
security parameters for the record layer, to authenticate themselves, security parameters for the record layer, to authenticate themselves,
to instantiate negotiated security parameters, and to report error to instantiate negotiated security parameters, and to report error
conditions to each other. conditions to each other.
The Handshake Protocol is responsible for negotiating a session, The Handshake Protocol is responsible for negotiating a session,
which consists of the following items: which consists of the following items:
session identifier session identifier
An arbitrary byte sequence chosen by the server to identify an An arbitrary byte sequence chosen by the server to identify an
active or resumable session state. active or resumable session state.
peer certificate peer certificate
X509v3 [RFC3280] certificate of the peer. This element of the X509v3 [RFC3280] certificate of the peer. This element of the
state may be null. state may be null.
compression method
The algorithm used to compress data prior to encryption.
cipher spec cipher spec
Specifies the pseudorandom function (PRF) used to generate keying Specifies the authentication and key establishment algorithms, the
material, the bulk data encryption algorithm (such as null, AES, pseudorandom function (PRF) used to generate keying material, and
etc.) and the MAC algorithm (such as HMAC-SHA1). It also defines the record protection algorithm (See Appendix A.6 for formal
cryptographic attributes such as the mac_length. (See definition.)
Appendix A.6 for formal definition.)
master secret master secret
48-byte secret shared between the client and server. 48-byte secret shared between the client and server.
is resumable is resumable
A flag indicating whether the session can be used to initiate new A flag indicating whether the session can be used to initiate new
connections. connections.
These items are then used to create security parameters for use by These items are then used to create security parameters for use by
the record layer when protecting application data. Many connections the record layer when protecting application data. Many connections
can be instantiated using the same session through the resumption can be instantiated using the same session through the resumption
feature of the TLS Handshake Protocol. feature of the TLS Handshake Protocol.
7.1. Change Cipher Spec Protocol 7.1. Change Cipher Spec Protocol
The change cipher spec protocol exists to signal transitions in The change cipher spec protocol exists to signal transitions in
ciphering strategies. The protocol consists of a single message, ciphering strategies. The protocol consists of a single message,
which is encrypted and compressed under the current (not the pending) which is encrypted under the current (not the pending) connection
connection state. The message consists of a single byte of value 1. state. The message consists of a single byte of value 1.
struct { struct {
enum { change_cipher_spec(1), (255) } type; enum { change_cipher_spec(1), (255) } type;
} ChangeCipherSpec; } ChangeCipherSpec;
The ChangeCipherSpec message is sent by both the client and the The ChangeCipherSpec message is sent by both the client and the
server to notify the receiving party that subsequent records will be server to notify the receiving party that subsequent records will be
protected under the newly negotiated CipherSpec and keys. Reception protected under the newly negotiated CipherSpec and keys. Reception
of this message causes the receiver to instruct the record layer to of this message causes the receiver to instruct the record layer to
immediately copy the read pending state into the read current state. immediately copy the read pending state into the read current state.
Immediately after sending this message, the sender MUST instruct the Immediately after sending this message, the sender MUST instruct the
record layer to make the write pending state the write active state. record layer to make the write pending state the write current state.
(See Section 6.1.) The ChangeCipherSpec message is sent during the (See Section 6.1.) The ChangeCipherSpec message is sent during the
handshake after the security parameters have been agreed upon, but handshake after the security parameters have been agreed upon, but
before the verifying Finished message is sent. before the first message protected with a new CipherSpec is sent.
Note: If a rehandshake occurs while data is flowing on a connection, Note: If a rehandshake occurs while data is flowing on a connection,
the communicating parties may continue to send data using the old the communicating parties may continue to send data using the old
CipherSpec. However, once the ChangeCipherSpec has been sent, the CipherSpec. However, once the ChangeCipherSpec has been sent, the
new CipherSpec MUST be used. The first side to send the new CipherSpec MUST be used. The first side to send the
ChangeCipherSpec does not know that the other side has finished ChangeCipherSpec does not know that the other side has finished
computing the new keying material (e.g., if it has to perform a time- computing the new keying material (e.g., if it has to perform a time-
consuming public key operation). Thus, a small window of time, consuming public key operation). Thus, a small window of time,
during which the recipient must buffer the data, MAY exist. In during which the recipient must buffer the data, MAY exist. In
practice, with modern machines this interval is likely to be fairly practice, with modern machines this interval is likely to be fairly
short. short. [[TODO: This text seems confusing.]]
7.2. Alert Protocol 7.2. Alert Protocol
One of the content types supported by the TLS record layer is the One of the content types supported by the TLS record layer is the
alert type. Alert messages convey the severity of the message alert type. Alert messages convey the severity of the message
(warning or fatal) and a description of the alert. Alert messages (warning or fatal) and a description of the alert. Alert messages
with a level of fatal result in the immediate termination of the with a level of fatal result in the immediate termination of the
connection. In this case, other connections corresponding to the connection. In this case, other connections corresponding to the
session may continue, but the session identifier MUST be invalidated, session may continue, but the session identifier MUST be invalidated,
preventing the failed session from being used to establish new preventing the failed session from being used to establish new
connections. Like other messages, alert messages are encrypted and connections. Like other messages, alert messages are encrypted as
compressed, as specified by the current connection state. specified by the current connection state.
enum { warning(1), fatal(2), (255) } AlertLevel; enum { warning(1), fatal(2), (255) } AlertLevel;
enum { enum {
close_notify(0), close_notify(0),
unexpected_message(10), unexpected_message(10),
bad_record_mac(20), bad_record_mac(20),
decryption_failed_RESERVED(21), decryption_failed_RESERVED(21),
record_overflow(22), record_overflow(22),
decompression_failure(30), decompression_failure_RESERVED(30),
handshake_failure(40), handshake_failure(40),
no_certificate_RESERVED(41), no_certificate_RESERVED(41),
bad_certificate(42), bad_certificate(42),
unsupported_certificate(43), unsupported_certificate(43),
certificate_revoked(44), certificate_revoked(44),
certificate_expired(45), certificate_expired(45),
certificate_unknown(46), certificate_unknown(46),
illegal_parameter(47), illegal_parameter(47),
unknown_ca(48), unknown_ca(48),
access_denied(49), access_denied(49),
skipping to change at page 32, line 22 skipping to change at page 27, line 29
certificate_expired alert. certificate_expired alert.
The following error alerts are defined: The following error alerts are defined:
unexpected_message unexpected_message
An inappropriate message was received. This alert is always fatal An inappropriate message was received. This alert is always fatal
and should never be observed in communication between proper and should never be observed in communication between proper
implementations. implementations.
bad_record_mac bad_record_mac
This alert is returned if a record is received with an incorrect This alert is returned if a record is received which cannot be
MAC. This alert also MUST be returned if an alert is sent because deprotected. Because AEAD algorithms combine decryption and
a TLSCiphertext decrypted in an invalid way: either it wasn't an verification, this message is used for all deprotection failures.
even multiple of the block length, or its padding values, when This message is always fatal and should never be observed in
checked, weren't correct. This message is always fatal and should communication between proper implementations (except when messages
never be observed in communication between proper implementations were corrupted in the network).
(except when messages were corrupted in the network).
decryption_failed_RESERVED decryption_failed_RESERVED
This alert was used in some earlier versions of TLS, and may have This alert was used in some earlier versions of TLS, and may have
permitted certain attacks against the CBC mode [CBCATT]. It MUST permitted certain attacks against the CBC mode [CBCATT]. It MUST
NOT be sent by compliant implementations. NOT be sent by compliant implementations.
record_overflow record_overflow
A TLSCiphertext record was received that had a length more than A TLSCiphertext record was received that had a length more than
2^14+2048 bytes, or a record decrypted to a TLSCompressed record 2^14+2048 bytes, or a record decrypted to a TLSPlaintext record
with more than 2^14+1024 bytes. This message is always fatal and with more than 2^14 bytes. This message is always fatal and
should never be observed in communication between proper should never be observed in communication between proper
implementations (except when messages were corrupted in the implementations (except when messages were corrupted in the
network). network).
decompression_failure decompression_failure
The decompression function received improper input (e.g., data This alert was used in previous versions of TLS. TLS 1.3 does not
that would expand to excessive length). This message is always include compression and TLS 1.3 implementations MUST NOT send this
fatal and should never be observed in communication between proper alert when in TLS 1.3 mode.
implementations.
handshake_failure handshake_failure
Reception of a handshake_failure alert message indicates that the Reception of a handshake_failure alert message indicates that the
sender was unable to negotiate an acceptable set of security sender was unable to negotiate an acceptable set of security
parameters given the options available. This is a fatal error. parameters given the options available. This is a fatal error.
no_certificate_RESERVED no_certificate_RESERVED
This alert was used in SSLv3 but not any version of TLS. It MUST This alert was used in SSLv3 but not any version of TLS. It MUST
NOT be sent by compliant implementations. NOT be sent by compliant implementations.
skipping to change at page 35, line 23 skipping to change at page 30, line 27
The cryptographic parameters of the session state are produced by the The cryptographic parameters of the session state are produced by the
TLS Handshake Protocol, which operates on top of the TLS record TLS Handshake Protocol, which operates on top of the TLS record
layer. When a TLS client and server first start communicating, they layer. When a TLS client and server first start communicating, they
agree on a protocol version, select cryptographic algorithms, agree on a protocol version, select cryptographic algorithms,
optionally authenticate each other, and use public-key encryption optionally authenticate each other, and use public-key encryption
techniques to generate shared secrets. techniques to generate shared secrets.
The TLS Handshake Protocol involves the following steps: The TLS Handshake Protocol involves the following steps:
- Exchange hello messages to agree on algorithms, exchange random - Exchange hello messages to agree on a protocol version,
values, and check for session resumption. algorithms, exchange random values, and check for session
resumption.
- Exchange the necessary cryptographic parameters to allow the - Exchange the necessary cryptographic parameters to allow the
client and server to agree on a premaster secret. client and server to agree on a premaster secret.
- Exchange certificates and cryptographic information to allow the - Exchange certificates and cryptographic information to allow the
client and server to authenticate themselves. client and server to authenticate themselves.
- Generate a master secret from the premaster secret and exchanged - Generate a master secret from the premaster secret and exchanged
random values. random values.
skipping to change at page 36, line 4 skipping to change at page 31, line 10
peers. There are a number of ways in which a man-in-the-middle peers. There are a number of ways in which a man-in-the-middle
attacker can attempt to make two entities drop down to the least attacker can attempt to make two entities drop down to the least
secure method they support. The protocol has been designed to secure method they support. The protocol has been designed to
minimize this risk, but there are still attacks available: for minimize this risk, but there are still attacks available: for
example, an attacker could block access to the port a secure service example, an attacker could block access to the port a secure service
runs on, or attempt to get the peers to negotiate an unauthenticated runs on, or attempt to get the peers to negotiate an unauthenticated
connection. The fundamental rule is that higher levels must be connection. The fundamental rule is that higher levels must be
cognizant of what their security requirements are and never transmit cognizant of what their security requirements are and never transmit
information over a channel less secure than what they require. The information over a channel less secure than what they require. The
TLS protocol is secure in that any cipher suite offers its promised TLS protocol is secure in that any cipher suite offers its promised
level of security: if you negotiate 3DES with a 1024-bit RSA key level of security: if you negotiate AES-GCM [GCM] with a 1024-bit DHE
exchange with a host whose certificate you have verified, you can key exchange with a host whose certificate you have verified, you can
expect to be that secure. expect to be that secure.
These goals are achieved by the handshake protocol, which can be These goals are achieved by the handshake protocol, which can be
summarized as follows: The client sends a ClientHello message to summarized as follows: The client sends a ClientHello message which
which the server must respond with a ServerHello message, or else a contains a random nonce (ClientHello.random), its preferences for
fatal error will occur and the connection will fail. The ClientHello Protocol Version, Cipher Suite, and a variety of extensions. In the
and ServerHello are used to establish security enhancement same flight, it sends a ClientKeyExchange message which contains its
capabilities between client and server. The ClientHello and share of the parameters for key agreement for some set of expected
ServerHello establish the following attributes: Protocol Version, server parameters (DHE/ECDHE groups, etc.).
Session ID, Cipher Suite, and Compression Method. Additionally, two
random values are generated and exchanged: ClientHello.random and
ServerHello.random.
The actual key exchange uses up to four messages: the server The server responds to the ClientHello with a ServerHello message, or
Certificate, the ServerKeyExchange, the client Certificate, and the else a fatal error will occur and the connection will fail. The
ClientKeyExchange. New key exchange methods can be created by ServerHello contains the server's nonce (ServerHello.random), the
specifying a format for these messages and by defining the use of the server's choice of the Protocol Version, Session ID and Cipher Suite,
messages to allow the client and server to agree upon a shared and the server's response to the extensions the client offered.
secret. This secret MUST be quite long; currently defined key
exchange methods exchange secrets that range from 46 bytes upwards.
Following the hello messages, the server will send its certificate in If the client has provided a ClientKeyExchange with an appropriate
a Certificate message if it is to be authenticated. Additionally, a set of keying material, the server can then generate its own keying
ServerKeyExchange message may be sent, if it is required (e.g., if material share and send a ServerKeyExchange message which contains
the server has no certificate, or if its certificate is for signing its share of the parameters for the key agreement. The server can
only). If the server is authenticated, it may request a certificate now compute the shared secret. At this point, a ChangeCipherSpec
from the client, if that is appropriate to the cipher suite selected. message is sent by the server, and the server copies the pending
Next, the server will send the ServerHelloDone message, indicating Cipher Spec into the current Cipher Spec. The remainder of the
that the hello-message phase of the handshake is complete. The server's handshake messages will be encrypted under that Cipher Spec.
server will then wait for a client response. If the server has sent
a CertificateRequest message, the client MUST send the Certificate
message. The ClientKeyExchange message is now sent, and the content
of that message will depend on the public key algorithm selected
between the ClientHello and the ServerHello. If the client has sent
a certificate with signing ability, a digitally-signed
CertificateVerify message is sent to explicitly verify possession of
the private key in the certificate.
At this point, a ChangeCipherSpec message is sent by the client, and Following these messages, the server will send an EncryptedExtensions
the client copies the pending Cipher Spec into the current Cipher message which contains a response to any client's extensions which
Spec. The client then immediately sends the Finished message under are not necessary to establish the Cipher Suite. The server will
the new algorithms, keys, and secrets. In response, the server will then send its certificate in a Certificate message if it is to be
send its own ChangeCipherSpec message, transfer the pending to the authenticated. The server may optionally request a certificate from
current Cipher Spec, and send its Finished message under the new the client by sending a CertificateRequest message at this point.
Cipher Spec. At this point, the handshake is complete, and the Finally, if the server is authenticated, it will send a
client and server may begin to exchange application layer data. (See CertificateVerify message which provides a signature over the entire
flow chart below.) Application data MUST NOT be sent prior to the handshake up to this point. This serves both to authenticate the
completion of the first handshake (before a cipher suite other than server and to establish the integrity of the negotiation. Finally,
TLS_NULL_WITH_NULL_NULL is established). the server sends a Finished message which includes an integrity check
over the handshake keyed by the shared secret and demonstrates that
the server and client have agreed upon the same keys. [[TODO: If the
server is not requesting client authentication, it MAY start sending
application data following the Finished, though the server has no way
of knowing who will be receiving the data. Add this.]]
Client Server Once the client receives the ServerKeyExchange, it can also compute
the shared key. At this point ChangeCipherSpec message is sent by
the client, and the client copies the pending Cipher Spec into the
current Cipher Spec. The remainder of the client's messages will be
encrypted under this Cipher Spec. If the server has sent a
CertificateRequest message, the client MUST send the Certificate
message, though it may contain zero certificates. If the client has
sent a certificate, a digitally-signed CertificateVerify message is
sent to explicitly verify possession of the private key in the
certificate. Finally, the client sends the Finished message. At
this point, the handshake is complete, and the client and server may
exchange application layer data. (See flow chart below.)
Application data MUST NOT be sent prior to the Finished message.
[[TODO: can we make this clearer and more clearly match the text
above about server-side False Start.]] Client Server
ClientHello --------> ClientHello
ClientKeyExchange -------->
ServerHello ServerHello
ServerKeyExchange
[ChangeCipherSpec]
EncryptedExtensions*
Certificate* Certificate*
ServerKeyExchange*
CertificateRequest* CertificateRequest*
<-------- ServerHelloDone CertificateVerify*
<-------- Finished
[ChangeCipherSpec]
Certificate* Certificate*
ClientKeyExchange
CertificateVerify* CertificateVerify*
[ChangeCipherSpec]
Finished --------> Finished -------->
[ChangeCipherSpec]
<-------- Finished
Application Data <-------> Application Data Application Data <-------> Application Data
Figure 1. Message flow for a full handshake Figure 1. Message flow for a full handshake
* Indicates optional or situation-dependent messages that are not * Indicates optional or situation-dependent messages that are not
always sent. always sent.
Note: To help avoid pipeline stalls, ChangeCipherSpec is an Note: To help avoid pipeline stalls, ChangeCipherSpec is an
independent TLS protocol content type, and is not actually a TLS independent TLS protocol content type, and is not actually a TLS
handshake message. handshake message.
If the client has not provided an appropriate ClientKeyExchange (e.g.
it includes only DHE or ECDHE groups unacceptable or unsupported by
the server), the server corrects the mismatch with the ServerHello
(which the client can detect by comparing the selected cipher suite
and parameters with the ClientKeyExchange it offered) and the client
will need to restart the handshake with an appropriate
ClientKeyExchange, as shown in Figure 2:
Client Server
ClientHello
ClientKeyExchange -------->
<-------- ServerHello
ClientHello
ClientKeyExchange -------->
ServerHello
ServerKeyExchange
[ChangeCipherSpec]
EncryptedExtensions*
Certificate*
CertificateRequest*
CertificateVerify*
<-------- Finished
[ChangeCipherSpec]
Certificate*
CertificateVerify*
Finished -------->
Application Data <-------> Application Data
Figure 2. Message flow for a full handshake with mismatched
parameters
[[OPEN ISSUE: Do we restart the handshake hash?]] [[OPEN ISSUE: We
need to make sure that this flow doesn't introduce downgrade issues.
Potential options include continuing the handshake hashes (as long as
clients don't change their opinion of the server's capabilities with
aborted handshakes) and requiring the client to send the same
ClientHello (as is currently done) and then checking you get the same
negotiated parameters.]]
When the client and server decide to resume a previous session or When the client and server decide to resume a previous session or
duplicate an existing session (instead of negotiating new security duplicate an existing session (instead of negotiating new security
parameters), the message flow is as follows: parameters), the message flow is as follows:
The client sends a ClientHello using the Session ID of the session to The client sends a ClientHello using the Session ID of the session to
be resumed. The server then checks its session cache for a match. be resumed. The server then checks its session cache for a match.
If a match is found, and the server is willing to re-establish the If a match is found, and the server is willing to re-establish the
connection under the specified session state, it will send a connection under the specified session state, it will send a
ServerHello with the same Session ID value. At this point, both ServerHello with the same Session ID value. At this point, both
client and server MUST send ChangeCipherSpec messages and proceed client and server MUST send ChangeCipherSpec messages and proceed
directly to Finished messages. Once the re-establishment is directly to Finished messages. Once the re-establishment is
complete, the client and server MAY begin to exchange application complete, the client and server MAY begin to exchange application
layer data. (See flow chart below.) If a Session ID match is not layer data. (See flow chart below.) If a Session ID match is not
found, the server generates a new session ID, and the TLS client and found, the server generates a new session ID, and the TLS client and
server perform a full handshake. server perform a full handshake.
Client Server Client Server
ClientHello --------> ClientHello
ClientKeyExhange -------->
ServerHello ServerHello
[ChangeCipherSpec] [ChangeCipherSpec]
<-------- Finished <-------- Finished
[ChangeCipherSpec] [ChangeCipherSpec]
Finished --------> Finished -------->
Application Data <-------> Application Data Application Data <-------> Application Data
Figure 2. Message flow for an abbreviated handshake Figure 3. Message flow for an abbreviated handshake
The contents and significance of each message will be presented in The contents and significance of each message will be presented in
detail in the following sections. detail in the following sections.
7.4. Handshake Protocol 7.4. Handshake Protocol
The TLS Handshake Protocol is one of the defined higher-level clients The TLS Handshake Protocol is one of the defined higher-level clients
of the TLS Record Protocol. This protocol is used to negotiate the of the TLS Record Protocol. This protocol is used to negotiate the
secure attributes of a session. Handshake messages are supplied to secure attributes of a session. Handshake messages are supplied to
the TLS record layer, where they are encapsulated within one or more the TLS record layer, where they are encapsulated within one or more
TLSPlaintext structures, which are processed and transmitted as TLSPlaintext structures, which are processed and transmitted as
specified by the current active session state. specified by the current active session state.
enum { enum {
hello_request(0), client_hello(1), server_hello(2), hello_request(0), client_hello(1), server_hello(2),
certificate(11), server_key_exchange (12), certificate(11), server_key_exchange (12),
certificate_request(13), server_hello_done(14), certificate_request(13), certificate_verify(15),
certificate_verify(15), client_key_exchange(16), client_key_exchange(16), finished(20), (255)
finished(20), (255)
} HandshakeType; } HandshakeType;
struct { struct {
HandshakeType msg_type; /* handshake type */ HandshakeType msg_type; /* handshake type */
uint24 length; /* bytes in message */ uint24 length; /* bytes in message */
select (HandshakeType) { select (HandshakeType) {
case hello_request: HelloRequest; case hello_request: HelloRequest;
case client_hello: ClientHello; case client_hello: ClientHello;
case client_key_exchange: ClientKeyExchange;
case server_hello: ServerHello; case server_hello: ServerHello;
case certificate: Certificate;
case server_key_exchange: ServerKeyExchange; case server_key_exchange: ServerKeyExchange;
case certificate: Certificate;
case certificate_request: CertificateRequest; case certificate_request: CertificateRequest;
case server_hello_done: ServerHelloDone;
case certificate_verify: CertificateVerify; case certificate_verify: CertificateVerify;
case client_key_exchange: ClientKeyExchange;
case finished: Finished; case finished: Finished;
} body; } body;
} Handshake; } Handshake;
The handshake protocol messages are presented below in the order they The handshake protocol messages are presented below in the order they
MUST be sent; sending handshake messages in an unexpected order MUST be sent; sending handshake messages in an unexpected order
results in a fatal error. Unneeded handshake messages can be results in a fatal error. Unneeded handshake messages can be
omitted, however. Note one exception to the ordering: the omitted, however. The one message that is not bound by these
Certificate message is used twice in the handshake (from server to ordering rules is the HelloRequest message, which can be sent at any
client, then from client to server), but described only in its first time, but which SHOULD be ignored by the client if it arrives in the
position. The one message that is not bound by these ordering rules middle of a handshake.
is the HelloRequest message, which can be sent at any time, but which
SHOULD be ignored by the client if it arrives in the middle of a
handshake.
New handshake message types are assigned by IANA as described in New handshake message types are assigned by IANA as described in
Section 12. Section 12.
7.4.1. Hello Messages 7.4.1. Hello Messages
The hello phase messages are used to exchange security enhancement The hello phase messages are used to exchange security enhancement
capabilities between the client and server. When a new session capabilities between the client and server. When a new session
begins, the record layer's connection state encryption, hash, and begins, the record layer's connection state AEAD algorithm is
compression algorithms are initialized to null. The current initialized to NULL_NULL. The current connection state is used for
connection state is used for renegotiation messages. renegotiation messages.
7.4.1.1. Hello Request 7.4.1.1. Hello Request
When this message will be sent: When this message will be sent:
The HelloRequest message MAY be sent by the server at any time. The HelloRequest message MAY be sent by the server at any time.
Meaning of this message: Meaning of this message:
HelloRequest is a simple notification that the client should begin HelloRequest is a simple notification that the client should begin
skipping to change at page 40, line 24 skipping to change at page 36, line 47
and the certificate verify message. and the certificate verify message.
7.4.1.2. Client Hello 7.4.1.2. Client Hello
When this message will be sent: When this message will be sent:
When a client first connects to a server, it is required to send When a client first connects to a server, it is required to send
the ClientHello as its first message. The client can also send a the ClientHello as its first message. The client can also send a
ClientHello in response to a HelloRequest or on its own initiative ClientHello in response to a HelloRequest or on its own initiative
in order to renegotiate the security parameters in an existing in order to renegotiate the security parameters in an existing
connection. connection. Finally, the client will send a ClientHello when the
server has responded to its ClientHello with a ServerHello that
selects cryptographic parameters that don't match the client's
ClientKeyExchange. In that case, the client MUST send the same
ClientHello (without modification) along with the new
ClientKeyExchange.
Structure of this message: Structure of this message:
The ClientHello message includes a random structure, which is used The ClientHello message includes a random structure, which is used
later in the protocol. later in the protocol.
struct { struct {
uint32 gmt_unix_time; uint32 gmt_unix_time;
opaque random_bytes[28]; opaque random_bytes[28];
} Random; } Random;
skipping to change at page 41, line 18 skipping to change at page 37, line 45
connections without repeating the full handshake protocol. These connections without repeating the full handshake protocol. These
independent connections may occur sequentially or simultaneously; a independent connections may occur sequentially or simultaneously; a
SessionID becomes valid when the handshake negotiating it completes SessionID becomes valid when the handshake negotiating it completes
with the exchange of Finished messages and persists until it is with the exchange of Finished messages and persists until it is
removed due to aging or because a fatal error was encountered on a removed due to aging or because a fatal error was encountered on a
connection associated with the session. The actual contents of the connection associated with the session. The actual contents of the
SessionID are defined by the server. SessionID are defined by the server.
opaque SessionID<0..32>; opaque SessionID<0..32>;
Warning: Because the SessionID is transmitted without encryption or Warning: Because the SessionID is transmitted without confidentiality
immediate MAC protection, servers MUST NOT place confidential or integrity protection, servers MUST NOT place confidential
information in session identifiers or let the contents of fake information in session identifiers or let the contents of fake
session identifiers cause any breach of security. (Note that the session identifiers cause any breach of security. (Note that the
content of the handshake as a whole, including the SessionID, is content of the handshake as a whole, including the SessionID, is
protected by the Finished messages exchanged at the end of the protected by the Finished messages exchanged at the end of the
handshake.) handshake.)
The cipher suite list, passed from the client to the server in the The cipher suite list, passed from the client to the server in the
ClientHello message, contains the combinations of cryptographic ClientHello message, contains the combinations of cryptographic
algorithms supported by the client in order of the client's algorithms supported by the client in order of the client's
preference (favorite choice first). Each cipher suite defines a key preference (favorite choice first). Each cipher suite defines a key
exchange algorithm, a bulk encryption algorithm (including secret key exchange algorithm, a record protection algorithm (including secret
length), a MAC algorithm, and a PRF. The server will select a cipher key length) and a PRF. The server will select a cipher suite or, if
suite or, if no acceptable choices are presented, return a handshake no acceptable choices are presented, return a handshake failure alert
failure alert and close the connection. If the list contains cipher and close the connection. If the list contains cipher suites the
suites the server does not recognize, support, or wish to use, the server does not recognize, support, or wish to use, the server MUST
server MUST ignore those cipher suites, and process the remaining ignore those cipher suites, and process the remaining ones as usual.
ones as usual.
uint8 CipherSuite[2]; /* Cryptographic suite selector */ uint8 CipherSuite[2]; /* Cryptographic suite selector */
The ClientHello includes a list of compression algorithms supported
by the client, ordered according to the client's preference.
enum { null(0), (255) } CompressionMethod; enum { null(0), (255) } CompressionMethod;
struct { struct {
ProtocolVersion client_version; ProtocolVersion client_version;
Random random; Random random;
SessionID session_id; SessionID session_id;
CipherSuite cipher_suites<2..2^16-2>; CipherSuite cipher_suites<2..2^16-2>;
CompressionMethod compression_methods<1..2^8-1>; CompressionMethod compression_methods<1..2^8-1>;
select (extensions_present) { select (extensions_present) {
case false: case false:
skipping to change at page 42, line 33 skipping to change at page 38, line 45
determining whether there are bytes following the compression_methods determining whether there are bytes following the compression_methods
at the end of the ClientHello. Note that this method of detecting at the end of the ClientHello. Note that this method of detecting
optional data differs from the normal TLS method of having a optional data differs from the normal TLS method of having a
variable-length field, but it is used for compatibility with TLS variable-length field, but it is used for compatibility with TLS
before extensions were defined. before extensions were defined.
client_version client_version
The version of the TLS protocol by which the client wishes to The version of the TLS protocol by which the client wishes to
communicate during this session. This SHOULD be the latest communicate during this session. This SHOULD be the latest
(highest valued) version supported by the client. For this (highest valued) version supported by the client. For this
version of the specification, the version will be 3.3 (see version of the specification, the version will be 3.4 (see
Appendix E for details about backward compatibility). Appendix E for details about backward compatibility).
random random
A client-generated random structure. A client-generated random structure.
session_id session_id
The ID of a session the client wishes to use for this connection. The ID of a session the client wishes to use for this connection.
This field is empty if no session_id is available, or if the This field is empty if no session_id is available, or if the
client wishes to generate new security parameters. client wishes to generate new security parameters.
cipher_suites cipher_suites
This is a list of the cryptographic options supported by the This is a list of the cryptographic options supported by the
client, with the client's first preference first. If the client, with the client's first preference first. If the
session_id field is not empty (implying a session resumption session_id field is not empty (implying a session resumption
request), this vector MUST include at least the cipher_suite from request), this vector MUST include at least the cipher_suite from
that session. Values are defined in Appendix A.5. that session. Values are defined in Appendix A.5.
compression_methods compression_methods
This is a list of the compression methods supported by the client, Versions of TLS before 1.3 supported compression and the list of
sorted by client preference. If the session_id field is not empty compression methods was supplied in this field. For any TLS 1.3
(implying a session resumption request), it MUST include the ClientHello, this field MUST contain only the "null" compression
compression_method from that session. This vector MUST contain, method with the code point of 0. If a TLS 1.3 ClientHello is
and all implementations MUST support, CompressionMethod.null. received with any other value in this field, the server MUST
Thus, a client and server will always be able to agree on a generate a fatal "illegal_parameter" alert. Note that TLS 1.3
compression method. servers may receive TLS 1.2 or prior ClientHellos which contain
other compression methods and MUST follow the procedures for the
appropriate prior version of TLS.
extensions extensions
Clients MAY request extended functionality from servers by sending Clients MAY request extended functionality from servers by sending
data in the extensions field. The actual "Extension" format is data in the extensions field. The actual "Extension" format is
defined in Section 7.4.1.4. defined in Section 7.4.2.3.
In the event that a client requests additional functionality using In the event that a client requests additional functionality using
extensions, and this functionality is not supplied by the server, the extensions, and this functionality is not supplied by the server, the
client MAY abort the handshake. A server MUST accept ClientHello client MAY abort the handshake. A server MUST accept ClientHello
messages both with and without the extensions field, and (as for all messages both with and without the extensions field, and (as for all
other messages) it MUST check that the amount of data in the message other messages) it MUST check that the amount of data in the message
precisely matches one of these formats; if not, then it MUST send a precisely matches one of these formats; if not, then it MUST send a
fatal "decode_error" alert. fatal "decode_error" alert.
After sending the ClientHello message, the client waits for a After sending the ClientHello message, the client waits for a
ServerHello message. Any handshake message returned by the server, ServerHello message. Any handshake message returned by the server,
except for a HelloRequest, is treated as a fatal error. except for a HelloRequest, is treated as a fatal error.
7.4.1.3. Server Hello 7.4.2. Client Key Exchange Message
When this message will be sent:
This message is always sent by the client. It MUST immediately
follow the ClientHello message. In backward compatibility mode
(see Section XXX) it will be included in the EarlyData extension
(Section 7.4.2.3.2) in the ClientHello.
Meaning of this message:
This message contains the client's cryptographic parameters for
zero or more key establishment methods.
Structure of this message:
enum { dhe(1), (255) } KeyExchangeAlgorithm;
struct {
KeyExchangeAlgorithm algorithm;
select (KeyExchangeAlgorithm) {
dhe:
ClientDiffieHellmanParams;
} exchange_keys;
} ClientKeyExchangeOffer;
struct {
ClientKeyExchangeOffer offers<0..2^16-1>;
} ClientKeyExchange;
offers
A list of ClientKeyExchangeOffer values.
[[OPEN ISSUE: Should we rename CKE here?]] Clients may offer an
arbitrary number of ClientKeyExchangeOffer values, each representing
a single set of key agreement parameters; for instance a client might
offer shares for several elliptic curves or multiple integer DH
groups. The shares for each ClientKeyExchangeOffer MUST by generated
independently. Clients MUST NOT offer multiple
ClientKeyExchangeOffers for the same parameters. It is explicitly
permitted to send an empty ClientKeyExchange message, as this is used
to elicit the server's parameters if the client has no useful
information.
[TODO: Recommendation about what the client offers. Presumably which
integer DH groups and which curves.] [TODO: Work out how this
interacts with PSK and SRP.]
7.4.2.1. Client Diffie-Hellman Parameters
When one of the ClientKeyExchangeOffers is a Diffie-Hellman key, the
client SHALL encode it using ClientDiffieHellmanParams. This
structure conveys the client's Diffie-Hellman public value (dh_Yc)
and the group which it is being provided for.
Structure of this message:
struct {
DiscreteLogDHEGroup group; // from draft-gillmor
opaque dh_Yc<1..2^16-1>;
} ClientDiffieHellmanParams;
group
The DHE group to which these parameters correspond.
dh_Yc
The client's Diffie-Hellman public value (g^X mod p).
7.4.2.2. Server Hello
When this message will be sent: When this message will be sent:
The server will send this message in response to a ClientHello The server will send this message in response to a ClientHello
message when it was able to find an acceptable set of algorithms. message when it was able to find an acceptable set of algorithms.
If it cannot find such a match, it will respond with a handshake If it cannot find such a match, it will respond with a handshake
failure alert. failure alert.
Structure of this message: Structure of this message:
struct { struct {
ProtocolVersion server_version; ProtocolVersion server_version;
Random random; Random random;
SessionID session_id; SessionID session_id;
CipherSuite cipher_suite; CipherSuite cipher_suite;
CompressionMethod compression_method;
select (extensions_present) { select (extensions_present) {
case false: case false:
struct {}; struct {};
case true: case true:
Extension extensions<0..2^16-1>; Extension extensions<0..2^16-1>;
}; };
} ServerHello; } ServerHello;
The presence of extensions can be detected by determining whether The presence of extensions can be detected by determining whether
there are bytes following the compression_method field at the end of there are bytes following the cipher_suite field at the end of the
the ServerHello. ServerHello.
server_version server_version
This field will contain the lower of that suggested by the client This field will contain the lower of that suggested by the client
in the client hello and the highest supported by the server. For in the client hello and the highest supported by the server. For
this version of the specification, the version is 3.3. (See this version of the specification, the version is 3.4. (See
Appendix E for details about backward compatibility.) Appendix E for details about backward compatibility.)
random random
This structure is generated by the server and MUST be This structure is generated by the server and MUST be
independently generated from the ClientHello.random. independently generated from the ClientHello.random.
session_id session_id
This is the identity of the session corresponding to this This is the identity of the session corresponding to this
connection. If the ClientHello.session_id was non-empty, the connection. If the ClientHello.session_id was non-empty, the
server will look in its session cache for a match. If a match is server will look in its session cache for a match. If a match is
skipping to change at page 45, line 10 skipping to change at page 42, line 33
that the server resume any session even if it had formerly that the server resume any session even if it had formerly
provided a session_id. Clients MUST be prepared to do a full provided a session_id. Clients MUST be prepared to do a full
negotiation -- including negotiating new cipher suites -- during negotiation -- including negotiating new cipher suites -- during
any handshake. any handshake.
cipher_suite cipher_suite
The single cipher suite selected by the server from the list in The single cipher suite selected by the server from the list in
ClientHello.cipher_suites. For resumed sessions, this field is ClientHello.cipher_suites. For resumed sessions, this field is
the value from the state of the session being resumed. the value from the state of the session being resumed.
compression_method
The single compression algorithm selected by the server from the
list in ClientHello.compression_methods. For resumed sessions,
this field is the value from the resumed session state.
extensions extensions
A list of extensions. Note that only extensions offered by the A list of extensions. Note that only extensions offered by the
client can appear in the server's list. client can appear in the server's list. In TLS 1.3 as opposed to
previous versions of TLS, the server's extensions are split
between the ServerHello and the EncryptedExtensions Section 7.4.4
message. The ServerHello MUST only include extensions which are
required to establish the cryptographic context.
7.4.1.4. Hello Extensions 7.4.2.3. Hello Extensions
The extension format is: The extension format is:
struct { struct {
ExtensionType extension_type; ExtensionType extension_type;
opaque extension_data<0..2^16-1>; opaque extension_data<0..2^16-1>;
} Extension; } Extension;
enum { enum {
signature_algorithms(13), (65535) signature_algorithms(13), early_data(TBD), (65535)
} ExtensionType; } ExtensionType;
Here: Here:
- "extension_type" identifies the particular extension type. - "extension_type" identifies the particular extension type.
- "extension_data" contains information specific to the particular - "extension_data" contains information specific to the particular
extension type. extension type.
The initial set of extensions is defined in a companion document The initial set of extensions is defined in a companion document
skipping to change at page 47, line 14 skipping to change at page 44, line 34
- It would be technically possible to use extensions to change major - It would be technically possible to use extensions to change major
aspects of the design of TLS; for example the design of cipher aspects of the design of TLS; for example the design of cipher
suite negotiation. This is not recommended; it would be more suite negotiation. This is not recommended; it would be more
appropriate to define a new version of TLS -- particularly since appropriate to define a new version of TLS -- particularly since
the TLS handshake algorithms have specific protection against the TLS handshake algorithms have specific protection against
version rollback attacks based on the version number, and the version rollback attacks based on the version number, and the
possibility of version rollback should be a significant possibility of version rollback should be a significant
consideration in any major design change. consideration in any major design change.
7.4.1.4.1. Signature Algorithms 7.4.2.3.1. Signature Algorithms
The client uses the "signature_algorithms" extension to indicate to The client uses the "signature_algorithms" extension to indicate to
the server which signature/hash algorithm pairs may be used in the server which signature/hash algorithm pairs may be used in
digital signatures. The "extension_data" field of this extension digital signatures. The "extension_data" field of this extension
contains a "supported_signature_algorithms" value. contains a "supported_signature_algorithms" value.
enum { enum {
none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5),
sha512(6), (255) sha512(6), (255)
} HashAlgorithm; } HashAlgorithm;
skipping to change at page 48, line 14 skipping to change at page 45, line 45
signature signature
This field indicates the signature algorithm that may be used. This field indicates the signature algorithm that may be used.
The values indicate anonymous signatures, RSASSA-PKCS1-v1_5 The values indicate anonymous signatures, RSASSA-PKCS1-v1_5
[RFC3447] and DSA [DSS], and ECDSA [ECDSA], respectively. The [RFC3447] and DSA [DSS], and ECDSA [ECDSA], respectively. The
"anonymous" value is meaningless in this context but used in "anonymous" value is meaningless in this context but used in
Section 7.4.3. It MUST NOT appear in this extension. Section 7.4.3. It MUST NOT appear in this extension.
The semantics of this extension are somewhat complicated because the The semantics of this extension are somewhat complicated because the
cipher suite indicates permissible signature algorithms but not hash cipher suite indicates permissible signature algorithms but not hash
algorithms. Section 7.4.2 and Section 7.4.3 describe the appropriate algorithms. Section 7.4.5 and Section 7.4.3 describe the appropriate
rules. rules.
If the client supports only the default hash and signature algorithms If the client supports only the default hash and signature algorithms
(listed in this section), it MAY omit the signature_algorithms (listed in this section), it MAY omit the signature_algorithms
extension. If the client does not support the default algorithms, or extension. If the client does not support the default algorithms, or
supports other hash and signature algorithms (and it is willing to supports other hash and signature algorithms (and it is willing to
use them for verifying messages sent by the server, i.e., server use them for verifying messages sent by the server, i.e., server
certificates and server key exchange), it MUST send the certificates and server key exchange), it MUST send the
signature_algorithms extension, listing the algorithms it is willing signature_algorithms extension, listing the algorithms it is willing
to accept. to accept.
If the client does not send the signature_algorithms extension, the If the client does not send the signature_algorithms extension, the
server MUST do the following: server MUST do the following:
- If the negotiated key exchange algorithm is one of (RSA, DHE_RSA, - If the negotiated key exchange algorithm is one of (DHE_RSA,
DH_RSA, RSA_PSK, ECDH_RSA, ECDHE_RSA), behave as if client had ECDHE_RSA), behave as if client had sent the value {sha1,rsa}.
sent the value {sha1,rsa}.
- If the negotiated key exchange algorithm is one of (DHE_DSS, - If the negotiated key exchange algorithm is DHE_DSS, behave as if
DH_DSS), behave as if the client had sent the value {sha1,dsa}. the client had sent the value {sha1,dsa}.
- If the negotiated key exchange algorithm is one of (ECDH_ECDSA, - If the negotiated key exchange algorithm is ECDHE_ECDSA, behave as
ECDHE_ECDSA), behave as if the client had sent value {sha1,ecdsa}. if the client had sent value {sha1,ecdsa}.
Note: this is a change from TLS 1.1 where there are no explicit Note: this is a change from TLS 1.1 where there are no explicit
rules, but as a practical matter one can assume that the peer rules, but as a practical matter one can assume that the peer
supports MD5 and SHA-1. supports MD5 and SHA-1.
Note: this extension is not meaningful for TLS versions prior to 1.2. Note: this extension is not meaningful for TLS versions prior to 1.2.
Clients MUST NOT offer it if they are offering prior versions. Clients MUST NOT offer it if they are offering prior versions.
However, even if clients do offer it, the rules specified in [TLSEXT] However, even if clients do offer it, the rules specified in [TLSEXT]
require servers to ignore extensions they do not understand. require servers to ignore extensions they do not understand.
Servers MUST NOT send this extension. TLS servers MUST support Servers MUST NOT send this extension. TLS servers MUST support
receiving this extension. receiving this extension.
When performing session resumption, this extension is not included in When performing session resumption, this extension is not included in
Server Hello, and the server ignores the extension in Client Hello Server Hello, and the server ignores the extension in Client Hello
(if present). (if present).
7.4.2. Server Certificate 7.4.2.3.2. Early Data Extension
TLS versions before 1.3 have a strict message ordering and do not
permit additional messages to follow the ClientHello. The EarlyData
extension allows TLS messages which would otherwise be sent as
separate records to be instead inserted in the ClientHello. The
extension simply contains the TLS records which would otherwise have
been included in the client's first flight.
struct {
TLSCipherText messages<5 .. 2^24-1>;
} EarlyDataExtension;
Extra messages for the client's first flight MAY either be
transmitted standalone or sent as EarlyData. However, when a client
does not know whether TLS 1.3 can be negotiated - e.g., because the
server may support a prior version of TLS or because of network
intermediaries - it SHOULD use the EarlyData extension. If the
EarlyData extension is used, then clients MUST NOT send any messages
other than the ClientHello in their initial flight.
Any data included in EarlyData is not integrated into the handshake
hashes directly. E.g., if the ClientKeyExchange is included in
EarlyData, then the handshake hashes consist of ClientHello +
ServerHello, etc. However, because the ClientKeyExchange is in a
ClientHello extension, it is still hashed transitively. This
procedure guarantees that the Finished message covers these messages
even if they are ultimately ignored by the server (e.g., because it
is sent to a TLS 1.2 server). TLS 1.3 servers MUST understand
messages sent in EarlyData, and aside from hashing them differently,
MUST treat them as if they had been sent immediately after the
ClientHello.
Servers MUST NOT send the EarlyData extension. Negotiating TLS 1.3
serves as acknowledgement that it was processed as described above.
[[OPEN ISSUE: This is a fairly general mechanism which is possibly
overkill in the 1-RTT case, where it would potentially be more
attractive to just have a "ClientKeyExchange" extension. However,
for the 0-RTT case we will want to send the Certificate,
CertificateVerify, and application data, so a more general extension
seems appropriate at least until we have determined we don't need it
for 0-RTT.]]
7.4.2.4. Negotiated DL DHE Groups
Previous versions of TLS before 1.3 allowed the server to specify a
custom DHE group. This version of TLS requires the use of specific
named groups. [I-D.gillmor-tls-negotiated-dl-dhe] describes a
mechanism for negotiating such groups.
If the ClientHello contains a DHE cipher suite, it MUST also include
a "negotiated_dl_dhe_groups" extension. If the server selects a DHE
cipher suite, it MUST respond with that extension to indicate the
selected group. If no acceptable group can be selected across all
cipher suites, then the server MUST generate a fatal
"handshake_failure" alert. [[TODO: Presumably we want to bring
[I-D.gillmor-tls-negotiated-dl-dhe] into this specification.]]
7.4.3. Server Key Exchange Message
When this message will be sent:
This message will be sent immediately after the ServerHello
message if the client has provided a ClientKeyExchange message
which is compatible with the selected cipher suite and group
parameters.
Meaning of this message:
This message conveys cryptographic information to allow the client
to compute the premaster secret: a Diffie-Hellman public key with
which the client can complete a key exchange (with the result
being the premaster secret) or a public key for some other
algorithm.
Structure of this message:
struct {
opaque dh_Ys<1..2^16-1>;
} ServerDiffieHellmanParams; /* Ephemeral DH parameters */
dh_Ys
The server's Diffie-Hellman public value (g^X mod p).
struct {
select (KeyExchangeAlgorithm) {
case dhe:
ServerDiffieHellmanParams;
/* may be extended, e.g., for ECDH -- see [RFC4492] */
} params;
} ServerKeyExchange;
params
The server's key exchange parameters. These correspond to the
group indicated by the ServerHello message using the cipher suite
and the "negotiated_dl_dhe_groups"
[I-D.gillmor-tls-negotiated-dl-dhe] extension. [[TODO:
incorporate ECDHE if the WG decides to.]] [[OPEN ISSUE: Note that
we explicitly do not indicate the group here since that's
specified in the ServerHello. We could duplicate it here, but
that seems more confusing since there is room for mismatch.]]
7.4.4. Encrypted Extensions
When this message will be sent:
If this message is sent, it MUST be sent immediately after the
server's ChangeCipherSpec (and hence as the first handshake
message after the ServerKeyExchange).
Meaning of this message:
The EncryptedExtensions message simply contains any extensions
which should be protected, i.e., any which are not needed to
establish the cryptographic context. The same extension types
MUST NOT appear in both the ServerHello and EncryptedExtensions.
If the same extension appears in both locations, the client MUST
rely only on the value in the EncryptedExtensions block. [[OPEN
ISSUE: Should we just produce a canonical list of what goes where
and have it be an error to have it in the wrong place? That seems
simpler. Perhaps have a whitelist of which extensions can be
unencrypted and everything else MUST be encrypted.]]
Structure of this message:
struct {
Extension extensions<0..2^16-1>;
} EncryptedExtensions;
extensions
A list of extensions.
7.4.5. Server Certificate
When this message will be sent: When this message will be sent:
The server MUST send a Certificate message whenever the agreed- The server MUST send a Certificate message whenever the agreed-
upon key exchange method uses certificates for authentication upon key exchange method uses certificates for authentication
(this includes all key exchange methods defined in this document (this includes all key exchange methods defined in this document
except DH_anon). This message will always immediately follow the except DH_anon). This message will always immediately follow the
ServerHello message. ChangeCipherSpec which follows the server's ServerKeyExchange
message.
Meaning of this message: Meaning of this message:
This message conveys the server's certificate chain to the client. This message conveys the server's certificate chain to the client.
The certificate MUST be appropriate for the negotiated cipher The certificate MUST be appropriate for the negotiated cipher
suite's key exchange algorithm and any negotiated extensions. suite's key exchange algorithm and any negotiated extensions.
Structure of this message: Structure of this message:
opaque ASN.1Cert<1..2^24-1>; opaque ASN1Cert<1..2^24-1>;
struct { struct {
ASN.1Cert certificate_list<0..2^24-1>; ASN1Cert certificate_list<0..2^24-1>;
} Certificate; } Certificate;
certificate_list certificate_list
This is a sequence (chain) of certificates. The sender's This is a sequence (chain) of certificates. The sender's
certificate MUST come first in the list. Each following certificate MUST come first in the list. Each following
certificate MUST directly certify the one preceding it. Because certificate MUST directly certify the one preceding it. Because
certificate validation requires that root keys be distributed certificate validation requires that root keys be distributed
independently, the self-signed certificate that specifies the root independently, the self-signed certificate that specifies the root
certificate authority MAY be omitted from the chain, under the certificate authority MAY be omitted from the chain, under the
assumption that the remote end must already possess it in order to assumption that the remote end must already possess it in order to
skipping to change at page 50, line 14 skipping to change at page 51, line 7
- The certificate type MUST be X.509v3, unless explicitly negotiated - The certificate type MUST be X.509v3, unless explicitly negotiated
otherwise (e.g., [RFC5081]). otherwise (e.g., [RFC5081]).
- The end entity certificate's public key (and associated - The end entity certificate's public key (and associated
restrictions) MUST be compatible with the selected key exchange restrictions) MUST be compatible with the selected key exchange
algorithm. algorithm.
Key Exchange Alg. Certificate Key Type Key Exchange Alg. Certificate Key Type
RSA RSA public key; the certificate MUST allow the
RSA_PSK key to be used for encryption (the
keyEncipherment bit MUST be set if the key
usage extension is present).
Note: RSA_PSK is defined in [RFC4279].
DHE_RSA RSA public key; the certificate MUST allow the DHE_RSA RSA public key; the certificate MUST allow the
ECDHE_RSA key to be used for signing (the ECDHE_RSA key to be used for signing (the
digitalSignature bit MUST be set if the key digitalSignature bit MUST be set if the key
usage extension is present) with the signature usage extension is present) with the signature
scheme and hash algorithm that will be employed scheme and hash algorithm that will be employed
in the server key exchange message. in the server key exchange message.
Note: ECDHE_RSA is defined in [RFC4492]. Note: ECDHE_RSA is defined in [RFC4492].
DHE_DSS DSA public key; the certificate MUST allow the DHE_DSS DSA public key; the certificate MUST allow the
key to be used for signing with the hash key to be used for signing with the hash
algorithm that will be employed in the server algorithm that will be employed in the server
key exchange message. key exchange message.
DH_DSS Diffie-Hellman public key; the keyAgreement bit
DH_RSA MUST be set if the key usage extension is
present.
ECDH_ECDSA ECDH-capable public key; the public key MUST
ECDH_RSA use a curve and point format supported by the
client, as described in [RFC4492].
ECDHE_ECDSA ECDSA-capable public key; the certificate MUST ECDHE_ECDSA ECDSA-capable public key; the certificate MUST
allow the key to be used for signing with the allow the key to be used for signing with the
hash algorithm that will be employed in the hash algorithm that will be employed in the
server key exchange message. The public key server key exchange message. The public key
MUST use a curve and point format supported by MUST use a curve and point format supported by
the client, as described in [RFC4492]. the client, as described in [RFC4492].
- The "server_name" and "trusted_ca_keys" extensions [TLSEXT] are - The "server_name" and "trusted_ca_keys" extensions [TLSEXT] are
used to guide certificate selection. used to guide certificate selection.
If the client provided a "signature_algorithms" extension, then all If the client provided a "signature_algorithms" extension, then all
certificates provided by the server MUST be signed by a hash/ certificates provided by the server MUST be signed by a hash/
signature algorithm pair that appears in that extension. Note that signature algorithm pair that appears in that extension. Note that
this implies that a certificate containing a key for one signature this implies that a certificate containing a key for one signature
algorithm MAY be signed using a different signature algorithm (for algorithm MAY be signed using a different signature algorithm (for
instance, an RSA key signed with a DSA key). This is a departure instance, an RSA key signed with a DSA key). This is a departure
from TLS 1.1, which required that the algorithms be the same. Note from TLS 1.1, which required that the algorithms be the same.
that this also implies that the DH_DSS, DH_RSA, ECDH_ECDSA, and
ECDH_RSA key exchange algorithms do not restrict the algorithm used
to sign the certificate. Fixed DH certificates MAY be signed with
any hash/signature algorithm pair appearing in the extension. The
names DH_DSS, DH_RSA, ECDH_ECDSA, and ECDH_RSA are historical.
If the server has multiple certificates, it chooses one of them based If the server has multiple certificates, it chooses one of them based
on the above-mentioned criteria (in addition to other criteria, such on the above-mentioned criteria (in addition to other criteria, such
as transport layer endpoint, local configuration and preferences, as transport layer endpoint, local configuration and preferences,
etc.). If the server has a single certificate, it SHOULD attempt to etc.). If the server has a single certificate, it SHOULD attempt to
validate that it meets these criteria. validate that it meets these criteria.
Note that there are certificates that use algorithms and/or algorithm Note that there are certificates that use algorithms and/or algorithm
combinations that cannot be currently used with TLS. For example, a combinations that cannot be currently used with TLS. For example, a
certificate with RSASSA-PSS signature key (id-RSASSA-PSS OID in certificate with RSASSA-PSS signature key (id-RSASSA-PSS OID in
SubjectPublicKeyInfo) cannot be used because TLS defines no SubjectPublicKeyInfo) cannot be used because TLS defines no
corresponding signature algorithm. corresponding signature algorithm.
As cipher suites that specify new key exchange methods are specified As cipher suites that specify new key exchange methods are specified
for the TLS protocol, they will imply the certificate format and the for the TLS protocol, they will imply the certificate format and the
required encoded keying information. required encoded keying information.
7.4.3. Server Key Exchange Message 7.4.6. Certificate Request
When this message will be sent:
This message will be sent immediately after the server Certificate
message (or the ServerHello message, if this is an anonymous
negotiation).
The ServerKeyExchange message is sent by the server only when the
server Certificate message (if sent) does not contain enough data
to allow the client to exchange a premaster secret. This is true
for the following key exchange methods:
DHE_DSS
DHE_RSA
DH_anon
It is not legal to send the ServerKeyExchange message for the
following key exchange methods:
RSA
DH_DSS
DH_RSA
Other key exchange algorithms, such as those defined in [RFC4492],
MUST specify whether the ServerKeyExchange message is sent or not;
and if the message is sent, its contents.
Meaning of this message:
This message conveys cryptographic information to allow the client
to communicate the premaster secret: a Diffie-Hellman public key
with which the client can complete a key exchange (with the result
being the premaster secret) or a public key for some other
algorithm.
Structure of this message:
enum { dhe_dss, dhe_rsa, dh_anon, rsa, dh_dss, dh_rsa
/* may be extended, e.g., for ECDH -- see [RFC4492] */
} KeyExchangeAlgorithm;
struct {
opaque dh_p<1..2^16-1>;
opaque dh_g<1..2^16-1>;
opaque dh_Ys<1..2^16-1>;
} ServerDHParams; /* Ephemeral DH parameters */
dh_p
The prime modulus used for the Diffie-Hellman operation.
dh_g
The generator used for the Diffie-Hellman operation.
dh_Ys
The server's Diffie-Hellman public value (g^X mod p).
struct {
select (KeyExchangeAlgorithm) {
case dh_anon:
ServerDHParams params;
case dhe_dss:
case dhe_rsa:
ServerDHParams params;
digitally-signed struct {
opaque client_random[32];
opaque server_random[32];
ServerDHParams params;
} signed_params;
case rsa:
case dh_dss:
case dh_rsa:
struct {} ;
/* message is omitted for rsa, dh_dss, and dh_rsa */
/* may be extended, e.g., for ECDH -- see [RFC4492] */
};
} ServerKeyExchange;
params
The server's key exchange parameters.
signed_params
For non-anonymous key exchanges, a signature over the server's key
exchange parameters.
If the client has offered the "signature_algorithms" extension, the
signature algorithm and hash algorithm MUST be a pair listed in that
extension. Note that there is a possibility for inconsistencies
here. For instance, the client might offer DHE_DSS key exchange but
omit any DSA pairs from its "signature_algorithms" extension. In
order to negotiate correctly, the server MUST check any candidate
cipher suites against the "signature_algorithms" extension before
selecting them. This is somewhat inelegant but is a compromise
designed to minimize changes to the original cipher suite design.
In addition, the hash and signature algorithms MUST be compatible
with the key in the server's end-entity certificate. RSA keys MAY be
used with any permitted hash algorithm, subject to restrictions in
the certificate, if any.
Because DSA signatures do not contain any secure indication of hash
algorithm, there is a risk of hash substitution if multiple hashes
may be used with any key. Currently, DSA [DSS] may only be used with
SHA-1. Future revisions of DSS [DSS-3] are expected to allow the use
of other digest algorithms with DSA, as well as guidance as to which
digest algorithms should be used with each key size. In addition,
future revisions of [RFC3280] may specify mechanisms for certificates
to indicate which digest algorithms are to be used with DSA.
As additional cipher suites are defined for TLS that include new key
exchange algorithms, the server key exchange message will be sent if
and only if the certificate type associated with the key exchange
algorithm does not provide enough information for the client to
exchange a premaster secret.
7.4.4. Certificate Request
When this message will be sent: When this message will be sent:
A non-anonymous server can optionally request a certificate from A non-anonymous server can optionally request a certificate from
the client, if appropriate for the selected cipher suite. This the client, if appropriate for the selected cipher suite. This
message, if sent, will immediately follow the ServerKeyExchange message, if sent, will immediately follow the server's Certificate
message (if it is sent; otherwise, this message follows the message).
server's Certificate message).
Structure of this message: Structure of this message:
enum { enum {
rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),
rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6),
fortezza_dms_RESERVED(20), (255) fortezza_dms_RESERVED(20), (255)
} ClientCertificateType; } ClientCertificateType;
opaque DistinguishedName<1..2^16-1>; opaque DistinguishedName<1..2^16-1>;
struct { struct {
ClientCertificateType certificate_types<1..2^8-1>; ClientCertificateType certificate_types<1..2^8-1>;
SignatureAndHashAlgorithm SignatureAndHashAlgorithm
supported_signature_algorithms<2^16-1>; supported_signature_algorithms<2..2^16-2>;
DistinguishedName certificate_authorities<0..2^16-1>; DistinguishedName certificate_authorities<0..2^16-1>;
} CertificateRequest; } CertificateRequest;
certificate_types certificate_types
A list of the types of certificate types that the client may A list of the types of certificate types that the client may
offer. offer.
rsa_sign a certificate containing an RSA key rsa_sign a certificate containing an RSA key
dss_sign a certificate containing a DSA key dss_sign a certificate containing a DSA key
rsa_fixed_dh a certificate containing a static DH key. rsa_fixed_dh a certificate containing a static DH key.
skipping to change at page 56, line 31 skipping to change at page 53, line 41
New ClientCertificateType values are assigned by IANA as described in New ClientCertificateType values are assigned by IANA as described in
Section 12. Section 12.
Note: Values listed as RESERVED may not be used. They were used in Note: Values listed as RESERVED may not be used. They were used in
SSLv3. SSLv3.
Note: It is a fatal handshake_failure alert for an anonymous server Note: It is a fatal handshake_failure alert for an anonymous server
to request client authentication. to request client authentication.
7.4.5. Server Hello Done 7.4.7. Server Certificate Verify
When this message will be sent: When this message will be sent:
The ServerHelloDone message is sent by the server to indicate the This message is used to provide explicit proof that the server
end of the ServerHello and associated messages. After sending possesses the private key corresponding to its certificate.
this message, the server will wait for a client response. certificate and also provides integrity for the handshake up to
this point. This message is only sent when the server is
authenticated via a certificate. When sent, it MUST be the last
server handshake message prior to the Finished.
Meaning of this message: Structure of this message:
This message means that the server is done sending messages to struct {
support the key exchange, and the client can proceed with its digitally-signed struct {
phase of the key exchange. opaque handshake_messages[handshake_messages_length];
}
} CertificateVerify;
Upon receipt of the ServerHelloDone message, the client SHOULD Here handshake_messages refers to all handshake messages sent or
verify that the server provided a valid certificate, if required, received, starting at client hello and up to, but not including,
and check that the server hello parameters are acceptable. this message, including the type and length fields of the
handshake messages. This is the concatenation of all the
Handshake structures (as defined in Section 7.4) exchanged thus
far. Note that this requires both sides to either buffer the
messages or compute running hashes for all potential hash
algorithms up to the time of the CertificateVerify computation.
Servers can minimize this computation cost by offering a
restricted set of digest algorithms in the CertificateRequest
message.
If the client has offered the "signature_algorithms" extension,
the signature algorithm and hash algorithm MUST be a pair listed
in that extension. Note that there is a possibility for
inconsistencies here. For instance, the client might offer
DHE_DSS key exchange but omit any DSA pairs from its
"signature_algorithms" extension. In order to negotiate
correctly, the server MUST check any candidate cipher suites
against the "signature_algorithms" extension before selecting
them. This is somewhat inelegant but is a compromise designed to
minimize changes to the original cipher suite design.
In addition, the hash and signature algorithms MUST be compatible
with the key in the server's end-entity certificate. RSA keys MAY
be used with any permitted hash algorithm, subject to restrictions
in the certificate, if any.
Because DSA signatures do not contain any secure indication of
hash algorithm, there is a risk of hash substitution if multiple
hashes may be used with any key. Currently, DSA [DSS] may only be
used with SHA-1. Future revisions of DSS [DSS-3] are expected to
allow the use of other digest algorithms with DSA, as well as
guidance as to which digest algorithms should be used with each
key size. In addition, future revisions of [RFC3280] may specify
mechanisms for certificates to indicate which digest algorithms
are to be used with DSA. [[TODO: Update this to deal with DSS-3
and DSS-4. https://github.com/tlswg/tls13-spec/issues/59]]
7.4.8. Server Finished
When this message will be sent:
The Server's Finished message is the final message sent by the
server and indicates that the key exchange and authentication
processes were successful.
Meaning of this message:
Recipients of Finished messages MUST verify that the contents are
correct. Once a side has sent its Finished message and received
and validated the Finished message from its peer, it may begin to
send and receive application data over the connection.
Structure of this message: Structure of this message:
struct { } ServerHelloDone; struct {
opaque verify_data[verify_data_length];
} Finished;
7.4.6. Client Certificate verify_data
PRF(master_secret, finished_label, Hash(handshake_messages))
[0..verify_data_length-1];
finished_label
For Finished messages sent by the client, the string
"client finished". For Finished messages sent by the server,
the string "server finished".
Hash denotes a Hash of the handshake messages. For the PRF
defined in Section 5, the Hash MUST be the Hash used as the basis
for the PRF. Any cipher suite which defines a different PRF MUST
also define the Hash to use in the Finished computation.
In previous versions of TLS, the verify_data was always 12 octets
long. In the current version of TLS, it depends on the cipher
suite. Any cipher suite which does not explicitly specify
verify_data_length has a verify_data_length equal to 12. This
includes all existing cipher suites. Note that this
representation has the same encoding as with previous versions.
Future cipher suites MAY specify other lengths but such length
MUST be at least 12 bytes.
handshake_messages
All of the data from all messages in this handshake (not including
any HelloRequest messages) up to, but not including, this message.
This is only data visible at the handshake layer and does not
include record layer headers. This is the concatenation of all
the Handshake structures as defined in Section 7.4, exchanged thus
far.
It is a fatal error if a Finished message is not preceded by a
ChangeCipherSpec message at the appropriate point in the handshake.
The value handshake_messages includes all handshake messages starting
at ClientHello up to, but not including, this Finished message. This
may be different from handshake_messages in Section 7.4.7 or
Section 7.4.10. Also, the handshake_messages for the Finished
message sent by the client will be different from that for the
Finished message sent by the server, because the one that is sent
second will include the prior one.
Note: ChangeCipherSpec messages, alerts, and any other record types
are not handshake messages and are not included in the hash
computations. Also, HelloRequest messages are omitted from handshake
hashes.
7.4.9. Client Certificate
When this message will be sent: When this message will be sent:
This is the first message the client can send after receiving a This message is the first handshake message the client can send
ServerHelloDone message. This message is only sent if the server after receiving the server's Finished and having sent its own
ChangeCipherSpecs. This message is only sent if the server
requests a certificate. If no suitable certificate is available, requests a certificate. If no suitable certificate is available,
the client MUST send a certificate message containing no the client MUST send a certificate message containing no
certificates. That is, the certificate_list structure has a certificates. That is, the certificate_list structure has a
length of zero. If the client does not send any certificates, the length of zero. If the client does not send any certificates, the
server MAY at its discretion either continue the handshake without server MAY at its discretion either continue the handshake without
client authentication, or respond with a fatal handshake_failure client authentication, or respond with a fatal handshake_failure
alert. Also, if some aspect of the certificate chain was alert. Also, if some aspect of the certificate chain was
unacceptable (e.g., it was not signed by a known, trusted CA), the unacceptable (e.g., it was not signed by a known, trusted CA), the
server MAY at its discretion either continue the handshake server MAY at its discretion either continue the handshake
(considering the client unauthenticated) or send a fatal alert. (considering the client unauthenticated) or send a fatal alert.
Client certificates are sent using the Certificate structure Client certificates are sent using the Certificate structure
defined in Section 7.4.2. defined in Section 7.4.5.
Meaning of this message: Meaning of this message:
This message conveys the client's certificate chain to the server; This message conveys the client's certificate chain to the server;
the server will use it when verifying the CertificateVerify the server will use it when verifying the CertificateVerify
message (when the client authentication is based on signing) or message (when the client authentication is based on signing) or
calculating the premaster secret (for non-ephemeral Diffie- calculating the premaster secret (for non-ephemeral Diffie-
Hellman). The certificate MUST be appropriate for the negotiated Hellman). The certificate MUST be appropriate for the negotiated
cipher suite's key exchange algorithm, and any negotiated cipher suite's key exchange algorithm, and any negotiated
extensions. extensions.
skipping to change at page 58, line 36 skipping to change at page 58, line 6
rsa_fixed_ecdh ECDH-capable public key; MUST use the rsa_fixed_ecdh ECDH-capable public key; MUST use the
ecdsa_fixed_ecdh same curve as the server's key, and MUST use a ecdsa_fixed_ecdh same curve as the server's key, and MUST use a
point format supported by the server. point format supported by the server.
- If the certificate_authorities list in the certificate request - If the certificate_authorities list in the certificate request
message was non-empty, one of the certificates in the certificate message was non-empty, one of the certificates in the certificate
chain SHOULD be issued by one of the listed CAs. chain SHOULD be issued by one of the listed CAs.
- The certificates MUST be signed using an acceptable hash/ - The certificates MUST be signed using an acceptable hash/
signature algorithm pair, as described in Section 7.4.4. Note signature algorithm pair, as described in Section 7.4.6. Note
that this relaxes the constraints on certificate-signing that this relaxes the constraints on certificate-signing
algorithms found in prior versions of TLS. algorithms found in prior versions of TLS.
Note that, as with the server certificate, there are certificates Note that, as with the server certificate, there are certificates
that use algorithms/algorithm combinations that cannot be currently that use algorithms/algorithm combinations that cannot be currently
used with TLS. used with TLS.
7.4.7. Client Key Exchange Message 7.4.10. Client Certificate Verify
When this message will be sent:
This message is always sent by the client. It MUST immediately
follow the client certificate message, if it is sent. Otherwise,
it MUST be the first message sent by the client after it receives
the ServerHelloDone message.
Meaning of this message:
With this message, the premaster secret is set, either by direct
transmission of the RSA-encrypted secret or by the transmission of
Diffie-Hellman parameters that will allow each side to agree upon
the same premaster secret.
When the client is using an ephemeral Diffie-Hellman exponent,
then this message contains the client's Diffie-Hellman public
value. If the client is sending a certificate containing a static
DH exponent (i.e., it is doing fixed_dh client authentication),
then this message MUST be sent but MUST be empty.
Structure of this message:
The choice of messages depends on which key exchange method has
been selected. See Section 7.4.3 for the KeyExchangeAlgorithm
definition.
struct {
select (KeyExchangeAlgorithm) {
case rsa:
EncryptedPreMasterSecret;
case dhe_dss:
case dhe_rsa:
case dh_dss:
case dh_rsa:
case dh_anon:
ClientDiffieHellmanPublic;
} exchange_keys;
} ClientKeyExchange;
7.4.7.1. RSA-Encrypted Premaster Secret Message
Meaning of this message:
If RSA is being used for key agreement and authentication, the
client generates a 48-byte premaster secret, encrypts it using the
public key from the server's certificate, and sends the result in
an encrypted premaster secret message. This structure is a
variant of the ClientKeyExchange message and is not a message in
itself.
Structure of this message:
struct {
ProtocolVersion client_version;
opaque random[46];
} PreMasterSecret;
client_version
The latest (newest) version supported by the client. This is
used to detect version rollback attacks.
random
46 securely-generated random bytes.
struct {
public-key-encrypted PreMasterSecret pre_master_secret;
} EncryptedPreMasterSecret;
pre_master_secret
This random value is generated by the client and is used to
generate the master secret, as specified in
[Section 8.1].
Note: The version number in the PreMasterSecret is the version
offered by the client in the ClientHello.client_version, not the
version negotiated for the connection. This feature is designed to
prevent rollback attacks. Unfortunately, some old implementations
use the negotiated version instead, and therefore checking the
version number may lead to failure to interoperate with such
incorrect client implementations.
Client implementations MUST always send the correct version number in
PreMasterSecret. If ClientHello.client_version is TLS 1.1 or higher,
server implementations MUST check the version number as described in
the note below. If the version number is TLS 1.0 or earlier, server
implementations SHOULD check the version number, but MAY have a
configuration option to disable the check. Note that if the check
fails, the PreMasterSecret SHOULD be randomized as described below.
Note: Attacks discovered by Bleichenbacher [BLEI] and Klima et al.
[KPR03] can be used to attack a TLS server that reveals whether a
particular message, when decrypted, is properly PKCS#1 formatted,
contains a valid PreMasterSecret structure, or has the correct
version number.
As described by Klima [KPR03], these vulnerabilities can be avoided
by treating incorrectly formatted message blocks and/or mismatched
version numbers in a manner indistinguishable from correctly
formatted RSA blocks. In other words:
1. Generate a string R of 46 random bytes
2. Decrypt the message to recover the plaintext M
3. If the PKCS#1 padding is not correct, or the length of message M
is not exactly 48 bytes:
pre_master_secret = ClientHello.client_version || R
else If ClientHello.client_version <= TLS 1.0, and version number
check is explicitly disabled:
pre_master_secret = M
else:
pre_master_secret = ClientHello.client_version || M[2..47]
Note that explicitly constructing the pre_master_secret with the
ClientHello.client_version produces an invalid master_secret if the
client has sent the wrong version in the original pre_master_secret.
An alternative approach is to treat a version number mismatch as a
PKCS-1 formatting error and randomize the premaster secret
completely:
1. Generate a string R of 48 random bytes
2. Decrypt the message to recover the plaintext M
3. If the PKCS#1 padding is not correct, or the length of message M
is not exactly 48 bytes:
pre_master_secret = R
else If ClientHello.client_version <= TLS 1.0, and version number
check is explicitly disabled:
premaster secret = M
else If M[0..1] != ClientHello.client_version:
premaster secret = R
else:
premaster secret = M
Although no practical attacks against this construction are known,
Klima et al. [KPR03] describe some theoretical attacks, and
therefore the first construction described is RECOMMENDED.
In any case, a TLS server MUST NOT generate an alert if processing an
RSA-encrypted premaster secret message fails, or the version number
is not as expected. Instead, it MUST continue the handshake with a
randomly generated premaster secret. It may be useful to log the
real cause of failure for troubleshooting purposes; however, care
must be taken to avoid leaking the information to an attacker
(through, e.g., timing, log files, or other channels.)
The RSAES-OAEP encryption scheme defined in [RFC3447] is more secure
against the Bleichenbacher attack. However, for maximal
compatibility with earlier versions of TLS, this specification uses
the RSAES-PKCS1-v1_5 scheme. No variants of the Bleichenbacher
attack are known to exist provided that the above recommendations are
followed.
Implementation note: Public-key-encrypted data is represented as an
opaque vector <0..2^16-1> (see Section 4.7). Thus, the RSA-encrypted
PreMasterSecret in a ClientKeyExchange is preceded by two length
bytes. These bytes are redundant in the case of RSA because the
EncryptedPreMasterSecret is the only data in the ClientKeyExchange
and its length can therefore be unambiguously determined. The SSLv3
specification was not clear about the encoding of public-key-
encrypted data, and therefore many SSLv3 implementations do not
include the length bytes -- they encode the RSA-encrypted data
directly in the ClientKeyExchange message.
This specification requires correct encoding of the
EncryptedPreMasterSecret complete with length bytes. The resulting
PDU is incompatible with many SSLv3 implementations. Implementors
upgrading from SSLv3 MUST modify their implementations to generate
and accept the correct encoding. Implementors who wish to be
compatible with both SSLv3 and TLS should make their implementation's
behavior dependent on the protocol version.
Implementation note: It is now known that remote timing-based attacks
on TLS are possible, at least when the client and server are on the
same LAN. Accordingly, implementations that use static RSA keys MUST
use RSA blinding or some other anti-timing technique, as described in
[TIMING].
7.4.7.2. Client Diffie-Hellman Public Value
Meaning of this message:
This structure conveys the client's Diffie-Hellman public value
(Yc) if it was not already included in the client's certificate.
The encoding used for Yc is determined by the enumerated
PublicValueEncoding. This structure is a variant of the client
key exchange message, and not a message in itself.
Structure of this message:
enum { implicit, explicit } PublicValueEncoding;
implicit
If the client has sent a certificate which contains a suitable
Diffie-Hellman key (for fixed_dh client authentication), then
Yc is implicit and does not need to be sent again. In this
case, the client key exchange message will be sent, but it MUST
be empty.
explicit
Yc needs to be sent.
struct {
select (PublicValueEncoding) {
case implicit: struct { };
case explicit: opaque dh_Yc<1..2^16-1>;
} dh_public;
} ClientDiffieHellmanPublic;
dh_Yc
The client's Diffie-Hellman public value (Yc).
7.4.8. Certificate Verify
When this message will be sent: When this message will be sent:
This message is used to provide explicit verification of a client This message is used to provide explicit verification of a client
certificate. This message is only sent following a client certificate. This message is only sent following a client
certificate that has signing capability (i.e., all certificates certificate that has signing capability (i.e., all certificates
except those containing fixed Diffie-Hellman parameters). When except those containing fixed Diffie-Hellman parameters). When
sent, it MUST immediately follow the client key exchange message. sent, it MUST immediately follow the client's Certificate message.
The contents of the message are computed as described in
Structure of this message: Section 7.4.7.
struct {
digitally-signed struct {
opaque handshake_messages[handshake_messages_length];
}
} CertificateVerify;
Here handshake_messages refers to all handshake messages sent or
received, starting at client hello and up to, but not including,
this message, including the type and length fields of the
handshake messages. This is the concatenation of all the
Handshake structures (as defined in Section 7.4) exchanged thus
far. Note that this requires both sides to either buffer the
messages or compute running hashes for all potential hash
algorithms up to the time of the CertificateVerify computation.
Servers can minimize this computation cost by offering a
restricted set of digest algorithms in the CertificateRequest
message.
The hash and signature algorithms used in the signature MUST be The hash and signature algorithms used in the signature MUST be
one of those present in the supported_signature_algorithms field one of those present in the supported_signature_algorithms field
of the CertificateRequest message. In addition, the hash and of the CertificateRequest message. In addition, the hash and
signature algorithms MUST be compatible with the key in the signature algorithms MUST be compatible with the key in the
client's end-entity certificate. RSA keys MAY be used with any client's end-entity certificate. RSA keys MAY be used with any
permitted hash algorithm, subject to restrictions in the permitted hash algorithm, subject to restrictions in the
certificate, if any. certificate, if any.
Because DSA signatures do not contain any secure indication of Because DSA signatures do not contain any secure indication of
hash algorithm, there is a risk of hash substitution if multiple hash algorithm, there is a risk of hash substitution if multiple
hashes may be used with any key. Currently, DSA [DSS] may only be hashes may be used with any key. Currently, DSA [DSS] may only be
used with SHA-1. Future revisions of DSS [DSS-3] are expected to used with SHA-1. Future revisions of DSS [DSS-3] are expected to
allow the use of other digest algorithms with DSA, as well as allow the use of other digest algorithms with DSA, as well as
guidance as to which digest algorithms should be used with each guidance as to which digest algorithms should be used with each
key size. In addition, future revisions of [RFC3280] may specify key size. In addition, future revisions of [RFC3280] may specify
mechanisms for certificates to indicate which digest algorithms mechanisms for certificates to indicate which digest algorithms
are to be used with DSA. are to be used with DSA.
7.4.9. Finished
When this message will be sent:
A Finished message is always sent immediately after a change
cipher spec message to verify that the key exchange and
authentication processes were successful. It is essential that a
change cipher spec message be received between the other handshake
messages and the Finished message.
Meaning of this message:
The Finished message is the first one protected with the just
negotiated algorithms, keys, and secrets. Recipients of Finished
messages MUST verify that the contents are correct. Once a side
has sent its Finished message and received and validated the
Finished message from its peer, it may begin to send and receive
application data over the connection.
Structure of this message:
struct {
opaque verify_data[verify_data_length];
} Finished;
verify_data
PRF(master_secret, finished_label, Hash(handshake_messages))
[0..verify_data_length-1];
finished_label
For Finished messages sent by the client, the string
"client finished". For Finished messages sent by the server,
the string "server finished".
Hash denotes a Hash of the handshake messages. For the PRF
defined in Section 5, the Hash MUST be the Hash used as the basis
for the PRF. Any cipher suite which defines a different PRF MUST
also define the Hash to use in the Finished computation.
In previous versions of TLS, the verify_data was always 12 octets
long. In the current version of TLS, it depends on the cipher
suite. Any cipher suite which does not explicitly specify
verify_data_length has a verify_data_length equal to 12. This
includes all existing cipher suites. Note that this
representation has the same encoding as with previous versions.
Future cipher suites MAY specify other lengths but such length
MUST be at least 12 bytes.
handshake_messages
All of the data from all messages in this handshake (not including
any HelloRequest messages) up to, but not including, this message.
This is only data visible at the handshake layer and does not
include record layer headers. This is the concatenation of all
the Handshake structures as defined in Section 7.4, exchanged thus
far.
It is a fatal error if a Finished message is not preceded by a
ChangeCipherSpec message at the appropriate point in the handshake.
The value handshake_messages includes all handshake messages starting
at ClientHello up to, but not including, this Finished message. This
may be different from handshake_messages in Section 7.4.8 because it
would include the CertificateVerify message (if sent). Also, the
handshake_messages for the Finished message sent by the client will
be different from that for the Finished message sent by the server,
because the one that is sent second will include the prior one.
Note: ChangeCipherSpec messages, alerts, and any other record types
are not handshake messages and are not included in the hash
computations. Also, HelloRequest messages are omitted from handshake
hashes.
8. Cryptographic Computations 8. Cryptographic Computations
In order to begin connection protection, the TLS Record Protocol In order to begin connection protection, the TLS Record Protocol
requires specification of a suite of algorithms, a master secret, and requires specification of a suite of algorithms, a master secret, and
the client and server random values. The authentication, encryption, the client and server random values. The authentication, key
and MAC algorithms are determined by the cipher_suite selected by the agreement, and record protection algorithms are determined by the
server and revealed in the ServerHello message. The compression cipher_suite selected by the server and revealed in the ServerHello
algorithm is negotiated in the hello messages, and the random values message. The random values are exchanged in the hello messages. All
are exchanged in the hello messages. All that remains is to that remains is to calculate the master secret.
calculate the master secret.
8.1. Computing the Master Secret 8.1. Computing the Master Secret
For all key exchange methods, the same algorithm is used to convert For all key exchange methods, the same algorithm is used to convert
the pre_master_secret into the master_secret. The pre_master_secret the pre_master_secret into the master_secret. The pre_master_secret
should be deleted from memory once the master_secret has been should be deleted from memory once the master_secret has been
computed. computed.
master_secret = PRF(pre_master_secret, "master secret", master_secret = PRF(pre_master_secret, "master secret",
ClientHello.random + ServerHello.random) ClientHello.random + ServerHello.random)
[0..47]; [0..47];
The master secret is always exactly 48 bytes in length. The length The master secret is always exactly 48 bytes in length. The length
of the premaster secret will vary depending on key exchange method. of the premaster secret will vary depending on key exchange method.
8.1.1. RSA 8.1.1. Diffie-Hellman
When RSA is used for server authentication and key exchange, a 48-
byte pre_master_secret is generated by the client, encrypted under
the server's public key, and sent to the server. The server uses its
private key to decrypt the pre_master_secret. Both parties then
convert the pre_master_secret into the master_secret, as specified
above.
8.1.2. Diffie-Hellman
A conventional Diffie-Hellman computation is performed. The A conventional Diffie-Hellman computation is performed. The
negotiated key (Z) is used as the pre_master_secret, and is converted negotiated key (Z) is used as the pre_master_secret, and is converted
into the master_secret, as specified above. Leading bytes of Z that into the master_secret, as specified above. Leading bytes of Z that
contain all zero bits are stripped before it is used as the contain all zero bits are stripped before it is used as the
pre_master_secret. pre_master_secret.
Note: Diffie-Hellman parameters are specified by the server and may Note: Diffie-Hellman parameters are specified by the server and may
be either ephemeral or contained within the server's certificate. be either ephemeral or contained within the server's certificate.
9. Mandatory Cipher Suites 9. Mandatory Cipher Suites
In the absence of an application profile standard specifying In the absence of an application profile standard specifying
otherwise, a TLS-compliant application MUST implement the cipher otherwise, a TLS-compliant application MUST implement the cipher
suite TLS_RSA_WITH_AES_128_CBC_SHA (see Appendix A.5 for the suite TODO:Needs to be selected [1]. (See Appendix A.5 for the
definition). definition).
10. Application Data Protocol 10. Application Data Protocol
Application data messages are carried by the record layer and are Application data messages are carried by the record layer and are
fragmented, compressed, and encrypted based on the current connection fragmented and encrypted based on the current connection state. The
state. The messages are treated as transparent data to the record messages are treated as transparent data to the record layer.
layer.
11. Security Considerations 11. Security Considerations
Security issues are discussed throughout this memo, especially in Security issues are discussed throughout this memo, especially in
Appendices D, E, and F. Appendices D, E, and F.
12. IANA Considerations 12. IANA Considerations
[[TODO: Update https://github.com/tlswg/tls13-spec/issues/62]]
This document uses several registries that were originally created in This document uses several registries that were originally created in
[RFC4346]. IANA has updated these to reference this document. The [RFC4346]. IANA has updated these to reference this document. The
registries and their allocation policies (unchanged from [RFC4346]) registries and their allocation policies (unchanged from [RFC4346])
are listed below. are listed below.
- TLS ClientCertificateType Identifiers Registry: Future values in - TLS ClientCertificateType Identifiers Registry: Future values in
the range 0-63 (decimal) inclusive are assigned via Standards the range 0-63 (decimal) inclusive are assigned via Standards
Action [RFC2434]. Values in the range 64-223 (decimal) inclusive Action [RFC2434]. Values in the range 64-223 (decimal) inclusive
are assigned via Specification Required [RFC2434]. Values from are assigned via Specification Required [RFC2434]. Values from
224-255 (decimal) inclusive are reserved for Private Use 224-255 (decimal) inclusive are reserved for Private Use
[RFC2434]. [RFC2434].
skipping to change at page 68, line 9 skipping to change at page 60, line 23
224-255 (decimal) inclusive are reserved for Private Use 224-255 (decimal) inclusive are reserved for Private Use
[RFC2434]. [RFC2434].
- TLS Cipher Suite Registry: Future values with the first byte in - TLS Cipher Suite Registry: Future values with the first byte in
the range 0-191 (decimal) inclusive are assigned via Standards the range 0-191 (decimal) inclusive are assigned via Standards
Action [RFC2434]. Values with the first byte in the range 192-254 Action [RFC2434]. Values with the first byte in the range 192-254
(decimal) are assigned via Specification Required [RFC2434]. (decimal) are assigned via Specification Required [RFC2434].
Values with the first byte 255 (decimal) are reserved for Private Values with the first byte 255 (decimal) are reserved for Private
Use [RFC2434]. Use [RFC2434].
- This document defines several new HMAC-SHA256-based cipher suites,
whose values (in Appendix A.5) have been allocated from the TLS
Cipher Suite registry.
- TLS ContentType Registry: Future values are allocated via - TLS ContentType Registry: Future values are allocated via
Standards Action [RFC2434]. Standards Action [RFC2434].
- TLS Alert Registry: Future values are allocated via Standards - TLS Alert Registry: Future values are allocated via Standards
Action [RFC2434]. Action [RFC2434].
- TLS HandshakeType Registry: Future values are allocated via - TLS HandshakeType Registry: Future values are allocated via
Standards Action [RFC2434]. Standards Action [RFC2434].
This document also uses a registry originally created in [RFC4366]. This document also uses a registry originally created in [RFC4366].
IANA has updated it to reference this document. The registry and its IANA has updated it to reference this document. The registry and its
allocation policy (unchanged from [RFC4366]) is listed below: allocation policy (unchanged from [RFC4366]) is listed below:
- TLS ExtensionType Registry: Future values are allocated via IETF - TLS ExtensionType Registry: Future values are allocated via IETF
Consensus [RFC2434]. IANA has updated this registry to include Consensus [RFC2434]. IANA has updated this registry to include
the signature_algorithms extension and its corresponding value the signature_algorithms extension and its corresponding value
(see Section 7.4.1.4). (see Section 7.4.2.3).
In addition, this document defines two new registries to be In addition, this document defines two new registries to be
maintained by IANA: maintained by IANA:
- TLS SignatureAlgorithm Registry: The registry has been initially - TLS SignatureAlgorithm Registry: The registry has been initially
populated with the values described in Section 7.4.1.4.1. Future populated with the values described in Section 7.4.2.3.1. Future
values in the range 0-63 (decimal) inclusive are assigned via values in the range 0-63 (decimal) inclusive are assigned via
Standards Action [RFC2434]. Values in the range 64-223 (decimal) Standards Action [RFC2434]. Values in the range 64-223 (decimal)
inclusive are assigned via Specification Required [RFC2434]. inclusive are assigned via Specification Required [RFC2434].
Values from 224-255 (decimal) inclusive are reserved for Private Values from 224-255 (decimal) inclusive are reserved for Private
Use [RFC2434]. Use [RFC2434].
- TLS HashAlgorithm Registry: The registry has been initially - TLS HashAlgorithm Registry: The registry has been initially
populated with the values described in Section 7.4.1.4.1. Future populated with the values described in Section 7.4.2.3.1. Future
values in the range 0-63 (decimal) inclusive are assigned via values in the range 0-63 (decimal) inclusive are assigned via
Standards Action [RFC2434]. Values in the range 64-223 (decimal) Standards Action [RFC2434]. Values in the range 64-223 (decimal)
inclusive are assigned via Specification Required [RFC2434]. inclusive are assigned via Specification Required [RFC2434].
Values from 224-255 (decimal) inclusive are reserved for Private Values from 224-255 (decimal) inclusive are reserved for Private
Use [RFC2434]. Use [RFC2434].
This document also uses the TLS Compression Method Identifiers
Registry, defined in [RFC3749]. IANA has allocated value 0 for the
"null" compression method.
13. References 13. References
13.1. Normative References 13.1. Normative References
[AES] National Institute of Standards and Technology, [AES] National Institute of Standards
"Specification for the Advanced Encryption Standard and Technology, "Specification
(AES)", NIST FIPS 197, November 2001. for the Advanced Encryption
Standard (AES)", NIST FIPS 197,
[DSS] National Institute of Standards and Technology, U.S. November 2001.
Department of Commerce, "Digital Signature Standard",
NIST FIPS PUB 186-2, 2000.
[RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm",
RFC 1321, April 1992.
[RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- [DSS] National Institute of Standards
Hashing for Message Authentication", RFC 2104, and Technology, U.S. Department
February 1997. of Commerce, "Digital Signature
Standard", NIST FIPS PUB 186-2,
2000.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC1321] Rivest, R., "The MD5 Message-
Requirement Levels", BCP 14, RFC 2119, March 1997. Digest Algorithm", RFC 1321,
April 1992.
[RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an [RFC2104] Krawczyk, H., Bellare, M., and
IANA Considerations Section in RFCs", BCP 26, RFC 2434, R. Canetti, "HMAC: Keyed-Hashing
October 1998. for Message Authentication",
RFC 2104, February 1997.
[RFC3280] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet [RFC2119] Bradner, S., "Key words for use
X.509 Public Key Infrastructure Certificate and in RFCs to Indicate Requirement
Certificate Revocation List (CRL) Profile", RFC 3280, Levels", BCP 14, RFC 2119,
April 2002. March 1997.
[RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography [RFC2434] Narten, T. and H. Alvestrand,
Standards (PKCS) #1: RSA Cryptography Specifications "Guidelines for Writing an IANA
Version 2.1", RFC 3447, February 2003. Considerations Section in RFCs",
BCP 26, RFC 2434, October 1998.
[SCH] Schneier, B., "Applied Cryptography: Protocols, [RFC3280] Housley, R., Polk, W., Ford, W.,
Algorithms, and Source Code in C, 2nd ed.", 1996. and D. Solo, "Internet X.509
Public Key Infrastructure
Certificate and Certificate
Revocation List (CRL) Profile",
RFC 3280, April 2002.
[SHS] National Institute of Standards and Technology, U.S. [RFC3447] Jonsson, J. and B. Kaliski,
Department of Commerce, "Secure Hash Standard", "Public-Key Cryptography
NIST FIPS PUB 180-2, August 2002. Standards (PKCS) #1: RSA
Cryptography Specifications
Version 2.1", RFC 3447,
February 2003.
[TRIPLEDES] National Institute of Standards and Technology, [RFC5288] Salowey, J., Choudhury, A., and
"Recommendation for the Triple Data Encryption Algorithm D. McGrew, "AES Galois Counter
(TDEA) Block Cipher", NIST Special Publication 800-67, Mode (GCM) Cipher Suites for
May 2004. TLS", RFC 5288, August 2008.
[X680] ITU-T, "Information technology - Abstract Syntax [SCH] Schneier, B., "Applied
Notation One (ASN.1): Specification of basic notation", Cryptography: Protocols,
ISO/IEC 8824-1:2002, 2002. Algorithms, and Source Code in
C, 2nd ed.", 1996.
[X690] ITU-T, "Information technology - ASN.1 encoding Rules: [SHS] National Institute of Standards
Specification of Basic Encoding Rules (BER), Canonical and Technology, U.S. Department
Encoding Rules (CER) and Distinguished Encoding Rules of Commerce, "Secure Hash
(DER)", ISO/IEC 8825-1:2002, 2002. Standard", NIST FIPS PUB 180-2,
August 2002.
13.2. Informative References [TRIPLEDES] National Institute of Standards
and Technology, "Recommendation
for the Triple Data Encryption
Algorithm (TDEA) Block Cipher",
NIST Special Publication 800-67,
May 2004.
[BLEI] Bleichenbacher, D., "Chosen Ciphertext Attacks against [X680] ITU-T, "Information technology -
Protocols Based on RSA Encryption Standard PKCS", Abstract Syntax Notation One
CRYPTO98 LNCS vol. 1462, pages: 1-12, 1998, Advances in (ASN.1): Specification of basic
Cryptology, 1998. notation", ISO/IEC 8824-1:2002,
2002.
[CBCATT] Moeller, B., "Security of CBC Ciphersuites in SSL/TLS: [X690] ITU-T, "Information technology -
Problems and Countermeasures", May 2004, ASN.1 encoding Rules:
<http://www.openssl.org/~bodo/tls-cbc.txt>. Specification of Basic Encoding
Rules (BER), Canonical Encoding
Rules (CER) and Distinguished
Encoding Rules (DER)", ISO/
IEC 8825-1:2002, 2002.
[CBCTIME] Canvel, B., Hiltgen, A., Vaudenay, S., and M. Vuagnoux, 13.2. Informative References
"Password Interception in a SSL/TLS Channel", CRYPTO
2003 LNCS vol. 2729, 2003.
[CCM] "NIST Special Publication 800-38C: The CCM Mode for [BLEI] Bleichenbacher, D., "Chosen
Authentication and Confidentiality", May 2004, <http:// Ciphertext Attacks against
csrc.nist.gov/publications/nistpubs/800-38C/ Protocols Based on RSA
SP800-38C.pdf>. Encryption Standard PKCS",
CRYPTO98 LNCS vol. 1462, pages:
1-12, 1998, Advances in
Cryptology, 1998.
[DES] "Data Encryption Standard (DES)", NIST FIPS PUB 46-3, [CBCATT] Moeller, B., "Security of CBC
October 1999. Ciphersuites in SSL/TLS:
Problems and Countermeasures",
May 2004, <http://
www.openssl.org/~bodo/
tls-cbc.txt>.
[DSS-3] National Institute of Standards and Technology, U.S., [CCM] "NIST Special Publication 800-
"Digital Signature Standard", NIST FIPS PUB 186-3 Draft, 38C: The CCM Mode for
2006. Authentication and
Confidentiality", May 2004, <htt
p://csrc.nist.gov/publications/
nistpubs/800-38C/SP800-38C.pdf>.
[ECDSA] American National Standards Institute, "Public Key [DES] "Data Encryption Standard
Cryptography for the Financial Services Industry: The (DES)", NIST FIPS PUB 46-3,
Elliptic Curve Digital Signature Algorithm (ECDSA)", October 1999.
ANSI ANS X9.62-2005, November 2005.
[ENCAUTH] Krawczyk, H., "The Order of Encryption and [DSS-3] National Institute of Standards
Authentication for Protecting Communications (Or: How and Technology, U.S., "Digital
Secure is SSL?)", 2001. Signature Standard", NIST FIPS
PUB 186-3 Draft, 2006.
[FI06] "Bleichenbacher's RSA signature forgery based on [ECDSA] American National Standards
implementation error", August 2006, <http://www.imc.org/ Institute, "Public Key
ietf-openpgp/mail-archive/msg14307.html>. Cryptography for the Financial
Services Industry: The Elliptic
Curve Digital Signature
Algorithm (ECDSA)", ANSI ANS
X9.62-2005, November 2005.
[GCM] Dworkin, M., "Recommendation for Block Cipher Modes of [ENCAUTH] Krawczyk, H., "The Order of
Operation: Galois/Counter Mode (GCM) and GMAC", Encryption and Authentication
NIST Special Publication 800-38D, November 2007. for Protecting Communications
(Or: How Secure is SSL?)", 2001.
[KPR03] Klima, V., Pokorny, O., and T. Rosa, "Attacking RSA- [FI06] "Bleichenbacher's RSA signature
based Sessions in SSL/TLS", March 2003, forgery based on implementation
<http://eprint.iacr.org/2003/052/>. error", August 2006, <http://
www.imc.org/ietf-openpgp/
mail-archive/msg14307.html>.
[PKCS6] RSA Laboratories, "PKCS #6: RSA Extended Certificate [GCM] Dworkin, M., "Recommendation for
Syntax Standard, version 1.5", November 1993. Block Cipher Modes of Operation:
Galois/Counter Mode (GCM) and
GMAC", NIST Special Publication
800-38D, November 2007.
[PKCS7] RSA Laboratories, "PKCS #7: RSA Cryptographic Message [I-D.gillmor-tls-negotiated-dl-dhe] Gillmor, D., "Negotiated
Syntax Standard, version 1.5", November 1993. Discrete Log Diffie-Hellman
Ephemeral Parameters for TLS", d
raft-gillmor-tls-negotiated-dl-
dhe-02 (work in progress),
April 2014.
[RFC0793] Postel, J., "Transmission Control Protocol", STD 7, [PKCS6] RSA Laboratories, "PKCS #6: RSA
RFC 793, September 1981. Extended Certificate Syntax
Standard, version 1.5",
November 1993.
[RFC1948] Bellovin, S., "Defending Against Sequence Number [PKCS7] RSA Laboratories, "PKCS #7: RSA
Attacks", RFC 1948, May 1996. Cryptographic Message Syntax
Standard, version 1.5",
November 1993.
[RFC2246] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", [RFC0793] Postel, J., "Transmission
RFC 2246, January 1999. Control Protocol", STD 7,
RFC 793, September 1981.
[RFC2785] Zuccherato, R., "Methods for Avoiding the "Small- [RFC1948] Bellovin, S., "Defending Against
Subgroup" Attacks on the Diffie-Hellman Key Agreement Sequence Number Attacks",
Method for S/MIME", RFC 2785, March 2000. RFC 1948, May 1996.
[RFC3268] Chown, P., "Advanced Encryption Standard (AES) [RFC2246] Dierks, T. and C. Allen, "The
Ciphersuites for Transport Layer Security (TLS)", TLS Protocol Version 1.0",
RFC 3268, June 2002. RFC 2246, January 1999.
[RFC3526] Kivinen, T. and M. Kojo, "More Modular Exponential [RFC2785] Zuccherato, R., "Methods for
(MODP) Diffie-Hellman groups for Internet Key Exchange Avoiding the "Small-Subgroup"
(IKE)", RFC 3526, May 2003. Attacks on the Diffie-Hellman
Key Agreement Method for
S/MIME", RFC 2785, March 2000.
[RFC3749] Hollenbeck, S., "Transport Layer Security Protocol [RFC3268] Chown, P., "Advanced Encryption
Compression Methods", RFC 3749, May 2004. Standard (AES) Ciphersuites for
Transport Layer Security (TLS)",
RFC 3268, June 2002.
[RFC3766] Orman, H. and P. Hoffman, "Determining Strengths For [RFC3526] Kivinen, T. and M. Kojo, "More
Public Keys Used For Exchanging Symmetric Keys", BCP 86, Modular Exponential (MODP)
RFC 3766, April 2004. Diffie-Hellman groups for
Internet Key Exchange (IKE)",
RFC 3526, May 2003.
[RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness [RFC3766] Orman, H. and P. Hoffman,
Requirements for Security", BCP 106, RFC 4086, "Determining Strengths For
June 2005. Public Keys Used For Exchanging
Symmetric Keys", BCP 86,
RFC 3766, April 2004.
[RFC4279] Eronen, P. and H. Tschofenig, "Pre-Shared Key [RFC4086] Eastlake, D., Schiller, J., and
Ciphersuites for Transport Layer Security (TLS)", S. Crocker, "Randomness
RFC 4279, December 2005. Requirements for Security",
BCP 106, RFC 4086, June 2005.
[RFC4302] Kent, S., "IP Authentication Header", RFC 4302, [RFC4302] Kent, S., "IP Authentication
December 2005. Header", RFC 4302,
December 2005.
[RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", [RFC4303] Kent, S., "IP Encapsulating
RFC 4303, December 2005. Security Payload (ESP)",
RFC 4303, December 2005.
[RFC4307] Schiller, J., "Cryptographic Algorithms for Use in the [RFC4307] Schiller, J., "Cryptographic
Internet Key Exchange Version 2 (IKEv2)", RFC 4307, Algorithms for Use in the
December 2005. Internet Key Exchange Version 2
(IKEv2)", RFC 4307,
December 2005.
[RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer [RFC4346] Dierks, T. and E. Rescorla, "The
Security (TLS) Protocol Version 1.1", RFC 4346, Transport Layer Security (TLS)
April 2006. Protocol Version 1.1", RFC 4346,
April 2006.
[RFC4366] Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, [RFC4366] Blake-Wilson, S., Nystrom, M.,
J., and T. Wright, "Transport Layer Security (TLS) Hopwood, D., Mikkelsen, J., and
Extensions", RFC 4366, April 2006. T. Wright, "Transport Layer
Security (TLS) Extensions",
RFC 4366, April 2006.
[RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and [RFC4492] Blake-Wilson, S., Bolyard, N.,
B. Moeller, "Elliptic Curve Cryptography (ECC) Cipher Gupta, V., Hawk, C., and B.
Suites for Transport Layer Security (TLS)", RFC 4492, Moeller, "Elliptic Curve
May 2006. Cryptography (ECC) Cipher Suites
for Transport Layer Security
(TLS)", RFC 4492, May 2006.
[RFC4506] Eisler, M., "XDR: External Data Representation [RFC4506] Eisler, M., "XDR: External Data
Standard", STD 67, RFC 4506, May 2006. Representation Standard",
STD 67, RFC 4506, May 2006.
[RFC5081] Mavrogiannopoulos, N., "Using OpenPGP Keys for Transport [RFC5081] Mavrogiannopoulos, N., "Using
Layer Security (TLS) Authentication", RFC 5081, OpenPGP Keys for Transport Layer
November 2007. Security (TLS) Authentication",
RFC 5081, November 2007.
[RFC5116] McGrew, D., "An Interface and Algorithms for [RFC5116] McGrew, D., "An Interface and
Authenticated Encryption", RFC 5116, January 2008. Algorithms for Authenticated
Encryption", RFC 5116,
January 2008.
[RSA] Rivest, R., Shamir, A., and L. Adleman, "A Method for [RSA] Rivest, R., Shamir, A., and L.
Obtaining Digital Signatures and Public-Key Adleman, "A Method for Obtaining
Cryptosystems", Communications of the ACM v. 21, n. 2, Digital Signatures and Public-
pp. 120-126., February 1978. Key Cryptosystems",
Communications of the ACM v. 21,
n. 2, pp. 120-126.,
February 1978.
[SSL2] Netscape Communications Corp., "The SSL Protocol", [SSL2] Netscape Communications Corp.,
February 1995. "The SSL Protocol",
February 1995.
[SSL3] Freier, A., Karlton, P., and P. Kocher, "The SSL 3.0 [SSL3] Freier, A., Karlton, P., and P.
Protocol", November 1996. Kocher, "The SSL 3.0 Protocol",
November 1996.
[TIMING] Boneh, D. and D. Brumley, "Remote timing attacks are [TIMING] Boneh, D. and D. Brumley,
practical", USENIX Security Symposium, 2003. "Remote timing attacks are
practical", USENIX Security
Symposium, 2003.
[TLSEXT] Eastlake 3rd, D., "Transport Layer Security (TLS) [TLSEXT] Eastlake 3rd, D., "Transport
Extensions: Extension Definitions", February 2008. Layer Security (TLS) Extensions:
Extension Definitions",
February 2008.
[X501] "Information Technology - Open Systems Interconnection - [X501] "Information Technology - Open
The Directory: Models", ITU-T X.501, 1993. Systems Interconnection - The
Directory: Models", ITU-T X.501,
1993.
URIs URIs
[1] <mailto:tls@ietf.org> [1] <https://github.com/tlswg/tls13-spec/issues/32>
[2] <mailto:tls@ietf.org>
Appendix A. Protocol Data Structures and Constant Values Appendix A. Protocol Data Structures and Constant Values
This section describes protocol types and constants. This section describes protocol types and constants.
[[TODO: Clean this up to match the in-text description.]]
A.1. Record Layer A.1. Record Layer
struct { struct {
uint8 major; uint8 major;
uint8 minor; uint8 minor;
} ProtocolVersion; } ProtocolVersion;
ProtocolVersion version = { 3, 3 }; /* TLS v1.2*/ ProtocolVersion version = { 3, 4 }; /* TLS v1.3*/
enum { enum {
change_cipher_spec(20), alert(21), handshake(22), change_cipher_spec(20), alert(21), handshake(22),
application_data(23), (255) application_data(23), (255)
} ContentType; } ContentType;
struct { struct {
ContentType type; ContentType type;
ProtocolVersion version; ProtocolVersion version;
uint16 length; uint16 length;
opaque fragment[TLSPlaintext.length]; opaque fragment[TLSPlaintext.length];
} TLSPlaintext; } TLSPlaintext;
struct { struct {
ContentType type; ContentType type;
ProtocolVersion version; ProtocolVersion version;
uint16 length; uint16 length;
opaque fragment[TLSCompressed.length]; opaque nonce_explicit[SecurityParameters.record_iv_length];
} TLSCompressed; aead-ciphered struct {
opaque content[TLSPlaintext.length];
struct {
ContentType type;
ProtocolVersion version;
uint16 length;
select (SecurityParameters.cipher_type) {
case stream: GenericStreamCipher;
case block: GenericBlockCipher;
case aead: GenericAEADCipher;
} fragment; } fragment;
} TLSCiphertext; } TLSCiphertext;
stream-ciphered struct {
opaque content[TLSCompressed.length];
opaque MAC[SecurityParameters.mac_length];
} GenericStreamCipher;
struct {
opaque IV[SecurityParameters.record_iv_length];
block-ciphered struct {
opaque content[TLSCompressed.length];
opaque MAC[SecurityParameters.mac_length];
uint8 padding[GenericBlockCipher.padding_length];
uint8 padding_length;
};
} GenericBlockCipher;
struct {
opaque nonce_explicit[SecurityParameters.record_iv_length];
aead-ciphered struct {
opaque content[TLSCompressed.length];
};
} GenericAEADCipher;
A.2. Change Cipher Specs Message A.2. Change Cipher Specs Message
struct { struct {
enum { change_cipher_spec(1), (255) } type; enum { change_cipher_spec(1), (255) } type;
} ChangeCipherSpec; } ChangeCipherSpec;
A.3. Alert Messages A.3. Alert Messages
enum { warning(1), fatal(2), (255) } AlertLevel; enum { warning(1), fatal(2), (255) } AlertLevel;
enum { enum {
close_notify(0), close_notify(0),
unexpected_message(10), unexpected_message(10),
bad_record_mac(20), bad_record_mac(20),
decryption_failed_RESERVED(21), decryption_failed_RESERVED(21),
record_overflow(22), record_overflow(22),
decompression_failure(30), decompression_failure_RESERVED(30),
handshake_failure(40), handshake_failure(40),
no_certificate_RESERVED(41), no_certificate_RESERVED(41),
bad_certificate(42), bad_certificate(42),
unsupported_certificate(43), unsupported_certificate(43),
certificate_revoked(44), certificate_revoked(44),
certificate_expired(45), certificate_expired(45),
certificate_unknown(46), certificate_unknown(46),
illegal_parameter(47), illegal_parameter(47),
unknown_ca(48), unknown_ca(48),
access_denied(49), access_denied(49),
skipping to change at page 76, line 12 skipping to change at page 69, line 12
AlertDescription description; AlertDescription description;
} Alert; } Alert;
A.4. Handshake Protocol A.4. Handshake Protocol
enum { enum {
hello_request(0), client_hello(1), server_hello(2), hello_request(0), client_hello(1), server_hello(2),
certificate(11), server_key_exchange (12), certificate(11), server_key_exchange (12),
certificate_request(13), server_hello_done(14), certificate_request(13), server_hello_done(14),
certificate_verify(15), client_key_exchange(16), certificate_verify(15), client_key_exchange(16),
finished(20) finished(20),
(255) (255)
} HandshakeType; } HandshakeType;
struct { struct {
HandshakeType msg_type; HandshakeType msg_type;
uint24 length; uint24 length;
select (HandshakeType) { select (HandshakeType) {
case hello_request: HelloRequest; case hello_request: HelloRequest;
case client_hello: ClientHello; case client_hello: ClientHello;
case server_hello: ServerHello; case server_hello: ServerHello;
skipping to change at page 77, line 18 skipping to change at page 70, line 18
case true: case true:
Extension extensions<0..2^16-1>; Extension extensions<0..2^16-1>;
}; };
} ClientHello; } ClientHello;
struct { struct {
ProtocolVersion server_version; ProtocolVersion server_version;
Random random; Random random;
SessionID session_id; SessionID session_id;
CipherSuite cipher_suite; CipherSuite cipher_suite;
CompressionMethod compression_method;
select (extensions_present) { select (extensions_present) {
case false: case false:
struct {}; struct {};
case true: case true:
Extension extensions<0..2^16-1>; Extension extensions<0..2^16-1>;
}; };
} ServerHello; } ServerHello;
struct { struct {
ExtensionType extension_type; ExtensionType extension_type;
skipping to change at page 77, line 50 skipping to change at page 70, line 49
enum { enum {
anonymous(0), rsa(1), dsa(2), ecdsa(3), (255) anonymous(0), rsa(1), dsa(2), ecdsa(3), (255)
} SignatureAlgorithm; } SignatureAlgorithm;
struct { struct {
HashAlgorithm hash; HashAlgorithm hash;
SignatureAlgorithm signature; SignatureAlgorithm signature;
} SignatureAndHashAlgorithm; } SignatureAndHashAlgorithm;
SignatureAndHashAlgorithm SignatureAndHashAlgorithm
supported_signature_algorithms<2..2^16-1>; supported_signature_algorithms<2..2^16-2>;
A.4.2. Server Authentication and Key Exchange Messages A.4.2. Server Authentication and Key Exchange Messages
opaque ASN1Cert<2^24-1>;
opaque ASN.1Cert<2^24-1>;
struct { struct {
ASN.1Cert certificate_list<0..2^24-1>; ASN1Cert certificate_list<0..2^24-1>;
} Certificate; } Certificate;
enum { dhe_dss, dhe_rsa, dh_anon, rsa,dh_dss, dh_rsa enum { dhe_dss, dhe_rsa, dh_anon
/* may be extended, e.g., for ECDH -- see [TLSECC] */ /* may be extended, e.g., for ECDH -- see [TLSECC] */
} KeyExchangeAlgorithm; } KeyExchangeAlgorithm;
struct { struct {
opaque dh_p<1..2^16-1>; opaque dh_p<1..2^16-1>;
opaque dh_g<1..2^16-1>; opaque dh_g<1..2^16-1>;
opaque dh_Ys<1..2^16-1>; opaque dh_Ys<1..2^16-1>;
} ServerDHParams; /* Ephemeral DH parameters */ } ServerDHParams; /* Ephemeral DH parameters */
struct { struct {
skipping to change at page 78, line 35 skipping to change at page 71, line 32
case dh_anon: case dh_anon:
ServerDHParams params; ServerDHParams params;
case dhe_dss: case dhe_dss:
case dhe_rsa: case dhe_rsa:
ServerDHParams params; ServerDHParams params;
digitally-signed struct { digitally-signed struct {
opaque client_random[32]; opaque client_random[32];
opaque server_random[32]; opaque server_random[32];
ServerDHParams params; ServerDHParams params;
} signed_params; } signed_params;
case rsa:
case dh_dss:
case dh_rsa:
struct {} ;
/* message is omitted for rsa, dh_dss, and dh_rsa */
/* may be extended, e.g., for ECDH --- see [RFC4492] */ /* may be extended, e.g., for ECDH --- see [RFC4492] */
} ServerKeyExchange; } ServerKeyExchange;
enum { enum {
rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),
rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6),
fortezza_dms_RESERVED(20), fortezza_dms_RESERVED(20),
(255) (255)
} ClientCertificateType; } ClientCertificateType;
skipping to change at page 79, line 14 skipping to change at page 72, line 9
ClientCertificateType certificate_types<1..2^8-1>; ClientCertificateType certificate_types<1..2^8-1>;
DistinguishedName certificate_authorities<0..2^16-1>; DistinguishedName certificate_authorities<0..2^16-1>;
} CertificateRequest; } CertificateRequest;
struct { } ServerHelloDone; struct { } ServerHelloDone;
A.4.3. Client Authentication and Key Exchange Messages A.4.3. Client Authentication and Key Exchange Messages
struct { struct {
select (KeyExchangeAlgorithm) { select (KeyExchangeAlgorithm) {
case rsa:
EncryptedPreMasterSecret;
case dhe_dss: case dhe_dss:
case dhe_rsa: case dhe_rsa:
case dh_dss:
case dh_rsa:
case dh_anon: case dh_anon:
ClientDiffieHellmanPublic; ClientDiffieHellmanPublic;
} exchange_keys; } exchange_keys;
} ClientKeyExchange; } ClientKeyExchange;
struct { struct {
ProtocolVersion client_version; ProtocolVersion client_version;
opaque random[46]; opaque random[46];
} PreMasterSecret; } PreMasterSecret;
struct {
public-key-encrypted PreMasterSecret pre_master_secret;
} EncryptedPreMasterSecret;
enum { implicit, explicit } PublicValueEncoding; enum { implicit, explicit } PublicValueEncoding;
struct { struct {
select (PublicValueEncoding) { select (PublicValueEncoding) {
case implicit: struct {}; case implicit: struct {};
case explicit: opaque DH_Yc<1..2^16-1>; case explicit: opaque DH_Yc<1..2^16-1>;
} dh_public; } dh_public;
} ClientDiffieHellmanPublic; } ClientDiffieHellmanPublic;
struct { struct {
skipping to change at page 80, line 24 skipping to change at page 73, line 6
ClientHello and ServerHello messages. ClientHello and ServerHello messages.
A cipher suite defines a cipher specification supported in TLS A cipher suite defines a cipher specification supported in TLS
Version 1.2. Version 1.2.
TLS_NULL_WITH_NULL_NULL is specified and is the initial state of a TLS_NULL_WITH_NULL_NULL is specified and is the initial state of a
TLS connection during the first handshake on that channel, but MUST TLS connection during the first handshake on that channel, but MUST
NOT be negotiated, as it provides no more protection than an NOT be negotiated, as it provides no more protection than an
unsecured connection. unsecured connection.
CipherSuite TLS_NULL_WITH_NULL_NULL = { 0x00,0x00 }; CipherSuite TLS_NULL_WITH_NULL_NULL = { 0x00,0x00 };
The following CipherSuite definitions require that the server provide
an RSA certificate that can be used for key exchange. The server may
request any signature-capable certificate in the certificate request
message.
CipherSuite TLS_RSA_WITH_NULL_MD5 = { 0x00,0x01 };
CipherSuite TLS_RSA_WITH_NULL_SHA = { 0x00,0x02 };
CipherSuite TLS_RSA_WITH_NULL_SHA256 = { 0x00,0x3B };
CipherSuite TLS_RSA_WITH_RC4_128_MD5 = { 0x00,0x04 };
CipherSuite TLS_RSA_WITH_RC4_128_SHA = { 0x00,0x05 };
CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x0A };
CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = { 0x00,0x2F };
CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = { 0x00,0x35 };
CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = { 0x00,0x3C };
CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = { 0x00,0x3D };
The following cipher suite definitions are used for server- The following cipher suite definitions, defined in {{RFC5288}, are
authenticated (and optionally client-authenticated) Diffie-Hellman. used for server-authenticated (and optionally client-authenticated)
DH denotes cipher suites in which the server's certificate contains Diffie-Hellman. DH denotes cipher suites in which the server's
the Diffie-Hellman parameters signed by the certificate authority certificate contains the Diffie-Hellman parameters signed by the
(CA). DHE denotes ephemeral Diffie-Hellman, where the Diffie-Hellman certificate authority (CA). DHE denotes ephemeral Diffie-Hellman,
parameters are signed by a signature-capable certificate, which has where the Diffie-Hellman parameters are signed by a signature-capable
been signed by the CA. The signing algorithm used by the server is certificate, which has been signed by the CA. The signing algorithm
specified after the DHE component of the CipherSuite name. The used by the server is specified after the DHE component of the
server can request any signature-capable certificate from the client CipherSuite name. The server can request any signature-capable
for client authentication, or it may request a Diffie-Hellman certificate from the client for client authentication, or it may
certificate. Any Diffie-Hellman certificate provided by the client request a Diffie-Hellman certificate. Any Diffie-Hellman certificate
must use the parameters (group and generator) described by the provided by the client must use the parameters (group and generator)
server. described by the server.
CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00,0x0D }; CipherSuite TLS_RSA_WITH_AES_128_GCM_SHA256 = {0x00,0x9C}
CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x10 }; CipherSuite TLS_RSA_WITH_AES_256_GCM_SHA384 = {0x00,0x9D}
CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00,0x13 }; CipherSuite TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = {0x00,0x9E}
CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00,0x16 }; CipherSuite TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = {0x00,0x9F}
CipherSuite TLS_DH_DSS_WITH_AES_128_CBC_SHA = { 0x00,0x30 }; CipherSuite TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = {0x00,0xA2}
CipherSuite TLS_DH_RSA_WITH_AES_128_CBC_SHA = { 0x00,0x31 }; CipherSuite TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = {0x00,0xA3}
CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = { 0x00,0x32 };
CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = { 0x00,0x33 };
CipherSuite TLS_DH_DSS_WITH_AES_256_CBC_SHA = { 0x00,0x36 };
CipherSuite TLS_DH_RSA_WITH_AES_256_CBC_SHA = { 0x00,0x37 };
CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = { 0x00,0x38 };
CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = { 0x00,0x39 };
CipherSuite TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = { 0x00,0x3E };
CipherSuite TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = { 0x00,0x3F };
CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = { 0x00,0x40 };
CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = { 0x00,0x67 };
CipherSuite TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = { 0x00,0x68 };
CipherSuite TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = { 0x00,0x69 };
CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = { 0x00,0x6A };
CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = { 0x00,0x6B };
The following cipher suites are used for completely anonymous Diffie- The following cipher suites, defined in {{RFC5288}, are used for
Hellman communications in which neither party is authenticated. Note completely anonymous Diffie-Hellman communications in which neither
that this mode is vulnerable to man-in-the- middle attacks. Using party is authenticated. Note that this mode is vulnerable to man-in-
this mode therefore is of limited use: These cipher suites MUST NOT the-middle attacks. Using this mode therefore is of limited use:
be used by TLS 1.2 implementations unless the application layer has These cipher suites MUST NOT be used by TLS 1.2 implementations
specifically requested to allow anonymous key exchange. (Anonymous unless the application layer has specifically requested to allow
key exchange may sometimes be acceptable, for example, to support anonymous key exchange. (Anonymous key exchange may sometimes be
opportunistic encryption when no set-up for authentication is in acceptable, for example, to support opportunistic encryption when no
place, or when TLS is used as part of more complex security protocols set-up for authentication is in place, or when TLS is used as part of
that have other means to ensure authentication.) more complex security protocols that have other means to ensure
authentication.)
CipherSuite TLS_DH_anon_WITH_RC4_128_MD5 = { 0x00,0x18 }; CipherSuite TLS_DH_anon_WITH_AES_128_GCM_SHA256 = {0x00,0xA6}
CipherSuite TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = { 0x00,0x1B }; CipherSuite TLS_DH_anon_WITH_AES_256_GCM_SHA384 = {0x00,0xA7}
CipherSuite TLS_DH_anon_WITH_AES_128_CBC_SHA = { 0x00,0x34 };
CipherSuite TLS_DH_anon_WITH_AES_256_CBC_SHA = { 0x00,0x3A };
CipherSuite TLS_DH_anon_WITH_AES_128_CBC_SHA256 = { 0x00,0x6C };
CipherSuite TLS_DH_anon_WITH_AES_256_CBC_SHA256 = { 0x00,0x6D };
Note that using non-anonymous key exchange without actually verifying [[TODO: Add all the defined AEAD ciphers. This currently only lists
the key exchange is essentially equivalent to anonymous key exchange, GCM. https://github.com/tlswg/tls13-spec/issues/53]] Note that using
and the same precautions apply. While non-anonymous key exchange non-anonymous key exchange without actually verifying the key
will generally involve a higher computational and communicational exchange is essentially equivalent to anonymous key exchange, and the
cost than anonymous key exchange, it may be in the interest of same precautions apply. While non-anonymous key exchange will
generally involve a higher computational and communicational cost
than anonymous key exchange, it may be in the interest of
interoperability not to disable non-anonymous key exchange when the interoperability not to disable non-anonymous key exchange when the
application layer is allowing anonymous key exchange. application layer is allowing anonymous key exchange.
New cipher suite values have been assigned by IANA as described in New cipher suite values have been assigned by IANA as described in
Section 12. Section 12.
Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are
reserved to avoid collision with Fortezza-based cipher suites in SSL reserved to avoid collision with Fortezza-based cipher suites in SSL
3. 3.
skipping to change at page 82, line 25 skipping to change at page 74, line 25
These security parameters are determined by the TLS Handshake These security parameters are determined by the TLS Handshake
Protocol and provided as parameters to the TLS record layer in order Protocol and provided as parameters to the TLS record layer in order
to initialize a connection state. SecurityParameters includes: to initialize a connection state. SecurityParameters includes:
enum { null(0), (255) } CompressionMethod; enum { null(0), (255) } CompressionMethod;
enum { server, client } ConnectionEnd; enum { server, client } ConnectionEnd;
enum { tls_prf_sha256 } PRFAlgorithm; enum { tls_prf_sha256 } PRFAlgorithm;
enum { null, rc4, 3des, aes } BulkCipherAlgorithm; enum { aes_gcm } RecordProtAlgorithm;
enum { stream, block, aead } CipherType;
enum { null, hmac_md5, hmac_sha1, hmac_sha256, hmac_sha384,
hmac_sha512} MACAlgorithm;
/* Other values may be added to the algorithms specified in /* Other values may be added to the algorithms specified in
CompressionMethod, PRFAlgorithm, BulkCipherAlgorithm, and PRFAlgorithm and RecordProtAlgorithm */
MACAlgorithm. */
struct { struct {
ConnectionEnd entity; ConnectionEnd entity;
PRFAlgorithm prf_algorithm; PRFAlgorithm prf_algorithm;
BulkCipherAlgorithm bulk_cipher_algorithm; RecordProtAlgorithm record_prot_algorithm;
CipherType cipher_type;
uint8 enc_key_length; uint8 enc_key_length;
uint8 block_length; uint8 block_length;
uint8 fixed_iv_length; uint8 fixed_iv_length;
uint8 record_iv_length; uint8 record_iv_length;
MACAlgorithm mac_algorithm;
uint8 mac_length;
uint8 mac_key_length;
CompressionMethod compression_algorithm;
opaque master_secret[48]; opaque master_secret[48];
opaque client_random[32]; opaque client_random[32];
opaque server_random[32]; opaque server_random[32];
} SecurityParameters; } SecurityParameters;
A.7. Changes to RFC 4492 A.7. Changes to RFC 4492
RFC 4492 [RFC4492] adds Elliptic Curve cipher suites to TLS. This RFC 4492 [RFC4492] adds Elliptic Curve cipher suites to TLS. This
document changes some of the structures used in that document. This document changes some of the structures used in that document. This
section details the required changes for implementors of both RFC section details the required changes for implementors of both RFC
4492 and TLS 1.2. Implementors of TLS 1.2 who are not implementing 4492 and TLS 1.2. Implementors of TLS 1.2 who are not implementing
RFC 4492 do not need to read this section. RFC 4492 do not need to read this section.
skipping to change at page 83, line 23 skipping to change at page 75, line 11
RFC 4492 do not need to read this section. RFC 4492 do not need to read this section.
This document adds a "signature_algorithm" field to the digitally- This document adds a "signature_algorithm" field to the digitally-
signed element in order to identify the signature and digest signed element in order to identify the signature and digest
algorithms used to create a signature. This change applies to algorithms used to create a signature. This change applies to
digital signatures formed using ECDSA as well, thus allowing ECDSA digital signatures formed using ECDSA as well, thus allowing ECDSA
signatures to be used with digest algorithms other than SHA-1, signatures to be used with digest algorithms other than SHA-1,
provided such use is compatible with the certificate and any provided such use is compatible with the certificate and any
restrictions imposed by future revisions of [RFC3280]. restrictions imposed by future revisions of [RFC3280].
As described in Section 7.4.2 and Section 7.4.6, the restrictions on As described in Section 7.4.5 and Section 7.4.9, the restrictions on
the signature algorithms used to sign certificates are no longer tied the signature algorithms used to sign certificates are no longer tied
to the cipher suite (when used by the server) or the to the cipher suite (when used by the server) or the
ClientCertificateType (when used by the client). Thus, the ClientCertificateType (when used by the client). Thus, the
restrictions on the algorithm used to sign certificates specified in restrictions on the algorithm used to sign certificates specified in
Sections 2 and 3 of RFC 4492 are also relaxed. As in this document, Sections 2 and 3 of RFC 4492 are also relaxed. As in this document,
the restrictions on the keys in the end-entity certificate remain. the restrictions on the keys in the end-entity certificate remain.
Appendix B. Glossary Appendix B. Glossary
Advanced Encryption Standard (AES) Advanced Encryption Standard (AES)
skipping to change at page 84, line 9 skipping to change at page 75, line 43
See public key cryptography. See public key cryptography.
authenticated encryption with additional data (AEAD) authenticated encryption with additional data (AEAD)
A symmetric encryption algorithm that simultaneously provides A symmetric encryption algorithm that simultaneously provides
confidentiality and message integrity. confidentiality and message integrity.
authentication authentication
Authentication is the ability of one entity to determine the Authentication is the ability of one entity to determine the
identity of another entity. identity of another entity.
block cipher
A block cipher is an algorithm that operates on plaintext in
groups of bits, called blocks. 64 bits was, and 128 bits is, a
common block size.
bulk cipher
A symmetric encryption algorithm used to encrypt large quantities
of data.
cipher block chaining (CBC)
CBC is a mode in which every plaintext block encrypted with a
block cipher is first exclusive-ORed with the previous ciphertext
block (or, in the case of the first block, with the initialization
vector). For decryption, every block is first decrypted, then
exclusive-ORed with the previous ciphertext block (or IV).
certificate certificate
As part of the X.509 protocol (a.k.a. ISO Authentication As part of the X.509 protocol (a.k.a. ISO Authentication
framework), certificates are assigned by a trusted Certificate framework), certificates are assigned by a trusted Certificate
Authority and provide a strong binding between a party's identity Authority and provide a strong binding between a party's identity
or some other attributes and its public key. or some other attributes and its public key.
client client
The application entity that initiates a TLS connection to a The application entity that initiates a TLS connection to a
server. This may or may not imply that the client initiated the server. This may or may not imply that the client initiated the
underlying transport connection. The primary operational underlying transport connection. The primary operational
difference between the server and client is that the server is difference between the server and client is that the server is
generally authenticated, while the client is only optionally generally authenticated, while the client is only optionally
authenticated. authenticated.
client write key client write key
The key used to encrypt data written by the client. The key used to protect data written by the client.
client write MAC key
The secret data used to authenticate data written by the client.
connection connection
A connection is a transport (in the OSI layering model definition) A connection is a transport (in the OSI layering model definition)
that provides a suitable type of service. For TLS, such that provides a suitable type of service. For TLS, such
connections are peer-to-peer relationships. The connections are connections are peer-to-peer relationships. The connections are
transient. Every connection is associated with one session. transient. Every connection is associated with one session.
Data Encryption Standard
DES [DES] still is a very widely used symmetric encryption
algorithm although it is considered as rather weak now. DES is a
block cipher with a 56-bit key and an 8-byte block size. Note
that in TLS, for key generation purposes, DES is treated as having
an 8-byte key length (64 bits), but it still only provides 56 bits
of protection. (The low bit of each key byte is presumed to be
set to produce odd parity in that key byte.) DES can also be
operated in a mode [TRIPLEDES] where three independent keys and
three encryptions are used for each block of data; this uses 168
bits of key (24 bytes in the TLS key generation method) and
provides the equivalent of 112 bits of security.
Digital Signature Standard (DSS) Digital Signature Standard (DSS)
A standard for digital signing, including the Digital Signing A standard for digital signing, including the Digital Signing
Algorithm, approved by the National Institute of Standards and Algorithm, approved by the National Institute of Standards and
Technology, defined in NIST FIPS PUB 186-2, "Digital Signature Technology, defined in NIST FIPS PUB 186-2, "Digital Signature
Standard", published January 2000 by the U.S. Department of Standard", published January 2000 by the U.S. Department of
Commerce [DSS]. A significant update [DSS-3] has been drafted and Commerce [DSS]. A significant update [DSS-3] has been drafted and
was published in March 2006. was published in March 2006.
digital signatures digital signatures
Digital signatures utilize public key cryptography and one-way Digital signatures utilize public key cryptography and one-way
hash functions to produce a signature of the data that can be hash functions to produce a signature of the data that can be
authenticated, and is difficult to forge or repudiate. authenticated, and is difficult to forge or repudiate.
handshake handshake
An initial negotiation between client and server that establishes An initial negotiation between client and server that establishes
the parameters of their transactions. the parameters of their transactions.
Initialization Vector (IV) Initialization Vector (IV)
When a block cipher is used in CBC mode, the initialization vector Some AEAD ciphers require an initialization vector to allow the
is exclusive-ORed with the first plaintext block prior to cipher to safely protect multiple chunks of data with the same
encryption. keying material. The size of the IV depends on the cipher suite.
Message Authentication Code (MAC) Message Authentication Code (MAC)
A Message Authentication Code is a one-way hash computed from a A Message Authentication Code is a one-way hash computed from a
message and some secret data. It is difficult to forge without message and some secret data. It is difficult to forge without
knowing the secret data. Its purpose is to detect if the message knowing the secret data. Its purpose is to detect if the message
has been altered. has been altered.
master secret master secret
Secure secret data used for generating encryption keys, MAC Secure secret data used for generating keys and IVs.
secrets, and IVs.
MD5 MD5
MD5 [RFC1321] is a hashing function that converts an arbitrarily MD5 [RFC1321] is a hashing function that converts an arbitrarily
long data stream into a hash of fixed size (16 bytes). Due to long data stream into a hash of fixed size (16 bytes). Due to
significant progress in cryptanalysis, at the time of publication significant progress in cryptanalysis, at the time of publication
of this document, MD5 no longer can be considered a 'secure' of this document, MD5 no longer can be considered a 'secure'
hashing function. hashing function.
public key cryptography public key cryptography
A class of cryptographic techniques employing two-key ciphers. A class of cryptographic techniques employing two-key ciphers.
Messages encrypted with the public key can only be decrypted with Messages encrypted with the public key can only be decrypted with
the associated private key. Conversely, messages signed with the the associated private key. Conversely, messages signed with the
private key can be verified with the public key. private key can be verified with the public key.
one-way hash function one-way hash function
A one-way transformation that converts an arbitrary amount of data A one-way transformation that converts an arbitrary amount of data
into a fixed-length hash. It is computationally hard to reverse into a fixed-length hash. It is computationally hard to reverse
the transformation or to find collisions. MD5 and SHA are the transformation or to find collisions. MD5 and SHA are
examples of one-way hash functions. examples of one-way hash functions.
RC4
A stream cipher invented by Ron Rivest. A compatible cipher is
described in [SCH].
RSA RSA
A very widely used public key algorithm that can be used for A very widely used public key algorithm that can be used for
either encryption or digital signing. [RSA] either encryption or digital signing. [RSA]
server server
The server is the application entity that responds to requests for The server is the application entity that responds to requests for
connections from clients. See also "client". connections from clients. See also "client".
session session
A TLS session is an association between a client and a server. A TLS session is an association between a client and a server.
Sessions are created by the handshake protocol. Sessions define a Sessions are created by the handshake protocol. Sessions define a
set of cryptographic security parameters that can be shared among set of cryptographic security parameters that can be shared among
multiple connections. Sessions are used to avoid the expensive multiple connections. Sessions are used to avoid the expensive
negotiation of new security parameters for each connection. negotiation of new security parameters for each connection.
session identifier session identifier
A session identifier is a value generated by a server that A session identifier is a value generated by a server that
identifies a particular session. identifies a particular session.
server write key server write key
The key used to encrypt data written by the server. The key used to protect data written by the server.
server write MAC key
The secret data used to authenticate data written by the server.
SHA SHA
The Secure Hash Algorithm [SHS] is defined in FIPS PUB 180-2. It The Secure Hash Algorithm [SHS] is defined in FIPS PUB 180-2. It
produces a 20-byte output. Note that all references to SHA produces a 20-byte output. Note that all references to SHA
(without a numerical suffix) actually use the modified SHA-1 (without a numerical suffix) actually use the modified SHA-1
algorithm. algorithm.
SHA-256 SHA-256
The 256-bit Secure Hash Algorithm is defined in FIPS PUB 180-2. The 256-bit Secure Hash Algorithm is defined in FIPS PUB 180-2.
It produces a 32-byte output. It produces a 32-byte output.
SSL SSL
Netscape's Secure Socket Layer protocol [SSL3]. TLS is based on Netscape's Secure Socket Layer protocol [SSL3]. TLS is based on
SSL Version 3.0. SSL Version 3.0.
stream cipher
An encryption algorithm that converts a key into a
cryptographically strong keystream, which is then exclusive-ORed
with the plaintext.
symmetric cipher
See bulk cipher.
Transport Layer Security (TLS) Transport Layer Security (TLS)
This protocol; also, the Transport Layer Security working group of This protocol; also, the Transport Layer Security working group of
the Internet Engineering Task Force (IETF). See "Working Group the Internet Engineering Task Force (IETF). See "Working Group
Information" at the end of this document (see page 99). Information" at the end of this document (see page 99).
Appendix C. Cipher Suite Definitions Appendix C. Cipher Suite Definitions
Cipher Suite Key Cipher Mac Cipher Suite Key Record
Exchange Exchange Protection PRF
TLS_NULL_WITH_NULL_NULL NULL NULL NULL
TLS_RSA_WITH_NULL_MD5 RSA NULL MD5
TLS_RSA_WITH_NULL_SHA RSA NULL SHA
TLS_RSA_WITH_NULL_SHA256 RSA NULL SHA256
TLS_RSA_WITH_RC4_128_MD5 RSA RC4_128 MD5
TLS_RSA_WITH_RC4_128_SHA RSA RC4_128 SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA RSA 3DES_EDE_CBC SHA
TLS_RSA_WITH_AES_128_CBC_SHA RSA AES_128_CBC SHA
TLS_RSA_WITH_AES_256_CBC_SHA RSA AES_256_CBC SHA
TLS_RSA_WITH_AES_128_CBC_SHA256 RSA AES_128_CBC SHA256
TLS_RSA_WITH_AES_256_CBC_SHA256 RSA AES_256_CBC SHA256
TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA DH_DSS 3DES_EDE_CBC SHA
TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA DH_RSA 3DES_EDE_CBC SHA
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA DHE_DSS 3DES_EDE_CBC SHA
TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA DHE_RSA 3DES_EDE_CBC SHA
TLS_DH_anon_WITH_RC4_128_MD5 DH_anon RC4_128 MD5
TLS_DH_anon_WITH_3DES_EDE_CBC_SHA DH_anon 3DES_EDE_CBC SHA
TLS_DH_DSS_WITH_AES_128_CBC_SHA DH_DSS AES_128_CBC SHA
TLS_DH_RSA_WITH_AES_128_CBC_SHA DH_RSA AES_128_CBC SHA
TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE_DSS AES_128_CBC SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE_RSA AES_128_CBC SHA
TLS_DH_anon_WITH_AES_128_CBC_SHA DH_anon AES_128_CBC SHA
TLS_DH_DSS_WITH_AES_256_CBC_SHA DH_DSS AES_256_CBC SHA
TLS_DH_RSA_WITH_AES_256_CBC_SHA DH_RSA AES_256_CBC SHA
TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE_DSS AES_256_CBC SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE_RSA AES_256_CBC SHA
TLS_DH_anon_WITH_AES_256_CBC_SHA DH_anon AES_256_CBC SHA
TLS_DH_DSS_WITH_AES_128_CBC_SHA256 DH_DSS AES_128_CBC SHA256
TLS_DH_RSA_WITH_AES_128_CBC_SHA256 DH_RSA AES_128_CBC SHA256
TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 DHE_DSS AES_128_CBC SHA256
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 DHE_RSA AES_128_CBC SHA256
TLS_DH_anon_WITH_AES_128_CBC_SHA256 DH_anon AES_128_CBC SHA256
TLS_DH_DSS_WITH_AES_256_CBC_SHA256 DH_DSS AES_256_CBC SHA256
TLS_DH_RSA_WITH_AES_256_CBC_SHA256 DH_RSA AES_256_CBC SHA256
TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 DHE_DSS AES_256_CBC SHA256
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 DHE_RSA AES_256_CBC SHA256
TLS_DH_anon_WITH_AES_256_CBC_SHA256 DH_anon AES_256_CBC SHA256
Key IV Block
Cipher Type Material Size Size
NULL Stream 0 0 N/A
RC4_128 Stream 16 0 N/A
3DES_EDE_CBC Block 24 8 8
AES_128_CBC Block 16 16 16
AES_256_CBC Block 32 16 16
MAC Algorithm mac_length mac_key_length TLS_NULL_WITH_NULL_NULL NULL NULL_NULL N/A
NULL N/A 0 0 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 DHE_RSA AES_128_GCM SHA256
MD5 HMAC-MD5 16 16 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 DHE_RSA AES_256_GCM SHA384
SHA HMAC-SHA1 20 20 TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 DHE_DSS AES_128_GCM SHA256
SHA256 HMAC-SHA256 32 32 TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 DHE_DSS AES_256_GCM SHA384
TLS_DH_anon_WITH_AES_128_GCM_SHA256 DH_anon AES_128_GCM SHA256
TLS_DH_anon_WITH_AES_256_GCM_SHA384 DH_anon AES_128_GCM SHA384
Type Key Implicit IV Explicit IV
Indicates whether this is a stream cipher or a block cipher Cipher Material Size Size
running in CBC mode. ------------ -------- ---------- -----------
NULL 0 0 0
AES_128_GCM 16 4 8
AES_256_GCM 32 4 8
Key Material Key Material
The number of bytes from the key_block that are used for The number of bytes from the key_block that are used for
generating the write keys. generating the write keys.
IV Size Implicit IV Size
The amount of data needed to be generated for the initialization The amount of data to be generated for the per-connection part of
vector. Zero for stream ciphers; equal to the block size for the initialization vector. This is equal to
block ciphers (this is equal to SecurityParameters.fixed_iv_length).
SecurityParameters.record_iv_length).
Block Size Explicit IV Size
The amount of data a block cipher enciphers in one chunk; a block The amount of data needed to be generated for the per-record part
cipher running in CBC mode can only encrypt an even multiple of of the initialization vector. This is equal to
its block size. SecurityParameters.record_iv_length).
Appendix D. Implementation Notes Appendix D. Implementation Notes
The TLS protocol cannot prevent many common security mistakes. This The TLS protocol cannot prevent many common security mistakes. This
section provides several recommendations to assist implementors. section provides several recommendations to assist implementors.
D.1. Random Number Generation and Seeding D.1. Random Number Generation and Seeding
TLS requires a cryptographically secure pseudorandom number generator TLS requires a cryptographically secure pseudorandom number generator
(PRNG). Care must be taken in designing and seeding PRNGs. PRNGs (PRNG). Care must be taken in designing and seeding PRNGs. PRNGs
skipping to change at page 90, line 47 skipping to change at page 80, line 29
- Do you handle TLS extensions in ClientHello correctly, including - Do you handle TLS extensions in ClientHello correctly, including
omitting the extensions field completely? omitting the extensions field completely?
- Do you support renegotiation, both client and server initiated? - Do you support renegotiation, both client and server initiated?
While renegotiation is an optional feature, supporting it is While renegotiation is an optional feature, supporting it is
highly recommended. highly recommended.
- When the server has requested a client certificate, but no - When the server has requested a client certificate, but no
suitable certificate is available, do you correctly send an empty suitable certificate is available, do you correctly send an empty
Certificate message, instead of omitting the whole message (see Certificate message, instead of omitting the whole message (see
Section 7.4.6)? Section 7.4.9)?
Cryptographic details: Cryptographic details:
- In the RSA-encrypted Premaster Secret, do you correctly send and
verify the version number? When an error is encountered, do you
continue the handshake to avoid the Bleichenbacher attack (see
Section 7.4.7.1)?
- What countermeasures do you use to prevent timing attacks against - What countermeasures do you use to prevent timing attacks against
RSA decryption and signing operations (see Section 7.4.7.1)? RSA signing operations [TIMING].
- When verifying RSA signatures, do you accept both NULL and missing - When verifying RSA signatures, do you accept both NULL and missing
parameters (see Section 4.7)? Do you verify that the RSA padding parameters (see Section 4.7)? Do you verify that the RSA padding
doesn't have additional data after the hash value? [FI06] doesn't have additional data after the hash value? [FI06]
- When using Diffie-Hellman key exchange, do you correctly strip - When using Diffie-Hellman key exchange, do you correctly strip
leading zero bytes from the negotiated key (see Section 8.1.2)? leading zero bytes from the negotiated key (see Section 8.1.1)?
- Does your TLS client check that the Diffie-Hellman parameters sent - Does your TLS client check that the Diffie-Hellman parameters sent
by the server are acceptable (see Appendix F.1.1.3)? by the server are acceptable (see Appendix F.1.1.2)?
- How do you generate unpredictable IVs for CBC mode ciphers (see
Section 6.2.3.2)?
- Do you accept long CBC mode padding (up to 255 bytes; see
Section 6.2.3.2?
- How do you address CBC mode timing attacks (Section 6.2.3.2)?
- Do you use a strong and, most importantly, properly seeded random - Do you use a strong and, most importantly, properly seeded random
number generator (see Appendix D.1) for generating the premaster number generator (see Appendix D.1) Diffie-Hellman private values,
secret (for RSA key exchange), Diffie-Hellman private values, the the DSA "k" parameter, and other security-critical values?
DSA "k" parameter, and other security-critical values?
Appendix E. Backward Compatibility Appendix E. Backward Compatibility
E.1. Compatibility with TLS 1.0/1.1 and SSL 3.0 E.1. Compatibility with TLS 1.0/1.1 and SSL 3.0
Since there are various versions of TLS (1.0, 1.1, 1.2, and any [[TODO: Revise backward compatibility section for TLS 1.3.
future versions) and SSL (2.0 and 3.0), means are needed to negotiate https://github.com/tlswg/tls13-spec/issues/54]] Since there are
the specific protocol version to use. The TLS protocol provides a various versions of TLS (1.0, 1.1, 1.2, and any future versions) and
built-in mechanism for version negotiation so as not to bother other SSL (2.0 and 3.0), means are needed to negotiate the specific
protocol components with the complexities of version selection. protocol version to use. The TLS protocol provides a built-in
mechanism for version negotiation so as not to bother other protocol
components with the complexities of version selection.
TLS versions 1.0, 1.1, and 1.2, and SSL 3.0 are very similar, and use TLS versions 1.0, 1.1, and 1.2, and SSL 3.0 are very similar, and use
compatible ClientHello messages; thus, supporting all of them is compatible ClientHello messages; thus, supporting all of them is
relatively easy. Similarly, servers can easily handle clients trying relatively easy. Similarly, servers can easily handle clients trying
to use future versions of TLS as long as the ClientHello format to use future versions of TLS as long as the ClientHello format
remains compatible, and the client supports the highest protocol remains compatible, and the client supports the highest protocol
version available in the server. version available in the server.
A TLS 1.2 client who wishes to negotiate with such older servers will A TLS 1.3 client who wishes to negotiate with such older servers will
send a normal TLS 1.2 ClientHello, containing { 3, 3 } (TLS 1.2) in send a normal TLS 1.3 ClientHello, containing { 3, 4 } (TLS 1.3) in
ClientHello.client_version. If the server does not support this ClientHello.client_version. If the server does not support this
version, it will respond with a ServerHello containing an older version, it will respond with a ServerHello containing an older
version number. If the client agrees to use this version, the version number. If the client agrees to use this version, the
negotiation will proceed as appropriate for the negotiated protocol. negotiation will proceed as appropriate for the negotiated protocol.
If the version chosen by the server is not supported by the client If the version chosen by the server is not supported by the client
(or not acceptable), the client MUST send a "protocol_version" alert (or not acceptable), the client MUST send a "protocol_version" alert
message and close the connection. message and close the connection.
If a TLS server receives a ClientHello containing a version number If a TLS server receives a ClientHello containing a version number
skipping to change at page 96, line 6 skipping to change at page 85, line 24
its certificate message must provide a valid certificate chain its certificate message must provide a valid certificate chain
leading to an acceptable certificate authority. Similarly, leading to an acceptable certificate authority. Similarly,
authenticated clients must supply an acceptable certificate to the authenticated clients must supply an acceptable certificate to the
server. Each party is responsible for verifying that the other's server. Each party is responsible for verifying that the other's
certificate is valid and has not expired or been revoked. certificate is valid and has not expired or been revoked.
The general goal of the key exchange process is to create a The general goal of the key exchange process is to create a
pre_master_secret known to the communicating parties and not to pre_master_secret known to the communicating parties and not to
attackers. The pre_master_secret will be used to generate the attackers. The pre_master_secret will be used to generate the
master_secret (see Section 8.1). The master_secret is required to master_secret (see Section 8.1). The master_secret is required to
generate the Finished messages, encryption keys, and MAC keys (see generate the Finished messages and record protection keys (see
Section 7.4.9 and Section 6.3). By sending a correct Finished Section 7.4.8 and Section 6.3). By sending a correct Finished
message, parties thus prove that they know the correct message, parties thus prove that they know the correct
pre_master_secret. pre_master_secret.
F.1.1.1. Anonymous Key Exchange F.1.1.1. Anonymous Key Exchange
Completely anonymous sessions can be established using Diffie-Hellman Completely anonymous sessions can be established using Diffie-Hellman
for key exchange. The server's public parameters are contained in for key exchange. The server's public parameters are contained in
the server key exchange message, and the client's are sent in the the server key exchange message, and the client's are sent in the
client key exchange message. Eavesdroppers who do not know the client key exchange message. Eavesdroppers who do not know the
private values should not be able to find the Diffie-Hellman result private values should not be able to find the Diffie-Hellman result
(i.e., the pre_master_secret). (i.e., the pre_master_secret).
Warning: Completely anonymous connections only provide protection Warning: Completely anonymous connections only provide protection
against passive eavesdropping. Unless an independent tamper-proof against passive eavesdropping. Unless an independent tamper-proof
channel is used to verify that the Finished messages were not channel is used to verify that the Finished messages were not
replaced by an attacker, server authentication is required in replaced by an attacker, server authentication is required in
environments where active man-in-the-middle attacks are a concern. environments where active man-in-the-middle attacks are a concern.
F.1.1.2. RSA Key Exchange and Authentication F.1.1.2. Diffie-Hellman Key Exchange with Authentication
With RSA, key exchange and server authentication are combined. The
public key is contained in the server's certificate. Note that
compromise of the server's static RSA key results in a loss of
confidentiality for all sessions protected under that static key.
TLS users desiring Perfect Forward Secrecy should use DHE cipher
suites. The damage done by exposure of a private key can be limited
by changing one's private key (and certificate) frequently.
After verifying the server's certificate, the client encrypts a
pre_master_secret with the server's public key. By successfully
decoding the pre_master_secret and producing a correct Finished
message, the server demonstrates that it knows the private key
corresponding to the server certificate.
When RSA is used for key exchange, clients are authenticated using
the certificate verify message (see Section 7.4.8). The client signs
a value derived from all preceding handshake messages. These
handshake messages include the server certificate, which binds the
signature to the server, and ServerHello.random, which binds the
signature to the current handshake process.
F.1.1.3. Diffie-Hellman Key Exchange with Authentication
When Diffie-Hellman key exchange is used, the server can either When Diffie-Hellman key exchange is used, the server can either
supply a certificate containing fixed Diffie-Hellman parameters or supply a certificate containing fixed Diffie-Hellman parameters or
use the server key exchange message to send a set of temporary use the server key exchange message to send a set of temporary
Diffie-Hellman parameters signed with a DSA or RSA certificate. Diffie-Hellman parameters signed with a DSA or RSA certificate.
Temporary parameters are hashed with the hello.random values before Temporary parameters are hashed with the hello.random values before
signing to ensure that attackers do not replay old parameters. In signing to ensure that attackers do not replay old parameters. In
either case, the client can verify the certificate or signature to either case, the client can verify the certificate or signature to
ensure that the parameters belong to the server. ensure that the parameters belong to the server.
skipping to change at page 98, line 42 skipping to change at page 87, line 35
result, the parties will not accept each others' Finished messages. result, the parties will not accept each others' Finished messages.
Without the master_secret, the attacker cannot repair the Finished Without the master_secret, the attacker cannot repair the Finished
messages, so the attack will be discovered. messages, so the attack will be discovered.
F.1.4. Resuming Sessions F.1.4. Resuming Sessions
When a connection is established by resuming a session, new When a connection is established by resuming a session, new
ClientHello.random and ServerHello.random values are hashed with the ClientHello.random and ServerHello.random values are hashed with the
session's master_secret. Provided that the master_secret has not session's master_secret. Provided that the master_secret has not
been compromised and that the secure hash operations used to produce been compromised and that the secure hash operations used to produce
the encryption keys and MAC keys are secure, the connection should be the record protection kayes are secure, the connection should be
secure and effectively independent from previous connections. secure and effectively independent from previous connections.
Attackers cannot use known encryption keys or MAC secrets to Attackers cannot use known keys to compromise the master_secret
compromise the master_secret without breaking the secure hash without breaking the secure hash operations.
operations.
Sessions cannot be resumed unless both the client and server agree. Sessions cannot be resumed unless both the client and server agree.
If either party suspects that the session may have been compromised, If either party suspects that the session may have been compromised,
or that certificates may have expired or been revoked, it should or that certificates may have expired or been revoked, it should
force a full handshake. An upper limit of 24 hours is suggested for force a full handshake. An upper limit of 24 hours is suggested for
session ID lifetimes, since an attacker who obtains a master_secret session ID lifetimes, since an attacker who obtains a master_secret
may be able to impersonate the compromised party until the may be able to impersonate the compromised party until the
corresponding session ID is retired. Applications that may be run in corresponding session ID is retired. Applications that may be run in
relatively insecure environments should not write session IDs to relatively insecure environments should not write session IDs to
stable storage. stable storage.
F.2. Protecting Application Data F.2. Protecting Application Data
The master_secret is hashed with the ClientHello.random and The master_secret is hashed with the ClientHello.random and
ServerHello.random to produce unique data encryption keys and MAC ServerHello.random to produce unique record protection secrets for
secrets for each connection. each connection.
Outgoing data is protected with a MAC before transmission. To Outgoing data is protected using an AEAD algorithm before
prevent message replay or modification attacks, the MAC is computed transmission. The authentication data includes the sequence number,
from the MAC key, the sequence number, the message length, the message type, message length, and the message contents. The message
message contents, and two fixed character strings. The message type type field is necessary to ensure that messages intended for one TLS
field is necessary to ensure that messages intended for one TLS
record layer client are not redirected to another. The sequence record layer client are not redirected to another. The sequence
number ensures that attempts to delete or reorder messages will be number ensures that attempts to delete or reorder messages will be
detected. Since sequence numbers are 64 bits long, they should never detected. Since sequence numbers are 64 bits long, they should never
overflow. Messages from one party cannot be inserted into the overflow. Messages from one party cannot be inserted into the
other's output, since they use independent MAC keys. Similarly, the other's output, since they use independent keys.
server write and client write keys are independent, so stream cipher
keys are used only once.
If an attacker does break an encryption key, all messages encrypted
with it can be read. Similarly, compromise of a MAC key can make
message-modification attacks possible. Because MACs are also
encrypted, message-alteration attacks generally require breaking the
encryption algorithm as well as the MAC.
Note: MAC keys may be larger than encryption keys, so messages can
remain tamper resistant even if encryption keys are broken.
F.3. Explicit IVs
[CBCATT] describes a chosen plaintext attack on TLS that depends on
knowing the IV for a record. Previous versions of TLS [RFC2246] used
the CBC residue of the previous record as the IV and therefore
enabled this attack. This version uses an explicit IV in order to
protect against this attack.
F.4. Security of Composite Cipher Modes
TLS secures transmitted application data via the use of symmetric
encryption and authentication functions defined in the negotiated
cipher suite. The objective is to protect both the integrity and
confidentiality of the transmitted data from malicious actions by
active attackers in the network. It turns out that the order in
which encryption and authentication functions are applied to the data
plays an important role for achieving this goal [ENCAUTH].
The most robust method, called encrypt-then-authenticate, first
applies encryption to the data and then applies a MAC to the
ciphertext. This method ensures that the integrity and
confidentiality goals are obtained with ANY pair of encryption and
MAC functions, provided that the former is secure against chosen
plaintext attacks and that the MAC is secure against chosen-message
attacks. TLS uses another method, called authenticate-then-encrypt,
in which first a MAC is computed on the plaintext and then the
concatenation of plaintext and MAC is encrypted. This method has
been proven secure for CERTAIN combinations of encryption functions
and MAC functions, but it is not guaranteed to be secure in general.
In particular, it has been shown that there exist perfectly secure
encryption functions (secure even in the information-theoretic sense)
that combined with any secure MAC function, fail to provide the
confidentiality goal against an active attack. Therefore, new cipher
suites and operation modes adopted into TLS need to be analyzed under
the authenticate-then-encrypt method to verify that they achieve the
stated integrity and confidentiality goals.
Currently, the security of the authenticate-then-encrypt method has
been proven for some important cases. One is the case of stream
ciphers in which a computationally unpredictable pad of the length of
the message, plus the length of the MAC tag, is produced using a
pseudorandom generator and this pad is exclusive-ORed with the
concatenation of plaintext and MAC tag. The other is the case of CBC
mode using a secure block cipher. In this case, security can be
shown if one applies one CBC encryption pass to the concatenation of
plaintext and MAC and uses a new, independent, and unpredictable IV
for each new pair of plaintext and MAC. In versions of TLS prior to
1.1, CBC mode was used properly EXCEPT that it used a predictable IV
in the form of the last block of the previous ciphertext. This made
TLS open to chosen plaintext attacks. This version of the protocol
is immune to those attacks. For exact details in the encryption
modes proven secure, see [ENCAUTH].
F.5. Denial of Service F.3. Denial of Service
TLS is susceptible to a number of denial-of-service (DoS) attacks. TLS is susceptible to a number of denial-of-service (DoS) attacks.
In particular, an attacker who initiates a large number of TCP In particular, an attacker who initiates a large number of TCP
connections can cause a server to consume large amounts of CPU for connections can cause a server to consume large amounts of CPU doing
doing RSA decryption. However, because TLS is generally used over asymmetric crypto operations. However, because TLS is generally used
TCP, it is difficult for the attacker to hide his point of origin if over TCP, it is difficult for the attacker to hide his point of
proper TCP SYN randomization is used [RFC1948] by the TCP stack. origin if proper TCP SYN randomization is used [RFC1948] by the TCP
stack.
Because TLS runs over TCP, it is also susceptible to a number of DoS Because TLS runs over TCP, it is also susceptible to a number of DoS
attacks on individual connections. In particular, attackers can attacks on individual connections. In particular, attackers can
forge RSTs, thereby terminating connections, or forge partial TLS forge RSTs, thereby terminating connections, or forge partial TLS
records, thereby causing the connection to stall. These attacks records, thereby causing the connection to stall. These attacks
cannot in general be defended against by a TCP-using protocol. cannot in general be defended against by a TCP-using protocol.
Implementors or users who are concerned with this class of attack Implementors or users who are concerned with this class of attack
should use IPsec AH [RFC4302] or ESP [RFC4303]. should use IPsec AH [RFC4302] or ESP [RFC4303].
F.6. Final Notes F.4. Final Notes
For TLS to be able to provide a secure connection, both the client For TLS to be able to provide a secure connection, both the client
and server systems, keys, and applications must be secure. In and server systems, keys, and applications must be secure. In
addition, the implementation must be free of security errors. addition, the implementation must be free of security errors.
The system is only as strong as the weakest key exchange and The system is only as strong as the weakest key exchange and
authentication algorithm supported, and only trustworthy authentication algorithm supported, and only trustworthy
cryptographic functions should be used. Short public keys and cryptographic functions should be used. Short public keys and
anonymous servers should be used with great caution. Implementations anonymous servers should be used with great caution. Implementations
and users must be careful when deciding which certificates and and users must be careful when deciding which certificates and
certificate authorities are acceptable; a dishonest certificate certificate authorities are acceptable; a dishonest certificate
authority can do tremendous damage. authority can do tremendous damage.
Appendix G. Working Group Information Appendix G. Working Group Information
The discussion list for the IETF TLS working group is located at the The discussion list for the IETF TLS working group is located at the
e-mail address tls@ietf.org [1]. Information on the group and e-mail address tls@ietf.org [2]. Information on the group and
information on how to subscribe to the list is at information on how to subscribe to the list is at
https://www1.ietf.org/mailman/listinfo/tls https://www1.ietf.org/mailman/listinfo/tls
Archives of the list can be found at: Archives of the list can be found at:
http://www.ietf.org/mail-archive/web/tls/current/index.html http://www.ietf.org/mail-archive/web/tls/current/index.html
Appendix H. Contributors Appendix H. Contributors
Christopher Allen (co-editor of TLS 1.0) Christopher Allen (co-editor of TLS 1.0)
Alacrity Ventures Alacrity Ventures
 End of changes. 254 change blocks. 
1645 lines changed or deleted 1125 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/