1 #ifndef PACKETPP_SSL_HANDSHAKE_MESSAGE 2 #define PACKETPP_SSL_HANDSHAKE_MESSAGE 47 : m_Id(id), m_KeyExAlg(keyExAlg), m_AuthAlg(authAlg), m_SymKeyAlg(symKeyAlg), m_MACAlg(MACAlg), m_Name(name) {}
52 uint16_t
getID()
const {
return m_Id; }
57 std::string
asString()
const {
return m_Name; }
128 uint16_t getTypeAsInt()
const;
133 uint16_t getLength()
const;
138 uint16_t getTotalLength()
const;
143 uint8_t* getData()
const;
158 uint8_t extensionData[];
184 std::string getHostName()
const;
205 std::vector<SSLVersion> getSupportedVersions()
const;
226 std::vector<uint16_t> getSupportedGroups()
const;
247 std::vector<uint8_t> getECPointFormatList()
const;
270 : m_Data(data), m_DataLen(dataLen), m_AllDataExists(allDataExists) {}
292 bool m_AllDataExists;
331 virtual size_t getMessageLength()
const;
339 virtual bool isMessageComplete()
const;
349 virtual std::string toString()
const = 0;
402 std::string toString();
413 std::pair<std::string, std::string> toStringAndMD5();
442 uint8_t getSessionIDLength()
const;
447 uint8_t* getSessionID()
const;
452 int getCipherSuiteCount()
const;
473 uint16_t getCipherSuiteID(
int index,
bool& isValid)
const;
478 uint8_t getCompressionMethodsValue()
const;
483 int getExtensionCount()
const;
488 uint16_t getExtensionsLenth()
const;
521 template<
class TExtension>
522 TExtension* getExtensionOfType()
const;
538 std::string toString()
const;
578 std::string toString();
589 std::pair<std::string, std::string> toStringAndMD5();
622 uint8_t getSessionIDLength()
const;
627 uint8_t* getSessionID()
const;
644 uint16_t getCipherSuiteID(
bool& isValid)
const;
649 uint8_t getCompressionMethodsValue()
const;
654 int getExtensionCount()
const;
659 uint16_t getExtensionsLenth()
const;
692 template<
class TExtension>
693 TExtension* getExtensionOfType()
const;
710 std::string toString()
const;
747 int getNumOfCertificates()
const;
759 std::string toString()
const;
788 std::string toString()
const;
818 uint8_t* getServerKeyExchangeParams()
const;
826 size_t getServerKeyExchangeParamsLength()
const;
830 std::string toString()
const;
860 uint8_t* getClientKeyExchangeParams()
const;
868 size_t getClientKeyExchangeParamsLength()
const;
872 std::string toString()
const;
899 std::vector<SSLClientCertificateType>& getCertificateTypes();
906 uint8_t* getCertificateAuthorityData()
const;
914 size_t getCertificateAuthorityLength()
const;
918 std::string toString()
const;
921 std::vector<SSLClientCertificateType> m_ClientCertificateTypes;
947 std::string toString()
const;
977 uint8_t* getSignedHash()
const;
985 size_t getSignedHashLength()
const;
989 std::string toString()
const;
1019 uint8_t* getSignedHash()
const;
1027 size_t getSignedHashLength()
const;
1031 std::string toString()
const;
1060 uint8_t* getSessionTicketData()
const;
1068 size_t getSessionTicketDataLength()
const;
1072 std::string toString()
const;
1109 size_t getMessageLength()
const;
1111 std::string toString()
const;
1114 template<
class TExtension>
1117 size_t vecSize = m_ExtensionList.size();
1118 for (
size_t i = 0; i < vecSize; i++)
1121 if (dynamic_cast<TExtension*>(curElem) != NULL)
1122 return (TExtension*)curElem;
1128 template<
class TExtension>
1131 size_t vecSize = m_ExtensionList.size();
1132 for (
size_t i = 0; i < vecSize; i++)
1135 if (dynamic_cast<TExtension*>(curElem) != NULL)
1136 return (TExtension*)curElem;
The main namespace for the PcapPlusPlus lib.
static SSLCipherSuite * getCipherSuiteByID(uint16_t id)
Definition: SSLHandshake.h:257
bool allDataExists() const
Definition: SSLHandshake.h:287
uint16_t extensionDataLength
Definition: SSLHandshake.h:156
SSLSymetricEncryptionAlgorithm getSymKeyAlg() const
Definition: SSLHandshake.h:72
SSLHandshakeLayer * getContainingLayer() const
Definition: SSLHandshake.h:344
SSLKeyExchangeAlgorithm
Definition: SSLCommon.h:325
uint16_t getID() const
Definition: SSLHandshake.h:52
SSLUnknownMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:1093
Definition: PointerVector.h:24
Definition: SSLLayer.h:306
Definition: SSLHandshake.h:172
uint16_t cipherSuite
Definition: SSLHandshake.h:567
Definition: SSLHandshake.h:930
Definition: SSLHandshake.h:379
SSLExtensionType
Definition: SSLCommon.h:501
SSLServerNameIndicationExtension(uint8_t *data)
Definition: SSLHandshake.h:179
SSLAuthenticationAlgorithm
Definition: SSLCommon.h:358
size_t getDataLength() const
Definition: SSLHandshake.h:280
SSLFinishedMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:1010
Definition: SSLHandshake.h:109
Definition: SSLHandshake.h:999
SSLClientKeyExchangeMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:851
std::vector< uint16_t > cipherSuites
Definition: SSLHandshake.h:384
ssl_tls_client_server_hello * getClientHelloHeader() const
Definition: SSLHandshake.h:431
uint16_t tlsVersion
Definition: SSLHandshake.h:565
SSLHandshakeType
Definition: SSLCommon.h:216
Definition: SSLHandshake.h:725
std::vector< uint8_t > ecPointFormats
Definition: SSLHandshake.h:390
Definition: SSLHandshake.h:957
Definition: SSLHandshake.h:798
Definition: SSLHandshake.h:551
SSLSymetricEncryptionAlgorithm
Definition: SSLCommon.h:391
TExtension * getExtensionOfType() const
Definition: SSLHandshake.h:1115
static SSLCipherSuite * getCipherSuiteByName(std::string name)
Definition: SSLHandshake.h:771
Definition: SSLHandshake.h:193
SSLHelloRequestMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:782
SSLx509Certificate(uint8_t *data, size_t dataLen, bool allDataExists)
Definition: SSLHandshake.h:269
Definition: SSLHandshake.h:307
ssl_tls_client_server_hello * getServerHelloHeader() const
Definition: SSLHandshake.h:607
SSLNewSessionTicketMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:1051
Definition: SSLHandshake.h:840
SSLHashingAlgorithm
Definition: SSLCommon.h:474
std::vector< uint16_t > extensions
Definition: SSLHandshake.h:386
SSLHashingAlgorithm getMACAlg() const
Definition: SSLHandshake.h:77
Definition: SSLCommon.h:118
SSLCipherSuite(uint16_t id, SSLKeyExchangeAlgorithm keyExAlg, SSLAuthenticationAlgorithm authAlg, SSLSymetricEncryptionAlgorithm symKeyAlg, SSLHashingAlgorithm MACAlg, const char *name)
Definition: SSLHandshake.h:42
SSLKeyExchangeAlgorithm getKeyExchangeAlg() const
Definition: SSLHandshake.h:62
Definition: SSLHandshake.h:1082
Definition: SSLHandshake.h:151
uint8_t * getData() const
Definition: SSLHandshake.h:275
Definition: SSLCommon.h:58
SSLServerHelloDoneMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:941
SSLServerKeyExchangeMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:809
uint16_t extensionType
Definition: SSLHandshake.h:154
SSLCertificateVerifyMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:968
Definition: SSLHandshake.h:562
std::vector< uint16_t > extensions
Definition: SSLHandshake.h:569
Definition: SSLHandshake.h:30
std::vector< uint16_t > supportedGroups
Definition: SSLHandshake.h:388
SSLSupportedVersionsExtension(uint8_t *data)
Definition: SSLHandshake.h:200
Definition: SSLHandshake.h:367
Definition: SSLHandshake.h:881
Definition: SSLHandshake.h:214
uint16_t tlsVersion
Definition: SSLHandshake.h:382
TLSSupportedGroupsExtension(uint8_t *data)
Definition: SSLHandshake.h:221
std::string asString() const
Definition: SSLHandshake.h:57
SSLAuthenticationAlgorithm getAuthAlg() const
Definition: SSLHandshake.h:67
TExtension * getExtensionOfType() const
Definition: SSLHandshake.h:1129
Definition: SSLHandshake.h:1040