Fix build against current ndn-cxx
Change-Id: I9f2e06204ee190d507c76aac7ead09ad8e4d5009
diff --git a/src/detail/ca-configuration.cpp b/src/detail/ca-configuration.cpp
index 7d27bfb..813c428 100644
--- a/src/detail/ca-configuration.cpp
+++ b/src/detail/ca-configuration.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017-2020, Regents of the University of California.
+/*
+ * Copyright (c) 2017-2021, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
@@ -19,8 +19,11 @@
*/
#include "detail/ca-configuration.hpp"
+
#include <ndn-cxx/util/io.hpp>
+
#include <boost/filesystem.hpp>
+#include <boost/property_tree/json_parser.hpp>
namespace ndn {
namespace ndncert {
@@ -39,7 +42,7 @@
if (configJson.begin() == configJson.end()) {
NDN_THROW(std::runtime_error("No JSON configuration found in file: " + fileName));
}
- caProfile = CaProfile::fromJson(configJson);
+ caProfile = CaProfile::fromJson(configJson);
if (caProfile.supportedChallenges.size() == 0) {
NDN_THROW(std::runtime_error("At least one challenge should be specified."));
}
diff --git a/src/detail/ca-request-state.cpp b/src/detail/ca-request-state.cpp
index 53783d4..b8a6b27 100644
--- a/src/detail/ca-request-state.cpp
+++ b/src/detail/ca-request-state.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017-2020, Regents of the University of California.
+/*
+ * Copyright (c) 2017-2021, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
@@ -19,15 +19,17 @@
*/
#include "detail/ca-request-state.hpp"
+
#include <ndn-cxx/util/indented-stream.hpp>
+#include <boost/property_tree/json_parser.hpp>
+
namespace ndn {
namespace ndncert {
std::string statusToString(Status status)
{
- switch (status)
- {
+ switch (status) {
case Status::BEFORE_CHALLENGE:
return "Before challenge";
case Status::CHALLENGE:
@@ -58,11 +60,11 @@
const time::system_clock::TimePoint& challengeTp,
size_t remainingTries, time::seconds remainingTime,
JsonSection&& challengeSecrets)
- : challengeStatus(challengeStatus)
- , timestamp(challengeTp)
- , remainingTries(remainingTries)
- , remainingTime(remainingTime)
- , secrets(std::move(challengeSecrets))
+ : challengeStatus(challengeStatus)
+ , timestamp(challengeTp)
+ , remainingTries(remainingTries)
+ , remainingTime(remainingTime)
+ , secrets(std::move(challengeSecrets))
{
}
diff --git a/src/detail/ca-sqlite.cpp b/src/detail/ca-sqlite.cpp
index 1cddfed..c247501 100644
--- a/src/detail/ca-sqlite.cpp
+++ b/src/detail/ca-sqlite.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2017-2020, Regents of the University of California.
+ * Copyright (c) 2017-2021, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
@@ -21,10 +21,13 @@
#include "detail/ca-sqlite.hpp"
#include <sqlite3.h>
-#include <boost/filesystem.hpp>
+
#include <ndn-cxx/security/validation-policy.hpp>
#include <ndn-cxx/util/sqlite3-statement.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/property_tree/json_parser.hpp>
+
namespace ndn {
namespace ndncert {
namespace ca {
@@ -186,7 +189,8 @@
statement.bind(11, request.challengeState->remainingTime.count());
}
if (statement.step() != SQLITE_DONE) {
- NDN_THROW(std::runtime_error("Request " + toHex(request.requestId.data(), request.requestId.size()) + " cannot be added to database"));
+ NDN_THROW(std::runtime_error("Request " + toHex(request.requestId.data(), request.requestId.size()) +
+ " cannot be added to database"));
}
}
diff --git a/src/detail/ndncert-common.hpp b/src/detail/ndncert-common.hpp
index 0e1b392..01fa883 100644
--- a/src/detail/ndncert-common.hpp
+++ b/src/detail/ndncert-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017-2020, Regents of the University of California.
+/*
+ * Copyright (c) 2017-2021, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
@@ -37,6 +37,9 @@
#include <cstddef>
#include <cstdint>
+#include <string>
+#include <tuple>
+
#include <ndn-cxx/data.hpp>
#include <ndn-cxx/encoding/block-helpers.hpp>
#include <ndn-cxx/encoding/block.hpp>
@@ -48,13 +51,11 @@
#include <ndn-cxx/security/certificate.hpp>
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/util/logger.hpp>
-#include <ndn-cxx/util/nonstd/optional.hpp>
-#include <tuple>
+#include <ndn-cxx/util/optional.hpp>
+
#include <boost/algorithm/string.hpp>
#include <boost/assert.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/property_tree/info_parser.hpp>
-#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
namespace ndn {
@@ -93,8 +94,7 @@
} // namespace tlv
-using boost::noncopyable;
-typedef boost::property_tree::ptree JsonSection;
+using JsonSection = boost::property_tree::ptree;
// NDNCERT error code
enum class ErrorCode : uint64_t {
diff --git a/src/detail/profile-storage.cpp b/src/detail/profile-storage.cpp
index 7ae3c08..949309a 100644
--- a/src/detail/profile-storage.cpp
+++ b/src/detail/profile-storage.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017-2020, Regents of the University of California.
+/*
+ * Copyright (c) 2017-2021, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
@@ -19,7 +19,9 @@
*/
#include "detail/profile-storage.hpp"
+
#include <boost/filesystem.hpp>
+#include <boost/property_tree/json_parser.hpp>
namespace ndn {
namespace ndncert {