1 #ifndef PACKETPP_SSL_HANDSHAKE_MESSAGE 2 #define PACKETPP_SSL_HANDSHAKE_MESSAGE 8 #ifndef PCPP_DEPRECATED 9 #if defined(__GNUC__) || defined(__clang__) 10 #define PCPP_DEPRECATED __attribute__((deprecated)) 11 #elif defined(_MSC_VER) 12 #define PCPP_DEPRECATED __declspec(deprecated) 14 #pragma message("WARNING: DEPRECATED feature is not implemented for this compiler") 15 #define PCPP_DEPRECATED 58 : m_Id(id), m_KeyExAlg(keyExAlg), m_AuthAlg(authAlg), m_SymKeyAlg(symKeyAlg), m_MACAlg(MACAlg), m_Name(name) {}
63 uint16_t
getID()
const {
return m_Id; }
68 std::string
asString()
const {
return m_Name; }
139 uint16_t getTypeAsInt()
const;
144 uint16_t getLength()
const;
149 uint16_t getTotalLength()
const;
154 uint8_t* getData()
const;
169 uint8_t extensionData[];
195 std::string getHostName()
const;
216 std::vector<SSLVersion> getSupportedVersions()
const;
237 std::vector<uint16_t> getSupportedGroups()
const;
258 std::vector<uint8_t> getECPointFormatList()
const;
281 : m_Data(data), m_DataLen(dataLen), m_AllDataExists(allDataExists) {}
303 bool m_AllDataExists;
347 virtual size_t getMessageLength()
const;
355 virtual bool isMessageComplete()
const;
365 virtual std::string toString()
const = 0;
418 std::string toString();
429 std::pair<std::string, std::string> toStringAndMD5();
458 uint8_t getSessionIDLength()
const;
463 uint8_t* getSessionID()
const;
468 int getCipherSuiteCount()
const;
489 uint16_t getCipherSuiteID(
int index,
bool& isValid)
const;
494 uint8_t getCompressionMethodsValue()
const;
499 int getExtensionCount()
const;
504 PCPP_DEPRECATED uint16_t getExtensionsLenth()
const {
return getExtensionsLength(); };
509 uint16_t getExtensionsLength()
const;
542 template<
class TExtension>
543 TExtension* getExtensionOfType()
const;
559 std::string toString()
const;
599 std::string toString();
610 std::pair<std::string, std::string> toStringAndMD5();
643 uint8_t getSessionIDLength()
const;
648 uint8_t* getSessionID()
const;
665 uint16_t getCipherSuiteID(
bool& isValid)
const;
670 uint8_t getCompressionMethodsValue()
const;
675 int getExtensionCount()
const;
680 PCPP_DEPRECATED uint16_t getExtensionsLenth()
const {
return getExtensionsLength(); };
685 uint16_t getExtensionsLength()
const;
718 template<
class TExtension>
719 TExtension* getExtensionOfType()
const;
736 std::string toString()
const;
773 int getNumOfCertificates()
const;
785 std::string toString()
const;
814 std::string toString()
const;
844 uint8_t* getServerKeyExchangeParams()
const;
852 size_t getServerKeyExchangeParamsLength()
const;
856 std::string toString()
const;
886 uint8_t* getClientKeyExchangeParams()
const;
894 size_t getClientKeyExchangeParamsLength()
const;
898 std::string toString()
const;
925 std::vector<SSLClientCertificateType>& getCertificateTypes();
932 uint8_t* getCertificateAuthorityData()
const;
940 size_t getCertificateAuthorityLength()
const;
944 std::string toString()
const;
947 std::vector<SSLClientCertificateType> m_ClientCertificateTypes;
973 std::string toString()
const;
1003 uint8_t* getSignedHash()
const;
1011 size_t getSignedHashLength()
const;
1015 std::string toString()
const;
1045 uint8_t* getSignedHash()
const;
1053 size_t getSignedHashLength()
const;
1057 std::string toString()
const;
1086 uint8_t* getSessionTicketData()
const;
1094 size_t getSessionTicketDataLength()
const;
1098 std::string toString()
const;
1135 size_t getMessageLength()
const;
1137 std::string toString()
const;
1140 template<
class TExtension>
1143 size_t vecSize = m_ExtensionList.size();
1144 for (
size_t i = 0; i < vecSize; i++)
1147 if (dynamic_cast<TExtension*>(curElem) != NULL)
1148 return (TExtension*)curElem;
1154 template<
class TExtension>
1157 size_t vecSize = m_ExtensionList.size();
1158 for (
size_t i = 0; i < vecSize; i++)
1161 if (dynamic_cast<TExtension*>(curElem) != NULL)
1162 return (TExtension*)curElem;
The main namespace for the PcapPlusPlus lib.
static SSLCipherSuite * getCipherSuiteByID(uint16_t id)
Definition: SSLHandshake.h:268
bool allDataExists() const
Definition: SSLHandshake.h:298
uint16_t extensionDataLength
Definition: SSLHandshake.h:167
SSLSymetricEncryptionAlgorithm getSymKeyAlg() const
Definition: SSLHandshake.h:83
SSLHandshakeLayer * getContainingLayer() const
Definition: SSLHandshake.h:360
SSLKeyExchangeAlgorithm
Definition: SSLCommon.h:325
uint16_t getID() const
Definition: SSLHandshake.h:63
SSLUnknownMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:1119
Definition: PointerVector.h:24
Definition: SSLLayer.h:306
Definition: SSLHandshake.h:183
uint16_t cipherSuite
Definition: SSLHandshake.h:588
Definition: SSLHandshake.h:956
Definition: SSLHandshake.h:395
SSLExtensionType
Definition: SSLCommon.h:501
SSLServerNameIndicationExtension(uint8_t *data)
Definition: SSLHandshake.h:190
SSLAuthenticationAlgorithm
Definition: SSLCommon.h:358
size_t getDataLength() const
Definition: SSLHandshake.h:291
SSLFinishedMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:1036
Definition: SSLHandshake.h:120
Definition: SSLHandshake.h:1025
SSLClientKeyExchangeMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:877
std::vector< uint16_t > cipherSuites
Definition: SSLHandshake.h:400
ssl_tls_client_server_hello * getClientHelloHeader() const
Definition: SSLHandshake.h:447
uint16_t tlsVersion
Definition: SSLHandshake.h:586
SSLHandshakeType
Definition: SSLCommon.h:216
Definition: SSLHandshake.h:751
std::vector< uint8_t > ecPointFormats
Definition: SSLHandshake.h:406
Definition: SSLHandshake.h:983
Definition: SSLHandshake.h:824
Definition: SSLHandshake.h:572
SSLSymetricEncryptionAlgorithm
Definition: SSLCommon.h:391
TExtension * getExtensionOfType() const
Definition: SSLHandshake.h:1141
static SSLCipherSuite * getCipherSuiteByName(std::string name)
Definition: SSLHandshake.h:797
Definition: SSLHandshake.h:204
SSLHelloRequestMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:808
SSLx509Certificate(uint8_t *data, size_t dataLen, bool allDataExists)
Definition: SSLHandshake.h:280
Definition: SSLHandshake.h:318
ssl_tls_client_server_hello * getServerHelloHeader() const
Definition: SSLHandshake.h:628
SSLNewSessionTicketMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:1077
Definition: SSLHandshake.h:866
SSLHashingAlgorithm
Definition: SSLCommon.h:474
std::vector< uint16_t > extensions
Definition: SSLHandshake.h:402
SSLHashingAlgorithm getMACAlg() const
Definition: SSLHandshake.h:88
Definition: SSLCommon.h:118
SSLCipherSuite(uint16_t id, SSLKeyExchangeAlgorithm keyExAlg, SSLAuthenticationAlgorithm authAlg, SSLSymetricEncryptionAlgorithm symKeyAlg, SSLHashingAlgorithm MACAlg, const char *name)
Definition: SSLHandshake.h:53
SSLKeyExchangeAlgorithm getKeyExchangeAlg() const
Definition: SSLHandshake.h:73
Definition: SSLHandshake.h:1108
Definition: SSLHandshake.h:162
uint8_t * getData() const
Definition: SSLHandshake.h:286
Definition: SSLCommon.h:58
SSLServerHelloDoneMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:967
SSLServerKeyExchangeMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:835
uint16_t extensionType
Definition: SSLHandshake.h:165
SSLCertificateVerifyMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:994
Definition: SSLHandshake.h:583
std::vector< uint16_t > extensions
Definition: SSLHandshake.h:590
Definition: SSLHandshake.h:41
std::vector< uint16_t > supportedGroups
Definition: SSLHandshake.h:404
SSLSupportedVersionsExtension(uint8_t *data)
Definition: SSLHandshake.h:211
Definition: SSLHandshake.h:383
Definition: SSLHandshake.h:907
Definition: SSLHandshake.h:225
uint16_t tlsVersion
Definition: SSLHandshake.h:398
TLSSupportedGroupsExtension(uint8_t *data)
Definition: SSLHandshake.h:232
std::string asString() const
Definition: SSLHandshake.h:68
SSLAuthenticationAlgorithm getAuthAlg() const
Definition: SSLHandshake.h:78
TExtension * getExtensionOfType() const
Definition: SSLHandshake.h:1155
Definition: SSLHandshake.h:1066