security: Rename security/v2/* to security/*
Security v1-v2 transition has been completed for a while and path
separation is no longer needed. However, this commit preserves
`ndn::security::v2` namespace, but makes it inline.
Some commonly used v2 headers are preserved, but are deprecated and
should be avoided in the dependent software.
Change-Id: I26056cb3d34bcdc0a16e06dea8c1a78c03da2d40
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index 3877a23..0c95567 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -21,7 +21,7 @@
#include "tests/identity-management-fixture.hpp"
-#include "ndn-cxx/security/v2/additional-description.hpp"
+#include "ndn-cxx/security/additional-description.hpp"
#include "ndn-cxx/util/io.hpp"
#include <boost/filesystem.hpp>
diff --git a/tests/identity-management-fixture.hpp b/tests/identity-management-fixture.hpp
index ba42ca3..7c0ffbd 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) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,7 +22,7 @@
#ifndef NDN_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
#define NDN_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
-#include "ndn-cxx/security/v2/key-chain.hpp"
+#include "ndn-cxx/security/key-chain.hpp"
#include "ndn-cxx/security/signing-helpers.hpp"
#include "tests/test-home-fixture.hpp"
diff --git a/tests/test-home-fixture.hpp b/tests/test-home-fixture.hpp
index 63d5d88..68ffd50 100644
--- a/tests/test-home-fixture.hpp
+++ b/tests/test-home-fixture.hpp
@@ -22,7 +22,7 @@
#ifndef NDN_TESTS_TEST_HOME_FIXTURE_HPP
#define NDN_TESTS_TEST_HOME_FIXTURE_HPP
-#include "ndn-cxx/security/v2/key-chain.hpp"
+#include "ndn-cxx/security/key-chain.hpp"
#include <cstdlib>
#include <fstream>
@@ -76,8 +76,8 @@
}
boost::filesystem::remove_all(m_pibDir);
- const_cast<std::string&>(security::v2::KeyChain::getDefaultPibLocator()).clear();
- const_cast<std::string&>(security::v2::KeyChain::getDefaultTpmLocator()).clear();
+ const_cast<std::string&>(KeyChain::getDefaultPibLocator()).clear();
+ const_cast<std::string&>(KeyChain::getDefaultTpmLocator()).clear();
}
protected:
diff --git a/tests/tests-pch.hpp b/tests/tests-pch.hpp
index a81f7bf..f60e472 100644
--- a/tests/tests-pch.hpp
+++ b/tests/tests-pch.hpp
@@ -27,7 +27,7 @@
#include "ndn-cxx/data.hpp"
#include "ndn-cxx/interest.hpp"
#include "ndn-cxx/lp/nack.hpp"
-#include "ndn-cxx/security/v2/key-chain.hpp"
+#include "ndn-cxx/security/key-chain.hpp"
#include "tests/boost-test.hpp"
diff --git a/tests/unit/dummy-validator.hpp b/tests/unit/dummy-validator.hpp
index aab9114..bb05167 100644
--- a/tests/unit/dummy-validator.hpp
+++ b/tests/unit/dummy-validator.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,9 +22,9 @@
#ifndef NDN_TESTS_UNIT_DUMMY_VALIDATOR_HPP
#define NDN_TESTS_UNIT_DUMMY_VALIDATOR_HPP
-#include "ndn-cxx/security/v2/validator.hpp"
-#include "ndn-cxx/security/v2/validation-policy.hpp"
-#include "ndn-cxx/security/v2/certificate-fetcher-offline.hpp"
+#include "ndn-cxx/security/validator.hpp"
+#include "ndn-cxx/security/validation-policy.hpp"
+#include "ndn-cxx/security/certificate-fetcher-offline.hpp"
namespace ndn {
namespace tests {
diff --git a/tests/unit/mgmt/nfd/controller-fixture.hpp b/tests/unit/mgmt/nfd/controller-fixture.hpp
index bc42e20..c210fcf 100644
--- a/tests/unit/mgmt/nfd/controller-fixture.hpp
+++ b/tests/unit/mgmt/nfd/controller-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,7 +23,7 @@
#define NDN_TESTS_UNIT_MGMT_NFD_CONTROLLER_FIXTURE_HPP
#include "ndn-cxx/mgmt/nfd/controller.hpp"
-#include "ndn-cxx/security/v2/certificate-fetcher-offline.hpp"
+#include "ndn-cxx/security/certificate-fetcher-offline.hpp"
#include "ndn-cxx/util/dummy-client-face.hpp"
#include "tests/unit/dummy-validator.hpp"
diff --git a/tests/unit/security/v2/additional-description.t.cpp b/tests/unit/security/additional-description.t.cpp
similarity index 96%
rename from tests/unit/security/v2/additional-description.t.cpp
rename to tests/unit/security/additional-description.t.cpp
index 86a3a90..657870f 100644
--- a/tests/unit/security/v2/additional-description.t.cpp
+++ b/tests/unit/security/additional-description.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,7 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/additional-description.hpp"
+#include "ndn-cxx/security/additional-description.hpp"
#include "tests/boost-test.hpp"
diff --git a/tests/unit/security/v2/certificate-bundle-fetcher.t.cpp b/tests/unit/security/certificate-bundle-fetcher.t.cpp
similarity index 91%
rename from tests/unit/security/v2/certificate-bundle-fetcher.t.cpp
rename to tests/unit/security/certificate-bundle-fetcher.t.cpp
index cd96300..5c05148 100644
--- a/tests/unit/security/v2/certificate-bundle-fetcher.t.cpp
+++ b/tests/unit/security/certificate-bundle-fetcher.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,23 +19,22 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/certificate-bundle-fetcher.hpp"
-#include "ndn-cxx/security/v2/validation-policy-simple-hierarchy.hpp"
+#include "ndn-cxx/security/certificate-bundle-fetcher.hpp"
+#include "ndn-cxx/security/validation-policy-simple-hierarchy.hpp"
#include "ndn-cxx/util/regex/regex-pattern-list-matcher.hpp"
#include "ndn-cxx/lp/nack.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(TestCertificateBundleFetcher)
class CertificateBundleFetcherWrapper : public CertificateBundleFetcher
@@ -69,9 +68,9 @@
{
public:
CertificateBundleFetcherFixture()
- : data("/Security/V2/ValidatorFixture/Sub1/Sub3/Data")
+ : data("/Security/ValidatorFixture/Sub1/Sub3/Data")
{
- subSubIdentity = addSubCertificate("/Security/V2/ValidatorFixture/Sub1/Sub3", subIdentity);
+ subSubIdentity = addSubCertificate("/Security/ValidatorFixture/Sub1/Sub3", subIdentity);
cache.insert(subSubIdentity.getDefaultKey().getDefaultCertificate());
m_keyChain.sign(data, signingByIdentity(subSubIdentity));
@@ -182,10 +181,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestCertificateBundleFetcher
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/certificate-cache.t.cpp b/tests/unit/security/certificate-cache.t.cpp
similarity index 92%
rename from tests/unit/security/v2/certificate-cache.t.cpp
rename to tests/unit/security/certificate-cache.t.cpp
index 8062c18..65614ac 100644
--- a/tests/unit/security/v2/certificate-cache.t.cpp
+++ b/tests/unit/security/certificate-cache.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,18 +19,17 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/certificate-cache.hpp"
+#include "ndn-cxx/security/certificate-cache.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/identity-management-time-fixture.hpp"
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
class CertificateCacheFixture : public ndn::tests::IdentityManagementTimeFixture
{
@@ -84,10 +83,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestCertificateCache
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/certificate-fetcher-direct-fetch.t.cpp b/tests/unit/security/certificate-fetcher-direct-fetch.t.cpp
similarity index 93%
rename from tests/unit/security/v2/certificate-fetcher-direct-fetch.t.cpp
rename to tests/unit/security/certificate-fetcher-direct-fetch.t.cpp
index 7e513c6..9f8c24f 100644
--- a/tests/unit/security/v2/certificate-fetcher-direct-fetch.t.cpp
+++ b/tests/unit/security/certificate-fetcher-direct-fetch.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,26 +19,25 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/certificate-fetcher-direct-fetch.hpp"
-#include "ndn-cxx/security/v2/validation-policy-simple-hierarchy.hpp"
+#include "ndn-cxx/security/certificate-fetcher-direct-fetch.hpp"
+#include "ndn-cxx/security/validation-policy-simple-hierarchy.hpp"
#include "ndn-cxx/lp/nack.hpp"
#include "ndn-cxx/lp/tags.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
#include <boost/range/adaptor/sliced.hpp>
#include <boost/range/adaptor/strided.hpp>
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(TestCertificateFetcherDirectFetch)
class Cert
@@ -66,11 +65,11 @@
public:
CertificateFetcherDirectFetchFixture()
- : data("/Security/V2/ValidatorFixture/Sub1/Sub3/Data")
- , interest("/Security/V2/ValidatorFixture/Sub1/Sub3/Interest")
- , interestNoTag("/Security/V2/ValidatorFixture/Sub1/Sub3/Interest2")
+ : data("/Security/ValidatorFixture/Sub1/Sub3/Data")
+ , interest("/Security/ValidatorFixture/Sub1/Sub3/Interest")
+ , interestNoTag("/Security/ValidatorFixture/Sub1/Sub3/Interest2")
{
- Identity subSubIdentity = addSubCertificate("/Security/V2/ValidatorFixture/Sub1/Sub3", subIdentity);
+ Identity subSubIdentity = addSubCertificate("/Security/ValidatorFixture/Sub1/Sub3", subIdentity);
cache.insert(subSubIdentity.getDefaultKey().getDefaultCertificate());
m_keyChain.sign(data, signingByIdentity(subSubIdentity));
@@ -258,10 +257,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestCertificateFetcherDirectFetch
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/certificate-fetcher-from-network.t.cpp b/tests/unit/security/certificate-fetcher-from-network.t.cpp
similarity index 86%
rename from tests/unit/security/v2/certificate-fetcher-from-network.t.cpp
rename to tests/unit/security/certificate-fetcher-from-network.t.cpp
index a7b1388..56677b7 100644
--- a/tests/unit/security/v2/certificate-fetcher-from-network.t.cpp
+++ b/tests/unit/security/certificate-fetcher-from-network.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,22 +19,21 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/certificate-fetcher-from-network.hpp"
-#include "ndn-cxx/security/v2/validation-policy-simple-hierarchy.hpp"
+#include "ndn-cxx/security/certificate-fetcher-from-network.hpp"
+#include "ndn-cxx/security/validation-policy-simple-hierarchy.hpp"
#include "ndn-cxx/lp/nack.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(TestCertificateFetcherFromNetwork)
class Cert
@@ -55,10 +54,10 @@
{
public:
CertificateFetcherFromNetworkFixture()
- : data("/Security/V2/ValidatorFixture/Sub1/Sub3/Data")
- , interest("/Security/V2/ValidatorFixture/Sub1/Sub3/Interest")
+ : data("/Security/ValidatorFixture/Sub1/Sub3/Data")
+ , interest("/Security/ValidatorFixture/Sub1/Sub3/Interest")
{
- Identity subSubIdentity = addSubCertificate("/Security/V2/ValidatorFixture/Sub1/Sub3", subIdentity);
+ Identity subSubIdentity = addSubCertificate("/Security/ValidatorFixture/Sub1/Sub3", subIdentity);
cache.insert(subSubIdentity.getDefaultKey().getDefaultCertificate());
m_keyChain.sign(data, signingByIdentity(subSubIdentity));
@@ -131,10 +130,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestCertificateFetcherFromNetwork
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/certificate-fetcher-offline.t.cpp b/tests/unit/security/certificate-fetcher-offline.t.cpp
similarity index 84%
rename from tests/unit/security/v2/certificate-fetcher-offline.t.cpp
rename to tests/unit/security/certificate-fetcher-offline.t.cpp
index bdf61c6..0a11d24 100644
--- a/tests/unit/security/v2/certificate-fetcher-offline.t.cpp
+++ b/tests/unit/security/certificate-fetcher-offline.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,21 +19,20 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/certificate-fetcher-offline.hpp"
-#include "ndn-cxx/security/v2/validation-policy-simple-hierarchy.hpp"
+#include "ndn-cxx/security/certificate-fetcher-offline.hpp"
+#include "ndn-cxx/security/validation-policy-simple-hierarchy.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
class CertificateFetcherOfflineWrapper : public CertificateFetcherOffline
{
@@ -52,7 +51,7 @@
BOOST_AUTO_TEST_CASE_TEMPLATE(Validate, Packet, Packets)
{
- Packet unsignedPacket("/Security/V2/ValidatorFixture/Sub1/Packet");
+ Packet unsignedPacket("/Security/ValidatorFixture/Sub1/Packet");
Packet packet = unsignedPacket;
m_keyChain.sign(packet, signingByIdentity(subIdentity));
@@ -66,10 +65,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestCertificateFetcherOffline
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/certificate.t.cpp b/tests/unit/security/certificate.t.cpp
similarity index 98%
rename from tests/unit/security/v2/certificate.t.cpp
rename to tests/unit/security/certificate.t.cpp
index 91bb5c1..f645dbd 100644
--- a/tests/unit/security/v2/certificate.t.cpp
+++ b/tests/unit/security/certificate.t.cpp
@@ -21,7 +21,7 @@
* @author Zhiyi Zhang <dreamerbarrychang@gmail.com>
*/
-#include "ndn-cxx/security/v2/certificate.hpp"
+#include "ndn-cxx/security/certificate.hpp"
#include "tests/boost-test.hpp"
#include "tests/unit/unit-test-time-fixture.hpp"
@@ -30,13 +30,12 @@
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_FIXTURE_TEST_SUITE(TestCertificate, UnitTestTimeFixture)
const uint8_t PUBLIC_KEY[] = {
@@ -275,10 +274,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestCertificate
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/key-chain.t.cpp b/tests/unit/security/key-chain.t.cpp
similarity index 98%
rename from tests/unit/security/v2/key-chain.t.cpp
rename to tests/unit/security/key-chain.t.cpp
index 7f6abb0..6e85b75 100644
--- a/tests/unit/security/v2/key-chain.t.cpp
+++ b/tests/unit/security/key-chain.t.cpp
@@ -19,7 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/key-chain.hpp"
+#include "ndn-cxx/security/key-chain.hpp"
#include "ndn-cxx/security/signing-helpers.hpp"
#include "ndn-cxx/security/verification-helpers.hpp"
#include "ndn-cxx/security/transform/private-key.hpp"
@@ -30,13 +30,12 @@
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_FIXTURE_TEST_SUITE(TestKeyChain, TestHomeEnvSaver)
template<class Path>
@@ -466,7 +465,7 @@
BOOST_FIXTURE_TEST_CASE(SelfSignedCertValidity, IdentityManagementFixture)
{
- Certificate cert = addIdentity("/Security/V2/TestKeyChain/SelfSignedCertValidity")
+ Certificate cert = addIdentity("/Security/TestKeyChain/SelfSignedCertValidity")
.getDefaultKey()
.getDefaultCertificate();
BOOST_CHECK(cert.isValid());
@@ -475,10 +474,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestKeyChain
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/pib/pib-data-fixture.hpp b/tests/unit/security/pib/pib-data-fixture.hpp
index 21af850..66e65eb 100644
--- a/tests/unit/security/pib/pib-data-fixture.hpp
+++ b/tests/unit/security/pib/pib-data-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,7 +22,7 @@
#ifndef NDN_TESTS_UNIT_SECURITY_PIB_DATA_FIXTURE_HPP
#define NDN_TESTS_UNIT_SECURITY_PIB_DATA_FIXTURE_HPP
-#include "ndn-cxx/security/v2/certificate.hpp"
+#include "ndn-cxx/security/certificate.hpp"
namespace ndn {
namespace security {
@@ -34,14 +34,14 @@
PibDataFixture();
public:
- v2::Certificate id1Key1Cert1;
- v2::Certificate id1Key1Cert2;
- v2::Certificate id1Key2Cert1;
- v2::Certificate id1Key2Cert2;
- v2::Certificate id2Key1Cert1;
- v2::Certificate id2Key1Cert2;
- v2::Certificate id2Key2Cert1;
- v2::Certificate id2Key2Cert2;
+ Certificate id1Key1Cert1;
+ Certificate id1Key1Cert2;
+ Certificate id1Key2Cert1;
+ Certificate id1Key2Cert2;
+ Certificate id2Key1Cert1;
+ Certificate id2Key1Cert2;
+ Certificate id2Key2Cert1;
+ Certificate id2Key2Cert2;
Name id1;
Name id2;
diff --git a/tests/unit/security/v2/trust-anchor-container.t.cpp b/tests/unit/security/trust-anchor-container.t.cpp
similarity index 96%
rename from tests/unit/security/v2/trust-anchor-container.t.cpp
rename to tests/unit/security/trust-anchor-container.t.cpp
index 8ed4cec..b25805f 100644
--- a/tests/unit/security/v2/trust-anchor-container.t.cpp
+++ b/tests/unit/security/trust-anchor-container.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,7 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/trust-anchor-container.hpp"
+#include "ndn-cxx/security/trust-anchor-container.hpp"
#include "ndn-cxx/util/io.hpp"
#include "tests/boost-test.hpp"
@@ -29,13 +29,12 @@
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
/**
* This fixture creates a directory and prepares two certificates.
@@ -183,10 +182,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestTrustAnchorContainer
-BOOST_AUTO_TEST_SUITE_END() // Detail
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validation-error.t.cpp b/tests/unit/security/validation-error.t.cpp
similarity index 90%
rename from tests/unit/security/v2/validation-error.t.cpp
rename to tests/unit/security/validation-error.t.cpp
index 21821ee..6ecb94f 100644
--- a/tests/unit/security/v2/validation-error.t.cpp
+++ b/tests/unit/security/validation-error.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,18 +19,17 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validation-error.hpp"
+#include "ndn-cxx/security/validation-error.hpp"
#include "tests/boost-test.hpp"
#include <boost/lexical_cast.hpp>
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(TestValidationError)
BOOST_AUTO_TEST_CASE(Basic)
@@ -52,10 +51,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestValidationError
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validation-policy-accept-all.t.cpp b/tests/unit/security/validation-policy-accept-all.t.cpp
similarity index 83%
rename from tests/unit/security/v2/validation-policy-accept-all.t.cpp
rename to tests/unit/security/validation-policy-accept-all.t.cpp
index 9d7d927..6a9f0f1 100644
--- a/tests/unit/security/v2/validation-policy-accept-all.t.cpp
+++ b/tests/unit/security/validation-policy-accept-all.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,29 +19,28 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validation-policy-accept-all.hpp"
+#include "ndn-cxx/security/validation-policy-accept-all.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mpl/vector.hpp>
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
class ValidationPolicyAcceptAllFixture : public ValidatorFixture<ValidationPolicyAcceptAll>
{
public:
ValidationPolicyAcceptAllFixture()
{
- identity = addIdentity("/Security/V2/TestValidationPolicyAcceptAll");
+ identity = addIdentity("/Security/TestValidationPolicyAcceptAll");
// don't add trust anchors
}
@@ -55,7 +54,7 @@
BOOST_AUTO_TEST_CASE_TEMPLATE(Validate, Packet, Packets)
{
- Packet unsignedPacket("/Security/V2/TestValidationPolicyAcceptAll/Sub/Packet");
+ Packet unsignedPacket("/Security/TestValidationPolicyAcceptAll/Sub/Packet");
Packet packet = unsignedPacket;
VALIDATE_SUCCESS(packet, "Should accept unsigned");
@@ -70,10 +69,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestValidationPolicyAcceptAll
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validation-policy-command-interest.t.cpp b/tests/unit/security/validation-policy-command-interest.t.cpp
similarity index 93%
rename from tests/unit/security/v2/validation-policy-command-interest.t.cpp
rename to tests/unit/security/validation-policy-command-interest.t.cpp
index a061a27..da6ced7 100644
--- a/tests/unit/security/v2/validation-policy-command-interest.t.cpp
+++ b/tests/unit/security/validation-policy-command-interest.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,28 +19,27 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validation-policy-command-interest.hpp"
-#include "ndn-cxx/security/v2/validation-policy-simple-hierarchy.hpp"
-#include "ndn-cxx/security/v2/validation-policy-accept-all.hpp"
+#include "ndn-cxx/security/validation-policy-command-interest.hpp"
#include "ndn-cxx/security/command-interest-signer.hpp"
#include "ndn-cxx/security/signing-helpers.hpp"
+#include "ndn-cxx/security/validation-policy-accept-all.hpp"
+#include "ndn-cxx/security/validation-policy-simple-hierarchy.hpp"
#include "tests/boost-test.hpp"
#include "tests/make-interest-data.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
#include <boost/lexical_cast.hpp>
#include <boost/mpl/vector.hpp>
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
class DefaultOptions
{
@@ -102,7 +101,7 @@
BOOST_AUTO_TEST_CASE(DataPassthru)
{
- Data d1("/Security/V2/ValidatorFixture/Sub1");
+ Data d1("/Security/ValidatorFixture/Sub1");
m_keyChain.sign(d1);
VALIDATE_SUCCESS(d1, "Should succeed (fallback on inner validation policy for data)");
}
@@ -324,13 +323,13 @@
BOOST_FIXTURE_TEST_CASE(LimitedRecords, ValidationPolicyCommandInterestFixture<LimitedRecordsOptions>)
{
- Identity id1 = this->addSubCertificate("/Security/V2/ValidatorFixture/Sub1", identity);
+ Identity id1 = this->addSubCertificate("/Security/ValidatorFixture/Sub1", identity);
this->cache.insert(id1.getDefaultKey().getDefaultCertificate());
- Identity id2 = this->addSubCertificate("/Security/V2/ValidatorFixture/Sub2", identity);
+ Identity id2 = this->addSubCertificate("/Security/ValidatorFixture/Sub2", identity);
this->cache.insert(id2.getDefaultKey().getDefaultCertificate());
- Identity id3 = this->addSubCertificate("/Security/V2/ValidatorFixture/Sub3", identity);
+ Identity id3 = this->addSubCertificate("/Security/ValidatorFixture/Sub3", identity);
this->cache.insert(id3.getDefaultKey().getDefaultCertificate());
- Identity id4 = this->addSubCertificate("/Security/V2/ValidatorFixture/Sub4", identity);
+ Identity id4 = this->addSubCertificate("/Security/ValidatorFixture/Sub4", identity);
this->cache.insert(id4.getDefaultKey().getDefaultCertificate());
auto i1 = makeCommandInterest(id2);
@@ -377,7 +376,7 @@
{
std::vector<Identity> identities;
for (int i = 0; i < 20; ++i) {
- Identity id = this->addSubCertificate("/Security/V2/ValidatorFixture/Sub" + to_string(i), identity);
+ Identity id = this->addSubCertificate("/Security/ValidatorFixture/Sub" + to_string(i), identity);
this->cache.insert(id.getDefaultKey().getDefaultCertificate());
identities.push_back(id);
}
@@ -476,10 +475,9 @@
BOOST_AUTO_TEST_SUITE_END() // Options
BOOST_AUTO_TEST_SUITE_END() // TestValidationPolicyCommandInterest
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validation-policy-config.t.cpp b/tests/unit/security/validation-policy-config.t.cpp
similarity index 95%
rename from tests/unit/security/v2/validation-policy-config.t.cpp
rename to tests/unit/security/validation-policy-config.t.cpp
index f7a4506..53f6778 100644
--- a/tests/unit/security/v2/validation-policy-config.t.cpp
+++ b/tests/unit/security/validation-policy-config.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,7 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validation-policy-config.hpp"
+#include "ndn-cxx/security/validation-policy-config.hpp"
#include "ndn-cxx/security/transform/base64-encode.hpp"
#include "ndn-cxx/security/transform/buffer-source.hpp"
#include "ndn-cxx/security/transform/stream-sink.hpp"
@@ -27,12 +27,12 @@
#include "ndn-cxx/util/io.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-config/common.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-config/common.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace validator_config {
namespace tests {
@@ -40,7 +40,6 @@
using namespace ndn::security::v2::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(TestValidationPolicyConfig)
BOOST_FIXTURE_TEST_CASE(EmptyConfig, HierarchicalValidatorFixture<ValidationPolicyConfig>)
@@ -52,11 +51,11 @@
BOOST_CHECK_EQUAL(this->policy.m_dataRules.size(), 0);
BOOST_CHECK_EQUAL(this->policy.m_interestRules.size(), 0);
- Data d("/Security/V2/ValidationPolicyConfig/D");
+ Data d("/Security/ValidationPolicyConfig/D");
this->m_keyChain.sign(d, signingByIdentity(this->identity));
VALIDATE_FAILURE(d, "Empty policy should reject everything");
- Interest i("/Security/V2/ValidationPolicyConfig/I");
+ Interest i("/Security/ValidationPolicyConfig/I");
this->m_keyChain.sign(i, signingByIdentity(this->identity));
VALIDATE_FAILURE(i, "Empty policy should reject everything");
}
@@ -340,7 +339,7 @@
BOOST_CHECK_EQUAL(this->policy.m_interestRules.size(), 0);
using Packet = typename Policy::Packet;
- Packet unsignedPacket("/Security/V2/ValidatorFixture/Sub1/Sub2/Packet");
+ Packet unsignedPacket("/Security/ValidatorFixture/Sub1/Sub2/Packet");
Packet packet = unsignedPacket;
VALIDATE_FAILURE(packet, "Unsigned");
@@ -372,7 +371,7 @@
BOOST_CHECK_EQUAL(this->policy.m_interestRules.size(), 1);
using Packet = typename Policy::Packet;
- Packet unsignedPacket("/Security/V2/ValidatorFixture/Sub1/Sub2/Packet");
+ Packet unsignedPacket("/Security/ValidatorFixture/Sub1/Sub2/Packet");
Packet packet = unsignedPacket;
VALIDATE_FAILURE(packet, "Unsigned");
@@ -474,7 +473,7 @@
BOOST_CHECK_EQUAL(this->policy.m_dataRules.size(), 0);
BOOST_CHECK_EQUAL(this->policy.m_interestRules.size(), 0);
- Packet unsignedPacket("/Security/V2/ValidatorFixture/Sub1/Sub2/Packet");
+ Packet unsignedPacket("/Security/ValidatorFixture/Sub1/Sub2/Packet");
Packet packet = unsignedPacket;
VALIDATE_SUCCESS(packet, "Policy should accept everything");
@@ -510,7 +509,7 @@
BOOST_FIXTURE_TEST_CASE_TEMPLATE(ValidateRefresh, Refresh, RefreshPolicies, RefreshPolicyFixture<Refresh>)
{
using Packet = Data;
- Packet unsignedPacket("/Security/V2/ValidatorFixture/Sub1/Sub2/Packet");
+ Packet unsignedPacket("/Security/ValidatorFixture/Sub1/Sub2/Packet");
boost::filesystem::remove(this->path / "keys" / "identity.ndncert");
this->advanceClocks(Refresh::getRefreshTime(), 3);
@@ -548,11 +547,10 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestValidationPolicyConfig
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
} // namespace validator_config
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validation-policy-simple-hierarchy.t.cpp b/tests/unit/security/validation-policy-simple-hierarchy.t.cpp
similarity index 87%
rename from tests/unit/security/v2/validation-policy-simple-hierarchy.t.cpp
rename to tests/unit/security/validation-policy-simple-hierarchy.t.cpp
index 96f936e..9c8816a 100644
--- a/tests/unit/security/v2/validation-policy-simple-hierarchy.t.cpp
+++ b/tests/unit/security/validation-policy-simple-hierarchy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,22 +19,21 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validation-policy-simple-hierarchy.hpp"
+#include "ndn-cxx/security/validation-policy-simple-hierarchy.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
#include <boost/mpl/vector.hpp>
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_FIXTURE_TEST_SUITE(TestValidationPolicySimpleHierarchy,
HierarchicalValidatorFixture<ValidationPolicySimpleHierarchy>)
@@ -42,7 +41,7 @@
BOOST_AUTO_TEST_CASE_TEMPLATE(Validate, Packet, Packets)
{
- Packet unsignedPacket("/Security/V2/ValidatorFixture/Sub1/Sub2/Packet");
+ Packet unsignedPacket("/Security/ValidatorFixture/Sub1/Sub2/Packet");
Packet packet = unsignedPacket;
VALIDATE_FAILURE(packet, "Unsigned");
@@ -71,10 +70,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestValidator
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/validator-config.t.cpp b/tests/unit/security/validator-config.t.cpp
index 06e66b0..b4654ac 100644
--- a/tests/unit/security/validator-config.t.cpp
+++ b/tests/unit/security/validator-config.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,13 +20,13 @@
*/
#include "ndn-cxx/security/validator-config.hpp"
+#include "ndn-cxx/security/certificate-fetcher-offline.hpp"
#include "ndn-cxx/security/command-interest-signer.hpp"
-#include "ndn-cxx/security/v2/certificate-fetcher-offline.hpp"
#include "ndn-cxx/util/dummy-client-face.hpp"
#include "tests/boost-test.hpp"
#include "tests/identity-management-fixture.hpp"
-#include "tests/unit/security/v2/validator-config/common.hpp"
+#include "tests/unit/security/validator-config/common.hpp"
namespace ndn {
namespace security {
diff --git a/tests/unit/security/v2/validator-config/checker.t.cpp b/tests/unit/security/validator-config/checker.t.cpp
similarity index 96%
rename from tests/unit/security/v2/validator-config/checker.t.cpp
rename to tests/unit/security/validator-config/checker.t.cpp
index 675ec23..a5fb205 100644
--- a/tests/unit/security/v2/validator-config/checker.t.cpp
+++ b/tests/unit/security/validator-config/checker.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,25 +19,24 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validator-config/checker.hpp"
+#include "ndn-cxx/security/validator-config/checker.hpp"
#include "ndn-cxx/security/command-interest-signer.hpp"
-#include "ndn-cxx/security/v2/validation-policy.hpp"
-#include "ndn-cxx/security/v2/validation-state.hpp"
+#include "ndn-cxx/security/validation-policy.hpp"
+#include "ndn-cxx/security/validation-state.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
-#include "tests/unit/security/v2/validator-config/common.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
+#include "tests/unit/security/validator-config/common.hpp"
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace validator_config {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(ValidatorConfig)
class CheckerFixture : public IdentityManagementFixture
@@ -358,11 +357,10 @@
BOOST_AUTO_TEST_SUITE_END() // TestChecker
BOOST_AUTO_TEST_SUITE_END() // ValidatorConfig
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
} // namespace validator_config
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validator-config/common.hpp b/tests/unit/security/validator-config/common.hpp
similarity index 90%
rename from tests/unit/security/v2/validator-config/common.hpp
rename to tests/unit/security/validator-config/common.hpp
index 1083eb5..de72e3f 100644
--- a/tests/unit/security/v2/validator-config/common.hpp
+++ b/tests/unit/security/validator-config/common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -22,13 +22,13 @@
#ifndef NDN_TESTS_SECURITY_V2_VALIDATOR_CONFIG_COMMON_HPP
#define NDN_TESTS_SECURITY_V2_VALIDATOR_CONFIG_COMMON_HPP
-#include "ndn-cxx/security/v2/validator-config/common.hpp"
+#include "ndn-cxx/security/validator-config/common.hpp"
#include <boost/property_tree/info_parser.hpp>
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace validator_config {
namespace tests {
@@ -43,7 +43,7 @@
} // namespace tests
} // namespace validator_config
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validator-config/filter.t.cpp b/tests/unit/security/validator-config/filter.t.cpp
similarity index 95%
rename from tests/unit/security/v2/validator-config/filter.t.cpp
rename to tests/unit/security/validator-config/filter.t.cpp
index d02d745..2b3bf6d 100644
--- a/tests/unit/security/v2/validator-config/filter.t.cpp
+++ b/tests/unit/security/validator-config/filter.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,23 +19,22 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validator-config/filter.hpp"
+#include "ndn-cxx/security/validator-config/filter.hpp"
#include "ndn-cxx/security/command-interest-signer.hpp"
#include "tests/boost-test.hpp"
#include "tests/identity-management-fixture.hpp"
-#include "tests/unit/security/v2/validator-config/common.hpp"
+#include "tests/unit/security/validator-config/common.hpp"
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace validator_config {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(ValidatorConfig)
class FilterFixture : public IdentityManagementFixture
@@ -191,11 +190,10 @@
BOOST_AUTO_TEST_SUITE_END() // TestFilter
BOOST_AUTO_TEST_SUITE_END() // ValidatorConfig
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
} // namespace validator_config
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validator-config/name-relation.t.cpp b/tests/unit/security/validator-config/name-relation.t.cpp
similarity index 92%
rename from tests/unit/security/v2/validator-config/name-relation.t.cpp
rename to tests/unit/security/validator-config/name-relation.t.cpp
index ff23348..8879212 100644
--- a/tests/unit/security/v2/validator-config/name-relation.t.cpp
+++ b/tests/unit/security/validator-config/name-relation.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,7 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validator-config/name-relation.hpp"
+#include "ndn-cxx/security/validator-config/name-relation.hpp"
#include "tests/boost-test.hpp"
@@ -27,12 +27,11 @@
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace validator_config {
namespace tests {
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(ValidatorConfig)
BOOST_AUTO_TEST_SUITE(TestNameRelation)
@@ -69,11 +68,10 @@
BOOST_AUTO_TEST_SUITE_END() // TestNameRelation
BOOST_AUTO_TEST_SUITE_END() // ValidatorConfig
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
} // namespace validator_config
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validator-config/rule.t.cpp b/tests/unit/security/validator-config/rule.t.cpp
similarity index 94%
rename from tests/unit/security/v2/validator-config/rule.t.cpp
rename to tests/unit/security/validator-config/rule.t.cpp
index 558ffb4..dbc81bf 100644
--- a/tests/unit/security/v2/validator-config/rule.t.cpp
+++ b/tests/unit/security/validator-config/rule.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,17 +19,17 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validator-config/rule.hpp"
+#include "ndn-cxx/security/validator-config/rule.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
-#include "tests/unit/security/v2/validator-config/common.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
+#include "tests/unit/security/validator-config/common.hpp"
#include <boost/mpl/vector_c.hpp>
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace validator_config {
namespace tests {
@@ -37,7 +37,6 @@
using namespace ndn::security::v2::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_AUTO_TEST_SUITE(ValidatorConfig)
template<uint32_t PktType>
@@ -198,11 +197,10 @@
BOOST_AUTO_TEST_SUITE_END() // TestRule
BOOST_AUTO_TEST_SUITE_END() // ValidatorConfig
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
} // namespace validator_config
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/v2/validator-fixture.hpp b/tests/unit/security/validator-fixture.hpp
similarity index 88%
rename from tests/unit/security/v2/validator-fixture.hpp
rename to tests/unit/security/validator-fixture.hpp
index e5079bc..276ac40 100644
--- a/tests/unit/security/v2/validator-fixture.hpp
+++ b/tests/unit/security/validator-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -19,11 +19,11 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#ifndef NDN_TESTS_UNIT_SECURITY_V2_VALIDATOR_FIXTURE_HPP
-#define NDN_TESTS_UNIT_SECURITY_V2_VALIDATOR_FIXTURE_HPP
+#ifndef NDN_TESTS_UNIT_SECURITY_VALIDATOR_FIXTURE_HPP
+#define NDN_TESTS_UNIT_SECURITY_VALIDATOR_FIXTURE_HPP
-#include "ndn-cxx/security/v2/validator.hpp"
-#include "ndn-cxx/security/v2/certificate-fetcher-from-network.hpp"
+#include "ndn-cxx/security/validator.hpp"
+#include "ndn-cxx/security/certificate-fetcher-from-network.hpp"
#include "ndn-cxx/util/dummy-client-face.hpp"
#include "tests/boost-test.hpp"
@@ -33,7 +33,7 @@
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
template<class ValidationPolicy, class CertificateFetcher = CertificateFetcherFromNetwork>
@@ -127,10 +127,10 @@
public:
HierarchicalValidatorFixture()
{
- identity = this->addIdentity("/Security/V2/ValidatorFixture");
- subIdentity = this->addSubCertificate("/Security/V2/ValidatorFixture/Sub1", identity);
- subSelfSignedIdentity = this->addIdentity("/Security/V2/ValidatorFixture/Sub1/Sub2");
- otherIdentity = this->addIdentity("/Security/V2/OtherIdentity");
+ identity = this->addIdentity("/Security/ValidatorFixture");
+ subIdentity = this->addSubCertificate("/Security/ValidatorFixture/Sub1", identity);
+ subSelfSignedIdentity = this->addIdentity("/Security/ValidatorFixture/Sub1/Sub2");
+ otherIdentity = this->addIdentity("/Security/OtherIdentity");
this->validator.loadAnchor("", Certificate(identity.getDefaultKey().getDefaultCertificate()));
@@ -180,8 +180,8 @@
};
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
-#endif // NDN_TESTS_UNIT_SECURITY_V2_VALIDATOR_FIXTURE_HPP
+#endif // NDN_TESTS_UNIT_SECURITY_VALIDATOR_FIXTURE_HPP
diff --git a/tests/unit/security/v2/validator.t.cpp b/tests/unit/security/validator.t.cpp
similarity index 91%
rename from tests/unit/security/v2/validator.t.cpp
rename to tests/unit/security/validator.t.cpp
index b5a7e04..c87d348 100644
--- a/tests/unit/security/v2/validator.t.cpp
+++ b/tests/unit/security/validator.t.cpp
@@ -19,21 +19,20 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "ndn-cxx/security/v2/validator.hpp"
-#include "ndn-cxx/security/v2/validation-policy-simple-hierarchy.hpp"
+#include "ndn-cxx/security/validator.hpp"
+#include "ndn-cxx/security/validation-policy-simple-hierarchy.hpp"
#include "tests/boost-test.hpp"
-#include "tests/unit/security/v2/validator-fixture.hpp"
+#include "tests/unit/security/validator-fixture.hpp"
namespace ndn {
namespace security {
-namespace v2 {
+inline namespace v2 {
namespace tests {
using namespace ndn::tests;
BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(V2)
BOOST_FIXTURE_TEST_SUITE(TestValidator, HierarchicalValidatorFixture<ValidationPolicySimpleHierarchy>)
BOOST_AUTO_TEST_CASE(ConstructorSetValidator)
@@ -53,7 +52,7 @@
{
processInterest = nullptr; // no response for all interests
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subIdentity));
VALIDATE_FAILURE(data, "Should fail to retrieve certificate");
@@ -68,7 +67,7 @@
face.receive(nack);
};
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subIdentity));
VALIDATE_FAILURE(data, "All interests should get NACKed");
@@ -94,7 +93,7 @@
}
};
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subIdentity));
VALIDATE_FAILURE(data, "Signed by a malformed certificate");
@@ -120,7 +119,7 @@
}
};
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subIdentity));
VALIDATE_FAILURE(data, "Signed by an expired certificate");
@@ -131,14 +130,14 @@
{
validator.resetAnchors();
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subIdentity));
VALIDATE_FAILURE(data, "Should fail, as no anchors configured");
}
BOOST_AUTO_TEST_CASE(TrustedCertCaching)
{
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subIdentity));
VALIDATE_SUCCESS(data, "Should get accepted, as signed by the policy-compliant cert");
@@ -160,7 +159,7 @@
BOOST_AUTO_TEST_CASE(ResetVerifiedCertificates)
{
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subIdentity));
VALIDATE_SUCCESS(data, "Should get accepted, as signed by the policy-compliant cert");
@@ -175,7 +174,7 @@
BOOST_AUTO_TEST_CASE(UntrustedCertCaching)
{
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subSelfSignedIdentity));
VALIDATE_FAILURE(data, "Should fail, as signed by the policy-violating cert");
@@ -209,15 +208,15 @@
BOOST_FIXTURE_TEST_CASE(ValidateInterestsButBypassForData,
HierarchicalValidatorFixture<ValidationPolicySimpleHierarchyForInterestOnly>)
{
- Interest interest("/Security/V2/ValidatorFixture/Sub1/Sub2/Interest");
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Interest");
+ Interest interest("/Security/ValidatorFixture/Sub1/Sub2/Interest");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Interest");
VALIDATE_FAILURE(interest, "Unsigned");
VALIDATE_SUCCESS(data, "Policy requests validation bypassing for all data");
BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
face.sentInterests.clear();
- interest = Interest("/Security/V2/ValidatorFixture/Sub1/Sub2/Interest");
+ interest = Interest("/Security/ValidatorFixture/Sub1/Sub2/Interest");
m_keyChain.sign(interest, signingWithSha256());
m_keyChain.sign(data, signingWithSha256());
VALIDATE_FAILURE(interest, "Required KeyLocator/Name missing (not passed to policy)");
@@ -287,7 +286,7 @@
face.receive(certificate);
};
- Data data("/Security/V2/ValidatorFixture/Sub1/Sub2/Data");
+ Data data("/Security/ValidatorFixture/Sub1/Sub2/Data");
m_keyChain.sign(data, signingByIdentity(subIdentity));
validator.setMaxDepth(40);
@@ -335,10 +334,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestValidator
-BOOST_AUTO_TEST_SUITE_END() // V2
BOOST_AUTO_TEST_SUITE_END() // Security
} // namespace tests
-} // namespace v2
+} // inline namespace v2
} // namespace security
} // namespace ndn
diff --git a/tests/unit/security/verification-helpers.t.cpp b/tests/unit/security/verification-helpers.t.cpp
index c0c6b5a..dd5a832 100644
--- a/tests/unit/security/verification-helpers.t.cpp
+++ b/tests/unit/security/verification-helpers.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -466,7 +466,7 @@
BOOST_CHECK(!verifySignature(unsignedInterest1, invalidKey, sizeof(invalidKey)));
// - base version of verifySignature is tested transitively
- // - pib::Key version is tested as part of v2/key-chain.t.cpp (Security/V2/TestKeyChain)
+ // - pib::Key version is tested as part of key-chain.t.cpp (Security/TestKeyChain)
}
BOOST_FIXTURE_TEST_CASE(VerifyHmac, IdentityManagementFixture)
diff --git a/tests/unit/unit-tests-pch.hpp b/tests/unit/unit-tests-pch.hpp
index 54e15f9..5f2ed67 100644
--- a/tests/unit/unit-tests-pch.hpp
+++ b/tests/unit/unit-tests-pch.hpp
@@ -27,7 +27,7 @@
#include "ndn-cxx/face.hpp"
#include "ndn-cxx/ims/in-memory-storage.hpp"
#include "ndn-cxx/security/transform.hpp"
-#include "ndn-cxx/security/v2/validator.hpp"
+#include "ndn-cxx/security/validator.hpp"
#include "ndn-cxx/util/config-file.hpp"
#include "tests/identity-management-fixture.hpp"