|
| jtls (std::shared_ptr< jrand > &rand, std::shared_ptr< jtlsa > &security, std::string &replay) |
|
| jtls (std::shared_ptr< jrand > &rand, std::shared_ptr< jtlsa > &security, std::string &file, std::string &replay) |
|
virtual | ~jtls ()=default |
| Standard deconstructor.
|
|
void | encap_packet (std::shared_ptr< jarray< uint8_t >> &input, std::shared_ptr< jarray< uint8_t >> &output) |
|
void | decap_packet (std::shared_ptr< jarray< uint8_t >> &input, std::shared_ptr< jarray< uint8_t >> &output) |
|
void | set_hdr (jarray< uint8_t > &hdr) |
|
void | set_field (field_t field, uint64_t value) |
|
jarray< uint8_t > | get_hdr () |
|
uint64_t | get_field (field_t field) |
|
uint64_t | get_field (field_t field, jarray< uint8_t > &header) |
|
void | get_security (std::shared_ptr< jtlsa > &sec) |
|
void | to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction) |
|
void | to_json (std::ofstream &myjson, direction_t direction, std::string &indent) |
|
| jtls (jtls &jtls)=delete |
|
| jtls (const jtls &jtls)=delete |
|
| jprotocol (direction_t dir) |
|
| jprotocol (direction_t dir, std::string &file) |
|
| jprotocol (direction_t dir, std::shared_ptr< jrand > &rand) |
|
| jprotocol (direction_t dir, std::shared_ptr< jrand > &rand, std::string &file) |
|
virtual | ~jprotocol () |
| Standard deconstructor.
|
|
virtual void | encap_packet (std::shared_ptr< jarray< uint8_t >> &output) |
|
virtual void | decap_packet (std::shared_ptr< jarray< uint8_t >> &input) |
|
bool | hasfile () |
|
uint32_t | get_status () |
|
jarray< uint8_t > | checksum (iana_t prot, direction_t dir, jarray< uint8_t > &check, uint32_t offset=0) |
|
jarray< uint8_t > | pad (pad_t padtype, uint32_t len) |
|
| jprotocol (jprotocol &jprotocol)=delete |
|
| jprotocol (const jprotocol &jprotocol)=delete |
|
|
static void | get_prf (tls_ciphersuite_t ciphersuite, jarray< uint8_t > secret, jarray< uint8_t > label, jarray< uint8_t > seed, std::shared_ptr< jarray< uint8_t >> &output, uint32_t length) |
|
static void | hkdf_extract (tls_ciphersuite_t ciphersuite, jarray< uint8_t > &salt, jarray< uint8_t > &ikm, std::shared_ptr< jarray< uint8_t >> &prk) |
|
static void | hkdf_expand (tls_ciphersuite_t ciphersuite, uint32_t keymatlen, std::shared_ptr< jarray< uint8_t >> &prk, std::shared_ptr< jarray< uint8_t >> &info, std::shared_ptr< jarray< uint8_t >> &okm) |
|
const static std::string | currentDateTime () |
|
static std::string | str_status (uint32_t status) |
|
static jarray< uint8_t > | to_array (uint8_t input) |
|
static jarray< uint8_t > | to_array (uint16_t input) |
|
static jarray< uint8_t > | to_array (uint32_t input) |
|
static jarray< uint8_t > | to_array (uint64_t input) |
|
static uint8_t | to_u8 (jarray< uint8_t > src_array) |
|
static uint16_t | to_u16 (jarray< uint8_t > src_array) |
|
static uint32_t | to_u32 (jarray< uint8_t > src_array) |
|
static uint64_t | to_u64 (jarray< uint8_t > src_array) |
|
static uint32_t | fnv_hash (std::shared_ptr< jarray< uint8_t >> &header, jarray< uint8_t > &mask, uint32_t hdrlen) |
|
|
template<typename T , typename TE > |
std::shared_ptr< jreplay< T, TE > > | update_replay (protocol_t prot, T &seqnum, TE &extseq, bool usext, uint32_t size) |
|
template<typename T , typename TE > |
std::shared_ptr< jreplay< T, TE > > | update_replay (protocol_t prot, T &seqnum, TE &extseq, bool usext, uint32_t size, jarray< uint8_t > &window) |
|
void | update_status (uint32_t stat) |
|
void | get_data (std::shared_ptr< jarray< uint8_t >> &data) |
|
void | put_data (std::shared_ptr< jarray< uint8_t >> &wdata) |
|
void | encryptdat (std::shared_ptr< jarray< uint8_t >> &red, std::shared_ptr< jarray< uint8_t >> &black) |
|
void | decryptdat (std::shared_ptr< jarray< uint8_t >> &black, std::shared_ptr< jarray< uint8_t >> &red) |
|
uint32_t | roundup (uint32_t value, uint32_t mult) |
|
direction_t | m_dir |
| direction of processing
|
|
uint32_t | m_status |
|
std::shared_ptr< jrand > | m_rand |
| random data generator passed into constructor
|
|
std::string | m_filename |
| file input string for this protocol
|
|
std::fstream | m_file |
| input file stream object for this protocol
|
|
endian_t | m_endian |
| endianess string for this protocol
|
|
◆ jtls() [1/2]
ProtocolPP::jtls::jtls |
( |
std::shared_ptr< jrand > & |
rand, |
|
|
std::shared_ptr< jtlsa > & |
security, |
|
|
std::string & |
replay |
|
) |
| |
Constructor for TLS
- Parameters
-
rand | - Random data generation for IVs and padding |
security | - Security association (SA) for this TLS flow |
replay | - Type of packet |
◆ jtls() [2/2]
ProtocolPP::jtls::jtls |
( |
std::shared_ptr< jrand > & |
rand, |
|
|
std::shared_ptr< jtlsa > & |
security, |
|
|
std::string & |
file, |
|
|
std::string & |
replay |
|
) |
| |
Constructor for TLS
- Parameters
-
rand | - Random data generation for IVs and padding |
security | - Security association (SA) for this TLS flow |
file | - file for input/output data |
replay | - Type of packet |
◆ decap_packet()
void ProtocolPP::jtls::decap_packet |
( |
std::shared_ptr< jarray< uint8_t >> & |
input, |
|
|
std::shared_ptr< jarray< uint8_t >> & |
output |
|
) |
| |
|
virtual |
Decap will produce a payload from the packet passed
- Parameters
-
input | - packet to decapsulate with TLS |
output | - packet encapsulated with TLS |
Implements ProtocolPP::jprotocol.
◆ encap_packet()
void ProtocolPP::jtls::encap_packet |
( |
std::shared_ptr< jarray< uint8_t >> & |
input, |
|
|
std::shared_ptr< jarray< uint8_t >> & |
output |
|
) |
| |
|
virtual |
Encap will produce a packet from the payload passed
- Parameters
-
input | - payload to protect with TLS |
output | - packet encapsulated with TLS |
Implements ProtocolPP::jprotocol.
◆ get_field() [1/2]
uint64_t ProtocolPP::jtls::get_field |
( |
field_t |
field | ) |
|
|
virtual |
Retrieve the field from the security association
- Parameters
-
- Returns
- value of the field
Reimplemented from ProtocolPP::jprotocol.
◆ get_field() [2/2]
uint64_t ProtocolPP::jtls::get_field |
( |
field_t |
field, |
|
|
jarray< uint8_t > & |
header |
|
) |
| |
|
virtual |
Retrieve the field from the TLS header
- Parameters
-
field | - field to retrieve |
header | - TLS header to retrieve field from |
- Returns
- value of the field
Implements ProtocolPP::jprotocol.
◆ get_hdr()
jarray<uint8_t> ProtocolPP::jtls::get_hdr |
( |
| ) |
|
|
virtual |
◆ get_prf()
static void ProtocolPP::jtls::get_prf |
( |
tls_ciphersuite_t |
ciphersuite, |
|
|
jarray< uint8_t > |
secret, |
|
|
jarray< uint8_t > |
label, |
|
|
jarray< uint8_t > |
seed, |
|
|
std::shared_ptr< jarray< uint8_t >> & |
output, |
|
|
uint32_t |
length |
|
) |
| |
|
static |
Generate PRF material
- Parameters
-
ciphersuite | - Ciphersuite to generate PRF data for |
secret | - Key for hash function |
label | - Label for the connection |
seed | - Seed for the PRF computation |
output | - Pointer to hold output data |
length | - amount of data to produce |
◆ get_security()
void ProtocolPP::jtls::get_security |
( |
std::shared_ptr< jtlsa > & |
sec | ) |
|
get_security
- Parameters
-
sec | - Shared pointer to hold the security association |
◆ hkdf_expand()
static void ProtocolPP::jtls::hkdf_expand |
( |
tls_ciphersuite_t |
ciphersuite, |
|
|
uint32_t |
keymatlen, |
|
|
std::shared_ptr< jarray< uint8_t >> & |
prk, |
|
|
std::shared_ptr< jarray< uint8_t >> & |
info, |
|
|
std::shared_ptr< jarray< uint8_t >> & |
okm |
|
) |
| |
|
static |
hkdf_expand that expands the psuedorandom key material into the output key material using the PRK, INFO that uniquifies the output key material, and generates enough material for keymatlen
- Parameters
-
ciphersuite | - Ciphersuite to generate PRF data for |
keymatlen | - length in bytes of the output key material |
prk | - psuedorandom key for the hash function |
info | - optional context and application specific information |
okm | - output keying material (of length keymatlen) |
◆ hkdf_extract()
hkdf_extract creates the pseudorandom key using the random salt and input key material (IKM). The PRK is then expanded by hkdf_expand() to create the required output key material
- Parameters
-
ciphersuite | - Ciphersuite to generate PRF data for |
salt | - optional salt (a non-secret random value) |
ikm | - input keying material (IKM) |
prk | - a pseudorandom key of length equal to the hash output |
◆ set_field()
void ProtocolPP::jtls::set_field |
( |
field_t |
field, |
|
|
uint64_t |
value |
|
) |
| |
|
virtual |
Update the type field in the TLS header
- Parameters
-
field | - TLS field to update |
value | - new value for the field |
Implements ProtocolPP::jprotocol.
◆ set_hdr()
void ProtocolPP::jtls::set_hdr |
( |
jarray< uint8_t > & |
hdr | ) |
|
|
virtual |
◆ to_json()
void ProtocolPP::jtls::to_json |
( |
std::ofstream & |
myjson, |
|
|
direction_t |
direction, |
|
|
std::string & |
indent |
|
) |
| |
|
virtual |
Print the protocol and security objects to JSON
- Parameters
-
myjson | - JSON object |
direction | - facilitator for random descriptor generation |
indent | - indentation for JSON output |
Implements ProtocolPP::jprotocol.
◆ to_xml()
Print the protocol and security objects to XML
- Parameters
-
myxml | - XMLPrinter object |
direction | - facilitator for random descriptor generation |
Implements ProtocolPP::jprotocol.
The documentation for this class was generated from the following file: