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

#include <tls_crypt.hpp>

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (ovpn_tls_crypt_context_digest_size)
 
 OPENVPN_SIMPLE_EXCEPTION (ovpn_tls_crypt_context_bad_sizing)
 
 OPENVPN_SIMPLE_EXCEPTION (ovpn_tls_crypt_wrong_mode)
 
 TLSCrypt ()
 
 TLSCrypt (SSLLib::Ctx libctx, const CryptoAlgs::Type digest, const StaticKey &key_hmac, const CryptoAlgs::Type cipher, const StaticKey &key_crypt, const int mode)
 
bool defined () const
 
size_t output_hmac_size () const
 
void init (SSLLib::Ctx libctx, const CryptoAlgs::Type digest, const StaticKey &key_hmac, const CryptoAlgs::Type cipher, const StaticKey &key_crypt, const int mode_arg)
 
bool hmac_gen (unsigned char *header, const size_t header_len, const unsigned char *payload, const size_t payload_len)
 
bool hmac_cmp (const unsigned char *header, const size_t header_len, const unsigned char *payload, const size_t payload_len)
 
size_t encrypt (const unsigned char *iv, unsigned char *out, const size_t olen, const unsigned char *in, const size_t ilen)
 
size_t decrypt (const unsigned char *iv, unsigned char *out, const size_t olen, const unsigned char *in, const size_t ilen)
 

Private Member Functions

void hmac_pre (const unsigned char *header, const size_t header_len, const unsigned char *payload, const size_t payload_len)
 
size_t encrypt_decrypt (const unsigned char *iv, unsigned char *out, const size_t olen, const unsigned char *in, const size_t ilen)
 

Private Attributes

CRYPTO_API::HMACContext ctx_hmac
 
CRYPTO_API::CipherContext ctx_crypt
 
int mode
 

Detailed Description

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

Definition at line 36 of file tls_crypt.hpp.

Constructor & Destructor Documentation

◆ TLSCrypt() [1/2]

template<typename CRYPTO_API >
openvpn::TLSCrypt< CRYPTO_API >::TLSCrypt ( )
inline

Definition at line 43 of file tls_crypt.hpp.

◆ TLSCrypt() [2/2]

template<typename CRYPTO_API >
openvpn::TLSCrypt< CRYPTO_API >::TLSCrypt ( SSLLib::Ctx  libctx,
const CryptoAlgs::Type  digest,
const StaticKey key_hmac,
const CryptoAlgs::Type  cipher,
const StaticKey key_crypt,
const int  mode 
)
inline

Definition at line 48 of file tls_crypt.hpp.

Member Function Documentation

◆ decrypt()

template<typename CRYPTO_API >
size_t openvpn::TLSCrypt< CRYPTO_API >::decrypt ( const unsigned char *  iv,
unsigned char *  out,
const size_t  olen,
const unsigned char *  in,
const size_t  ilen 
)
inline

Definition at line 107 of file tls_crypt.hpp.

◆ defined()

template<typename CRYPTO_API >
bool openvpn::TLSCrypt< CRYPTO_API >::defined ( ) const
inline

Definition at line 53 of file tls_crypt.hpp.

◆ encrypt()

template<typename CRYPTO_API >
size_t openvpn::TLSCrypt< CRYPTO_API >::encrypt ( const unsigned char *  iv,
unsigned char *  out,
const size_t  olen,
const unsigned char *  in,
const size_t  ilen 
)
inline

Definition at line 99 of file tls_crypt.hpp.

◆ encrypt_decrypt()

template<typename CRYPTO_API >
size_t openvpn::TLSCrypt< CRYPTO_API >::encrypt_decrypt ( const unsigned char *  iv,
unsigned char *  out,
const size_t  olen,
const unsigned char *  in,
const size_t  ilen 
)
inlineprivate

Definition at line 124 of file tls_crypt.hpp.

Here is the caller graph for this function:

◆ hmac_cmp()

template<typename CRYPTO_API >
bool openvpn::TLSCrypt< CRYPTO_API >::hmac_cmp ( const unsigned char *  header,
const size_t  header_len,
const unsigned char *  payload,
const size_t  payload_len 
)
inline

Definition at line 89 of file tls_crypt.hpp.

◆ hmac_gen()

template<typename CRYPTO_API >
bool openvpn::TLSCrypt< CRYPTO_API >::hmac_gen ( unsigned char *  header,
const size_t  header_len,
const unsigned char *  payload,
const size_t  payload_len 
)
inline

Definition at line 81 of file tls_crypt.hpp.

◆ hmac_pre()

template<typename CRYPTO_API >
void openvpn::TLSCrypt< CRYPTO_API >::hmac_pre ( const unsigned char *  header,
const size_t  header_len,
const unsigned char *  payload,
const size_t  payload_len 
)
inlineprivate

Definition at line 117 of file tls_crypt.hpp.

Here is the caller graph for this function:

◆ init()

template<typename CRYPTO_API >
void openvpn::TLSCrypt< CRYPTO_API >::init ( SSLLib::Ctx  libctx,
const CryptoAlgs::Type  digest,
const StaticKey key_hmac,
const CryptoAlgs::Type  cipher,
const StaticKey key_crypt,
const int  mode_arg 
)
inline

Definition at line 64 of file tls_crypt.hpp.

Here is the caller graph for this function:

◆ OPENVPN_SIMPLE_EXCEPTION() [1/3]

template<typename CRYPTO_API >
openvpn::TLSCrypt< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( ovpn_tls_crypt_context_bad_sizing  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/3]

template<typename CRYPTO_API >
openvpn::TLSCrypt< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( ovpn_tls_crypt_context_digest_size  )

◆ OPENVPN_SIMPLE_EXCEPTION() [3/3]

template<typename CRYPTO_API >
openvpn::TLSCrypt< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( ovpn_tls_crypt_wrong_mode  )

◆ output_hmac_size()

template<typename CRYPTO_API >
size_t openvpn::TLSCrypt< CRYPTO_API >::output_hmac_size ( ) const
inline

Definition at line 59 of file tls_crypt.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ ctx_crypt

template<typename CRYPTO_API >
CRYPTO_API::CipherContext openvpn::TLSCrypt< CRYPTO_API >::ctx_crypt
private

Definition at line 140 of file tls_crypt.hpp.

◆ ctx_hmac

template<typename CRYPTO_API >
CRYPTO_API::HMACContext openvpn::TLSCrypt< CRYPTO_API >::ctx_hmac
private

Definition at line 139 of file tls_crypt.hpp.

◆ mode

template<typename CRYPTO_API >
int openvpn::TLSCrypt< CRYPTO_API >::mode
private

Definition at line 141 of file tls_crypt.hpp.


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