TLS Handshake Model

This example demonstrates modeling TLS Handshake Protocol.

Module Downloads: | [.cfr] | [.html] |

Feature modeling

abstract final Feature
abstract final FeatureModel
TLSFeatures : FeatureModel
annonymousMode : Feature ?
clientAuthentication : Feature ?
abstract final Domain
enum ProtocolVersion = SSL2_0 | SSL3_0 | TLS1_0 | TLS1_1 | TLS1_2
enum HandshakeStatus = initiated | completed | failed
abstract Port
abstract final Message

Server side messages

serverHelloRequestMessage : Message
serverHelloMessage : Message
serverCertificateMessage : Message
serverKeyExchangeMessage : Message
serverCertificateRequestMessage : Message
serverHelloDoneMessage : Message
serverChangeCipherSpecMessage : Message
serverFinishedMessage : Message
protocolMismatch : Message

Client side messages

clientHelloMessage : Message
clientCertificateMessage : Message
clientKeyExchangeMessage : Message
certificateVerifyMessage : Message
clientChangeCipherSpecMessage : Message
clientFinishedMessage : Message

Application data

applicationDataMessage : Message

Nodes

abstract final Node : Domain
send : Port -> Message
receive : Port -> Message
protocolversion -> ProtocolVersion +
certificate ?
signing ?
abstract final Server : Node
abstract final Client : Node

connecting messages

Concrete client and server

The main protocol

Protocol : Domain
final client -> aClient
final server -> OurServer
handshakeStatus -> HandshakeStatus
xor channel
initial clientHello --> serverResponse
[ handshakeStatus = initiated ]
serverHelloDone --> clientResponse
xor serverFinish --> serverFinished
[ handshakeStatus = initiated ]
initial serverChangeCipherSpec
serverFinished --> dataTransfer
[ handshakeStatus = completed ]
dataTransfer -->> handshakeStatus = initiated
[ handshakeStatus = completed ]
fatalError
[ handshakeStatus = failed ]