aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-10-08 11:43:24 -0400
committerJack Lloyd <[email protected]>2019-10-17 20:36:19 -0400
commit0af734f5e904abaded54f06338e01cb63d4ffa58 (patch)
tree529597a11d124f21ab10594f07ea1b0f7f86c199 /src/lib
parent7f8148341ef4ecb83fd3acdb6a3d457ec1b84741 (diff)
Attempt to address some LGTM warnings in Roughtime
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/misc/roughtime/roughtime.cpp3
-rw-r--r--src/lib/misc/roughtime/roughtime.h6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/misc/roughtime/roughtime.cpp b/src/lib/misc/roughtime/roughtime.cpp
index 94a9a6b82..b8c53bdc8 100644
--- a/src/lib/misc/roughtime/roughtime.cpp
+++ b/src/lib/misc/roughtime/roughtime.cpp
@@ -21,6 +21,9 @@ namespace Botan {
namespace {
+// This exists to work around a LGTM false positive
+static_assert(Roughtime::request_min_size == 1024, "Expected minimum size");
+
template< bool B, class T = void >
using enable_if_t = typename std::enable_if<B,T>::type;
diff --git a/src/lib/misc/roughtime/roughtime.h b/src/lib/misc/roughtime/roughtime.h
index 595e693b9..82d093e6f 100644
--- a/src/lib/misc/roughtime/roughtime.h
+++ b/src/lib/misc/roughtime/roughtime.h
@@ -20,7 +20,7 @@ class RandomNumberGenerator;
namespace Roughtime {
-constexpr unsigned request_min_size = 1024;
+const unsigned request_min_size = 1024;
class BOTAN_PUBLIC_API(2, 13) Roughtime_Error final : public Decoding_Error
{
@@ -70,7 +70,9 @@ class BOTAN_PUBLIC_API(2, 13) Response final
microseconds32 utc_radius() const { return m_utc_radius; }
private:
- Response(std::array<uint8_t, 72> dele, std::array<uint8_t, 64> sig, sys_microseconds64 utc_midp,
+ Response(const std::array<uint8_t, 72>& dele,
+ const std::array<uint8_t, 64>& sig,
+ sys_microseconds64 utc_midp,
microseconds32 utc_radius)
: m_cert_dele(dele)
, m_cert_sig(sig)