security: stop installing headers of concrete PIB, TPM, and KeyHandle implementations
Refs: #4782 Change-Id: I23bb75c485034140f29b10bd3a103f4aa480be4b
This commit is contained in:
1 parent
12cef87c0c
commit
4fb35d8a35
31 files changed
+97
-240
No files matched your search
@@ -19,7 +19,7 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/security-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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_SECURITY_PIB_PIB_MEMORY_HPP
|
||||
#define NDN_SECURITY_PIB_PIB_MEMORY_HPP
|
||||
#ifndef NDN_SECURITY_PIB_IMPL_PIB_MEMORY_HPP
|
||||
#define NDN_SECURITY_PIB_IMPL_PIB_MEMORY_HPP
|
||||
|
||||
#include "ndn-cxx/security/pib/pib-impl.hpp"
|
||||
|
||||
@@ -145,4 +145,4 @@ private:
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_SECURITY_PIB_PIB_MEMORY_HPP
|
||||
#endif // NDN_SECURITY_PIB_IMPL_PIB_MEMORY_HPP
|
||||
@@ -19,14 +19,15 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/pib-sqlite3.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-sqlite3.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/security-common.hpp"
|
||||
#include "ndn-cxx/util/sqlite3-statement.hpp"
|
||||
|
||||
#include <sqlite3.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
namespace ndn {
|
||||
namespace security {
|
||||
@@ -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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_SECURITTY_PIB_PIB_SQLITE3_HPP
|
||||
#define NDN_SECURITTY_PIB_PIB_SQLITE3_HPP
|
||||
#ifndef NDN_SECURITTY_PIB_IMPL_PIB_SQLITE3_HPP
|
||||
#define NDN_SECURITTY_PIB_IMPL_PIB_SQLITE3_HPP
|
||||
|
||||
#include "ndn-cxx/security/pib/pib-impl.hpp"
|
||||
|
||||
@@ -154,4 +154,4 @@ private:
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_SECURITTY_PIB_PIB_SQLITE3_HPP
|
||||
#endif // NDN_SECURITTY_PIB_IMPL_PIB_SQLITE3_HPP
|
||||
+2
-2
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end-file.hpp"
|
||||
#include "ndn-cxx/security/tpm/key-handle-mem.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-file.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/key-handle-mem.hpp"
|
||||
#include "ndn-cxx/security/transform.hpp"
|
||||
#include "ndn-cxx/security/transform/private-key.hpp"
|
||||
#include "ndn-cxx/encoding/buffer-stream.hpp"
|
||||
+3
-3
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_SECURITY_TPM_BACK_END_FILE_HPP
|
||||
#define NDN_SECURITY_TPM_BACK_END_FILE_HPP
|
||||
#ifndef NDN_SECURITY_TPM_IMPL_BACK_END_FILE_HPP
|
||||
#define NDN_SECURITY_TPM_IMPL_BACK_END_FILE_HPP
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end.hpp"
|
||||
|
||||
@@ -99,4 +99,4 @@ private:
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_SECURITY_TPM_BACK_END_FILE_HPP
|
||||
#endif // NDN_SECURITY_TPM_IMPL_BACK_END_FILE_HPP
|
||||
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end-mem.hpp"
|
||||
#include "ndn-cxx/security/tpm/key-handle-mem.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-mem.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/key-handle-mem.hpp"
|
||||
#include "ndn-cxx/security/transform/private-key.hpp"
|
||||
#include "ndn-cxx/encoding/buffer-stream.hpp"
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_SECURITY_TPM_BACK_END_MEM_HPP
|
||||
#define NDN_SECURITY_TPM_BACK_END_MEM_HPP
|
||||
#ifndef NDN_SECURITY_TPM_IMPL_BACK_END_MEM_HPP
|
||||
#define NDN_SECURITY_TPM_IMPL_BACK_END_MEM_HPP
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end.hpp"
|
||||
|
||||
@@ -78,4 +78,4 @@ private:
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_SECURITY_TPM_BACK_END_MEM_HPP
|
||||
#endif // NDN_SECURITY_TPM_IMPL_BACK_END_MEM_HPP
|
||||
@@ -19,9 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/key-handle-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/tpm.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/key-handle-osx.hpp"
|
||||
#include "ndn-cxx/security/transform/private-key.hpp"
|
||||
#include "ndn-cxx/detail/cf-string-osx.hpp"
|
||||
#include "ndn-cxx/encoding/buffer-stream.hpp"
|
||||
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_SECURITY_TPM_BACK_END_OSX_HPP
|
||||
#define NDN_SECURITY_TPM_BACK_END_OSX_HPP
|
||||
#ifndef NDN_SECURITY_TPM_IMPL_BACK_END_OSX_HPP
|
||||
#define NDN_SECURITY_TPM_IMPL_BACK_END_OSX_HPP
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end.hpp"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#error "This file should not be compiled ..."
|
||||
#endif
|
||||
|
||||
#include "ndn-cxx/security/tpm/key-ref-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/key-ref-osx.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace security {
|
||||
@@ -110,4 +110,4 @@ private:
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_SECURITY_TPM_BACK_END_OSX_HPP
|
||||
#endif // NDN_SECURITY_TPM_IMPL_BACK_END_OSX_HPP
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/tpm/key-handle-mem.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/key-handle-mem.hpp"
|
||||
#include "ndn-cxx/security/transform/bool-sink.hpp"
|
||||
#include "ndn-cxx/security/transform/buffer-source.hpp"
|
||||
#include "ndn-cxx/security/transform/private-key.hpp"
|
||||
+3
-3
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_SECURITY_TPM_KEY_HANDLE_MEM_HPP
|
||||
#define NDN_SECURITY_TPM_KEY_HANDLE_MEM_HPP
|
||||
#ifndef NDN_SECURITY_TPM_IMPL_KEY_HANDLE_MEM_HPP
|
||||
#define NDN_SECURITY_TPM_IMPL_KEY_HANDLE_MEM_HPP
|
||||
|
||||
#include "ndn-cxx/security/tpm/key-handle.hpp"
|
||||
|
||||
@@ -64,4 +64,4 @@ private:
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_SECURITY_TPM_KEY_HANDLE_MEM_HPP
|
||||
#endif // NDN_SECURITY_TPM_IMPL_KEY_HANDLE_MEM_HPP
|
||||
+2
-2
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/tpm/key-handle-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/back-end-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/key-handle-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-osx.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace security {
|
||||
+4
-4
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
|
||||
#define NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
|
||||
#ifndef NDN_SECURITY_TPM_IMPL_KEY_HANDLE_OSX_HPP
|
||||
#define NDN_SECURITY_TPM_IMPL_KEY_HANDLE_OSX_HPP
|
||||
|
||||
#include "ndn-cxx/security/tpm/key-handle.hpp"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#error "This file should not be compiled ..."
|
||||
#endif
|
||||
|
||||
#include "ndn-cxx/security/tpm/key-ref-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/key-ref-osx.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace security {
|
||||
@@ -65,4 +65,4 @@ private:
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
|
||||
#endif // NDN_SECURITY_TPM_IMPL_KEY_HANDLE_OSX_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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_SECURITY_TPM_KEY_REF_OSX_HPP
|
||||
#define NDN_SECURITY_TPM_KEY_REF_OSX_HPP
|
||||
#ifndef NDN_SECURITY_TPM_IMPL_KEY_REF_OSX_HPP
|
||||
#define NDN_SECURITY_TPM_IMPL_KEY_REF_OSX_HPP
|
||||
|
||||
#include "ndn-cxx/detail/common.hpp"
|
||||
|
||||
@@ -42,4 +42,4 @@ using KeyRefOsx = detail::CFReleaser<SecKeyRef>;
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_SECURITY_TPM_KEY_REF_OSX_HPP
|
||||
#endif // NDN_SECURITY_TPM_IMPL_KEY_REF_OSX_HPP
|
||||
@@ -26,13 +26,13 @@
|
||||
#include "ndn-cxx/util/logger.hpp"
|
||||
#include "ndn-cxx/util/sha256.hpp"
|
||||
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-sqlite3.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-sqlite3.hpp"
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end-file.hpp"
|
||||
#include "ndn-cxx/security/tpm/back-end-mem.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-file.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-mem.hpp"
|
||||
#ifdef NDN_CXX_HAVE_OSX_FRAMEWORKS
|
||||
#include "ndn-cxx/security/tpm/back-end-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-osx.hpp"
|
||||
#endif // NDN_CXX_HAVE_OSX_FRAMEWORKS
|
||||
|
||||
#include "ndn-cxx/security/transform/bool-sink.hpp"
|
||||
@@ -59,7 +59,6 @@ namespace tpm {
|
||||
#if defined(NDN_CXX_HAVE_OSX_FRAMEWORKS) && defined(NDN_CXX_WITH_OSX_KEYCHAIN)
|
||||
NDN_CXX_V2_KEYCHAIN_REGISTER_TPM_BACKEND(BackEndOsx);
|
||||
#endif // defined(NDN_CXX_HAVE_OSX_FRAMEWORKS) && defined(NDN_CXX_WITH_OSX_KEYCHAIN)
|
||||
|
||||
NDN_CXX_V2_KEYCHAIN_REGISTER_TPM_BACKEND(BackEndFile);
|
||||
NDN_CXX_V2_KEYCHAIN_REGISTER_TPM_BACKEND(BackEndMem);
|
||||
} // namespace tpm
|
||||
|
||||
@@ -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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/certificate-container.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
#include "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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/identity-container.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
#include "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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/identity.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/identity-impl.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
#include "tests/unit/security/pib/pib-data-fixture.hpp"
|
||||
@@ -38,44 +38,24 @@ BOOST_AUTO_TEST_SUITE(Security)
|
||||
BOOST_AUTO_TEST_SUITE(Pib)
|
||||
BOOST_FIXTURE_TEST_SUITE(TestIdentity, PibDataFixture)
|
||||
|
||||
using pib::Pib;
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ValidityChecking)
|
||||
{
|
||||
using security::pib::detail::IdentityImpl;
|
||||
|
||||
Identity id;
|
||||
|
||||
BOOST_CHECK(!id);
|
||||
BOOST_CHECK_EQUAL(static_cast<bool>(id), false);
|
||||
BOOST_CHECK_EQUAL(!id, true);
|
||||
|
||||
if (id)
|
||||
BOOST_CHECK(false);
|
||||
else
|
||||
BOOST_CHECK(true);
|
||||
|
||||
auto identityImpl = make_shared<IdentityImpl>(id1, make_shared<PibMemory>(), true);
|
||||
auto identityImpl = make_shared<detail::IdentityImpl>(id1, make_shared<PibMemory>(), true);
|
||||
id = Identity(identityImpl);
|
||||
|
||||
BOOST_CHECK_EQUAL(static_cast<bool>(id), true);
|
||||
BOOST_CHECK(id);
|
||||
BOOST_CHECK_EQUAL(!id, false);
|
||||
|
||||
if (id)
|
||||
BOOST_CHECK(true);
|
||||
else
|
||||
BOOST_CHECK(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* pib::Identity is a wrapper of pib::detail::IdentityImpl. Since the functionalities of
|
||||
* IdentityImpl have already been tested in detail/identity-impl.t.cpp, we only test the shared
|
||||
* property of pib::Identity in this test case.
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(Share)
|
||||
// pib::Identity is a wrapper of pib::detail::IdentityImpl. Since the functionalities of
|
||||
// IdentityImpl have already been tested in detail/identity-impl.t.cpp, we only test the shared
|
||||
// property of pib::Identity in this test case.
|
||||
BOOST_AUTO_TEST_CASE(SharedImpl)
|
||||
{
|
||||
using security::pib::detail::IdentityImpl;
|
||||
|
||||
auto identityImpl = make_shared<IdentityImpl>(id1, make_shared<pib::PibMemory>(), true);
|
||||
auto identityImpl = make_shared<detail::IdentityImpl>(id1, make_shared<pib::PibMemory>(), true);
|
||||
Identity identity1(identityImpl);
|
||||
Identity identity2(identityImpl);
|
||||
BOOST_CHECK_EQUAL(identity1, identity2);
|
||||
@@ -85,7 +65,7 @@ BOOST_AUTO_TEST_CASE(Share)
|
||||
identity1.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
|
||||
BOOST_CHECK_NO_THROW(identity2.getKey(id1Key1Name));
|
||||
identity2.removeKey(id1Key1Name);
|
||||
BOOST_CHECK_THROW(identity1.getKey(id1Key1Name), Pib::Error);
|
||||
BOOST_CHECK_THROW(identity1.getKey(id1Key1Name), pib::Pib::Error);
|
||||
|
||||
identity1.setDefaultKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
|
||||
BOOST_CHECK_NO_THROW(identity2.getDefaultKey());
|
||||
|
||||
@@ -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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/impl/identity-impl.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
#include "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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/impl/key-impl.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
#include "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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/key-container.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
#include "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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/key.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/key-impl.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
#include "tests/unit/security/pib/pib-data-fixture.hpp"
|
||||
@@ -38,47 +38,26 @@ BOOST_AUTO_TEST_SUITE(Security)
|
||||
BOOST_AUTO_TEST_SUITE(Pib)
|
||||
BOOST_FIXTURE_TEST_SUITE(TestKey, PibDataFixture)
|
||||
|
||||
using pib::Pib;
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ValidityChecking)
|
||||
{
|
||||
using security::pib::detail::KeyImpl;
|
||||
|
||||
Key key;
|
||||
|
||||
BOOST_CHECK(!key);
|
||||
BOOST_CHECK_EQUAL(static_cast<bool>(key), false);
|
||||
BOOST_CHECK_EQUAL(!key, true);
|
||||
|
||||
if (key)
|
||||
BOOST_CHECK(false);
|
||||
else
|
||||
BOOST_CHECK(true);
|
||||
|
||||
auto keyImpl = make_shared<KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
|
||||
make_shared<pib::PibMemory>());
|
||||
auto keyImpl = make_shared<detail::KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
|
||||
make_shared<pib::PibMemory>());
|
||||
key = Key(keyImpl);
|
||||
|
||||
BOOST_CHECK_EQUAL(static_cast<bool>(key), true);
|
||||
BOOST_CHECK(key);
|
||||
BOOST_CHECK_EQUAL(!key, false);
|
||||
|
||||
if (key)
|
||||
BOOST_CHECK(true);
|
||||
else
|
||||
BOOST_CHECK(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* pib::Key is a wrapper of pib::detail::KeyImpl. Since the functionalities of KeyImpl
|
||||
* have already been tested in detail/key-impl.t.cpp, we only test the shared property
|
||||
* of pib::Key in this test case.
|
||||
*/
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Share)
|
||||
// pib::Key is a wrapper of pib::detail::KeyImpl. Since the functionalities of KeyImpl
|
||||
// have already been tested in detail/key-impl.t.cpp, we only test the shared property
|
||||
// of pib::Key in this test case.
|
||||
BOOST_AUTO_TEST_CASE(SharedImpl)
|
||||
{
|
||||
using security::pib::detail::KeyImpl;
|
||||
|
||||
auto keyImpl = make_shared<KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
|
||||
make_shared<pib::PibMemory>());
|
||||
auto keyImpl = make_shared<detail::KeyImpl>(id1Key1Name, id1Key1.data(), id1Key1.size(),
|
||||
make_shared<pib::PibMemory>());
|
||||
Key key1(keyImpl);
|
||||
Key key2(keyImpl);
|
||||
BOOST_CHECK_EQUAL(key1, key2);
|
||||
@@ -88,7 +67,7 @@ BOOST_AUTO_TEST_CASE(Share)
|
||||
key1.addCertificate(id1Key1Cert1);
|
||||
BOOST_CHECK_NO_THROW(key2.getCertificate(id1Key1Cert1.getName()));
|
||||
key2.removeCertificate(id1Key1Cert1.getName());
|
||||
BOOST_CHECK_THROW(key1.getCertificate(id1Key1Cert1.getName()), Pib::Error);
|
||||
BOOST_CHECK_THROW(key1.getCertificate(id1Key1Cert1.getName()), pib::Pib::Error);
|
||||
|
||||
key1.setDefaultCertificate(id1Key1Cert1);
|
||||
BOOST_CHECK_NO_THROW(key2.getDefaultCertificate());
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-sqlite3.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-sqlite3.hpp"
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/security-common.hpp"
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2018 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received copies of the GNU General Public License and GNU Lesser
|
||||
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace security {
|
||||
namespace pib {
|
||||
namespace tests {
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(Security)
|
||||
BOOST_AUTO_TEST_SUITE(Pib)
|
||||
BOOST_AUTO_TEST_SUITE(TestPibMemory)
|
||||
|
||||
// Functionality is tested as part of pib-impl.t.cpp
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END() // TestPibMemory
|
||||
BOOST_AUTO_TEST_SUITE_END() // Pib
|
||||
BOOST_AUTO_TEST_SUITE_END() // Security
|
||||
|
||||
} // namespace tests
|
||||
} // namespace pib
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
@@ -1,44 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2018 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received copies of the GNU General Public License and GNU Lesser
|
||||
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/pib-sqlite3.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace security {
|
||||
namespace pib {
|
||||
namespace tests {
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(Security)
|
||||
BOOST_AUTO_TEST_SUITE(Pib)
|
||||
BOOST_AUTO_TEST_SUITE(TestPibSqlite3)
|
||||
|
||||
// Functionality is tested as part of pib-impl.t.cpp
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END() // TestPibSqlite3
|
||||
BOOST_AUTO_TEST_SUITE_END() // Pib
|
||||
BOOST_AUTO_TEST_SUITE_END() // Security
|
||||
|
||||
} // namespace tests
|
||||
} // namespace pib
|
||||
} // namespace security
|
||||
} // namespace ndn
|
||||
@@ -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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/security/pib/pib.hpp"
|
||||
#include "ndn-cxx/security/pib/pib-memory.hpp"
|
||||
#include "ndn-cxx/security/pib/impl/pib-memory.hpp"
|
||||
|
||||
#include "tests/boost-test.hpp"
|
||||
#include "tests/unit/security/pib/pib-data-fixture.hpp"
|
||||
@@ -43,25 +43,12 @@ BOOST_AUTO_TEST_CASE(ValidityChecking)
|
||||
Pib pib("pib-memory", "", make_shared<PibMemory>());
|
||||
|
||||
Identity id = pib.addIdentity(id1);
|
||||
|
||||
BOOST_CHECK_EQUAL(static_cast<bool>(id), true);
|
||||
BOOST_CHECK(id);
|
||||
BOOST_CHECK_EQUAL(!id, false);
|
||||
|
||||
if (id)
|
||||
BOOST_CHECK(true);
|
||||
else
|
||||
BOOST_CHECK(false);
|
||||
|
||||
// key
|
||||
Key key = id.addKey(id1Key1.data(), id1Key1.size(), id1Key1Name);
|
||||
|
||||
BOOST_CHECK_EQUAL(static_cast<bool>(key), true);
|
||||
BOOST_CHECK(key);
|
||||
BOOST_CHECK_EQUAL(!key, false);
|
||||
|
||||
if (key)
|
||||
BOOST_CHECK(true);
|
||||
else
|
||||
BOOST_CHECK(false);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TpmLocator)
|
||||
|
||||
@@ -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-2019 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_SECURITY_TPM_BACK_END_WRAPPER_FILE_HPP
|
||||
#define NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_FILE_HPP
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end-file.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-file.hpp"
|
||||
|
||||
#include <boost/filesystem.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-2019 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_SECURITY_TPM_BACK_END_WRAPPER_MEM_HPP
|
||||
#define NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_MEM_HPP
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end-mem.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-mem.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace security {
|
||||
|
||||
@@ -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-2019 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -22,8 +22,8 @@
|
||||
#ifndef NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_OSX_HPP
|
||||
#define NDN_TESTS_SECURITY_TPM_BACK_END_WRAPPER_OSX_HPP
|
||||
|
||||
#include "ndn-cxx/security/tpm/back-end-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/key-handle-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/back-end-osx.hpp"
|
||||
#include "ndn-cxx/security/tpm/impl/key-handle-osx.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ def build(bld):
|
||||
EXTRA_LDFLAGS=' '.join([('-L%s' % i) for i in uniq(pkgconfig_ldflags)]),
|
||||
EXTRA_LINKFLAGS=' '.join(uniq(pkgconfig_linkflags)),
|
||||
EXTRA_INCLUDES=' '.join([('-I%s' % i) for i in uniq(pkgconfig_includes)]),
|
||||
EXTRA_CXXFLAGS=' '.join(uniq(pkgconfig_cxxflags)) + ' ' + ' '.join([('-D%s' % i) for i in uniq(pkgconfig_defines)]),
|
||||
EXTRA_CXXFLAGS=' '.join(uniq(pkgconfig_cxxflags) + [('-D%s' % i) for i in uniq(pkgconfig_defines)]),
|
||||
EXTRA_FRAMEWORKS=EXTRA_FRAMEWORKS)
|
||||
|
||||
if bld.env.WITH_TESTS:
|
||||
|
||||
Reference in new issue
Block a user