Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <SslConfig.h>
Public Types | |
using | cDebugCallback = void(*)(void *, int, const char *, int, const char *) |
Type of the SSL debug callback. More... | |
using | cVerifyCallback = int(*)(void *, mbedtls_x509_crt *, int, uint32_t *) |
Type of the SSL certificate verify callback. More... | |
Public Member Functions | |
cSslConfig () | |
int | InitDefaults (bool a_IsClient) |
Initialize with mbedTLS default settings. More... | |
void | SetAuthMode (eSslAuthMode a_AuthMode) |
Set the authorization mode. More... | |
void | SetCACerts (cX509CertPtr a_CACert) |
Set the trusted certificate authority chain. More... | |
void | SetCipherSuites (std::vector< int > a_CipherSuites) |
Set the enabled cipher suites. More... | |
void | SetDebugCallback (cDebugCallback a_CallbackFun, void *a_CallbackData) |
Set the debug callback. More... | |
void | SetOwnCert (cX509CertPtr a_OwnCert, cCryptoKeyPtr a_OwnCertPrivKey) |
Set the certificate to use for connections. More... | |
void | SetRng (cCtrDrbgContextPtr a_CtrDrbg) |
Set the random number generator. More... | |
void | SetVerifyCallback (cVerifyCallback a_CallbackFun, void *a_CallbackData) |
Set the certificate verify callback. More... | |
~cSslConfig () | |
Static Public Member Functions | |
static std::shared_ptr< const cSslConfig > | GetDefaultClientConfig () |
Returns the default config for client connections. More... | |
static std::shared_ptr< const cSslConfig > | GetDefaultServerConfig () |
Returns the default config for server connections. More... | |
static std::shared_ptr< cSslConfig > | MakeDefaultConfig (bool a_IsClient) |
Creates a new config with some sensible defaults on top of mbedTLS basic settings. More... | |
Private Member Functions | |
const mbedtls_ssl_config * | GetInternal () const |
Returns a pointer to the wrapped mbedtls representation. More... | |
Private Attributes | |
cX509CertPtr | m_CACerts |
std::vector< int > | m_CipherSuites |
mbedtls_ssl_config | m_Config |
cCtrDrbgContextPtr | m_CtrDrbg |
cX509CertPtr | m_OwnCert |
cCryptoKeyPtr | m_OwnCertPrivKey |
Friends | |
class | cSslContext |
Definition at line 25 of file SslConfig.h.
using cSslConfig::cDebugCallback = void(*)(void *, int, const char *, int, const char *) |
Type of the SSL debug callback.
Parameters are: void * Opaque context for the callback int Debug level const char * File name int Line number const char * Message
Definition at line 36 of file SslConfig.h.
using cSslConfig::cVerifyCallback = int(*)(void *, mbedtls_x509_crt *, int, uint32_t *) |
Type of the SSL certificate verify callback.
Parameters are: void * Opaque context for the callback mbedtls_x509_crt * Current cert int Cert chain depth uint32_t * Verification flags
Definition at line 44 of file SslConfig.h.
cSslConfig::cSslConfig | ( | ) |
Definition at line 106 of file SslConfig.cpp.
cSslConfig::~cSslConfig | ( | ) |
Definition at line 115 of file SslConfig.cpp.
|
static |
Returns the default config for client connections.
Definition at line 267 of file SslConfig.cpp.
|
static |
Returns the default config for server connections.
Definition at line 277 of file SslConfig.cpp.
|
inlineprivate |
Returns a pointer to the wrapped mbedtls representation.
Definition at line 85 of file SslConfig.h.
int cSslConfig::InitDefaults | ( | bool | a_IsClient | ) |
Initialize with mbedTLS default settings.
Definition at line 124 of file SslConfig.cpp.
|
static |
Creates a new config with some sensible defaults on top of mbedTLS basic settings.
Definition at line 226 of file SslConfig.cpp.
void cSslConfig::SetAuthMode | ( | eSslAuthMode | a_AuthMode | ) |
Set the authorization mode.
Definition at line 138 of file SslConfig.cpp.
void cSslConfig::SetCACerts | ( | cX509CertPtr | a_CACert | ) |
Set the trusted certificate authority chain.
Definition at line 216 of file SslConfig.cpp.
void cSslConfig::SetCipherSuites | ( | std::vector< int > | a_CipherSuites | ) |
Set the enabled cipher suites.
Definition at line 205 of file SslConfig.cpp.
void cSslConfig::SetDebugCallback | ( | cDebugCallback | a_CallbackFun, |
void * | a_CallbackData | ||
) |
Set the debug callback.
Definition at line 170 of file SslConfig.cpp.
void cSslConfig::SetOwnCert | ( | cX509CertPtr | a_OwnCert, |
cCryptoKeyPtr | a_OwnCertPrivKey | ||
) |
Set the certificate to use for connections.
Definition at line 179 of file SslConfig.cpp.
void cSslConfig::SetRng | ( | cCtrDrbgContextPtr | a_CtrDrbg | ) |
Set the random number generator.
Definition at line 159 of file SslConfig.cpp.
void cSslConfig::SetVerifyCallback | ( | cVerifyCallback | a_CallbackFun, |
void * | a_CallbackData | ||
) |
Set the certificate verify callback.
Definition at line 196 of file SslConfig.cpp.
|
friend |
Definition at line 27 of file SslConfig.h.
|
private |
Definition at line 91 of file SslConfig.h.
|
private |
Definition at line 92 of file SslConfig.h.
|
private |
Definition at line 87 of file SslConfig.h.
|
private |
Definition at line 88 of file SslConfig.h.
|
private |
Definition at line 89 of file SslConfig.h.
|
private |
Definition at line 90 of file SslConfig.h.