diff options
-rw-r--r-- | src/algo_factory/info.txt | 1 | ||||
-rw-r--r-- | src/alloc/mem_pool/info.txt | 4 | ||||
-rw-r--r-- | src/libstate/info.txt | 2 | ||||
-rw-r--r-- | src/libstate/libstate.cpp | 22 |
4 files changed, 11 insertions, 18 deletions
diff --git a/src/algo_factory/info.txt b/src/algo_factory/info.txt index dfc42230a..fc248523d 100644 --- a/src/algo_factory/info.txt +++ b/src/algo_factory/info.txt @@ -16,6 +16,5 @@ block engine hash mac -mutex stream </requires> diff --git a/src/alloc/mem_pool/info.txt b/src/alloc/mem_pool/info.txt index 0a762ccc4..b1c7a091f 100644 --- a/src/alloc/mem_pool/info.txt +++ b/src/alloc/mem_pool/info.txt @@ -6,7 +6,3 @@ load_on auto mem_pool.cpp mem_pool.h </add> - -<requires> -mutex -</requires> diff --git a/src/libstate/info.txt b/src/libstate/info.txt index 6eaa2f70b..fcf386e6d 100644 --- a/src/libstate/info.txt +++ b/src/libstate/info.txt @@ -34,8 +34,6 @@ hash kdf mac mode_pad -mutex -noop_mutex pk_pad pubkey rng diff --git a/src/libstate/libstate.cpp b/src/libstate/libstate.cpp index 839d71d60..676c2a949 100644 --- a/src/libstate/libstate.cpp +++ b/src/libstate/libstate.cpp @@ -9,7 +9,6 @@ #include <botan/init.h> #include <botan/engine.h> #include <botan/stl_util.h> -#include <botan/mux_noop.h> #include <botan/charset.h> #include <botan/defalloc.h> #include <botan/def_eng.h> @@ -77,7 +76,7 @@ void set_global_state(Library_State* new_state) */ Library_State* swap_global_state(Library_State* new_state) { - Library_State* old_state = global_lib_state; + auto old_state = global_lib_state; global_lib_state = new_state; return old_state; } @@ -124,11 +123,11 @@ void Library_State::add_allocator(Allocator* allocator) */ void Library_State::set_default_allocator(const std::string& type) { - std::lock_guard<std::mutex> lock(allocator_lock); - if(type == "") return; + std::lock_guard<std::mutex> lock(allocator_lock); + this->set("conf", "base/default_allocator", type); cached_default_allocator = 0; } @@ -240,29 +239,30 @@ void Library_State::initialize() load_default_config(); - std::vector<Engine*> engines; + std::vector<Engine*> engines = { #if defined(BOTAN_HAS_ENGINE_GNU_MP) - engines.push_back(new GMP_Engine); + new GMP_Engine, #endif #if defined(BOTAN_HAS_ENGINE_OPENSSL) - engines.push_back(new OpenSSL_Engine); + new OpenSSL_Engine, #endif #if defined(BOTAN_HAS_ENGINE_SSE2_ASSEMBLER) - engines.push_back(new SSE2_Assembler_Engine); + new SSE2_Assembler_Engine, #endif #if defined(BOTAN_HAS_ENGINE_AMD64_ASSEMBLER) - engines.push_back(new AMD64_Assembler_Engine); + new AMD64_Assembler_Engine, #endif #if defined(BOTAN_HAS_ENGINE_IA32_ASSEMBLER) - engines.push_back(new IA32_Assembler_Engine); + new IA32_Assembler_Engine, #endif - engines.push_back(new Default_Engine); + new Default_Engine + }; m_algorithm_factory = new Algorithm_Factory(engines); } |