Adjust includes for the updated locations of ndn-cxx security headers
Change-Id: I01787a91cdb70b7136f3c4e9e646e68888e6d064
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index 69a7881..5a7e803 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "conf-file-processor.hpp"
#include "adjacent.hpp"
@@ -653,7 +653,7 @@
std::string file = it->second.data();
bf::path certfilePath = absolute(file, bf::path(m_confFileName).parent_path());
- auto idCert = ndn::io::load<ndn::security::v2::Certificate>(certfilePath.string());
+ auto idCert = ndn::io::load<ndn::security::Certificate>(certfilePath.string());
if (idCert == nullptr) {
std::cerr << "Error: Cannot load cert-to-publish: " << file << "!" << std::endl;
diff --git a/src/conf-parameter.cpp b/src/conf-parameter.cpp
index 51e4303..8e53106 100644
--- a/src/conf-parameter.cpp
+++ b/src/conf-parameter.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California
*
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "conf-parameter.hpp"
#include "logger.hpp"
@@ -30,10 +30,10 @@
// To be changed when breaking changes are made to sync
const uint64_t ConfParameter::SYNC_VERSION = 8;
-static std::unique_ptr<ndn::security::v2::CertificateFetcherDirectFetch>
+static std::unique_ptr<ndn::security::CertificateFetcherDirectFetch>
makeCertificateFetcher(ndn::Face& face)
{
- auto fetcher = std::make_unique<ndn::security::v2::CertificateFetcherDirectFetch>(face);
+ auto fetcher = std::make_unique<ndn::security::CertificateFetcherDirectFetch>(face);
fetcher->setSendDirectInterestOnly(true);
return fetcher;
}
@@ -58,7 +58,7 @@
, m_adjl()
, m_npl()
, m_validator(makeCertificateFetcher(face))
- , m_prefixUpdateValidator(std::make_unique<ndn::security::v2::CertificateFetcherDirectFetch>(face))
+ , m_prefixUpdateValidator(std::make_unique<ndn::security::CertificateFetcherDirectFetch>(face))
, m_keyChain(keyChain)
{
}
@@ -113,14 +113,14 @@
}
void
-ConfParameter::loadCertToValidator(const ndn::security::v2::Certificate& cert)
+ConfParameter::loadCertToValidator(const ndn::security::Certificate& cert)
{
NLSR_LOG_TRACE("Loading Certificate Name: " << cert.getName());
- m_validator.loadAnchor("Authoritative-Certificate", ndn::security::v2::Certificate(cert));
- m_prefixUpdateValidator.loadAnchor("Authoritative-Certificate", ndn::security::v2::Certificate(cert));
+ m_validator.loadAnchor("Authoritative-Certificate", ndn::security::Certificate(cert));
+ m_prefixUpdateValidator.loadAnchor("Authoritative-Certificate", ndn::security::Certificate(cert));
}
-shared_ptr<ndn::security::v2::Certificate>
+shared_ptr<ndn::security::Certificate>
ConfParameter::initializeKey()
{
NLSR_LOG_DEBUG("Initializing Key ...");
@@ -145,7 +145,7 @@
NLSR_LOG_ERROR("Can be ignored if running in non-production environments.");
return nullptr;
}
- auto certificate = std::make_shared<ndn::security::v2::Certificate>();
+ auto certificate = std::make_shared<ndn::security::Certificate>();
auto nlsrInstanceKey = nlsrInstanceIdentity.getDefaultKey();
ndn::Name certificateName = nlsrInstanceKey.getName();
certificateName.append("NA");
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index 702c4f5..89d01c4 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#ifndef NLSR_CONF_PARAMETER_HPP
#define NLSR_CONF_PARAMETER_HPP
@@ -31,7 +31,7 @@
#include <boost/cstdint.hpp>
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/validator-config.hpp>
-#include <ndn-cxx/security/v2/certificate-fetcher-direct-fetch.hpp>
+#include <ndn-cxx/security/certificate-fetcher-direct-fetch.hpp>
#include <ndn-cxx/util/time.hpp>
namespace nlsr {
@@ -478,11 +478,11 @@
return m_keyChain;
}
- shared_ptr<ndn::security::v2::Certificate>
+ shared_ptr<ndn::security::Certificate>
initializeKey();
void
- loadCertToValidator(const ndn::security::v2::Certificate& cert);
+ loadCertToValidator(const ndn::security::Certificate& cert);
/*! \brief Dump the current state of all attributes to the log.
*/
diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index 050def4..f5c0929 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "hello-protocol.hpp"
#include "nlsr.hpp"
@@ -232,7 +232,7 @@
void
HelloProtocol::onContentValidationFailed(const ndn::Data& data,
- const ndn::security::v2::ValidationError& ve)
+ const ndn::security::ValidationError& ve)
{
NLSR_LOG_DEBUG("Validation Error: " << ve);
}
diff --git a/src/hello-protocol.hpp b/src/hello-protocol.hpp
index 16d0f91..efce624 100644
--- a/src/hello-protocol.hpp
+++ b/src/hello-protocol.hpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#ifndef NLSR_HELLO_PROTOCOL_HPP
#define NLSR_HELLO_PROTOCOL_HPP
@@ -33,7 +33,7 @@
#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
#include <ndn-cxx/mgmt/nfd/control-response.hpp>
#include <ndn-cxx/util/scheduler.hpp>
-#include <ndn-cxx/security/v2/validation-error.hpp>
+#include <ndn-cxx/security/validation-error.hpp>
#include <ndn-cxx/security/validator-config.hpp>
namespace nlsr {
@@ -123,7 +123,7 @@
*/
void
onContentValidationFailed(const ndn::Data& data,
- const ndn::security::v2::ValidationError& ve);
+ const ndn::security::ValidationError& ve);
/*! \brief Treat a failed Face registration as an INACTIVE neighbor.
*
@@ -158,7 +158,7 @@
private:
ndn::Face& m_face;
ndn::Scheduler m_scheduler;
- ndn::security::v2::KeyChain& m_keyChain;
+ ndn::security::KeyChain& m_keyChain;
const ndn::security::SigningInfo& m_signingInfo;
ConfParameter& m_confParam;
RoutingTable& m_routingTable;
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 4e61bbc..02e3625 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#ifndef NLSR_NLSR_HPP
#define NLSR_NLSR_HPP
@@ -45,7 +45,7 @@
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/validator-config.hpp>
-#include <ndn-cxx/security/v2/certificate-fetcher-direct-fetch.hpp>
+#include <ndn-cxx/security/certificate-fetcher-direct-fetch.hpp>
#include <ndn-cxx/security/signing-helpers.hpp>
#include <ndn-cxx/security/signing-info.hpp>
#include <ndn-cxx/util/scheduler.hpp>
@@ -208,7 +208,7 @@
private:
ndn::Face& m_face;
ndn::Scheduler m_scheduler;
- ndn::security::v2::KeyChain& m_keyChain;
+ ndn::security::KeyChain& m_keyChain;
ConfParameter& m_confParam;
AdjacencyList& m_adjacencyList;
NamePrefixList& m_namePrefixList;
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 90cddee..2fef853 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "fib.hpp"
#include "adjacency-list.hpp"
@@ -38,7 +38,7 @@
const std::string Fib::BEST_ROUTE_V2_STRATEGY("ndn:/localhost/nfd/strategy/best-route");
Fib::Fib(ndn::Face& face, ndn::Scheduler& scheduler, AdjacencyList& adjacencyList,
- ConfParameter& conf, ndn::security::v2::KeyChain& keyChain)
+ ConfParameter& conf, ndn::security::KeyChain& keyChain)
: m_scheduler(scheduler)
, m_refreshTime(2 * conf.getLsaRefreshTime())
, m_controller(face, keyChain)
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index ba4d87b..3e4ef68 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -53,7 +53,7 @@
{
public:
Fib(ndn::Face& face, ndn::Scheduler& scheduler, AdjacencyList& adjacencyList,
- ConfParameter& conf, ndn::security::v2::KeyChain& keyChain);
+ ConfParameter& conf, ndn::security::KeyChain& keyChain);
/*! \brief Completely remove a name prefix from the FIB.
*
diff --git a/src/security/certificate-store.cpp b/src/security/certificate-store.cpp
index aa3ae32..11db5e3 100644
--- a/src/security/certificate-store.cpp
+++ b/src/security/certificate-store.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "certificate-store.hpp"
#include "conf-parameter.hpp"
@@ -40,7 +40,7 @@
this, _1)))
{
for (const auto& x: confParam.getIdCerts()) {
- auto idCert = ndn::io::load<ndn::security::v2::Certificate>(x);
+ auto idCert = ndn::io::load<ndn::security::Certificate>(x);
insert(*idCert);
}
@@ -48,13 +48,13 @@
}
void
-CertificateStore::insert(const ndn::security::v2::Certificate& certificate)
+CertificateStore::insert(const ndn::security::Certificate& certificate)
{
m_certificates[certificate.getKeyName()] = certificate;
NLSR_LOG_TRACE("Certificate inserted successfully");
}
-const ndn::security::v2::Certificate*
+const ndn::security::Certificate*
CertificateStore::find(const ndn::Name& keyName) const
{
auto it = m_certificates.find(keyName);
@@ -147,7 +147,7 @@
if (cert) {
insert(*cert);
NLSR_LOG_TRACE(*cert);
- ndn::Name certName = ndn::security::v2::extractKeyNameFromCertName(cert->getName());
+ ndn::Name certName = ndn::security::extractKeyNameFromCertName(cert->getName());
NLSR_LOG_TRACE("Setting interest filter for: " << certName);
setInterestFilter(certName);
diff --git a/src/security/certificate-store.hpp b/src/security/certificate-store.hpp
index 99b88bf..95437c5 100644
--- a/src/security/certificate-store.hpp
+++ b/src/security/certificate-store.hpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#ifndef NLSR_CERTIFICATE_STORE_HPP
#define NLSR_CERTIFICATE_STORE_HPP
@@ -28,7 +28,7 @@
#include <ndn-cxx/interest.hpp>
#include <ndn-cxx/mgmt/nfd/controller.hpp>
-#include <ndn-cxx/security/v2/certificate.hpp>
+#include <ndn-cxx/security/certificate.hpp>
#include <ndn-cxx/security/validator-config.hpp>
namespace nlsr {
@@ -49,7 +49,7 @@
CertificateStore(ndn::Face& face, ConfParameter& confParam, Lsdb& lsdb);
void
- insert(const ndn::security::v2::Certificate& certificate);
+ insert(const ndn::security::Certificate& certificate);
/*! \brief Find a certificate
*
@@ -59,7 +59,7 @@
* checks the cache of certificates it has already fetched. If none
* can be found, it will return an null pointer.
*/
- const ndn::security::v2::Certificate*
+ const ndn::security::Certificate*
find(const ndn::Name& keyName) const;
/*! \brief Retrieves the chain of certificates from Validator's cache and
@@ -92,7 +92,7 @@
registrationFailed(const ndn::Name& name);
private:
- typedef std::map<ndn::Name, ndn::security::v2::Certificate> CertMap;
+ typedef std::map<ndn::Name, ndn::security::Certificate> CertMap;
CertMap m_certificates;
ndn::Face& m_face;
ConfParameter& m_confParam;
diff --git a/src/update/prefix-update-processor.cpp b/src/update/prefix-update-processor.cpp
index 3552123..956fc7b 100644
--- a/src/update/prefix-update-processor.cpp
+++ b/src/update/prefix-update-processor.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019, The University of Memphis,
+/*
+ * Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "prefix-update-processor.hpp"
#include "lsdb.hpp"
@@ -89,7 +89,7 @@
NLSR_LOG_DEBUG("accept " << request.getName() << " signer=" << signer);
accept(signer);
},
- [reject] (const ndn::Interest& request, const ndn::security::v2::ValidationError& error) {
+ [reject] (const ndn::Interest& request, const ndn::security::ValidationError& error) {
NLSR_LOG_DEBUG("reject " << request.getName() << " signer=" <<
getSignerFromTag(request).value_or("?") << ' ' << error);
reject(ndn::mgmt::RejectReply::STATUS403);
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index c5aed73..77cc97c 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,14 +26,14 @@
#include "identity-management-fixture.hpp"
#include <ndn-cxx/util/io.hpp>
-#include <ndn-cxx/security/v2/additional-description.hpp>
+#include <ndn-cxx/security/additional-description.hpp>
#include <boost/filesystem.hpp>
namespace nlsr {
namespace tests {
-namespace v2 = ndn::security::v2;
+namespace v2 = ndn::security;
namespace io = ndn::io;
namespace time = ndn::time;
diff --git a/tests/identity-management-fixture.hpp b/tests/identity-management-fixture.hpp
index acd75d0..447a320 100644
--- a/tests/identity-management-fixture.hpp
+++ b/tests/identity-management-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,7 +31,7 @@
#include <vector>
-#include <ndn-cxx/security/v2/key-chain.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/signing-helpers.hpp>
namespace nlsr {
@@ -93,7 +93,7 @@
/**
* @brief Add a self-signed certificate to @p key with issuer ID @p issuer
*/
- ndn::security::v2::Certificate
+ ndn::security::Certificate
addCertificate(const ndn::security::Key& key, const std::string& issuer);
protected:
diff --git a/tests/security/test-certificate-store.cpp b/tests/security/test-certificate-store.cpp
index 0009c17..b4ef2da 100644
--- a/tests/security/test-certificate-store.cpp
+++ b/tests/security/test-certificate-store.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "security/certificate-store.hpp"
@@ -116,7 +116,7 @@
Nlsr nlsr;
Lsdb& lsdb;
- ndn::security::v2::Certificate certificate;
+ ndn::security::Certificate certificate;
ndn::Name certificateKey;
security::CertificateStore certStore;
const boost::filesystem::path ROOT_CERT_PATH;
@@ -201,7 +201,7 @@
// Make NLSR validate data signed by its own key
conf.getValidator().validate(data,
[] (const ndn::Data&) { BOOST_CHECK(true); },
- [] (const ndn::Data&, const ndn::security::v2::ValidationError&) {
+ [] (const ndn::Data&, const ndn::security::ValidationError&) {
BOOST_CHECK(false);
});
diff --git a/tests/test-home-fixture.hpp b/tests/test-home-fixture.hpp
index a3ced4e..e712f25 100644
--- a/tests/test-home-fixture.hpp
+++ b/tests/test-home-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,6 @@
#include <fstream>
-#include <ndn-cxx/security/v2/key-chain.hpp>
-
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
@@ -80,8 +78,6 @@
}
boost::filesystem::remove_all(m_pibDir);
- //const_cast<std::string&>(ndn::security::v2::KeyChain::getDefaultPibLocator()).clear();
- //const_cast<std::string&>(ndn::security::v2::KeyChain::getDefaultTpmLocator()).clear();
}
protected:
diff --git a/tests/test-lsa-rule.cpp b/tests/test-lsa-rule.cpp
index 00c0ded..2827cd1 100644
--- a/tests/test-lsa-rule.cpp
+++ b/tests/test-lsa-rule.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "test-common.hpp"
#include "nlsr.hpp"
@@ -136,7 +136,7 @@
// Make NLSR validate data signed by its own key
confParam.getValidator().validate(data,
[] (const Data&) { BOOST_CHECK(true); },
- [] (const Data&, const ndn::security::v2::ValidationError&) {
+ [] (const Data&, const ndn::security::ValidationError&) {
BOOST_CHECK(false);
});
}
@@ -163,7 +163,7 @@
// Make NLSR validate data signed by its own key
confParam.getValidator().validate(data,
[] (const Data&) { BOOST_CHECK(false); },
- [] (const Data&, const ndn::security::v2::ValidationError&) {
+ [] (const Data&, const ndn::security::ValidationError&) {
BOOST_CHECK(true);
});
}
diff --git a/tests/test-lsdb.cpp b/tests/test-lsdb.cpp
index 9ed1f26..cf0de05 100644
--- a/tests/test-lsdb.cpp
+++ b/tests/test-lsdb.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "lsdb.hpp"
@@ -238,7 +238,7 @@
face.linkTo(face2);
auto fetcher = ndn::util::SegmentFetcher::start(face2, ndn::Interest(interestName),
- ndn::security::v2::getAcceptAllValidator());
+ ndn::security::getAcceptAllValidator());
fetcher->onComplete.connect([&expectedDataContent] (ndn::ConstBufferPtr bufferPtr) {
ndn::Block block(bufferPtr);
BOOST_CHECK_EQUAL(expectedDataContent, block);