aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-10-18 04:51:17 -0400
committerJack Lloyd <[email protected]>2019-10-18 04:51:17 -0400
commitca73e7a93e1b703252b70b4fe31c8c62f9cd6209 (patch)
tree529597a11d124f21ab10594f07ea1b0f7f86c199
parent7f8148341ef4ecb83fd3acdb6a3d457ec1b84741 (diff)
parent0af734f5e904abaded54f06338e01cb63d4ffa58 (diff)
Merge GH #2136 Fix LGTM warning in Roughtime
-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)