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

Public Member Functions

 jwifi (std::shared_ptr< jrand > &rand, std::shared_ptr< jwifisa > &security, std::string &replay)
 
virtual ~jwifi ()=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< jwifisa > &sec)
 
void to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction)
 
void to_json (std::ofstream &myjson, direction_t direction, std::string &indent)
 
 jwifi (jwifi &jwifi)=delete
 
 jwifi (const jwifi &jwifi)=delete
 
- Public Member Functions inherited from ProtocolPP::jprotocol
 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 Public Member Functions

static void pbkdf2 (auth_t auth, std::shared_ptr< jarray< uint8_t >> &passphrase, std::shared_ptr< jarray< uint8_t >> &ssid, std::shared_ptr< jarray< uint8_t >> &output, uint32_t outlen, uint32_t iterations)
 
static void prf (auth_t auth, std::shared_ptr< jarray< uint8_t >> &key, std::shared_ptr< jarray< uint8_t >> &label, std::shared_ptr< jarray< uint8_t >> &context, std::shared_ptr< jarray< uint8_t >> &prfout, uint32_t outlen)
 
static void kdf (auth_t auth, std::shared_ptr< jarray< uint8_t >> &key, std::shared_ptr< jarray< uint8_t >> &label, std::shared_ptr< jarray< uint8_t >> &context, std::shared_ptr< jarray< uint8_t >> &devkey, uint32_t outlen)
 
- Static Public Member Functions inherited from ProtocolPP::jprotocol
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)
 

Additional Inherited Members

- Protected Member Functions inherited from ProtocolPP::jprotocol
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)
 
- Protected Attributes inherited from ProtocolPP::jprotocol
direction_t m_dir
 direction of processing
 
uint32_t m_status
 
std::shared_ptr< jrandm_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
 

Constructor & Destructor Documentation

◆ jwifi()

ProtocolPP::jwifi::jwifi ( std::shared_ptr< jrand > &  rand,
std::shared_ptr< jwifisa > &  security,
std::string &  replay 
)

Constructor for Wifi

Parameters
rand- randomzier
security- Security association (SA) for this Wifi flow
replay- type of packets to generate

Member Function Documentation

◆ decap_packet()

void ProtocolPP::jwifi::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 WEP/WPA
output- packet encapsulated with WEP/WPA

Implements ProtocolPP::jprotocol.

◆ encap_packet()

void ProtocolPP::jwifi::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 WEP/WPA
output- packet encapsulated with WEP/WPA

Implements ProtocolPP::jprotocol.

◆ get_field() [1/2]

uint64_t ProtocolPP::jwifi::get_field ( field_t  field)
virtual

Retrieve the field from the Wifi security association

Parameters
field- field to retrieve
Returns
field

Reimplemented from ProtocolPP::jprotocol.

◆ get_field() [2/2]

uint64_t ProtocolPP::jwifi::get_field ( field_t  field,
jarray< uint8_t > &  header 
)
virtual

Retrieve the field from the Wifi header

Parameters
field- field to retrieve
header- header to extract the field from
Returns
field

Implements ProtocolPP::jprotocol.

◆ get_hdr()

jarray<uint8_t> ProtocolPP::jwifi::get_hdr ( )
virtual

Retrieve the Wifi header

Returns
current Wifi header

Implements ProtocolPP::jprotocol.

◆ get_security()

void ProtocolPP::jwifi::get_security ( std::shared_ptr< jwifisa > &  sec)

get_security

Parameters
sec- Shared pointer to hold the security association

◆ kdf()

static void ProtocolPP::jwifi::kdf ( auth_t  auth,
std::shared_ptr< jarray< uint8_t >> &  key,
std::shared_ptr< jarray< uint8_t >> &  label,
std::shared_ptr< jarray< uint8_t >> &  context,
std::shared_ptr< jarray< uint8_t >> &  devkey,
uint32_t  outlen 
)
static

Key derivation function (KDF) for Wifi

Parameters
auth- authentication algorithm (auth_t::SHA1, auth_t::SHA256, auth_t::SHA384, auth_t::SHA512)
key- key for hash function
label- string identifying purpose of keys derived using KDF
context- bit string to provide context to identify the derived key
devkey- the calculated derived key
outlen- length of the output derived key (in bits)

◆ pbkdf2()

static void ProtocolPP::jwifi::pbkdf2 ( auth_t  auth,
std::shared_ptr< jarray< uint8_t >> &  passphrase,
std::shared_ptr< jarray< uint8_t >> &  ssid,
std::shared_ptr< jarray< uint8_t >> &  output,
uint32_t  outlen,
uint32_t  iterations 
)
static

PBKDF2 function used to derive the Pairwise Master Key (PMK)

Parameters
auth- Authentication function to use (SHA1, SHA256, SHA384, SHA512)
passphrase- Passphrase from the user (PSK or EAP generated)
ssid- SSID of this Wifi connection
output- Pointer to hold output PMK
outlen- Length of the requested output. Length must be equal to or shorter that output of the HASH function
iterations- Number of times to process data to derive PMK

◆ prf()

static void ProtocolPP::jwifi::prf ( auth_t  auth,
std::shared_ptr< jarray< uint8_t >> &  key,
std::shared_ptr< jarray< uint8_t >> &  label,
std::shared_ptr< jarray< uint8_t >> &  context,
std::shared_ptr< jarray< uint8_t >> &  prfout,
uint32_t  outlen 
)
static

Pseudo random function (PRF) for Wifi

Parameters
auth- authentication algorithm (auth_t::SHA1, auth_t::SHA256, auth_t::SHA384, auth_t::SHA512)
key- key for hash function
label- string identifying purpose of keys derived using KDF
context- bit string to provide context to identify the derived key
prfout- the PRF output
outlen- length of the output derived key (in bits)

◆ set_field()

void ProtocolPP::jwifi::set_field ( field_t  field,
uint64_t  value 
)
virtual

Update Wifi field with the new value

Parameters
field- field to update
value- new value for the field

Implements ProtocolPP::jprotocol.

◆ set_hdr()

void ProtocolPP::jwifi::set_hdr ( jarray< uint8_t > &  hdr)
virtual

Update the current Wifi header with a new header

Parameters
hdr- new Wifi header for this flow

Implements ProtocolPP::jprotocol.

◆ to_json()

void ProtocolPP::jwifi::to_json ( std::ofstream &  myjson,
direction_t  direction,
std::string &  indent 
)
virtual

Print the protocol and security objects to JSON

Parameters
myjson- JSON object to print with
direction- facilitator for random generation
indent- indentation for JSON output

Implements ProtocolPP::jprotocol.

◆ to_xml()

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

Print the protocol and security objects to XML

Parameters
myxml- XMLPrinter object to print with
direction- facilitator for random generation

Implements ProtocolPP::jprotocol.


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