22 #include <openssl/crypto.h>
23 #include <openssl/err.h>
24 #include <openssl/provider.h>
25 #include <openssl/rand.h>
27 using namespace basis;
40 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
58 OSSL_PROVIDER *legacy_provider = OSSL_PROVIDER_load(
NULL_POINTER,
"legacy");
60 OSSL_PROVIDER *default_provider = OSSL_PROVIDER_load(NULL,
"default");
64 LOG(
"prior to crypto debug init");
65 CRYPTO_malloc_debug_init();
66 LOG(
"prior to dbg set options");
67 CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
68 LOG(
"prior to mem ctrl");
69 CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
71 LOG(
"prior to rand seed");
73 LOG(
"after rand seed");
79 LOG(
"prior to crypto cleanup");
80 CRYPTO_cleanup_all_ex_data();
98 for (
int i = 0; i < length; i++)
99 seed +=
abyte(c_rando.inclusive(0, 255));
A very common template for a dynamic array of bytes.
provides some initialization for the RSA and blowfish crypto.
a platform-independent way to acquire random numbers in a specific range.
#define NULL_POINTER
The value representing a pointer to nothing.
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
The guards collection helps in testing preconditions and reporting errors.
unsigned char abyte
A fairly important unit which is seldom defined...
const ssl_init & static_ssl_initializer()
the main method for accessing the SSL initialization support.
A logger that sends to the console screen using the standard output device.
An extension to floating point primitives providing approximate equality.
A dynamic container class that holds any kind of object via pointers.
#define SAFE_STATIC_CONST(type, func_name, parms)
this version returns a constant object instead.
byte_array random_bytes(int length)