Make the Botan rng, credential_manager etc be static
This actually makes the session_manager be useful, and saves a few octets of memory for the other ones
This commit is contained in:
@@ -20,6 +20,12 @@
|
|||||||
|
|
||||||
#ifdef BOTAN_FOUND
|
#ifdef BOTAN_FOUND
|
||||||
# include <botan/hex.h>
|
# include <botan/hex.h>
|
||||||
|
|
||||||
|
Botan::AutoSeeded_RNG SocketHandler::rng;
|
||||||
|
Permissive_Credentials_Manager SocketHandler::credential_manager;
|
||||||
|
Botan::TLS::Policy SocketHandler::policy;
|
||||||
|
Botan::TLS::Session_Manager_In_Memory SocketHandler::session_manager(SocketHandler::rng);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef UIO_FASTIOV
|
#ifndef UIO_FASTIOV
|
||||||
@@ -37,13 +43,6 @@ SocketHandler::SocketHandler(std::shared_ptr<Poller> poller):
|
|||||||
use_tls(false),
|
use_tls(false),
|
||||||
connected(false),
|
connected(false),
|
||||||
connecting(false)
|
connecting(false)
|
||||||
#ifdef BOTAN_FOUND
|
|
||||||
,
|
|
||||||
rng(),
|
|
||||||
credential_manager(),
|
|
||||||
policy(),
|
|
||||||
session_manager(rng)
|
|
||||||
#endif
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void SocketHandler::init_socket(const struct addrinfo* rp)
|
void SocketHandler::init_socket(const struct addrinfo* rp)
|
||||||
|
|||||||
@@ -253,10 +253,10 @@ private:
|
|||||||
/**
|
/**
|
||||||
* Botan stuff to manipulate a TLS session.
|
* Botan stuff to manipulate a TLS session.
|
||||||
*/
|
*/
|
||||||
Botan::AutoSeeded_RNG rng;
|
static Botan::AutoSeeded_RNG rng;
|
||||||
Permissive_Credentials_Manager credential_manager;
|
static Permissive_Credentials_Manager credential_manager;
|
||||||
Botan::TLS::Policy policy;
|
static Botan::TLS::Policy policy;
|
||||||
Botan::TLS::Session_Manager_In_Memory session_manager;
|
static Botan::TLS::Session_Manager_In_Memory session_manager;
|
||||||
/**
|
/**
|
||||||
* We use a unique_ptr because we may not want to create the object at
|
* We use a unique_ptr because we may not want to create the object at
|
||||||
* all. The Botan::TLS::Client object generates a handshake message as
|
* all. The Botan::TLS::Client object generates a handshake message as
|
||||||
|
|||||||
Reference in New Issue
Block a user