change from m_caName to m_caPrefix
diff --git a/src/client-module.cpp b/src/client-module.cpp
index adad5d9..d6fdc14 100644
--- a/src/client-module.cpp
+++ b/src/client-module.cpp
@@ -70,7 +70,7 @@
// verify the probe Data's sig
if (!security::verifySignature(reply, caItem.m_anchor)) {
- _LOG_ERROR("Cannot verify data signature from " << m_ca.m_caName.toUri());
+ _LOG_ERROR("Cannot verify data signature from " << m_ca.m_caPrefix.toUri());
return false;
}
return true;
@@ -87,7 +87,7 @@
// update the local config
bool findItem = false;
for (auto& item : m_config.m_caItems) {
- if (item.m_caName == caItem.m_caName) {
+ if (item.m_caPrefix == caItem.m_caPrefix) {
findItem = true;
item = caItem;
}
@@ -100,7 +100,7 @@
shared_ptr<Interest>
ClientModule::generateProbeInterest(const ClientCaItem& ca, const std::string& probeInfo)
{
- Name interestName = ca.m_caName;
+ Name interestName = ca.m_caPrefix;
interestName.append("CA").append("PROBE");
auto interest = make_shared<Interest>(interestName);
interest->setMustBeFresh(true);
@@ -118,7 +118,7 @@
ClientModule::onProbeResponse(const Data& reply)
{
if (!security::verifySignature(reply, m_ca.m_anchor)) {
- _LOG_ERROR("Cannot verify data signature from " << m_ca.m_caName.toUri());
+ _LOG_ERROR("Cannot verify data signature from " << m_ca.m_caPrefix.toUri());
return;
}
@@ -143,7 +143,7 @@
if (!identityName.empty()) { // if identityName is not empty, find the corresponding CA
bool findCa = false;
for (const auto& caItem : m_config.m_caItems) {
- if (caItem.m_caName.isPrefixOf(identityName)) {
+ if (caItem.m_caPrefix.isPrefixOf(identityName)) {
m_ca = caItem;
findCa = true;
}
@@ -160,7 +160,7 @@
else {
NDN_LOG_TRACE("Randomly create a new name because m_identityName is empty and the param is empty.");
auto id = std::to_string(random::generateSecureWord64());
- m_identityName = m_ca.m_caName;
+ m_identityName = m_ca.m_caPrefix;
m_identityName.append(id);
}
}
@@ -195,7 +195,7 @@
m_keyChain.sign(certRequest, signingByKey(m_key.getName()).setSignatureInfo(signatureInfo));
// generate Interest packet
- Name interestName = m_ca.m_caName;
+ Name interestName = m_ca.m_caPrefix;
interestName.append("CA").append("NEW");
auto interest = make_shared<Interest>(interestName);
interest->setMustBeFresh(true);
@@ -213,7 +213,7 @@
ClientModule::onNewResponse(const Data& reply)
{
if (!security::verifySignature(reply, m_ca.m_anchor)) {
- _LOG_ERROR("Cannot verify data signature from " << m_ca.m_caName.toUri());
+ _LOG_ERROR("Cannot verify data signature from " << m_ca.m_caPrefix.toUri());
return std::list<std::string>();
}
auto contentTLV = reply.getContent();
@@ -247,7 +247,7 @@
challengeRequest.parse();
m_challengeType = readString(challengeRequest.get(tlv_selected_challenge));
- Name interestName = m_ca.m_caName;
+ Name interestName = m_ca.m_caPrefix;
interestName.append("CA").append("CHALLENGE").append(m_requestId);
auto interest = make_shared<Interest>(interestName);
interest->setMustBeFresh(true);
@@ -267,7 +267,7 @@
ClientModule::onChallengeResponse(const Data& reply)
{
if (!security::verifySignature(reply, m_ca.m_anchor)) {
- _LOG_ERROR("Cannot verify data signature from " << m_ca.m_caName.toUri());
+ _LOG_ERROR("Cannot verify data signature from " << m_ca.m_caPrefix.toUri());
return;
}
auto result = decodeBlockWithAesGcm128(reply.getContent(), m_aesKey, (const uint8_t*)"test", strlen("test"));
@@ -288,7 +288,7 @@
shared_ptr<Interest>
ClientModule::generateDownloadInterest()
{
- Name interestName = m_ca.m_caName;
+ Name interestName = m_ca.m_caPrefix;
interestName.append("CA").append("DOWNLOAD").append(m_requestId);
auto interest = make_shared<Interest>(interestName);
interest->setMustBeFresh(true);