From 272e72d2dcb3e4b3e717946383dc67dba860c473 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 11 Dec 2015 09:42:48 -0500 Subject: Missing adds --- src/lib/base/algo_registry.h | 2 +- src/lib/base/scan_name.cpp | 1 - src/lib/codec/base64/base64.cpp | 2 +- src/lib/codec/hex/hex.cpp | 2 +- src/lib/entropy/egd/es_egd.cpp | 1 - src/lib/entropy/unix_procs/unix_procs.cpp | 1 + src/lib/ffi/ffi.cpp | 21 ++++++++++++++------- src/lib/filters/buf_filt.cpp | 2 +- src/lib/hash/comb4p/comb4p.cpp | 2 +- src/lib/math/mp/mp_misc.cpp | 4 ++-- src/lib/misc/fpe_fe1/fpe_fe1.cpp | 1 - src/lib/pbkdf/pbkdf.cpp | 1 - src/lib/pubkey/mce/code_based_util.h | 1 - src/lib/pubkey/mce/gf2m_small_m.cpp | 2 +- src/lib/tls/tls_ciphersuite.cpp | 1 - src/lib/tls/tls_reader.h | 1 - src/lib/tls/tls_seq_numbers.h | 1 - src/lib/utils/dyn_load/dyn_load.cpp | 1 - src/lib/utils/exceptn.h | 4 ++-- src/lib/utils/http_util/http_util.h | 1 + src/lib/utils/parsing.cpp | 1 - src/lib/utils/read_cfg.cpp | 2 +- src/lib/utils/sqlite3/sqlite3.cpp | 1 - 23 files changed, 27 insertions(+), 29 deletions(-) (limited to 'src/lib') diff --git a/src/lib/base/algo_registry.h b/src/lib/base/algo_registry.h index 842c4167b..3b1a72d88 100644 --- a/src/lib/base/algo_registry.h +++ b/src/lib/base/algo_registry.h @@ -9,8 +9,8 @@ #define BOTAN_ALGO_REGISTRY_H__ #include +#include #include -#include #include #include #include diff --git a/src/lib/base/scan_name.cpp b/src/lib/base/scan_name.cpp index 5c8c55b27..6f5eac43c 100644 --- a/src/lib/base/scan_name.cpp +++ b/src/lib/base/scan_name.cpp @@ -8,7 +8,6 @@ #include #include #include -#include namespace Botan { diff --git a/src/lib/codec/base64/base64.cpp b/src/lib/codec/base64/base64.cpp index b5f4244a1..bd4d36cfa 100644 --- a/src/lib/codec/base64/base64.cpp +++ b/src/lib/codec/base64/base64.cpp @@ -6,9 +6,9 @@ */ #include +#include #include #include -#include namespace Botan { diff --git a/src/lib/codec/hex/hex.cpp b/src/lib/codec/hex/hex.cpp index a718cc8be..e47a75cb7 100644 --- a/src/lib/codec/hex/hex.cpp +++ b/src/lib/codec/hex/hex.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include namespace Botan { diff --git a/src/lib/entropy/egd/es_egd.cpp b/src/lib/entropy/egd/es_egd.cpp index 8392996ab..ba43cc86d 100644 --- a/src/lib/entropy/egd/es_egd.cpp +++ b/src/lib/entropy/egd/es_egd.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include diff --git a/src/lib/entropy/unix_procs/unix_procs.cpp b/src/lib/entropy/unix_procs/unix_procs.cpp index 30ea6157b..55ad295cd 100644 --- a/src/lib/entropy/unix_procs/unix_procs.cpp +++ b/src/lib/entropy/unix_procs/unix_procs.cpp @@ -9,6 +9,7 @@ */ #include +#include #include #include #include diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp index dac4cafad..48591a774 100644 --- a/src/lib/ffi/ffi.cpp +++ b/src/lib/ffi/ffi.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -59,7 +60,13 @@ namespace { #define BOTAN_ASSERT_ARG_NON_NULL(p) \ - do { if(!p) throw Invalid_Argument("Argument " #p " is null"); } while(0) + do { if(!p) throw Botan::Invalid_Argument("Argument " #p " is null"); } while(0) + +class FFI_Error : public Botan::Exception + { + public: + FFI_Error(const std::string& what) : Exception("FFI error", what) {} + }; template struct botan_struct @@ -71,8 +78,8 @@ struct botan_struct T* get() const { if(m_magic != MAGIC) - throw Exception("Bad magic " + std::to_string(m_magic) + - " in ffi object expected " + std::to_string(MAGIC)); + throw FFI_Error("Bad magic " + std::to_string(m_magic) + + " in ffi object expected " + std::to_string(MAGIC)); return m_obj.get(); } private: @@ -95,10 +102,10 @@ template T& safe_get(botan_struct* p) { if(!p) - throw Exception("Null pointer argument"); + throw FFI_Error("Null pointer argument"); if(T* t = p->get()) return *t; - throw Exception("Invalid object pointer"); + throw FFI_Error("Invalid object pointer"); } template @@ -107,7 +114,7 @@ int apply_fn(botan_struct* o, const char* func_name, F func) try { if(!o) - throw Exception("Null object to " + std::string(func_name)); + throw FFI_Error("Null object to " + std::string(func_name)); if(T* t = o->get()) return func(*t); } @@ -677,7 +684,7 @@ int botan_bcrypt_generate(uint8_t* out, size_t* out_len, return BOTAN_FFI_ERROR_BAD_FLAG; if(wf < 2 || wf > 30) - throw Exception("Bad bcrypt work factor " + std::to_string(wf)); + throw FFI_Error("Bad bcrypt work factor " + std::to_string(wf)); #if defined(BOTAN_HAS_BCRYPT) Botan::RandomNumberGenerator& rng = safe_get(rng_obj); diff --git a/src/lib/filters/buf_filt.cpp b/src/lib/filters/buf_filt.cpp index eb978cffd..6fb367e5f 100644 --- a/src/lib/filters/buf_filt.cpp +++ b/src/lib/filters/buf_filt.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include namespace Botan { diff --git a/src/lib/hash/comb4p/comb4p.cpp b/src/lib/hash/comb4p/comb4p.cpp index 791d6d950..015873473 100644 --- a/src/lib/hash/comb4p/comb4p.cpp +++ b/src/lib/hash/comb4p/comb4p.cpp @@ -6,7 +6,7 @@ */ #include -#include +#include namespace Botan { diff --git a/src/lib/math/mp/mp_misc.cpp b/src/lib/math/mp/mp_misc.cpp index adf4a0a6b..768543a64 100644 --- a/src/lib/math/mp/mp_misc.cpp +++ b/src/lib/math/mp/mp_misc.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include namespace Botan { @@ -43,7 +43,7 @@ s32bit bigint_cmp(const word x[], size_t x_size, word bigint_divop(word n1, word n0, word d) { if(d == 0) - throw Exception("bigint_divop divide by zero"); + throw Invalid_Argument("bigint_divop divide by zero"); word high = n1 % d, quotient = 0; diff --git a/src/lib/misc/fpe_fe1/fpe_fe1.cpp b/src/lib/misc/fpe_fe1/fpe_fe1.cpp index bc14c425c..fad17c814 100644 --- a/src/lib/misc/fpe_fe1/fpe_fe1.cpp +++ b/src/lib/misc/fpe_fe1/fpe_fe1.cpp @@ -9,7 +9,6 @@ #include #include #include -#include namespace Botan { diff --git a/src/lib/pbkdf/pbkdf.cpp b/src/lib/pbkdf/pbkdf.cpp index dcaa48852..98722fcc6 100644 --- a/src/lib/pbkdf/pbkdf.cpp +++ b/src/lib/pbkdf/pbkdf.cpp @@ -7,7 +7,6 @@ #include #include -#include #if defined(BOTAN_HAS_PBKDF1) #include diff --git a/src/lib/pubkey/mce/code_based_util.h b/src/lib/pubkey/mce/code_based_util.h index a959ad0d3..31c962746 100644 --- a/src/lib/pubkey/mce/code_based_util.h +++ b/src/lib/pubkey/mce/code_based_util.h @@ -13,7 +13,6 @@ #define BOTAN_CODE_BASED_UTIL_H__ #include -#include namespace Botan { diff --git a/src/lib/pubkey/mce/gf2m_small_m.cpp b/src/lib/pubkey/mce/gf2m_small_m.cpp index f427ab4f3..e74e5c71f 100644 --- a/src/lib/pubkey/mce/gf2m_small_m.cpp +++ b/src/lib/pubkey/mce/gf2m_small_m.cpp @@ -9,8 +9,8 @@ */ #include +#include #include -#include namespace Botan { diff --git a/src/lib/tls/tls_ciphersuite.cpp b/src/lib/tls/tls_ciphersuite.cpp index d14376bdd..76c4e2416 100644 --- a/src/lib/tls/tls_ciphersuite.cpp +++ b/src/lib/tls/tls_ciphersuite.cpp @@ -12,7 +12,6 @@ #include #include #include -#include namespace Botan { diff --git a/src/lib/tls/tls_reader.h b/src/lib/tls/tls_reader.h index 7dd9fde57..b3c6db0c9 100644 --- a/src/lib/tls/tls_reader.h +++ b/src/lib/tls/tls_reader.h @@ -13,7 +13,6 @@ #include #include #include -#include namespace Botan { diff --git a/src/lib/tls/tls_seq_numbers.h b/src/lib/tls/tls_seq_numbers.h index 2071c810d..09962075e 100644 --- a/src/lib/tls/tls_seq_numbers.h +++ b/src/lib/tls/tls_seq_numbers.h @@ -9,7 +9,6 @@ #define BOTAN_TLS_SEQ_NUMBERS_H__ #include -#include namespace Botan { diff --git a/src/lib/utils/dyn_load/dyn_load.cpp b/src/lib/utils/dyn_load/dyn_load.cpp index 9b99331d1..03bf85090 100644 --- a/src/lib/utils/dyn_load/dyn_load.cpp +++ b/src/lib/utils/dyn_load/dyn_load.cpp @@ -7,7 +7,6 @@ #include #include -#include #if defined(BOTAN_TARGET_OS_HAS_DLOPEN) #include diff --git a/src/lib/utils/exceptn.h b/src/lib/utils/exceptn.h index c9b45f916..7ac32288d 100644 --- a/src/lib/utils/exceptn.h +++ b/src/lib/utils/exceptn.h @@ -11,7 +11,6 @@ #include #include #include -#include #include namespace Botan { @@ -24,7 +23,8 @@ class BOTAN_DLL Exception : public std::exception public: Exception(const std::string& what) : m_what(what) {} Exception(const char* prefix, const std::string& what) : m_what(std::string(prefix) + " " + what) {} - const char* what() const override { return m_what.c_str(); } + //const char* what() const override BOTAN_NOEXCEPT { return m_what.c_str(); } + const char* what() const BOTAN_NOEXCEPT override { return m_what.c_str(); } private: std::string m_what; }; diff --git a/src/lib/utils/http_util/http_util.h b/src/lib/utils/http_util/http_util.h index 746b790f1..6688285c6 100644 --- a/src/lib/utils/http_util/http_util.h +++ b/src/lib/utils/http_util/http_util.h @@ -9,6 +9,7 @@ #define BOTAN_UTILS_URLGET_H__ #include +#include #include #include #include diff --git a/src/lib/utils/parsing.cpp b/src/lib/utils/parsing.cpp index 179e2e546..2bf41f260 100644 --- a/src/lib/utils/parsing.cpp +++ b/src/lib/utils/parsing.cpp @@ -12,7 +12,6 @@ #include #include #include -#include namespace Botan { diff --git a/src/lib/utils/read_cfg.cpp b/src/lib/utils/read_cfg.cpp index 0719ee681..1a15f2e63 100644 --- a/src/lib/utils/read_cfg.cpp +++ b/src/lib/utils/read_cfg.cpp @@ -6,7 +6,7 @@ */ #include -#include +#include namespace Botan { diff --git a/src/lib/utils/sqlite3/sqlite3.cpp b/src/lib/utils/sqlite3/sqlite3.cpp index fde89b91d..1220829dd 100644 --- a/src/lib/utils/sqlite3/sqlite3.cpp +++ b/src/lib/utils/sqlite3/sqlite3.cpp @@ -6,7 +6,6 @@ */ #include -#include #include namespace Botan { -- cgit v1.2.3