aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/base')
-rw-r--r--src/lib/base/algo_registry.h5
-rw-r--r--src/lib/base/init.h2
-rw-r--r--src/lib/base/key_spec.h2
-rw-r--r--src/lib/base/scan_name.cpp4
-rw-r--r--src/lib/base/scan_name.h4
-rw-r--r--src/lib/base/symkey.h2
6 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/base/algo_registry.h b/src/lib/base/algo_registry.h
index eebbaa4e8..ebc23bfca 100644
--- a/src/lib/base/algo_registry.h
+++ b/src/lib/base/algo_registry.h
@@ -11,6 +11,7 @@
#include <botan/build.h>
#include <botan/types.h>
#include <botan/exceptn.h>
+#include <botan/scan_name.h>
#include <functional>
#include <mutex>
#include <vector>
@@ -212,7 +213,7 @@ class Algo_Registry
};
template<typename T> T*
-make_a(const typename T::Spec& spec, const std::string provider = "")
+make_a(const typename T::Spec& spec, const std::string& provider = "")
{
return Algo_Registry<T>::global_registry().make(spec, provider);
}
@@ -257,7 +258,7 @@ make_new_T_1str_req(const typename Algo_Registry<T>::Spec& spec)
template<typename T, typename X> T*
make_new_T_1X(const typename Algo_Registry<T>::Spec& spec)
{
- std::unique_ptr<X> x(Algo_Registry<X>::global_registry().make(spec.arg(0)));
+ std::unique_ptr<X> x(Algo_Registry<X>::global_registry().make(Botan::SCAN_Name(spec.arg(0))));
if(!x)
throw Exception(spec.arg(0));
return new T(x.release());
diff --git a/src/lib/base/init.h b/src/lib/base/init.h
index 0c61eba6f..7709883af 100644
--- a/src/lib/base/init.h
+++ b/src/lib/base/init.h
@@ -22,7 +22,7 @@ namespace Botan {
class BOTAN_DLL LibraryInitializer
{
public:
- LibraryInitializer(const std::string& s = "") { initialize(s); }
+ explicit LibraryInitializer(const std::string& s = "") { initialize(s); }
~LibraryInitializer() { deinitialize(); }
static void initialize(const std::string& = "");
diff --git a/src/lib/base/key_spec.h b/src/lib/base/key_spec.h
index f9cdcc78d..82e0e7e6f 100644
--- a/src/lib/base/key_spec.h
+++ b/src/lib/base/key_spec.h
@@ -22,7 +22,7 @@ class BOTAN_DLL Key_Length_Specification
* Constructor for fixed length keys
* @param keylen the supported key length
*/
- Key_Length_Specification(size_t keylen) :
+ explicit Key_Length_Specification(size_t keylen) :
m_min_keylen(keylen),
m_max_keylen(keylen),
m_keylen_mod(1)
diff --git a/src/lib/base/scan_name.cpp b/src/lib/base/scan_name.cpp
index 4688d0871..08f5e8702 100644
--- a/src/lib/base/scan_name.cpp
+++ b/src/lib/base/scan_name.cpp
@@ -70,10 +70,8 @@ SCAN_Name::SCAN_Name(const char* algo_spec) : SCAN_Name(std::string(algo_spec))
{
}
-SCAN_Name::SCAN_Name(std::string algo_spec)
+SCAN_Name::SCAN_Name(std::string algo_spec) : m_orig_algo_spec(algo_spec), m_alg_name(), m_args(), m_mode_info()
{
- m_orig_algo_spec = algo_spec;
-
std::vector<std::pair<size_t, std::string> > name;
size_t level = 0;
std::pair<size_t, std::string> accum = std::make_pair(level, "");
diff --git a/src/lib/base/scan_name.h b/src/lib/base/scan_name.h
index 43441e19c..d59d5889e 100644
--- a/src/lib/base/scan_name.h
+++ b/src/lib/base/scan_name.h
@@ -26,12 +26,12 @@ class BOTAN_DLL SCAN_Name
/**
* @param algo_spec A SCAN-format name
*/
- SCAN_Name(const char* algo_spec);
+ explicit SCAN_Name(const char* algo_spec);
/**
* @param algo_spec A SCAN-format name
*/
- SCAN_Name(std::string algo_spec);
+ explicit SCAN_Name(std::string algo_spec);
/**
* @param algo_spec A SCAN-format name
diff --git a/src/lib/base/symkey.h b/src/lib/base/symkey.h
index 3b0208e51..c780e5239 100644
--- a/src/lib/base/symkey.h
+++ b/src/lib/base/symkey.h
@@ -61,7 +61,7 @@ class BOTAN_DLL OctetString
* Create a new OctetString
* @param str is a hex encoded string
*/
- OctetString(const std::string& str = "");
+ explicit OctetString(const std::string& str = "");
/**
* Create a new random OctetString