Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jtlsa Class Reference
Inheritance diagram for ProtocolPP::jtlsa:
Collaboration diagram for ProtocolPP::jtlsa:

Public Member Functions

 jtlsa ()
 
 jtlsa (direction_t dir, tls_ciphersuite_t ciphersuite, tlsver_t ver, tlstype_t type, uint16_t epoch, uint64_t seqnum, uint32_t icvlen, uint32_t ivlen, std::shared_ptr< jarray< uint8_t >> iv, uint32_t ckeylen, std::shared_ptr< jarray< uint8_t >> cipherkey, uint32_t akeylen, std::shared_ptr< jarray< uint8_t >> authkey, uint32_t saltlen, std::shared_ptr< jarray< uint8_t >> salt, uint32_t arlen, jarray< uint8_t > arwin, uint32_t mtu, bool randiv, bool ivex, bool encthenmac)
 
 jtlsa (jtlsa &rhs)
 
 jtlsa (std::shared_ptr< jtlsa > &rhs)
 
 ~jtlsa ()
 Standard deconstructor.
 
template<typename T >
void set_field (field_t field, T fieldval)
 
template<typename T >
get_field (field_t field)
 
void to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction)
 
void to_json (std::ofstream &myjson, direction_t direction, std::string &indent)
 
 jtlsa (const jtlsa &rhs)=delete
 
- Public Member Functions inherited from ProtocolPP::jsecass
 jsecass ()
 
virtual ~jsecass ()=default
 Standard deconstructor.
 
 jsecass (jsecass &jsecass)=delete
 
 jsecass (const jsecass &jsecass)=delete
 

Constructor & Destructor Documentation

◆ jtlsa() [1/4]

ProtocolPP::jtlsa::jtlsa ( )

Standard Constructor with defaults

TLS Defaults
fieldDefault Value
dirdirection_t::ENCAP
ciphersuitetls_ciphersuite_t::TLS_DH_DSS_WITH_AES_128_CBC_SHA
vertlsver_t::TLS10
typetlstype_t::APPLICATION
icvlen20
epoch0
seqnum0
ivlen16
ckeylen16
akeylen20
saltlen0
arlen0
arwin0
mtu0
randivfalse
ivextrue
encthenmacfalse
authkey0
cipherkey0
iv0
salt0

◆ jtlsa() [2/4]

ProtocolPP::jtlsa::jtlsa ( direction_t  dir,
tls_ciphersuite_t  ciphersuite,
tlsver_t  ver,
tlstype_t  type,
uint16_t  epoch,
uint64_t  seqnum,
uint32_t  icvlen,
uint32_t  ivlen,
std::shared_ptr< jarray< uint8_t >>  iv,
uint32_t  ckeylen,
std::shared_ptr< jarray< uint8_t >>  cipherkey,
uint32_t  akeylen,
std::shared_ptr< jarray< uint8_t >>  authkey,
uint32_t  saltlen,
std::shared_ptr< jarray< uint8_t >>  salt,
uint32_t  arlen,
jarray< uint8_t >  arwin,
uint32_t  mtu,
bool  randiv,
bool  ivex,
bool  encthenmac 
)

Security Association for TLS

Parameters
dir- Direction of processing (ENCAP or DECAP)
ciphersuite- Ciphersuite to use with TLS/SSL
ver- Version of TLS/SSL to use
icvlen- Length of the ICV tag
mtu- Maximum transmition unit
type- Default type of packet to send (usually Application)
epoch- Initial Epoch for DTLS
seqnum- Initial sequence number
ivlen- Length of the initialization vector (IV)
iv- Initialization Vector (IV)
ckeylen- Length of the cipher key
cipherkey- Key for the encryption algorithm
akeylen- Length of the authentication key
authkey- Key for the authentication algorithm
saltlen- Length of the salt
salt- salt for CTR, CCM, GCM, and CHACHA20 ciphers
arlen- Number og packets to track in the replay window
arwin- Anti-replay window for tracking packets
randiv- use random IV instead of IV passed in
ivex- IV is sent in the clear instead of encrypted if asserted
encthenmac- Encrypt then MAC flag set by negogiated features

◆ jtlsa() [3/4]

ProtocolPP::jtlsa::jtlsa ( jtlsa rhs)

Constructor for TLS Security Association

Parameters
rhs- Security association (SA) for this TLS flow

◆ jtlsa() [4/4]

ProtocolPP::jtlsa::jtlsa ( std::shared_ptr< jtlsa > &  rhs)
explicit

Constructor for TLS Security Association

Parameters
rhs- Security association (SA) for this TLS flow

Member Function Documentation

◆ get_field()

template<typename T >
T ProtocolPP::jtlsa::get_field ( field_t  field)

Retrieve the field from the TLS security association

