libtins  4.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Static Public Attributes | List of all members
Tins::Crypto::WPA2::SessionKeys Class Reference

Class that represents the keys used to decrypt a session. More...

#include <crypto.h>

Public Types

typedef std::vector< uint8_t > ptk_type
 
typedef std::vector< uint8_t > pmk_type
 

Public Member Functions

 SessionKeys ()
 
 SessionKeys (const ptk_type &ptk, bool is_ccmp)
 Constructs an instance using the provided PTK and a flag indicating whether it should use ccmp. More...
 
 SessionKeys (const RSNHandshake &hs, const pmk_type &pmk)
 Constructs an instance using a handshake and a PMK. More...
 
SNAPdecrypt_unicast (const Dot11Data &dot11, RawPDU &raw) const
 Decrypts a unicast packet. More...
 
const ptk_typeget_ptk () const
 Gets the PTK for this session keys. More...
 
bool uses_ccmp () const
 Indicates whether CCMP is used to decrypt packets /return true iff CCMP is used.
 

Static Public Attributes

static const size_t PMK_SIZE
 
static const size_t PTK_SIZE
 

Detailed Description

Class that represents the keys used to decrypt a session.

Member Typedef Documentation

typedef std::vector<uint8_t> Tins::Crypto::WPA2::SessionKeys::pmk_type

The type used to hold the PMK (this has to be PMK_SIZE bytes long).

typedef std::vector<uint8_t> Tins::Crypto::WPA2::SessionKeys::ptk_type

The type used to hold the PTK (this has to be PTK_SIZE bytes long).

Constructor & Destructor Documentation

Tins::Crypto::WPA2::SessionKeys::SessionKeys ( )

Default constructs a SessionKeys object.

Tins::Crypto::WPA2::SessionKeys::SessionKeys ( const ptk_type ptk,
bool  is_ccmp 
)

Constructs an instance using the provided PTK and a flag indicating whether it should use ccmp.

Parameters
ptkThe PTK to use.
is_ccmpIndicates whether to use CCMP to decrypt this traffic.
Tins::Crypto::WPA2::SessionKeys::SessionKeys ( const RSNHandshake hs,
const pmk_type pmk 
)

Constructs an instance using a handshake and a PMK.

This will internally construct the PTK from the input parameters.

Parameters
hsThe handshake to use.
pmkThe PMK to use.

Member Function Documentation

SNAP* Tins::Crypto::WPA2::SessionKeys::decrypt_unicast ( const Dot11Data dot11,
RawPDU raw 
) const

Decrypts a unicast packet.

Parameters
dot11The encrypted packet to decrypt.
rawThe raw layer on the packet to decrypt.
Returns
A SNAP layer containing the decrypted traffic or a null pointer if decryption failed.
const ptk_type& Tins::Crypto::WPA2::SessionKeys::get_ptk ( ) const

Gets the PTK for this session keys.

Returns
The Pairwise Transcient Key.

Member Data Documentation

const size_t Tins::Crypto::WPA2::SessionKeys::PMK_SIZE
static

The size of the Pairwise Master Key.

const size_t Tins::Crypto::WPA2::SessionKeys::PTK_SIZE
static

The size of the Pairwise Transient Key.


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