PcapPlusPlus  20.08
pcpp::SSLHandshakeMessage Class Referenceabstract

#include <SSLHandshake.h>

Inheritance diagram for pcpp::SSLHandshakeMessage:
pcpp::SSLCertificateMessage pcpp::SSLCertificateRequestMessage pcpp::SSLCertificateVerifyMessage pcpp::SSLClientHelloMessage pcpp::SSLClientKeyExchangeMessage pcpp::SSLFinishedMessage pcpp::SSLHelloRequestMessage pcpp::SSLNewSessionTicketMessage pcpp::SSLServerHelloDoneMessage pcpp::SSLServerHelloMessage pcpp::SSLServerKeyExchangeMessage pcpp::SSLUnknownMessage

Public Member Functions

virtual SSLHandshakeType getHandshakeType () const
 
virtual size_t getMessageLength () const
 
virtual bool isMessageComplete () const
 
SSLHandshakeLayergetContainingLayer () const
 
virtual std::string toString () const =0
 

Static Public Member Functions

static SSLHandshakeMessagecreateHandhakeMessage (uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
 

Detailed Description

A base class for SSL/TLS handshake messages. This is an abstract class and cannot be instantiated. SSL/TLS handshake messages are contained in SSLHandshakeLayer, meaning a SSLHandshakeLayer instance can contain one or more SSLHandshakeMessage instances. For example: one SSLHandshakeLayer may contain a server-hello, certificate, server-key-exchange, and server-hello-done messages (although it's not such a common case, most handshake layers contain 1 handshake message only)

Member Function Documentation

◆ createHandhakeMessage()

static SSLHandshakeMessage* pcpp::SSLHandshakeMessage::createHandhakeMessage ( uint8_t *  data,
size_t  dataLen,
SSLHandshakeLayer container 
)
static

A factory method for creating instances of handshake messages from raw data

Parameters
[in]dataThe raw data containing 1 handshake message
[in]dataLenRaw data length in bytes
[in]containerA pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container

◆ getContainingLayer()

SSLHandshakeLayer* pcpp::SSLHandshakeMessage::getContainingLayer ( ) const
inline
Returns
A pointer to the SSLHandshakeLayer instance containing this message

◆ getHandshakeType()

virtual SSLHandshakeType pcpp::SSLHandshakeMessage::getHandshakeType ( ) const
virtual
Returns
The handshake message type

Reimplemented in pcpp::SSLUnknownMessage.

◆ getMessageLength()

virtual size_t pcpp::SSLHandshakeMessage::getMessageLength ( ) const
virtual
Returns
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet

Reimplemented in pcpp::SSLUnknownMessage.

◆ isMessageComplete()

virtual bool pcpp::SSLHandshakeMessage::isMessageComplete ( ) const
virtual
Returns
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)

◆ toString()