mirror of https://github.com/ctz/rustls
crypto: explain TLS 1.2 version in TLS 1.3 message encrypters
Without the context of RFC 8446 in your mind the use of the `ProtocolVersion::TLSv1_2` constant in the TLS 1.3 `MessageEncrypter` implementations appears like an oversight or copy/paste error. This commit adds a brief explanatory comment.
This commit is contained in:
parent
b2cd88697f
commit
495acf3444
|
@ -222,6 +222,8 @@ impl MessageEncrypter for AeadMessageEncrypter {
|
|||
|
||||
Ok(OpaqueMessage::new(
|
||||
ContentType::ApplicationData,
|
||||
// Note: all TLS 1.3 application data records use TLSv1_2 (0x0303) as the legacy record
|
||||
// protocol version, see https://www.rfc-editor.org/rfc/rfc8446#section-5.1
|
||||
ProtocolVersion::TLSv1_2,
|
||||
payload,
|
||||
))
|
||||
|
|
|
@ -194,6 +194,8 @@ impl MessageEncrypter for Tls13MessageEncrypter {
|
|||
|
||||
Ok(OpaqueMessage::new(
|
||||
ContentType::ApplicationData,
|
||||
// Note: all TLS 1.3 application data records use TLSv1_2 (0x0303) as the legacy record
|
||||
// protocol version, see https://www.rfc-editor.org/rfc/rfc8446#section-5.1
|
||||
ProtocolVersion::TLSv1_2,
|
||||
payload,
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue