跳到主要内容

9. Compliance Requirements (合规要求)

9.1. Mandatory-to-Implement Cipher Suites (必须实现的密码套件)

除非 application profile standard 另有规定, 符合 TLS 的应用 MUST 实现 TLS_AES_128_GCM_SHA256 [GCM] cipher suite, 并且 SHOULD 实现 TLS_AES_256_GCM_SHA384 [GCM] 和 TLS_CHACHA20_POLY1305_SHA256 [RFC8439] cipher suite.

符合 TLS 的应用 MUST 支持使用 rsa_pkcs1_sha256 (用于 certificate), rsa_pss_rsae_sha256 (用于 CertificateVerify 和 certificate), 以及 ecdsa_secp256r1_sha256 的 digital signature. 符合 TLS 的应用 MUST 支持使用 secp256r1 (NIST P-256) 的 key exchange, 并且 SHOULD 支持 X25519 [RFC7748].

9.2. Mandatory-to-Implement Extensions (必须实现的扩展)

除非 application profile standard 另有规定, 符合 TLS 的应用 MUST 实现以下 TLS extension:

  • Supported Versions ("supported_versions")
  • Cookie ("cookie")
  • Signature Algorithms ("signature_algorithms")
  • Signature Algorithms Certificate ("signature_algorithms_cert")
  • Negotiated Groups ("supported_groups")
  • Key Share ("key_share")
  • Server Name Indication ("server_name")

所有实现 MUST 在提供适用功能时发送并使用这些 extension:

  • "supported_versions" 对所有 ClientHello, ServerHello 和 HelloRetryRequest message 都是 REQUIRED.
  • "signature_algorithms" 对 certificate authentication 是 REQUIRED.
  • "supported_groups" 对使用 DHE 或 ECDHE key exchange 的 ClientHello message 是 REQUIRED.
  • "key_share" 对 DHE 或 ECDHE key exchange 是 REQUIRED.
  • "pre_shared_key" 对 PSK key agreement 是 REQUIRED.
  • "psk_key_exchange_modes" 对 PSK key agreement 是 REQUIRED.

如果 ClientHello 包含 "supported_versions" extension 且其 body 中包含 0x0304, 则认为 client 正在尝试按本规范协商. 这样的 ClientHello MUST 满足以下要求:

  • 如果不包含 "pre_shared_key" extension, 则 MUST 同时包含 "signature_algorithms" extension 和 "supported_groups" extension.
  • 如果包含 "supported_groups" extension, 则 MUST 同时包含 "key_share" extension, 反之亦然. 允许 KeyShare.client_shares vector 为空.

server 收到不符合这些要求的 ClientHello 时, MUST 以 "missing_extension" alert 中止 handshake.

此外, 所有实现 MUST 支持在能够使用 "server_name" extension 的应用中使用该 extension. server MAY 要求 client 发送有效的 "server_name" extension. 要求该 extension 的 server 在收到缺少 "server_name" extension 的 ClientHello 时, SHOULD 以 "missing_extension" alert 终止 connection.

9.3. Protocol Invariants (协议不变量)

本节描述 TLS endpoint 和 middlebox MUST 遵守的不变量, 以确保协议互操作性.

TLS 设计为可在广泛网络环境中使用, 包括存在不了解 TLS protocol 的 middlebox, 如 firewall, proxy 和 network address translator. 为最大化互操作性, TLS 1.3 实现 MUST 遵守若干 protocol invariant, 避免 middlebox 误解 connection.

Record Layer Invariants (记录层不变量)

TLS record layer MUST 遵守以下不变量:

  1. Record Version: 除初始 ClientHello 外, 所有 record MUST 将 legacy_record_version 设置为 0x0303 (TLS 1.2). 初始 ClientHello MAY 为最大兼容性设置为 0x0301 (TLS 1.0).
  2. Content Type: 所有加密 record MUST 将外层 content type 设置为 application_data (23). 实际 content type 位于 TLSInnerPlaintext.
  3. Record Size: 未加密 TLSPlaintext record MUST NOT 超过 2^14 byte. 加密 TLSCiphertext record MUST NOT 超过 2^14 + 256 byte.

Handshake Invariants (握手不变量)

TLS handshake MUST 遵守以下不变量:

  1. Extension Ordering: "pre_shared_key" extension MUST 是 ClientHello 中最后一个 extension.
  2. Message Ordering: handshake message MUST 按第 4 节规定的顺序发送.
  3. Key Change Boundaries: 某些 message, 包括 ClientHello, EndOfEarlyData, ServerHello, Finished 和 KeyUpdate, MUST 与 record boundary 对齐.

Middlebox Compatibility (中间盒兼容性)

为兼容遗留 middlebox, TLS 1.3 实现:

  1. MUST 在 ServerHello 之后发送一个单独的 change_cipher_spec record 用于 middlebox compatibility.
  2. MAY 忽略 handshake 期间收到的 unexpected change_cipher_spec record (值 0x01).
  3. MUST 在 ServerHello 中使用 0x0303 作为 legacy_version.

这些不变量确保 TLS 1.3 流量对于不了解新协议版本的 middlebox 看起来足够像 TLS 1.2, 从而最大化部署成功率.