17.1 TLS Record protocol
The purpose of the TLS Record protocol is to cryptographically protect data in transit using the shared secret keys that Alice and Bob established using the TLS Handshake protocol. More precisely, the Record protocol takes a message that Alice wants to send, partitions the message into one or multiple blocks, protects these records by cryptographic means, and transmits the protected records. When Bob receives this information, the Record protocol ensures that the records are verified regarding their authenticity and integrity, decrypted using the correct key, and reassembled into the original message sent by Alice.
Every TLS record has one of the following four types:
handshake
application
_data
alert
change˙cipher˙spec
Having types is beneficial because this way multiple higher-level protocols can use the same record layer. If Alice or Bob receive an unexpected record type, they terminate their TLS session and transmit the unexpected˙message...