8 #include "X509Decoder.h"
36 : m_Id(id), m_KeyExAlg(keyExAlg), m_AuthAlg(authAlg), m_SymKeyAlg(symKeyAlg), m_MACAlg(MACAlg), m_Name(name)
105 PCPP_DEPRECATED(
"Unbound memory span. Use the constructor with bounded span.")
150 template <typename T, typename std::enable_if_t<std::is_base_of<
SSLExtension, T>::value,
bool> = true>
164 return std::make_unique<T>(data, dataLen);
255 : m_Data(data), m_DataLen(dataLen), m_AllDataExists(
allDataExists)
285 return m_AllDataExists;
289 std::unique_ptr<Asn1Record> m_Asn1Record;
292 bool m_AllDataExists;
295 class SSLHandshakeLayer;
788 std::vector<SSLClientCertificateType> m_ClientCertificateTypes;
947 size_t vecSize = m_ExtensionList.size();
948 for (
size_t i = 0; i < vecSize; i++)
951 if (
dynamic_cast<TExtension*
>(curElem) !=
nullptr)
952 return static_cast<TExtension*
>(curElem);
960 size_t vecSize = m_ExtensionList.size();
961 for (
size_t i = 0; i < vecSize; i++)
964 if (
dynamic_cast<TExtension*
>(curElem) !=
nullptr)
965 return static_cast<TExtension*
>(curElem);
Definition: Asn1Codec.h:355
Definition: PointerVector.h:50
Definition: SSLHandshake.h:632
std::string toString() const override
SSLCertificateMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
SSLx509Certificate * getCertificate(int index) const
int getNumOfCertificates() const
Definition: SSLHandshake.h:758
size_t getCertificateAuthorityLength() const
std::vector< SSLClientCertificateType > & getCertificateTypes()
uint8_t * getCertificateAuthorityData() const
std::string toString() const override
SSLCertificateRequestMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:818
SSLCertificateVerifyMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:825
std::string toString() const override
size_t getSignedHashLength() const
uint8_t * getSignedHash() const
Definition: SSLHandshake.h:25
SSLAuthenticationAlgorithm getAuthAlg() const
Definition: SSLHandshake.h:58
SSLHashingAlgorithm getMACAlg() const
Definition: SSLHandshake.h:70
uint16_t getID() const
Definition: SSLHandshake.h:40
SSLCipherSuite(uint16_t id, SSLKeyExchangeAlgorithm keyExAlg, SSLAuthenticationAlgorithm authAlg, SSLSymetricEncryptionAlgorithm symKeyAlg, SSLHashingAlgorithm MACAlg, const char *name)
Definition: SSLHandshake.h:34
SSLSymetricEncryptionAlgorithm getSymKeyAlg() const
Definition: SSLHandshake.h:64
SSLKeyExchangeAlgorithm getKeyExchangeAlg() const
Definition: SSLHandshake.h:52
static SSLCipherSuite * getCipherSuiteByName(std::string name)
std::string asString() const
Definition: SSLHandshake.h:46
static SSLCipherSuite * getCipherSuiteByID(uint16_t id)
Definition: SSLHandshake.h:350
uint16_t getCipherSuiteID(int index, bool &isValid) const
uint16_t getExtensionsLength() const
SSLExtension * getExtensionOfType(uint16_t type) const
SSLExtension * getExtensionOfType(SSLExtensionType type) const
SSLClientHelloMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
std::string toString() const override
TExtension * getExtensionOfType() const
Definition: SSLHandshake.h:945
uint8_t getSessionIDLength() const
SSLCipherSuite * getCipherSuite(int index) const
int getCipherSuiteCount() const
ssl_tls_client_server_hello * getClientHelloHeader() const
Definition: SSLHandshake.h:401
uint8_t * getSessionID() const
uint8_t getCompressionMethodsValue() const
SSLExtension * getExtension(int index) const
int getExtensionCount() const
ClientHelloTLSFingerprint generateTLSFingerprint() const
SSLVersion getHandshakeVersion() const
Definition: SSLHandshake.h:725
SSLClientKeyExchangeMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:732
std::string toString() const override
uint8_t * getClientKeyExchangeParams() const
size_t getClientKeyExchangeParamsLength() const
Definition: SSLHandshake.h:99
uint16_t getLength() const
SSLExtension(uint8_t *data)
uint16_t getTotalLength() const
static std::unique_ptr< T > tryCreateExtension(uint8_t *data, size_t dataLen)
A static method that tries to create an instance of a specific extension type.
Definition: SSLHandshake.h:151
uint16_t getTypeAsInt() const
SSLExtensionType getType() const
uint8_t * getData() const
Definition: SSLHandshake.h:852
uint8_t * getSignedHash() const
std::string toString() const override
SSLFinishedMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:859
size_t getSignedHashLength() const
Definition: SSLLayer.h:303
Definition: SSLHandshake.h:304
static SSLHandshakeMessage * createHandshakeMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
virtual size_t getMessageLength() const
virtual SSLHandshakeType getHandshakeType() const
virtual std::string toString() const =0
SSLHandshakeLayer * getContainingLayer() const
Definition: SSLHandshake.h:330
virtual bool isMessageComplete() const
Definition: SSLHandshake.h:668
SSLHelloRequestMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:675
std::string toString() const override
Definition: SSLHandshake.h:885
size_t getSessionTicketDataLength() const
SSLNewSessionTicketMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:892
std::string toString() const override
uint8_t * getSessionTicketData() const
Definition: SSLHandshake.h:795
std::string toString() const override
SSLServerHelloDoneMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:802
Definition: SSLHandshake.h:495
uint8_t getSessionIDLength() const
SSLExtension * getExtensionOfType(uint16_t type) const
uint16_t getExtensionsLength() const
SSLServerHelloMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
SSLExtension * getExtensionOfType(SSLExtensionType type) const
std::string toString() const override
ssl_tls_client_server_hello * getServerHelloHeader() const
Definition: SSLHandshake.h:537
int getExtensionCount() const
SSLVersion getHandshakeVersion() const
uint16_t getCipherSuiteID(bool &isValid) const
uint8_t getCompressionMethodsValue() const
SSLExtension * getExtension(int index) const
SSLCipherSuite * getCipherSuite() const
TExtension * getExtensionOfType() const
Definition: SSLHandshake.h:958
ServerHelloTLSFingerprint generateTLSFingerprint() const
uint8_t * getSessionID() const
Definition: SSLHandshake.h:691
SSLServerKeyExchangeMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:698
std::string toString() const override
uint8_t * getServerKeyExchangeParams() const
size_t getServerKeyExchangeParamsLength() const
Definition: SSLHandshake.h:196
std::string getHostName() const
Definition: SSLHandshake.h:208
std::vector< SSLVersion > getSupportedVersions() const
Definition: SSLHandshake.h:919
SSLHandshakeType getHandshakeType() const override
std::string toString() const override
SSLUnknownMessage(uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)
Definition: SSLHandshake.h:926
size_t getMessageLength() const override
Definition: SSLCommon.h:98
Definition: SSLHandshake.h:246
SSLx509Certificate(uint8_t *data, size_t dataLen, bool allDataExists)
Definition: SSLHandshake.h:254
Asn1SequenceRecord * getRootAsn1Record()
size_t getDataLength() const
Definition: SSLHandshake.h:265
bool allDataExists() const
Definition: SSLHandshake.h:283
std::unique_ptr< X509Certificate > getX509Certificate()
uint8_t * getData() const
Definition: SSLHandshake.h:259
Definition: SSLHandshake.h:220
std::vector< uint16_t > getSupportedGroups() const
The main namespace for the PcapPlusPlus lib.
Definition: AssertionUtils.h:19
SSLKeyExchangeAlgorithm
SSL/TLS key exchange algorithms.
Definition: SSLCommon.h:291
SSLExtensionType
SSL/TLS extension types.
Definition: SSLCommon.h:459
SSLSymetricEncryptionAlgorithm
SSL/TLS symmetric encryption algorithms.
Definition: SSLCommon.h:353
SSLAuthenticationAlgorithm
SSL/TLS authentication algorithms.
Definition: SSLCommon.h:322
SSLHandshakeType
SSL/TLS handshake message types.
Definition: SSLCommon.h:188
SSLHashingAlgorithm
SSL/TLS hashing algorithms.
Definition: SSLCommon.h:434
Definition: SSLHandshake.h:359
std::vector< uint8_t > ecPointFormats
A list of EC point formats taken from the "EC point formats" TLS extension (if exist in the message)
Definition: SSLHandshake.h:369
std::pair< std::string, std::string > toStringAndMD5()
std::vector< uint16_t > extensions
A list of extension IDs.
Definition: SSLHandshake.h:365
std::vector< uint16_t > cipherSuites
A list of Cipher Suite IDs.
Definition: SSLHandshake.h:363
std::vector< uint16_t > supportedGroups
A list of Suppotred Groups taken from the "supported groups" TLS extension (if exist in the message)
Definition: SSLHandshake.h:367
uint16_t tlsVersion
TLS version.
Definition: SSLHandshake.h:361
Definition: SSLHandshake.h:171
uint8_t extensionData[]
Extension data as raw (byte array)
Definition: SSLHandshake.h:177
uint16_t extensionType
Extension type.
Definition: SSLHandshake.h:173
uint16_t getDataLength() const
Gets the extension length in host byte order.
uint16_t extensionDataLength
Extension length.
Definition: SSLHandshake.h:175
Definition: SSLHandshake.h:503
uint16_t tlsVersion
TLS version.
Definition: SSLHandshake.h:505
uint16_t cipherSuite
Cipher Suite ID.
Definition: SSLHandshake.h:507
std::vector< uint16_t > extensions
A list of extension IDs.
Definition: SSLHandshake.h:509
std::pair< std::string, std::string > toStringAndMD5()
Definition: SSLCommon.h:47