diff options
author | lloyd <[email protected]> | 2015-02-11 23:16:51 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-02-11 23:16:51 +0000 |
commit | 85caef829c9eeb7c224ad3b2e3ffbcfe981c2428 (patch) | |
tree | 130b3913b5e82de89042a74c2a8046f103deff1b /src | |
parent | 92bc6eac5addf77d610fad21378bc4434ef98119 (diff) |
Add version_cstr (returns const char*) and move tag_size from AEAD to
Cipher_Mode. Add missing includes in entropy sources, noticed by clang.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/entropy/egd/es_egd.h | 1 | ||||
-rw-r--r-- | src/lib/entropy/unix_procs/unix_procs.h | 2 | ||||
-rw-r--r-- | src/lib/modes/aead/aead.h | 5 | ||||
-rw-r--r-- | src/lib/modes/cipher_mode.h | 5 | ||||
-rw-r--r-- | src/lib/utils/version.cpp | 5 | ||||
-rw-r--r-- | src/lib/utils/version.h | 2 |
6 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/entropy/egd/es_egd.h b/src/lib/entropy/egd/es_egd.h index 5afdc5a41..3f46bc64f 100644 --- a/src/lib/entropy/egd/es_egd.h +++ b/src/lib/entropy/egd/es_egd.h @@ -11,6 +11,7 @@ #include <botan/entropy_src.h> #include <string> #include <vector> +#include <mutex> namespace Botan { diff --git a/src/lib/entropy/unix_procs/unix_procs.h b/src/lib/entropy/unix_procs/unix_procs.h index 00ebe13ad..b2505fcd5 100644 --- a/src/lib/entropy/unix_procs/unix_procs.h +++ b/src/lib/entropy/unix_procs/unix_procs.h @@ -10,7 +10,7 @@ #include <botan/entropy_src.h> #include <vector> -#include <sys/types.h> +#include <mutex> namespace Botan { diff --git a/src/lib/modes/aead/aead.h b/src/lib/modes/aead/aead.h index 41fc605ba..6bbb39dcb 100644 --- a/src/lib/modes/aead/aead.h +++ b/src/lib/modes/aead/aead.h @@ -55,11 +55,6 @@ class BOTAN_DLL AEAD_Mode : public Cipher_Mode * modes, and large enough that random collisions are unlikely). */ size_t default_nonce_length() const override { return 12; } - - /** - * Return the size of the authentication tag used (in bytes) - */ - virtual size_t tag_size() const = 0; }; /** diff --git a/src/lib/modes/cipher_mode.h b/src/lib/modes/cipher_mode.h index 110053489..63821005d 100644 --- a/src/lib/modes/cipher_mode.h +++ b/src/lib/modes/cipher_mode.h @@ -24,6 +24,11 @@ class BOTAN_DLL Cipher_Mode : public Keyed_Transform * confidentiality. */ virtual bool authenticated() const { return false; } + + /** + * Return the size of the authentication tag used (in bytes) + */ + virtual size_t tag_size() const { return 0; } }; /** diff --git a/src/lib/utils/version.cpp b/src/lib/utils/version.cpp index d13d091ca..f3e01e290 100644 --- a/src/lib/utils/version.cpp +++ b/src/lib/utils/version.cpp @@ -21,6 +21,11 @@ namespace Botan { */ std::string version_string() { + return std::string(version_cstr()); + } + +const char* version_cstr() + { #define QUOTE(name) #name #define STR(macro) QUOTE(macro) diff --git a/src/lib/utils/version.h b/src/lib/utils/version.h index c2f070433..3fc6f5fe7 100644 --- a/src/lib/utils/version.h +++ b/src/lib/utils/version.h @@ -24,6 +24,8 @@ namespace Botan { */ BOTAN_DLL std::string version_string(); +BOTAN_DLL const char* version_cstr(); + /** * Return the date this version of botan was released, in an integer of * the form YYYYMMDD. For instance a version released on May 21, 2013 |