TLS Get Fields
field typefield nameExample
direction_tDIRECTIONdirection_t mydir = get_field<direction_t>(field_t::DIRECTION)
tls_ciphersuite_tCIPHERSUITEtls_ciphersuite_t mycsuite = get_field<tls_ciphersuite_t>(field_t::CIPHERSUITE)
tlsver_tVERSIONtlsver_t myver = get_field<tlsver_t>(field_t::VERSION)
tlstype_tTYPEtlstype_t mytype = get_field<tlstype_t>(field_t::TYPE)
boolRANDIVbool myrandiv = get_field<bool>(field_t::RANDIV);
IVEXbool myivex = get_field<bool>(field_t::IVEX);
ENCTHENMACbool myethm = get_field<bool>(field_t::ENCTHENMAC);
uint16_tEPOCHuint16_t myepoch = get_field<uint16_t>(field_t::EPOCH);
uint32_tICVLENuint32_t myicvlen = get_field<uint32_t>(field_t::ICVLEN);
IVLENuint32_t myivlen = get_field<uint32_t>(field_t::IVLEN);
CKEYLENuint32_t myckeylen = get_field<uint32_t>(field_t::CKEYLEN);
AKEYLENuint32_t myakeylen = get_field<uint32_t>(field_t::AKEYLEN);
SALTLENuint32_t mysaltlen = get_field<uint32_t>(field_t::SALTLEN);
ARLENuint32_t myarlen = get_field<uint32_t>(field_t::ARLEN);
MTUuint32_t mymtu = get_field<uint32_t>(field_t::MTU);
uint64_tSEQNUMuint64_t myseqnum = get_field<uint64_t>(field_t::SEQNUM);
jarray<uint8_t>ARWINjarray<uint8_t> myarwin = get_field<jarray<uint8_t>>(field_t::ARWIN)
std::shared_ptr<jarray<uint8_t>>IVstd::shared_ptr<jarray<uint8_t>> myarwin = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::IV)
CIPHERKEYstd::shared_ptr<jarray<uint8_t>> myarwin = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY)
AUTHKEYstd::shared_ptr<jarray<uint8_t>> myarwin = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::AUTHKEY)
SALTstd::shared_ptr<jarray<uint8_t>> myarwin = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SALT)
Parameters
field- field to retrieve
Returns
value of the field

◆ set_field()

template<typename T >
void ProtocolPP::jtlsa::set_field ( field_t  field,
fieldval 
)

Update the field in the TLS security association

TLS Set Fields
field typefield nameExample
direction_tDIRECTIONset_field<direction_t>(field_t::DIRECTION, direction_t::DECAP)
tls_ciphersuite_tCIPHERSUITEset_field<tls_ciphersuite_t>(field_t::CIPHERSUITE, tls_ciphersuite::TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA)
tlsver_tVERSIONset_field<tlsver_t>(field_t::VERSION, tlsver_t::DTLS)
tlstype_tTYPEset_field<tlstype_t>(field_t::TYPE, tlstype_t::APPLICATION)
boolRANDIVset_field<bool>(field_t::RANDIV, true);
IVEXset_field<bool>(field_t::IVEX, true);
ENCTHENMACset_field<bool>(field_t::ENCTHENMAC, true);
uint16_tEPOCHset_field<uint16_t>(field_t::EPOCH, 0);
uint32_tICVLENset_field<uint32_t>(field_t::ICVLEN, 0);
IVLENset_field<uint32_t>(field_t::IVLEN, 0);
CKEYLENset_field<uint32_t>(field_t::CKEYLEN, 0);
AKEYLENset_field<uint32_t>(field_t::AKEYLEN, 0);
SALTLENset_field<uint32_t>(field_t::SALTLEN, 0);
ARLENset_field<uint32_t>(field_t::ARLEN, 0);
MTUset_field<uint32_t>(field_t::MTU, 0);
uint64_tSEQNUMset_field<uint64_t>(field_t::SEQNUM, 0);
jarray<uint8_t>ARWINset_field<jarray<uint8_t>>(field_t::ARWIN, jarray<uint8_t>("000000000000001"))
std::shared_ptr<jarray<uint8_t>>IVset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::IV, std::make_shared<rotocolPP::jarray<uint8_t>>("000000000000001"))
CIPHERKEYset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY, std::make_shared<rotocolPP::jarray<uint8_t>>("000000000000001"))
AUTHKEYset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::AUTHKEY, std::make_shared<rotocolPP::jarray<uint8_t>>("000000000000001"))
SALTset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SALT, std::make_shared<rotocolPP::jarray<uint8_t>>("000000000000001"))
Parameters
field- TLS field to update
fieldval- new value for the field

◆ to_json()

void ProtocolPP::jtlsa::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::jsecass.

◆ to_xml()

void ProtocolPP::jtlsa::to_xml ( tinyxml2::XMLPrinter myxml,
direction_t  direction 
)
virtual

Print the protocol and security objects to XML

Parameters
myxml- XMLPrinter object
direction- facilitator for random descriptor generation

Implements ProtocolPP::jsecass.


The documentation for this class was generated from the following file: