remove m_ prefix
Change-Id: I67aa409174fcd3f8df477be8aa4efb8ca96cf012
diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index 39642bf..80edada 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -50,7 +50,7 @@
{
// load the config and create storage
m_config.load(configPath);
- m_storage = CaStorage::createCaStorage(storageType, m_config.caProfile.m_caPrefix, "");
+ m_storage = CaStorage::createCaStorage(storageType, m_config.caProfile.caPrefix, "");
random::generateSecureBytes(m_requestIdGenKey, 32);
if (m_config.nameAssignmentFuncs.size() == 0) {
m_config.nameAssignmentFuncs.push_back(NameAssignmentFunc::createNameAssignmentFunc("random"));
@@ -72,7 +72,7 @@
CaModule::registerPrefix()
{
// register prefixes
- Name prefix = m_config.caProfile.m_caPrefix;
+ Name prefix = m_config.caProfile.caPrefix;
prefix.append("CA");
auto prefixId = m_face.registerPrefix(
@@ -120,16 +120,16 @@
{
if (m_profileData == nullptr) {
const auto& pib = m_keyChain.getPib();
- const auto& identity = pib.getIdentity( m_config.caProfile.m_caPrefix);
+ const auto& identity = pib.getIdentity( m_config.caProfile.caPrefix);
const auto& cert = identity.getDefaultKey().getDefaultCertificate();
Block contentTLV = infotlv::encodeDataContent(m_config.caProfile, cert);
- Name infoPacketName( m_config.caProfile.m_caPrefix);
+ Name infoPacketName( m_config.caProfile.caPrefix);
infoPacketName.append("CA").append("INFO").appendVersion().appendSegment(0);
m_profileData = std::make_unique<Data>(infoPacketName);
m_profileData->setContent(contentTLV);
m_profileData->setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
- m_keyChain.sign(*m_profileData, signingByIdentity( m_config.caProfile.m_caPrefix));
+ m_keyChain.sign(*m_profileData, signingByIdentity( m_config.caProfile.caPrefix));
}
return *m_profileData;
}
@@ -146,7 +146,7 @@
Name discoveryInterestName(m_profileData->getName().getPrefix(-2));
name::Component metadataComponent(32, reinterpret_cast<const uint8_t*>("metadata"), std::strlen("metadata"));
discoveryInterestName.append(metadataComponent);
- m_face.put(metadata.makeData(discoveryInterestName, m_keyChain, signingByIdentity( m_config.caProfile.m_caPrefix)));
+ m_face.put(metadata.makeData(discoveryInterestName, m_keyChain, signingByIdentity( m_config.caProfile.caPrefix)));
}
void
@@ -169,16 +169,16 @@
}
std::vector<Name> availableNames;
for (const auto& component : availableComponents) {
- Name newIdentityName = m_config.caProfile.m_caPrefix;
+ Name newIdentityName = m_config.caProfile.caPrefix;
newIdentityName.append(component);
availableNames.push_back(newIdentityName);
}
Data result;
result.setName(request.getName());
- result.setContent(probetlv::encodeDataContent(availableNames, m_config.caProfile.m_maxSuffixLength, m_config.redirection));
+ result.setContent(probetlv::encodeDataContent(availableNames, m_config.caProfile.maxSuffixLength, m_config.redirection));
result.setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
- m_keyChain.sign(result, signingByIdentity( m_config.caProfile.m_caPrefix));
+ m_keyChain.sign(result, signingByIdentity( m_config.caProfile.caPrefix));
m_face.put(result);
NDN_LOG_TRACE("Handle PROBE: send out the PROBE response");
}
@@ -237,16 +237,16 @@
hkdf(sharedSecret.data(), sharedSecret.size(), salt.data(), salt.size(), aesKey.data(), aesKey.size());
// verify identity name
- if (! m_config.caProfile.m_caPrefix.isPrefixOf(clientCert->getIdentity())
+ if (! m_config.caProfile.caPrefix.isPrefixOf(clientCert->getIdentity())
|| !security::Certificate::isValidName(clientCert->getName())
- || clientCert->getIdentity().size() <= m_config.caProfile.m_caPrefix.size()) {
+ || clientCert->getIdentity().size() <= m_config.caProfile.caPrefix.size()) {
NDN_LOG_ERROR("An invalid certificate name is being requested " << clientCert->getName());
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::NAME_NOT_ALLOWED,
"An invalid certificate name is being requested."));
return;
}
- if ( m_config.caProfile.m_maxSuffixLength) {
- if (clientCert->getIdentity().size() > m_config.caProfile.m_caPrefix.size() + * m_config.caProfile.m_maxSuffixLength) {
+ if ( m_config.caProfile.maxSuffixLength) {
+ if (clientCert->getIdentity().size() > m_config.caProfile.caPrefix.size() + * m_config.caProfile.maxSuffixLength) {
NDN_LOG_ERROR("An invalid certificate name is being requested " << clientCert->getName());
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::NAME_NOT_ALLOWED,
"An invalid certificate name is being requested."));
@@ -259,7 +259,7 @@
auto expectedPeriod = clientCert->getValidityPeriod().getPeriod();
auto currentTime = time::system_clock::now();
if (expectedPeriod.first < currentTime - REQUEST_VALIDITY_PERIOD_NOT_BEFORE_GRACE_PERIOD ||
- expectedPeriod.second > currentTime + m_config.caProfile.m_maxValidityPeriod ||
+ expectedPeriod.second > currentTime + m_config.caProfile.maxValidityPeriod ||
expectedPeriod.second <= expectedPeriod.first) {
NDN_LOG_ERROR("An invalid validity period is being requested.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_VALIDITY_PERIOD,
@@ -283,7 +283,7 @@
}
else if (requestType == RequestType::REVOKE) {
//verify cert is from this CA
- const auto& cert = m_keyChain.getPib().getIdentity( m_config.caProfile.m_caPrefix).getDefaultKey().getDefaultCertificate();
+ const auto& cert = m_keyChain.getPib().getIdentity( m_config.caProfile.caPrefix).getDefaultKey().getDefaultCertificate();
if (!security::verifySignature(*clientCert, cert)) {
NDN_LOG_ERROR("Invalid signature in the certificate to revoke.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
@@ -308,7 +308,7 @@
std::memcpy(id.data(), requestIdData, id.size());
// initialize request state
RequestState requestState;
- requestState.caPrefix = m_config.caProfile.m_caPrefix;
+ requestState.caPrefix = m_config.caProfile.caPrefix;
requestState.requestId = id;
requestState.requestType = requestType;
requestState.cert = *clientCert;
@@ -328,8 +328,8 @@
result.setContent(requesttlv::encodeDataContent(myEcdhPubKeyBase64,
salt,
requestState.requestId, requestState.status,
- m_config.caProfile.m_supportedChallenges));
- m_keyChain.sign(result, signingByIdentity( m_config.caProfile.m_caPrefix));
+ m_config.caProfile.supportedChallenges));
+ m_keyChain.sign(result, signingByIdentity( m_config.caProfile.caPrefix));
m_face.put(result);
if (m_statusUpdateCallback) {
m_statusUpdateCallback(requestState);
@@ -427,7 +427,7 @@
result.setName(request.getName());
result.setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
result.setContent(payload);
- m_keyChain.sign(result, signingByIdentity( m_config.caProfile.m_caPrefix));
+ m_keyChain.sign(result, signingByIdentity( m_config.caProfile.caPrefix));
m_face.put(result);
if (m_statusUpdateCallback) {
m_statusUpdateCallback(*requestState);
@@ -449,7 +449,7 @@
SignatureInfo signatureInfo;
signatureInfo.setValidityPeriod(period);
security::SigningInfo signingInfo(security::SigningInfo::SIGNER_TYPE_ID,
- m_config.caProfile.m_caPrefix, signatureInfo);
+ m_config.caProfile.caPrefix, signatureInfo);
m_keyChain.sign(newCert, signingInfo);
NDN_LOG_TRACE("new cert got signed" << newCert);
@@ -461,7 +461,7 @@
{
RequestId requestId;
try {
- auto& component = request.getName().at(m_config.caProfile.m_caPrefix.size() + 2);
+ auto& component = request.getName().at(m_config.caProfile.caPrefix.size() + 2);
std::memcpy(requestId.data(), component.value(), component.value_size());
}
catch (const std::exception& e) {
@@ -491,7 +491,7 @@
result.setName(name);
result.setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
result.setContent(errortlv::encodeDataContent(error, errorInfo));
- m_keyChain.sign(result, signingByIdentity( m_config.caProfile.m_caPrefix));
+ m_keyChain.sign(result, signingByIdentity( m_config.caProfile.caPrefix));
return result;
}
diff --git a/src/detail/ca-configuration.cpp b/src/detail/ca-configuration.cpp
index d44b36b..7d27bfb 100644
--- a/src/detail/ca-configuration.cpp
+++ b/src/detail/ca-configuration.cpp
@@ -40,7 +40,7 @@
NDN_THROW(std::runtime_error("No JSON configuration found in file: " + fileName));
}
caProfile = CaProfile::fromJson(configJson);
- if (caProfile.m_supportedChallenges.size() == 0) {
+ if (caProfile.supportedChallenges.size() == 0) {
NDN_THROW(std::runtime_error("At least one challenge should be specified."));
}
// parse redirection section if appears
diff --git a/src/detail/ca-profile.cpp b/src/detail/ca-profile.cpp
index 5216ae0..7986830 100644
--- a/src/detail/ca-profile.cpp
+++ b/src/detail/ca-profile.cpp
@@ -31,22 +31,22 @@
{
CaProfile profile;
// CA prefix
- profile.m_caPrefix = Name(json.get(CONFIG_CA_PREFIX, ""));
- if (profile.m_caPrefix.empty()) {
+ profile.caPrefix = Name(json.get(CONFIG_CA_PREFIX, ""));
+ if (profile.caPrefix.empty()) {
NDN_THROW(std::runtime_error("Cannot parse ca-prefix from the config file"));
}
// CA info
- profile.m_caInfo = json.get(CONFIG_CA_INFO, "");
+ profile.caInfo = json.get(CONFIG_CA_INFO, "");
// CA max validity period
- profile.m_maxValidityPeriod = time::seconds(json.get(CONFIG_MAX_VALIDITY_PERIOD, 86400));
+ profile.maxValidityPeriod = time::seconds(json.get(CONFIG_MAX_VALIDITY_PERIOD, 86400));
// CA max suffix length
- profile.m_maxSuffixLength = nullopt;
+ profile.maxSuffixLength = nullopt;
auto maxSuffixLength = json.get_optional<size_t>(CONFIG_MAX_SUFFIX_LENGTH);
if (maxSuffixLength) {
- profile.m_maxSuffixLength = *maxSuffixLength;
+ profile.maxSuffixLength = *maxSuffixLength;
}
// probe parameter keys
- profile.m_probeParameterKeys.clear();
+ profile.probeParameterKeys.clear();
auto probeParametersJson = json.get_child_optional(CONFIG_PROBE_PARAMETERS);
if (probeParametersJson) {
for (const auto& item : *probeParametersJson) {
@@ -55,11 +55,11 @@
if (probeParameter == "") {
NDN_THROW(std::runtime_error("Probe parameter key cannot be empty."));
}
- profile.m_probeParameterKeys.push_back(probeParameter);
+ profile.probeParameterKeys.push_back(probeParameter);
}
}
// supported challenges
- profile.m_supportedChallenges.clear();
+ profile.supportedChallenges.clear();
auto challengeListJson = json.get_child_optional(CONFIG_SUPPORTED_CHALLENGES);
if (challengeListJson) {
for (const auto& item : *challengeListJson) {
@@ -71,15 +71,15 @@
if (!ChallengeModule::isChallengeSupported(challengeType)) {
NDN_THROW(std::runtime_error("Challenge " + challengeType + " is not supported."));
}
- profile.m_supportedChallenges.push_back(challengeType);
+ profile.supportedChallenges.push_back(challengeType);
}
}
// anchor certificate
- profile.m_cert = nullptr;
+ profile.cert = nullptr;
auto certificateStr = json.get(CONFIG_CERTIFICATE, "");
if (certificateStr != "") {
std::istringstream ss(certificateStr);
- profile.m_cert = io::load<security::Certificate>(ss);
+ profile.cert = io::load<security::Certificate>(ss);
}
return profile;
}
@@ -88,33 +88,33 @@
CaProfile::toJson() const
{
JsonSection caItem;
- caItem.put(CONFIG_CA_PREFIX, m_caPrefix.toUri());
- caItem.put(CONFIG_CA_INFO, m_caInfo);
- caItem.put(CONFIG_MAX_VALIDITY_PERIOD, m_maxValidityPeriod.count());
- if (m_maxSuffixLength) {
- caItem.put(CONFIG_MAX_SUFFIX_LENGTH, *m_maxSuffixLength);
+ caItem.put(CONFIG_CA_PREFIX, caPrefix.toUri());
+ caItem.put(CONFIG_CA_INFO, caInfo);
+ caItem.put(CONFIG_MAX_VALIDITY_PERIOD, maxValidityPeriod.count());
+ if (maxSuffixLength) {
+ caItem.put(CONFIG_MAX_SUFFIX_LENGTH, *maxSuffixLength);
}
- if (!m_probeParameterKeys.empty()) {
+ if (!probeParameterKeys.empty()) {
JsonSection probeParametersJson;
- for (const auto& key : m_probeParameterKeys) {
+ for (const auto& key : probeParameterKeys) {
JsonSection keyJson;
keyJson.put(CONFIG_PROBE_PARAMETER, key);
probeParametersJson.push_back(std::make_pair("", keyJson));
}
caItem.add_child("", probeParametersJson);
}
- if (!m_supportedChallenges.empty()) {
+ if (!supportedChallenges.empty()) {
JsonSection challengeListJson;
- for (const auto& challenge : m_supportedChallenges) {
+ for (const auto& challenge : supportedChallenges) {
JsonSection challengeJson;
challengeJson.put(CONFIG_CHALLENGE, challenge);
challengeListJson.push_back(std::make_pair("", challengeJson));
}
caItem.add_child("", challengeListJson);
}
- if (m_cert != nullptr) {
+ if (cert != nullptr) {
std::stringstream ss;
- io::save(*m_cert, ss);
+ io::save(*cert, ss);
caItem.put("certificate", ss.str());
}
return caItem;
diff --git a/src/detail/ca-profile.hpp b/src/detail/ca-profile.hpp
index b3e31be..69adf43 100644
--- a/src/detail/ca-profile.hpp
+++ b/src/detail/ca-profile.hpp
@@ -60,37 +60,37 @@
/**
* @brief CA Name prefix (without /CA suffix).
*/
- Name m_caPrefix;
+ Name caPrefix;
/**
* @brief CA Information.
*/
- std::string m_caInfo;
+ std::string caInfo;
/**
* @brief A list of parameter-keys for PROBE.
*/
- std::vector<std::string> m_probeParameterKeys;
+ std::vector<std::string> probeParameterKeys;
/**
* @brief Maximum allowed validity period of the certificate being requested.
*
* The value is in the unit of second.
* Default: one day (86400 seconds).
*/
- time::seconds m_maxValidityPeriod;
+ time::seconds maxValidityPeriod;
/**
* @brief Maximum allowed suffix length of requested name.
*
* E.g., When its value is 2, at most 2 name components can be assigned after m_caPrefix.
* Default: none.
*/
- optional<size_t> m_maxSuffixLength = nullopt;
+ optional<size_t> maxSuffixLength = nullopt;
/**
* @brief A list of supported challenges. Only CA side will have m_supportedChallenges.
*/
- std::vector<std::string> m_supportedChallenges;
+ std::vector<std::string> supportedChallenges;
/**
* @brief CA's certificate. Only Client side will have m_cert.
*/
- std::shared_ptr<security::Certificate> m_cert;
+ std::shared_ptr<security::Certificate> cert;
};
} // namespace ndncert
diff --git a/src/detail/info-encoder.cpp b/src/detail/info-encoder.cpp
index 17e798c..79f617f 100644
--- a/src/detail/info-encoder.cpp
+++ b/src/detail/info-encoder.cpp
@@ -27,19 +27,19 @@
infotlv::encodeDataContent(const CaProfile& caConfig, const security::Certificate& certificate)
{
Block content(ndn::tlv::Content);
- content.push_back(makeNestedBlock(tlv::CaPrefix, caConfig.m_caPrefix));
+ content.push_back(makeNestedBlock(tlv::CaPrefix, caConfig.caPrefix));
std::string caInfo = "";
- if (caConfig.m_caInfo == "") {
+ if (caConfig.caInfo == "") {
caInfo = "Issued by " + certificate.getSignatureInfo().getKeyLocator().getName().toUri();
}
else {
- caInfo = caConfig.m_caInfo;
+ caInfo = caConfig.caInfo;
}
content.push_back(makeStringBlock(tlv::CaInfo, caInfo));
- for (const auto& key : caConfig.m_probeParameterKeys) {
+ for (const auto& key : caConfig.probeParameterKeys) {
content.push_back(makeStringBlock(tlv::ParameterKey, key));
}
- content.push_back(makeNonNegativeIntegerBlock(tlv::MaxValidityPeriod, caConfig.m_maxValidityPeriod.count()));
+ content.push_back(makeNonNegativeIntegerBlock(tlv::MaxValidityPeriod, caConfig.maxValidityPeriod.count()));
content.push_back(makeNestedBlock(tlv::CaCertificate, certificate));
content.encode();
return content;
@@ -54,20 +54,20 @@
switch (item.type()) {
case tlv::CaPrefix:
item.parse();
- result.m_caPrefix.wireDecode(item.get(ndn::tlv::Name));
+ result.caPrefix.wireDecode(item.get(ndn::tlv::Name));
break;
case tlv::CaInfo:
- result.m_caInfo = readString(item);
+ result.caInfo = readString(item);
break;
case tlv::ParameterKey:
- result.m_probeParameterKeys.push_back(readString(item));
+ result.probeParameterKeys.push_back(readString(item));
break;
case tlv::MaxValidityPeriod:
- result.m_maxValidityPeriod = time::seconds(readNonNegativeInteger(item));
+ result.maxValidityPeriod = time::seconds(readNonNegativeInteger(item));
break;
case tlv::CaCertificate:
item.parse();
- result.m_cert = std::make_shared<security::Certificate>(item.get(ndn::tlv::Data));
+ result.cert = std::make_shared<security::Certificate>(item.get(ndn::tlv::Data));
break;
default:
continue;
diff --git a/src/detail/profile-storage.cpp b/src/detail/profile-storage.cpp
index 2917382..7ae3c08 100644
--- a/src/detail/profile-storage.cpp
+++ b/src/detail/profile-storage.cpp
@@ -49,7 +49,7 @@
for (auto item : caList) {
CaProfile caItem;
caItem = CaProfile::fromJson(item.second);
- if (caItem.m_cert == nullptr) {
+ if (caItem.cert == nullptr) {
NDN_THROW(std::runtime_error("No CA certificate is loaded from JSON configuration."));
}
m_caProfiles.push_back(std::move(caItem));
@@ -74,14 +74,14 @@
void
ProfileStorage::removeCaProfile(const Name& caName)
{
- m_caProfiles.remove_if([&](const CaProfile& item) { return item.m_caPrefix == caName; });
+ m_caProfiles.remove_if([&](const CaProfile& item) { return item.caPrefix == caName; });
}
void
ProfileStorage::addCaProfile(const CaProfile& profile)
{
for (auto& item : m_caProfiles) {
- if (item.m_caPrefix == profile.m_caPrefix) {
+ if (item.caPrefix == profile.caPrefix) {
item = profile;
return;
}
diff --git a/src/requester.cpp b/src/requester.cpp
index ca75708..0f237eb 100644
--- a/src/requester.cpp
+++ b/src/requester.cpp
@@ -67,7 +67,7 @@
Requester::onCaProfileResponse(const Data& reply)
{
auto caItem = infotlv::decodeDataContent(reply.getContent());
- if (!security::verifySignature(reply, *caItem.m_cert)) {
+ if (!security::verifySignature(reply, *caItem.cert)) {
NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
NDN_THROW(std::runtime_error("Cannot verify replied Data packet signature."));
}
@@ -78,9 +78,9 @@
Requester::onCaProfileResponseAfterRedirection(const Data& reply, const Name& caCertFullName)
{
auto caItem = infotlv::decodeDataContent(reply.getContent());
- auto certBlock = caItem.m_cert->wireEncode();
- caItem.m_cert = std::make_shared<security::Certificate>(certBlock);
- if (caItem.m_cert->getFullName() != caCertFullName) {
+ auto certBlock = caItem.cert->wireEncode();
+ caItem.cert = std::make_shared<security::Certificate>(certBlock);
+ if (caItem.cert->getFullName() != caCertFullName) {
NDN_LOG_ERROR("Ca profile does not match the certificate information offered by the original CA.");
NDN_THROW(std::runtime_error("Cannot verify replied Data packet signature."));
}
@@ -90,7 +90,7 @@
shared_ptr<Interest>
Requester::genProbeInterest(const CaProfile& ca, std::multimap<std::string, std::string>&& probeInfo)
{
- Name interestName = ca.m_caPrefix;
+ Name interestName = ca.caPrefix;
interestName.append("CA").append("PROBE");
auto interest =std::make_shared<Interest>(interestName);
interest->setMustBeFresh(true);
@@ -103,7 +103,7 @@
Requester::onProbeResponse(const Data& reply, const CaProfile& ca,
std::vector<std::pair<Name, int>>& identityNames, std::vector<Name>& otherCas)
{
- if (!security::verifySignature(reply, *ca.m_cert)) {
+ if (!security::verifySignature(reply, *ca.cert)) {
NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
NDN_THROW(std::runtime_error("Cannot verify replied Data packet signature."));
return;
@@ -117,12 +117,12 @@
const time::system_clock::TimePoint& notBefore,
const time::system_clock::TimePoint& notAfter)
{
- if (!state.caProfile.m_caPrefix.isPrefixOf(identityName)) {
+ if (!state.caProfile.caPrefix.isPrefixOf(identityName)) {
return nullptr;
}
if (identityName.empty()) {
NDN_LOG_TRACE("Randomly create a new name because identityName is empty and the param is empty.");
- state.identityName = state.caProfile.m_caPrefix;
+ state.identityName = state.caProfile.caPrefix;
state.identityName.append(std::to_string(random::generateSecureWord64()));
}
else {
@@ -159,7 +159,7 @@
state.keyChain.sign(certRequest, signingByKey(keyName).setSignatureInfo(signatureInfo));
// generate Interest packet
- Name interestName = state.caProfile.m_caPrefix;
+ Name interestName = state.caProfile.caPrefix;
interestName.append("CA").append("NEW");
auto interest =std::make_shared<Interest>(interestName);
interest->setMustBeFresh(true);
@@ -175,11 +175,11 @@
shared_ptr<Interest>
Requester::genRevokeInterest(RequestState& state, const security::Certificate& certificate)
{
- if (!state.caProfile.m_caPrefix.isPrefixOf(certificate.getName())) {
+ if (!state.caProfile.caPrefix.isPrefixOf(certificate.getName())) {
return nullptr;
}
// generate Interest packet
- Name interestName = state.caProfile.m_caPrefix;
+ Name interestName = state.caProfile.caPrefix;
interestName.append("CA").append("REVOKE");
auto interest =std::make_shared<Interest>(interestName);
interest->setMustBeFresh(true);
@@ -192,7 +192,7 @@
std::list<std::string>
Requester::onNewRenewRevokeResponse(RequestState& state, const Data& reply)
{
- if (!security::verifySignature(reply, *state.caProfile.m_cert)) {
+ if (!security::verifySignature(reply, *state.caProfile.cert)) {
NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
NDN_THROW(std::runtime_error("Cannot verify replied Data packet signature."));
}
@@ -236,7 +236,7 @@
}
auto challengeParams = challenge->genChallengeRequestTLV(state.status, state.challengeStatus, std::move(parameters));
- Name interestName = state.caProfile.m_caPrefix;
+ Name interestName = state.caProfile.caPrefix;
interestName.append("CA").append("CHALLENGE").append(state.requestId.data(), state.requestId.size());
auto interest =std::make_shared<Interest>(interestName);
interest->setMustBeFresh(true);
@@ -256,7 +256,7 @@
void
Requester::onChallengeResponse(RequestState& state, const Data& reply)
{
- if (!security::verifySignature(reply, *state.caProfile.m_cert)) {
+ if (!security::verifySignature(reply, *state.caProfile.cert)) {
NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
NDN_THROW(std::runtime_error("Cannot verify replied Data packet signature."));
}