Adjust includes for the updated locations of ndn-cxx security headers

Change-Id: I5a94879966de2c166fed8dedda0ed1d65c33c300
diff --git a/daemon/mgmt/command-authenticator.cpp b/daemon/mgmt/command-authenticator.cpp
index c146962..833400c 100644
--- a/daemon/mgmt/command-authenticator.cpp
+++ b/daemon/mgmt/command-authenticator.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  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,
@@ -27,17 +27,17 @@
 #include "common/logger.hpp"
 
 #include <ndn-cxx/tag.hpp>
-#include <ndn-cxx/security/v2/certificate-fetcher-offline.hpp>
-#include <ndn-cxx/security/v2/certificate-request.hpp>
-#include <ndn-cxx/security/v2/validation-policy.hpp>
-#include <ndn-cxx/security/v2/validation-policy-accept-all.hpp>
-#include <ndn-cxx/security/v2/validation-policy-command-interest.hpp>
-#include <ndn-cxx/security/v2/validator.hpp>
+#include <ndn-cxx/security/certificate-fetcher-offline.hpp>
+#include <ndn-cxx/security/certificate-request.hpp>
+#include <ndn-cxx/security/validation-policy.hpp>
+#include <ndn-cxx/security/validation-policy-accept-all.hpp>
+#include <ndn-cxx/security/validation-policy-command-interest.hpp>
+#include <ndn-cxx/security/validator.hpp>
 #include <ndn-cxx/util/io.hpp>
 
 #include <boost/filesystem.hpp>
 
