security: Reorganizing source code to prepare for support of two version of NDN certificates
This commit also removes unused ndn_digestSha256 function and deprecates
crypto::sha256 in favor of crypto::computeSha256Digest in util/crypto.hpp.
Change-Id: I24ee50ff073a96b868633bdf2cfade412d3605f3
Refs: #3098
diff --git a/src/security/conf/checker.hpp b/src/security/conf/checker.hpp
index c2c4244..c4ec3ca 100644
--- a/src/security/conf/checker.hpp
+++ b/src/security/conf/checker.hpp
@@ -29,7 +29,7 @@
#include "key-locator-checker.hpp"
#include "../../util/io.hpp"
#include "../validator.hpp"
-#include "../identity-certificate.hpp"
+#include "../v1/identity-certificate.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
@@ -198,10 +198,10 @@
{
public:
FixedSignerChecker(uint32_t sigType,
- const std::vector<shared_ptr<IdentityCertificate>>& signers)
+ const std::vector<shared_ptr<v1::IdentityCertificate>>& signers)
: m_sigType(sigType)
{
- for (std::vector<shared_ptr<IdentityCertificate>>::const_iterator it = signers.begin();
+ for (std::vector<shared_ptr<v1::IdentityCertificate>>::const_iterator it = signers.begin();
it != signers.end(); it++)
m_signers[(*it)->getName().getPrefix(-1)] = (*it);
@@ -295,7 +295,7 @@
}
private:
- typedef std::map<Name, shared_ptr<IdentityCertificate>> SignerList;
+ typedef std::map<Name, shared_ptr<v1::IdentityCertificate>> SignerList;
uint32_t m_sigType;
SignerList m_signers;
};
@@ -394,7 +394,7 @@
std::string sigType = propertyIt->second.data();
propertyIt++;
- std::vector<shared_ptr<IdentityCertificate>> signers;
+ std::vector<shared_ptr<v1::IdentityCertificate>> signers;
for (; propertyIt != configSection.end(); propertyIt++) {
if (!boost::iequals(propertyIt->first, "signer"))
BOOST_THROW_EXCEPTION(Error("Expect <checker.signer> but get <checker." +
@@ -410,7 +410,7 @@
signers));
}
- static shared_ptr<IdentityCertificate>
+ static shared_ptr<v1::IdentityCertificate>
getSigner(const ConfigSection& configSection, const std::string& configFilename)
{
using namespace boost::filesystem;
@@ -436,8 +436,8 @@
if (propertyIt != configSection.end())
BOOST_THROW_EXCEPTION(Error("Expect the end of checker.signer"));
- shared_ptr<IdentityCertificate> idCert
- = io::load<IdentityCertificate>(certfilePath.c_str());
+ shared_ptr<v1::IdentityCertificate> idCert
+ = io::load<v1::IdentityCertificate>(certfilePath.c_str());
if (static_cast<bool>(idCert))
return idCert;
@@ -457,7 +457,7 @@
if (propertyIt != configSection.end())
BOOST_THROW_EXCEPTION(Error("Expect the end of checker.signer"));
- shared_ptr<IdentityCertificate> idCert = io::load<IdentityCertificate>(ss);
+ shared_ptr<v1::IdentityCertificate> idCert = io::load<v1::IdentityCertificate>(ss);
if (static_cast<bool>(idCert))
return idCert;