OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::TLSPRF< CRYPTO_API > Class Template Reference

#include <tlsprf.hpp>

Public Types

enum  { SIZE_OF_RANDOM = 32 }
 

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (tlsprf_uninitialized)
 
 OPENVPN_SIMPLE_EXCEPTION (tlsprf_client_server_mismatch)
 
 OPENVPN_SIMPLE_EXCEPTION (tlsprf_tlsprf_failed)
 
 TLSPRF (const bool server)
 
void randomize (StrongRandomAPI &rng)
 
void read (Buffer &buf)
 
bool read_complete (BufferComplete &bc)
 
void write (Buffer &buf)
 
void generate_key_expansion (OpenVPNStaticKey &dest, const TLSPRF &peer, const ProtoSessionID &psid_self, const ProtoSessionID &psid_peer) const
 
void erase ()
 
std::string dump (const char *title)
 
 ~TLSPRF ()
 

Static Public Member Functions

static void openvpn_PRF (const unsigned char *secret, const size_t secret_len, const char *label, const unsigned char *client_seed, const size_t client_seed_len, const unsigned char *server_seed, const size_t server_seed_len, const ProtoSessionID *client_sid, const ProtoSessionID *server_sid, unsigned char *output, const size_t output_len)
 

Private Member Functions

void verify_initialized () const
 

Static Private Member Functions

static void gen_exp (OpenVPNStaticKey &dest, const TLSPRF &client, const ProtoSessionID &psid_client, const TLSPRF &server, const ProtoSessionID &psid_server)
 

Private Attributes

bool initialized_
 
bool server_
 
unsigned char pre_master [48]
 
unsigned char random1 [SIZE_OF_RANDOM]
 
unsigned char random2 [SIZE_OF_RANDOM]
 

Detailed Description

template<typename CRYPTO_API>
class openvpn::TLSPRF< CRYPTO_API >

Definition at line 37 of file tlsprf.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<typename CRYPTO_API >
anonymous enum
Enumerator
SIZE_OF_RANDOM 

Definition at line 43 of file tlsprf.hpp.

Constructor & Destructor Documentation

◆ TLSPRF()

template<typename CRYPTO_API >
openvpn::TLSPRF< CRYPTO_API >::TLSPRF ( const bool  server)
inline

Definition at line 48 of file tlsprf.hpp.

◆ ~TLSPRF()

template<typename CRYPTO_API >
openvpn::TLSPRF< CRYPTO_API >::~TLSPRF ( )
inline

Definition at line 124 of file tlsprf.hpp.

Member Function Documentation

◆ dump()

template<typename CRYPTO_API >
std::string openvpn::TLSPRF< CRYPTO_API >::dump ( const char *  title)
inline

Definition at line 115 of file tlsprf.hpp.

◆ erase()

template<typename CRYPTO_API >
void openvpn::TLSPRF< CRYPTO_API >::erase ( )
inline

Definition at line 103 of file tlsprf.hpp.

Here is the caller graph for this function:

◆ gen_exp()

template<typename CRYPTO_API >
static void openvpn::TLSPRF< CRYPTO_API >::gen_exp ( OpenVPNStaticKey dest,
const TLSPRF< CRYPTO_API > &  client,
const ProtoSessionID psid_client,
const TLSPRF< CRYPTO_API > &  server,
const ProtoSessionID psid_server 
)
inlinestaticprivate

Definition at line 171 of file tlsprf.hpp.

Here is the caller graph for this function:

◆ generate_key_expansion()

template<typename CRYPTO_API >
void openvpn::TLSPRF< CRYPTO_API >::generate_key_expansion ( OpenVPNStaticKey dest,
const TLSPRF< CRYPTO_API > &  peer,
const ProtoSessionID psid_self,
const ProtoSessionID psid_peer 
) const
inline

Definition at line 90 of file tlsprf.hpp.

◆ openvpn_PRF()

template<typename CRYPTO_API >
static void openvpn::TLSPRF< CRYPTO_API >::openvpn_PRF ( const unsigned char *  secret,
const size_t  secret_len,
const char *  label,
const unsigned char *  client_seed,
const size_t  client_seed_len,
const unsigned char *  server_seed,
const size_t  server_seed_len,
const ProtoSessionID client_sid,
const ProtoSessionID server_sid,
unsigned char *  output,
const size_t  output_len 
)
inlinestatic

Definition at line 129 of file tlsprf.hpp.

Here is the caller graph for this function:

◆ OPENVPN_SIMPLE_EXCEPTION() [1/3]

template<typename CRYPTO_API >
openvpn::TLSPRF< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( tlsprf_client_server_mismatch  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/3]

template<typename CRYPTO_API >
openvpn::TLSPRF< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( tlsprf_tlsprf_failed  )

◆ OPENVPN_SIMPLE_EXCEPTION() [3/3]

template<typename CRYPTO_API >
openvpn::TLSPRF< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( tlsprf_uninitialized  )

◆ randomize()

template<typename CRYPTO_API >
void openvpn::TLSPRF< CRYPTO_API >::randomize ( StrongRandomAPI rng)
inline

Definition at line 53 of file tlsprf.hpp.

◆ read()

template<typename CRYPTO_API >
void openvpn::TLSPRF< CRYPTO_API >::read ( Buffer buf)
inline

Definition at line 62 of file tlsprf.hpp.

◆ read_complete()

template<typename CRYPTO_API >
bool openvpn::TLSPRF< CRYPTO_API >::read_complete ( BufferComplete bc)
inline

Definition at line 71 of file tlsprf.hpp.

◆ verify_initialized()

template<typename CRYPTO_API >
void openvpn::TLSPRF< CRYPTO_API >::verify_initialized ( ) const
inlineprivate

Definition at line 214 of file tlsprf.hpp.

Here is the caller graph for this function:

◆ write()

template<typename CRYPTO_API >
void openvpn::TLSPRF< CRYPTO_API >::write ( Buffer buf)
inline

Definition at line 81 of file tlsprf.hpp.

Member Data Documentation

◆ initialized_

template<typename CRYPTO_API >
bool openvpn::TLSPRF< CRYPTO_API >::initialized_
private

Definition at line 220 of file tlsprf.hpp.

◆ pre_master

template<typename CRYPTO_API >
unsigned char openvpn::TLSPRF< CRYPTO_API >::pre_master[48]
private

Definition at line 222 of file tlsprf.hpp.

◆ random1

template<typename CRYPTO_API >
unsigned char openvpn::TLSPRF< CRYPTO_API >::random1[SIZE_OF_RANDOM]
private

Definition at line 223 of file tlsprf.hpp.

◆ random2

template<typename CRYPTO_API >
unsigned char openvpn::TLSPRF< CRYPTO_API >::random2[SIZE_OF_RANDOM]
private

Definition at line 224 of file tlsprf.hpp.

◆ server_

template<typename CRYPTO_API >
bool openvpn::TLSPRF< CRYPTO_API >::server_
private

Definition at line 221 of file tlsprf.hpp.


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