-namespace sec2 = ndn::security::v2;
+namespace security = ndn::security;
 
 namespace nfd {
 
@@ -65,11 +65,11 @@
 
 /** \brief a validation policy that only permits Interest signed by a trust anchor
  */
-class CommandAuthenticatorValidationPolicy : public sec2::ValidationPolicy
+class CommandAuthenticatorValidationPolicy : public security::ValidationPolicy
 {
 public:
   void
-  checkPolicy(const Interest& interest, const shared_ptr<sec2::ValidationState>& state,
+  checkPolicy(const Interest& interest, const shared_ptr<security::ValidationState>& state,
               const ValidationContinuation& continueValidation) final
   {
     Name klName = getKeyLocatorName(interest, *state);
@@ -80,14 +80,14 @@
     // SignerTag must be placed on the 'original Interest' in ValidationState to be available for
     // InterestValidationSuccessCallback. The 'interest' parameter refers to a different instance
     // which is copied into 'original Interest'.
-    auto state1 = dynamic_pointer_cast<sec2::InterestValidationState>(state);
+    auto state1 = dynamic_pointer_cast<security::InterestValidationState>(state);
     state1->getOriginalInterest().setTag(make_shared<SignerTag>(klName));
 
-    continueValidation(make_shared<sec2::CertificateRequest>(Interest(klName)), state);
+    continueValidation(make_shared<security::CertificateRequest>(Interest(klName)), state);
   }
 
   void
-  checkPolicy(const Data& data, const shared_ptr<sec2::ValidationState>& state,
+  checkPolicy(const Data& data, const shared_ptr<security::ValidationState>& state,
               const ValidationContinuation& continueValidation) final
   {
     // Non-certificate Data are not handled by CommandAuthenticator.
@@ -117,9 +117,9 @@
   if (!isDryRun) {
     NFD_LOG_INFO("clear-authorizations");
     for (auto& kv : m_validators) {
-      kv.second = make_shared<sec2::Validator>(
-        make_unique<sec2::ValidationPolicyCommandInterest>(make_unique<CommandAuthenticatorValidationPolicy>()),
-        make_unique<sec2::CertificateFetcherOffline>());
+      kv.second = make_shared<security::Validator>(
+        make_unique<security::ValidationPolicyCommandInterest>(make_unique<CommandAuthenticatorValidationPolicy>()),
+        make_unique<security::CertificateFetcherOffline>());
     }
   }
 
@@ -144,7 +144,7 @@
     }
 
     bool isAny = false;
-    shared_ptr<sec2::Certificate> cert;
+    shared_ptr<security::Certificate> cert;
     if (certfile == "any") {
       isAny = true;
       NFD_LOG_WARN("'certfile any' is intended for demo purposes only and "
@@ -153,7 +153,7 @@
     else {
       using namespace boost::filesystem;
       path certfilePath = absolute(certfile, path(filename).parent_path());
-      cert = ndn::io::load<sec2::Certificate>(certfilePath.string());
+      cert = ndn::io::load<security::Certificate>(certfilePath.string());
       if (cert == nullptr) {
         NDN_THROW(ConfigFile::Error("cannot load certfile " + certfilePath.string() +
                                     " for authorize[" + to_string(authSectionIndex) + "]"));
@@ -185,13 +185,13 @@
       }
 
       if (isAny) {
-        found->second = make_shared<sec2::Validator>(make_unique<sec2::ValidationPolicyAcceptAll>(),
-                                                     make_unique<sec2::CertificateFetcherOffline>());
+        found->second = make_shared<security::Validator>(make_unique<security::ValidationPolicyAcceptAll>(),
+                                                         make_unique<security::CertificateFetcherOffline>());
         NFD_LOG_INFO("authorize module=" << module << " signer=any");
       }
       else {
         const Name& keyName = cert->getKeyName();
-        sec2::Certificate certCopy = *cert;
+        security::Certificate certCopy = *cert;
         found->second->loadAnchor(certfile, std::move(certCopy));
         NFD_LOG_INFO("authorize module=" << module << " signer=" << keyName << " certfile=" << certfile);
       }
@@ -215,20 +215,20 @@
     auto successCb = [accept, validator] (const Interest& interest1) {
       auto signer1 = getSignerFromTag(interest1);
       BOOST_ASSERT(signer1 || // signer must be available unless 'certfile any'
-                   dynamic_cast<sec2::ValidationPolicyAcceptAll*>(&validator->getPolicy()) != nullptr);
+                   dynamic_cast<security::ValidationPolicyAcceptAll*>(&validator->getPolicy()) != nullptr);
       std::string signer = signer1.value_or("*");
       NFD_LOG_DEBUG("accept " << interest1.getName() << " signer=" << signer);
       accept(signer);
     };
-    auto failureCb = [reject] (const Interest& interest1, const sec2::ValidationError& err) {
+    auto failureCb = [reject] (const Interest& interest1, const security::ValidationError& err) {
       using ndn::mgmt::RejectReply;
       RejectReply reply = RejectReply::STATUS403;
       switch (err.getCode()) {
-      case sec2::ValidationError::NO_SIGNATURE:
-      case sec2::ValidationError::INVALID_KEY_LOCATOR:
+      case security::ValidationError::NO_SIGNATURE:
+      case security::ValidationError::INVALID_KEY_LOCATOR:
         reply = RejectReply::SILENT;
         break;
-      case sec2::ValidationError::POLICY_ERROR:
+      case security::ValidationError::POLICY_ERROR:
         if (interest1.getName().size() < ndn::command_interest::MIN_SIZE) { // "name too short"
           reply = RejectReply::SILENT;
         }
diff --git a/daemon/mgmt/command-authenticator.hpp b/daemon/mgmt/command-authenticator.hpp
index 9f136a8..8d5158e 100644
--- a/daemon/mgmt/command-authenticator.hpp
+++ b/daemon/mgmt/command-authenticator.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  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,
@@ -29,14 +29,7 @@
 #include "common/config-file.hpp"
 
 #include <ndn-cxx/mgmt/dispatcher.hpp>
-
-namespace ndn {
-namespace security {
-namespace v2 {
-class Validator;
-} // namespace v2
-} // namespace security
-} // namespace ndn
+#include <ndn-cxx/security/validator.hpp>
 
 namespace nfd {
 
@@ -70,7 +63,7 @@
 
 private:
   /// module => validator
-  std::unordered_map<std::string, shared_ptr<ndn::security::v2::Validator>> m_validators;
+  std::unordered_map<std::string, shared_ptr<ndn::security::Validator>> m_validators;
 };
 
 } // namespace nfd
diff --git a/daemon/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index 768526b..68b061e 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  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,
@@ -33,7 +33,7 @@
 #include <ndn-cxx/lp/tags.hpp>
 #include <ndn-cxx/mgmt/nfd/face-status.hpp>
 #include <ndn-cxx/mgmt/nfd/rib-entry.hpp>
-#include <ndn-cxx/security/v2/certificate-fetcher-direct-fetch.hpp>
+#include <ndn-cxx/security/certificate-fetcher-direct-fetch.hpp>
 
 namespace nfd {
 
@@ -57,8 +57,8 @@
   , m_dispatcher(dispatcher)
   , m_faceMonitor(face)
   , m_localhostValidator(face)
-  , m_localhopValidator(make_unique<ndn::security::v2::CertificateFetcherDirectFetch>(face))
-  , m_paValidator(make_unique<ndn::security::v2::CertificateFetcherDirectFetch>(face))
+  , m_localhopValidator(make_unique<ndn::security::CertificateFetcherDirectFetch>(face))
+  , m_paValidator(make_unique<ndn::security::CertificateFetcherDirectFetch>(face))
   , m_isLocalhopEnabled(false)
 {
   registerCommandHandler<ndn::nfd::RibRegisterCommand>("register",
@@ -370,7 +370,7 @@
           cb(res);
         });
     },
-    [=] (const Data&, ndn::security::v2::ValidationError err) {
+    [=] (const Data&, ndn::security::ValidationError err) {
       NFD_LOG_INFO("slAnnounce " << pa.getAnnouncedName() << " " << faceId <<
                    " validation error: " << err);
       cb(SlAnnounceResult::VALIDATION_FAILURE);
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index d21b878..6ed5b0a 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  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,
@@ -235,7 +235,7 @@
   ConfigurationStatus m_status;
   Name m_anchorId;
   Name m_derivedId;
-  ndn::security::v2::Certificate m_derivedCert;
+  ndn::security::Certificate m_derivedCert;
 
   ndn::nfd::Controller m_nfdController;
   rib::Rib m_rib;
diff --git a/tests/key-chain-fixture.cpp b/tests/key-chain-fixture.cpp
index acefabe..9e20dd3 100644
--- a/tests/key-chain-fixture.cpp
+++ b/tests/key-chain-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  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,
@@ -25,11 +25,11 @@
 
 #include "tests/key-chain-fixture.hpp"
 
+#include <ndn-cxx/security/certificate.hpp>
 #include <ndn-cxx/security/pib/identity.hpp>
 #include <ndn-cxx/security/pib/key.hpp>
 #include <ndn-cxx/security/pib/pib.hpp>
 #include <ndn-cxx/security/transform.hpp>
-#include <ndn-cxx/security/v2/certificate.hpp>
 #include <ndn-cxx/util/io.hpp>
 
 #include <boost/filesystem.hpp>
@@ -66,7 +66,7 @@
 bool
 KeyChainFixture::saveIdentityCertificate(const Name& identity, const std::string& filename, bool allowAdd)
 {
-  ndn::security::v2::Certificate cert;
+  ndn::security::Certificate cert;
   try {
     cert = m_keyChain.getPib().getIdentity(identity).getDefaultKey().getDefaultCertificate();
   }
@@ -90,7 +90,7 @@
 std::string
 KeyChainFixture::getIdentityCertificateBase64(const Name& identity, bool allowAdd)
 {
-  ndn::security::v2::Certificate cert;
+  ndn::security::Certificate cert;
   try {
     cert = m_keyChain.getPib().getIdentity(identity).getDefaultKey().getDefaultCertificate();
   }
diff --git a/tests/tools/ndn-autoconfig-server/program.t.cpp b/tests/tools/ndn-autoconfig-server/program.t.cpp
index 88488a1..e4268a0 100644
--- a/tests/tools/ndn-autoconfig-server/program.t.cpp
+++ b/tests/tools/ndn-autoconfig-server/program.t.cpp
@@ -97,7 +97,7 @@
 
   Name baseName("/localhop/nfd/rib/routable-prefixes");
   auto fetcher = util::SegmentFetcher::start(clientFace, Interest(baseName),
-                                             security::v2::getAcceptAllValidator());
+                                             security::getAcceptAllValidator());
   fetcher->afterSegmentReceived.connect([baseName] (const Data& data) {
     const Name& dataName = data.getName();
     BOOST_CHECK_EQUAL(dataName.size(), baseName.size() + 2);
diff --git a/tests/tools/nfdc/status-fixture.hpp b/tests/tools/nfdc/status-fixture.hpp
index 4517254..f5fc2ec 100644
--- a/tests/tools/nfdc/status-fixture.hpp
+++ b/tests/tools/nfdc/status-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  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,
@@ -44,8 +44,8 @@
 
 using ndn::Face;
 using ndn::KeyChain;
-using ndn::security::v2::Validator;
-using ndn::security::v2::ValidatorNull;
+using ndn::security::Validator;
+using ndn::security::ValidatorNull;
 using boost::test_tools::output_test_stream;
 
 class MakeValidatorNull
diff --git a/tools/nfdc/status-report.hpp b/tools/nfdc/status-report.hpp
index 1658852..f88b175 100644
--- a/tools/nfdc/status-report.hpp
+++ b/tools/nfdc/status-report.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,
@@ -29,7 +29,7 @@
 #include "module.hpp"
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/security/v2/validator.hpp>
+#include <ndn-cxx/security/validator.hpp>
 
 namespace nfd {
 namespace tools {
@@ -37,7 +37,7 @@
 
 using ndn::Face;
 using ndn::KeyChain;
-using ndn::security::v2::Validator;
+using ndn::security::Validator;
 
 enum class ReportFormat {
   XML = 1,
diff --git a/tools/nfdc/status.cpp b/tools/nfdc/status.cpp
index a47d12b..441c3a9 100644
--- a/tools/nfdc/status.cpp
+++ b/tools/nfdc/status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  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,
@@ -72,7 +72,7 @@
   }
 
   uint32_t code = report.collect(ctx.face, ctx.keyChain,
-                                 ndn::security::v2::getAcceptAllValidator(),
+                                 ndn::security::getAcceptAllValidator(),
                                  CommandOptions());
   if (code != 0) {
     ctx.exitCode = 1;