security: refactor CertificateStore class
Refs: #5075
Change-Id: I8ab92012b3acf405503ab33c9320463accc682a9
diff --git a/tests/update/test-prefix-update-processor.cpp b/tests/update/test-prefix-update-processor.cpp
index 5a6cbde..711935f 100644
--- a/tests/update/test-prefix-update-processor.cpp
+++ b/tests/update/test-prefix-update-processor.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2019, The University of Memphis,
+ * Copyright (c) 2014-2020, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -22,8 +22,8 @@
#include "update/prefix-update-processor.hpp"
#include "nlsr.hpp"
-#include "../control-commands.hpp"
-#include "../test-common.hpp"
+#include "tests/control-commands.hpp"
+#include "tests/test-common.hpp"
#include <ndn-cxx/mgmt/nfd/control-response.hpp>
#include <ndn-cxx/security/command-interest-signer.hpp>
@@ -46,7 +46,7 @@
: face(m_ioService, m_keyChain, {true, true})
, siteIdentityName(ndn::Name("site"))
, opIdentityName(ndn::Name("site").append(ndn::Name("%C1.Operator")))
- , conf(face)
+ , conf(face, m_keyChain)
, confProcessor(conf)
, nlsr(face, m_keyChain, conf)
, namePrefixList(conf.getNamePrefixList())
@@ -59,6 +59,12 @@
// Operator cert
opIdentity = addSubCertificate(opIdentityName, siteIdentity);
+ // Create certificate and load it to the validator
+ conf.initializeKey();
+
+ conf.loadCertToValidator(siteIdentity.getDefaultKey().getDefaultCertificate());
+ conf.loadCertToValidator(opIdentity.getDefaultKey().getDefaultCertificate());
+
std::ifstream inputFile;
inputFile.open(std::string("nlsr.conf"));
@@ -78,8 +84,6 @@
}
inputFile.close();
- nlsr.loadCertToPublish(opIdentity.getDefaultKey().getDefaultCertificate());
-
addIdentity(conf.getRouterPrefix());
// Initialize NLSR so a sync socket is created
@@ -131,7 +135,9 @@
ndn::security::pib::Identity siteIdentity;
ndn::Name opIdentityName;
+ ndn::Name routerIdName;
ndn::security::pib::Identity opIdentity;
+ ndn::security::pib::Identity routerId;
ConfParameter conf;
DummyConfFileProcessor confProcessor;
@@ -175,7 +181,6 @@
BOOST_REQUIRE_EQUAL(namePrefixList.size(), 1);
BOOST_CHECK_EQUAL(namePrefixList.getNames().front(), parameters.getName());
-
BOOST_CHECK(wasRoutingUpdatePublished());
BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());