remove _LOG_XX
Change-Id: Iace32ffec68a8561465f49b217200c3a7590c273
diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index caba70d..097c0d7 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -40,7 +40,7 @@
static const time::seconds DEFAULT_DATA_FRESHNESS_PERIOD = 1_s;
static const time::seconds REQUEST_VALIDITY_PERIOD_NOT_BEFORE_GRACE_PERIOD = 120_s;
-_LOG_INIT(ndncert.ca);
+NDN_LOG_INIT(ndncert.ca);
CaModule::CaModule(Face& face, security::KeyChain& keyChain,
const std::string& configPath, const std::string& storageType)
@@ -102,7 +102,7 @@
filterId = m_face.setInterestFilter(Name(name).append("REVOKE"),
bind(&CaModule::onNewRenewRevoke, this, _2, RequestType::REVOKE));
m_interestFilterHandles.push_back(filterId);
- _LOG_TRACE("Prefix " << name << " got registered");
+ NDN_LOG_TRACE("Prefix " << name << " got registered");
},
bind(&CaModule::onRegisterFailed, this, _2));
m_registeredPrefixHandles.push_back(prefixId);
@@ -136,7 +136,7 @@
void
CaModule::onCaProfileDiscovery(const Interest& request)
{
- _LOG_TRACE("Received CA Profile MetaData discovery Interest");
+ NDN_LOG_TRACE("Received CA Profile MetaData discovery Interest");
if (m_profileData == nullptr) {
m_profileData = std::make_unique<Data>(getCaProfileData());
}
@@ -152,7 +152,7 @@
CaModule::onProbe(const Interest& request)
{
// PROBE Naming Convention: /<CA-Prefix>/CA/PROBE/[ParametersSha256DigestComponent]
- _LOG_TRACE("Received PROBE request");
+ NDN_LOG_TRACE("Received PROBE request");
// process PROBE requests: collect probe parameters
auto parameters = PROBE::decodeApplicationParameters(request.getApplicationParameters());
@@ -179,7 +179,7 @@
result.setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
m_keyChain.sign(result, signingByIdentity(m_config.m_caItem.m_caPrefix));
m_face.put(result);
- _LOG_TRACE("Handle PROBE: send out the PROBE response");
+ NDN_LOG_TRACE("Handle PROBE: send out the PROBE response");
}
void
@@ -196,20 +196,20 @@
}
catch (const std::exception& e) {
if (!parameterTLV.hasValue()) {
- _LOG_ERROR("Empty TLV obtained from the Interest parameter.");
+ NDN_LOG_ERROR("Empty TLV obtained from the Interest parameter.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
"Empty TLV obtained from the Interest parameter."));
return;
}
- _LOG_ERROR("Unrecognized self-signed certificate: " << e.what());
+ NDN_LOG_ERROR("Unrecognized self-signed certificate: " << e.what());
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
"Unrecognized self-signed certificate."));
return;
}
if (ecdhPub == "") {
- _LOG_ERROR("Empty ECDH PUB obtained from the Interest parameter.");
+ NDN_LOG_ERROR("Empty ECDH PUB obtained from the Interest parameter.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
"Empty ECDH PUB obtained from the Interest parameter."));
return;
@@ -222,7 +222,7 @@
ecdh.deriveSecret(ecdhPub);
}
catch (const std::exception& e) {
- _LOG_ERROR("Cannot derive a shared secret using the provided ECDH key: " << e.what());
+ NDN_LOG_ERROR("Cannot derive a shared secret using the provided ECDH key: " << e.what());
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
"Cannot derive a shared secret using the provided ECDH key."));
return;
@@ -238,14 +238,14 @@
if (!m_config.m_caItem.m_caPrefix.isPrefixOf(clientCert->getIdentity())
|| !security::Certificate::isValidName(clientCert->getName())
|| clientCert->getIdentity().size() <= m_config.m_caItem.m_caPrefix.size()) {
- _LOG_ERROR("An invalid certificate name is being requested " << clientCert->getName());
+ 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.m_caItem.m_maxSuffixLength) {
if (clientCert->getIdentity().size() > m_config.m_caItem.m_caPrefix.size() + *m_config.m_caItem.m_maxSuffixLength) {
- _LOG_ERROR("An invalid certificate name is being requested " << clientCert->getName());
+ 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;
@@ -259,7 +259,7 @@
if (expectedPeriod.first < currentTime - REQUEST_VALIDITY_PERIOD_NOT_BEFORE_GRACE_PERIOD ||
expectedPeriod.second > currentTime + m_config.m_caItem.m_maxValidityPeriod ||
expectedPeriod.second <= expectedPeriod.first) {
- _LOG_ERROR("An invalid validity period is being requested.");
+ NDN_LOG_ERROR("An invalid validity period is being requested.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_VALIDITY_PERIOD,
"An invalid validity period is being requested."));
return;
@@ -267,13 +267,13 @@
// verify signature
if (!security::verifySignature(*clientCert, *clientCert)) {
- _LOG_ERROR("Invalid signature in the self-signed certificate.");
+ NDN_LOG_ERROR("Invalid signature in the self-signed certificate.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
"Invalid signature in the self-signed certificate."));
return;
}
if (!security::verifySignature(request, *clientCert)) {
- _LOG_ERROR("Invalid signature in the Interest packet.");
+ NDN_LOG_ERROR("Invalid signature in the Interest packet.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
"Invalid signature in the Interest packet."));
return;
@@ -283,7 +283,7 @@
//verify cert is from this CA
const auto& cert = m_keyChain.getPib().getIdentity(m_config.m_caItem.m_caPrefix).getDefaultKey().getDefaultCertificate();
if (!security::verifySignature(*clientCert, cert)) {
- _LOG_ERROR("Invalid signature in the certificate to revoke.");
+ NDN_LOG_ERROR("Invalid signature in the certificate to revoke.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
"Invalid signature in the certificate to revoke."));
return;
@@ -301,7 +301,7 @@
m_storage->addRequest(requestState);
}
catch (const std::runtime_error& e) {
- _LOG_ERROR("Duplicate Request ID: The same request has been seen before.");
+ NDN_LOG_ERROR("Duplicate Request ID: The same request has been seen before.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
"Duplicate Request ID: The same request has been seen before.."));
return;
@@ -326,14 +326,14 @@
// get certificate request state
CaState requestState = getCertificateRequest(request);
if (requestState.m_requestId == "") {
- _LOG_ERROR("No certificate request state can be found.");
+ NDN_LOG_ERROR("No certificate request state can be found.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
"No certificate request state can be found."));
return;
}
// verify signature
if (!security::verifySignature(request, requestState.m_cert)) {
- _LOG_ERROR("Invalid Signature in the Interest packet.");
+ NDN_LOG_ERROR("Invalid Signature in the Interest packet.");
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::BAD_SIGNATURE,
"Invalid Signature in the Interest packet."));
return;
@@ -345,14 +345,14 @@
(uint8_t*)"test", strlen("test"));
}
catch (const std::exception& e) {
- _LOG_ERROR("Interest paramaters decryption failed: " << e.what());
+ NDN_LOG_ERROR("Interest paramaters decryption failed: " << e.what());
m_storage->deleteRequest(requestState.m_requestId);
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
"Interest paramaters decryption failed."));
return;
}
if (paramTLVPayload.size() == 0) {
- _LOG_ERROR("No parameters are found after decryption.");
+ NDN_LOG_ERROR("No parameters are found after decryption.");
m_storage->deleteRequest(requestState.m_requestId);
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
"No parameters are found after decryption."));
@@ -365,13 +365,13 @@
std::string challengeType = readString(paramTLV.get(tlv_selected_challenge));
auto challenge = ChallengeModule::createChallengeModule(challengeType);
if (challenge == nullptr) {
- _LOG_TRACE("Unrecognized challenge type: " << challengeType);
+ NDN_LOG_TRACE("Unrecognized challenge type: " << challengeType);
m_storage->deleteRequest(requestState.m_requestId);
m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER, "Unrecognized challenge type."));
return;
}
- _LOG_TRACE("CHALLENGE module to be load: " << challengeType);
+ NDN_LOG_TRACE("CHALLENGE module to be load: " << challengeType);
auto errorInfo = challenge->handleChallengeRequest(paramTLV, requestState);
if (std::get<0>(errorInfo) != ErrorCode::NO_ERROR) {
m_storage->deleteRequest(requestState.m_requestId);
@@ -392,20 +392,20 @@
payload.parse();
payload.push_back(makeNestedBlock(tlv_issued_cert_name, issuedCert.getName()));
payload.encode();
- _LOG_TRACE("Challenge succeeded. Certificate has been issued: " << issuedCert.getName());
+ NDN_LOG_TRACE("Challenge succeeded. Certificate has been issued: " << issuedCert.getName());
}
else if (requestState.m_requestType == RequestType::REVOKE) {
requestState.m_status = Status::SUCCESS;
m_storage->deleteRequest(requestState.m_requestId);
payload = CHALLENGE::encodeDataContent(requestState);
- _LOG_TRACE("Challenge succeeded. Certificate has been revoked");
+ NDN_LOG_TRACE("Challenge succeeded. Certificate has been revoked");
}
}
else {
m_storage->updateRequest(requestState);
payload = CHALLENGE::encodeDataContent(requestState);
- _LOG_TRACE("No failure no success. Challenge moves on");
+ NDN_LOG_TRACE("No failure no success. Challenge moves on");
}
Data result;
@@ -433,14 +433,14 @@
certName.append("NDNCERT").append(std::to_string(random::generateSecureWord64()));
newCert.setName(certName);
newCert.setContent(requestState.m_cert.getContent());
- _LOG_TRACE("cert request content " << requestState.m_cert);
+ NDN_LOG_TRACE("cert request content " << requestState.m_cert);
SignatureInfo signatureInfo;
signatureInfo.setValidityPeriod(period);
security::SigningInfo signingInfo(security::SigningInfo::SIGNER_TYPE_ID,
m_config.m_caItem.m_caPrefix, signatureInfo);
m_keyChain.sign(newCert, signingInfo);
- _LOG_TRACE("new cert got signed" << newCert);
+ NDN_LOG_TRACE("new cert got signed" << newCert);
return newCert;
}
@@ -453,14 +453,14 @@
requestId = readString(request.getName().at(m_config.m_caItem.m_caPrefix.size() + 2));
}
catch (const std::exception& e) {
- _LOG_ERROR("Cannot read the request ID out from the request: " << e.what());
+ NDN_LOG_ERROR("Cannot read the request ID out from the request: " << e.what());
}
try {
- _LOG_TRACE("Request Id to query the database " << requestId);
+ NDN_LOG_TRACE("Request Id to query the database " << requestId);
requestState = m_storage->getRequest(requestId);
}
catch (const std::exception& e) {
- _LOG_ERROR("Cannot get certificate request record from the storage: " << e.what());
+ NDN_LOG_ERROR("Cannot get certificate request record from the storage: " << e.what());
}
return requestState;
}
@@ -468,7 +468,7 @@
void
CaModule::onRegisterFailed(const std::string& reason)
{
- _LOG_ERROR("Failed to register prefix in local hub's daemon, REASON: " << reason);
+ NDN_LOG_ERROR("Failed to register prefix in local hub's daemon, REASON: " << reason);
}
Data
diff --git a/src/crypto-support/crypto-helper.cpp b/src/crypto-support/crypto-helper.cpp
index e28da4c..916bee4 100644
--- a/src/crypto-support/crypto-helper.cpp
+++ b/src/crypto-support/crypto-helper.cpp
@@ -36,7 +36,7 @@
const size_t HASH_SIZE = 32;
-_LOG_INIT(crypto-support);
+NDN_LOG_INIT(ndncert.crypto-support);
ECDHState::ECDHState()
{
@@ -377,7 +377,7 @@
void
handleErrors(const std::string& errorInfo)
{
- _LOG_DEBUG("Error in CRYPTO SUPPORT " << errorInfo);
+ NDN_LOG_DEBUG("Error in CRYPTO SUPPORT " << errorInfo);
BOOST_THROW_EXCEPTION(CryptoError("Error in CRYPTO SUPPORT: " + errorInfo));
}
diff --git a/src/identity-challenge/challenge-credential.cpp b/src/identity-challenge/challenge-credential.cpp
index e8cedf6..9cb54a6 100644
--- a/src/identity-challenge/challenge-credential.cpp
+++ b/src/identity-challenge/challenge-credential.cpp
@@ -27,7 +27,7 @@
namespace ndn {
namespace ndncert {
-_LOG_INIT(ndncert.challenge.credential);
+NDN_LOG_INIT(ndncert.challenge.credential);
NDNCERT_REGISTER_CHALLENGE(ChallengeCredential, "Credential");
const std::string ChallengeCredential::PARAMETER_KEY_CREDENTIAL_CERT = "issued-cert";
@@ -67,7 +67,7 @@
std::istringstream ss(it->second.get("certificate", ""));
auto cert = io::load<security::Certificate>(ss);
if (cert == nullptr) {
- _LOG_ERROR("Cannot load the certificate from config file");
+ NDN_LOG_ERROR("Cannot load the certificate from config file");
continue;
}
m_trustAnchors.push_back(*cert);
@@ -93,7 +93,7 @@
credential.wireDecode(elements[i + 1].blockFromValue());
}
catch (const std::exception& e) {
- _LOG_ERROR("Cannot load challenge parameter: credential " << e.what());
+ NDN_LOG_ERROR("Cannot load challenge parameter: credential " << e.what());
return returnWithError(request, ErrorCode::INVALID_PARAMETER, "Cannot challenge credential: credential." + std::string(e.what()));
}
}
@@ -118,7 +118,7 @@
}
}
- _LOG_TRACE("Cannot verify the proof of private key against credential");
+ NDN_LOG_TRACE("Cannot verify the proof of private key against credential");
return returnWithError(request, ErrorCode::INVALID_PARAMETER, "Cannot verify the proof of private key against credential.");
}
diff --git a/src/identity-challenge/challenge-email.cpp b/src/identity-challenge/challenge-email.cpp
index 4e2e249..39dd162 100644
--- a/src/identity-challenge/challenge-email.cpp
+++ b/src/identity-challenge/challenge-email.cpp
@@ -24,7 +24,7 @@
namespace ndn {
namespace ndncert {
-_LOG_INIT(ndncert.challenge.email);
+NDN_LOG_INIT(ndncert.challenge.email);
NDNCERT_REGISTER_CHALLENGE(ChallengeEmail, "email");
const std::string ChallengeEmail::NEED_CODE = "need-code";
@@ -55,20 +55,20 @@
}
auto lastComponentRequested = readString(request.m_cert.getIdentity().get(-1));
if (lastComponentRequested != emailAddress) {
- _LOG_TRACE("Email and requested name do not match. Email " << emailAddress << "requested last component " << lastComponentRequested);
+ NDN_LOG_TRACE("Email and requested name do not match. Email " << emailAddress << "requested last component " << lastComponentRequested);
}
std::string emailCode = generateSecretCode();
JsonSection secretJson;
secretJson.add(PARAMETER_KEY_CODE, emailCode);
// send out the email
sendEmail(emailAddress, emailCode, request);
- _LOG_TRACE("Secret for request " << request.m_requestId << " : " << emailCode);
+ NDN_LOG_TRACE("Secret for request " << request.m_requestId << " : " << emailCode);
return returnWithNewChallengeStatus(request, NEED_CODE, std::move(secretJson), m_maxAttemptTimes, m_secretLifetime);
}
if (request.m_challengeState) {
if (request.m_challengeState->m_challengeStatus == NEED_CODE ||
request.m_challengeState->m_challengeStatus == WRONG_CODE) {
- _LOG_TRACE("Challenge Interest arrives. Challenge Status: " << request.m_challengeState->m_challengeStatus);
+ NDN_LOG_TRACE("Challenge Interest arrives. Challenge Status: " << request.m_challengeState->m_challengeStatus);
// the incoming interest should bring the pin code
std::string givenCode = readString(params.get(tlv_parameter_value));
auto secret = request.m_challengeState->m_secrets;
@@ -79,20 +79,20 @@
// check if provided secret is correct
if (givenCode == secret.get<std::string>(PARAMETER_KEY_CODE)) {
// the code is correct
- _LOG_TRACE("Correct secret code. Challenge succeeded.");
+ NDN_LOG_TRACE("Correct secret code. Challenge succeeded.");
return returnWithSuccess(request);
}
// otherwise, check remaining attempt times
if (request.m_challengeState->m_remainingTries > 1) {
auto remainTime = m_secretLifetime - (currentTime - request.m_challengeState->m_timestamp);
- _LOG_TRACE("Wrong secret code provided. Remaining Tries - 1.");
+ NDN_LOG_TRACE("Wrong secret code provided. Remaining Tries - 1.");
return returnWithNewChallengeStatus(request, WRONG_CODE, std::move(secret),
request.m_challengeState->m_remainingTries - 1,
time::duration_cast<time::seconds>(remainTime));
}
else {
// run out times
- _LOG_TRACE("Wrong secret code provided. Ran out tires. Challenge failed.");
+ NDN_LOG_TRACE("Wrong secret code provided. Ran out tires. Challenge failed.");
return returnWithError(request, ErrorCode::OUT_OF_TRIES, "Ran out tires.");
}
}
@@ -163,9 +163,9 @@
command += " \"" + emailAddress + "\" \"" + secret + "\" \"" + request.m_caPrefix.toUri() + "\" \"" + request.m_cert.getName().toUri() + "\"";
int result = system(command.c_str());
if (result == -1) {
- _LOG_TRACE("EmailSending Script " + m_sendEmailScript + " fails.");
+ NDN_LOG_TRACE("EmailSending Script " + m_sendEmailScript + " fails.");
}
- _LOG_TRACE("EmailSending Script " + m_sendEmailScript +
+ NDN_LOG_TRACE("EmailSending Script " + m_sendEmailScript +
" was executed successfully with return value" + std::to_string(result) + ".");
return;
}
diff --git a/src/identity-challenge/challenge-pin.cpp b/src/identity-challenge/challenge-pin.cpp
index cd2c03e..d7416c5 100644
--- a/src/identity-challenge/challenge-pin.cpp
+++ b/src/identity-challenge/challenge-pin.cpp
@@ -24,7 +24,7 @@
namespace ndn {
namespace ndncert {
-_LOG_INIT(ndncert.challenge.pin);
+NDN_LOG_INIT(ndncert.challenge.pin);
NDNCERT_REGISTER_CHALLENGE(ChallengePin, "pin");
const std::string ChallengePin::NEED_CODE = "need-code";
@@ -43,18 +43,18 @@
params.parse();
auto currentTime = time::system_clock::now();
if (request.m_status == Status::BEFORE_CHALLENGE) {
- _LOG_TRACE("Challenge Interest arrives. Init the challenge");
+ NDN_LOG_TRACE("Challenge Interest arrives. Init the challenge");
// for the first time, init the challenge
std::string secretCode = generateSecretCode();
JsonSection secretJson;
secretJson.add(PARAMETER_KEY_CODE, secretCode);
- _LOG_TRACE("Secret for request " << request.m_requestId << " : " << secretCode);
+ NDN_LOG_TRACE("Secret for request " << request.m_requestId << " : " << secretCode);
return returnWithNewChallengeStatus(request, NEED_CODE, std::move(secretJson), m_maxAttemptTimes, m_secretLifetime);
}
if (request.m_challengeState) {
if (request.m_challengeState->m_challengeStatus == NEED_CODE ||
request.m_challengeState->m_challengeStatus == WRONG_CODE) {
- _LOG_TRACE("Challenge Interest arrives. Challenge Status: " << request.m_challengeState->m_challengeStatus);
+ NDN_LOG_TRACE("Challenge Interest arrives. Challenge Status: " << request.m_challengeState->m_challengeStatus);
// the incoming interest should bring the pin code
std::string givenCode = readString(params.get(tlv_parameter_value));
auto secret = request.m_challengeState->m_secrets;
@@ -62,20 +62,20 @@
return returnWithError(request, ErrorCode::OUT_OF_TIME, "Secret expired.");
}
if (givenCode == secret.get<std::string>(PARAMETER_KEY_CODE)) {
- _LOG_TRACE("Correct PIN code. Challenge succeeded.");
+ NDN_LOG_TRACE("Correct PIN code. Challenge succeeded.");
return returnWithSuccess(request);
}
// check rest attempt times
if (request.m_challengeState->m_remainingTries > 1) {
auto remainTime = m_secretLifetime - (currentTime - request.m_challengeState->m_timestamp);
- _LOG_TRACE("Wrong PIN code provided. Remaining Tries - 1.");
+ NDN_LOG_TRACE("Wrong PIN code provided. Remaining Tries - 1.");
return returnWithNewChallengeStatus(request, WRONG_CODE, std::move(secret),
request.m_challengeState->m_remainingTries - 1,
time::duration_cast<time::seconds>(remainTime));
}
else {
// run out times
- _LOG_TRACE("Wrong PIN code provided. Ran out tires. Challenge failed.");
+ NDN_LOG_TRACE("Wrong PIN code provided. Ran out tires. Challenge failed.");
return returnWithError(request, ErrorCode::OUT_OF_TRIES, "Ran out tires.");
}
}
diff --git a/src/ndncert-common.hpp b/src/ndncert-common.hpp
index cffef1a..c458be7 100644
--- a/src/ndncert-common.hpp
+++ b/src/ndncert-common.hpp
@@ -62,14 +62,7 @@
namespace ndncert {
using boost::noncopyable;
-using ndn::Block;
-using ndn::Data;
-using ndn::Interest;
-using ndn::make_unique;
-using ndn::Name;
-using ndn::PartialName;
-using ndn::time::system_clock;
-using ndn::time::toUnixTimestamp;
+using time::system_clock;
using std::bind;
using std::enable_shared_from_this;
using std::function;
@@ -79,11 +72,6 @@
using std::unique_ptr;
using std::weak_ptr;
-#define _LOG_INIT(name) NDN_LOG_INIT(ndncert.name)
-#define _LOG_DEBUG(x) NDN_LOG_DEBUG(__FILE__ << ":" << __LINE__ << ":" << " " << x)
-#define _LOG_TRACE(x) NDN_LOG_TRACE(__FILE__ << ":" << __LINE__ << ":" << " " << x)
-#define _LOG_ERROR(x) NDN_LOG_ERROR(x)
-
enum : uint32_t {
tlv_ca_prefix = 129,
tlv_ca_info = 131,
diff --git a/src/protocol-detail/new-renew-revoke.cpp b/src/protocol-detail/new-renew-revoke.cpp
index 2fecb4d..f153c40 100644
--- a/src/protocol-detail/new-renew-revoke.cpp
+++ b/src/protocol-detail/new-renew-revoke.cpp
@@ -28,7 +28,7 @@
namespace ndn {
namespace ndncert {
-_LOG_INIT(ndncert.encoding.new_renew_revoke);
+NDN_LOG_INIT(ndncert.encoding.new_renew_revoke);
Block
NEW_RENEW_REVOKE::encodeApplicationParameters(RequestType requestType, const std::string& ecdhPub, const security::Certificate& certRequest)
@@ -41,7 +41,7 @@
>> security::transform::streamSink(ss);
}
catch (const security::transform::Error& e) {
- _LOG_ERROR("Cannot convert self-signed cert into BASE64 string " << e.what());
+ NDN_LOG_ERROR("Cannot convert self-signed cert into BASE64 string " << e.what());
return request;
}
diff --git a/src/requester.cpp b/src/requester.cpp
index 4cb4135..16665a3 100644
--- a/src/requester.cpp
+++ b/src/requester.cpp
@@ -38,7 +38,7 @@
namespace ndn {
namespace ndncert {
-_LOG_INIT(ndncert.client);
+NDN_LOG_INIT(ndncert.client);
shared_ptr<Interest>
Requester::genCaProfileDiscoveryInterest(const Name& caName)
@@ -66,7 +66,7 @@
{
auto caItem = INFO::decodeDataContent(reply.getContent());
if (!security::verifySignature(reply, *caItem.m_cert)) {
- _LOG_ERROR("Cannot verify replied Data packet signature.");
+ NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
}
return caItem;
@@ -80,7 +80,7 @@
auto certBlock = caItem.m_cert->wireEncode();
caItem.m_cert = std::make_shared<security::Certificate>(certBlock);
if (caItem.m_cert->getFullName() != caCertFullName) {
- _LOG_ERROR("Ca profile does not match the certificate information offered by the original CA.");
+ NDN_LOG_ERROR("Ca profile does not match the certificate information offered by the original CA.");
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
}
return onCaProfileResponse(reply);
@@ -103,7 +103,7 @@
std::vector<std::pair<Name, int>>& identityNames, std::vector<Name>& otherCas)
{
if (!security::verifySignature(reply, *ca.m_cert)) {
- _LOG_ERROR("Cannot verify replied Data packet signature.");
+ NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
return;
}
@@ -192,7 +192,7 @@
Requester::onNewRenewRevokeResponse(RequesterState& state, const Data& reply)
{
if (!security::verifySignature(reply, *state.m_caItem.m_cert)) {
- _LOG_ERROR("Cannot verify replied Data packet signature.");
+ NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
}
processIfError(reply);
@@ -254,7 +254,7 @@
Requester::onChallengeResponse(RequesterState& state, const Data& reply)
{
if (!security::verifySignature(reply, *state.m_caItem.m_cert)) {
- _LOG_ERROR("Cannot verify replied Data packet signature.");
+ NDN_LOG_ERROR("Cannot verify replied Data packet signature.");
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot verify replied Data packet signature."));
}
processIfError(reply);
@@ -280,7 +280,7 @@
return std::make_shared<security::Certificate>(reply);
}
catch (const std::exception& e) {
- _LOG_ERROR("Cannot parse replied certificate ");
+ NDN_LOG_ERROR("Cannot parse replied certificate ");
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot parse replied certificate "));
return nullptr;
}
@@ -312,7 +312,7 @@
if (std::get<0>(errorInfo) == ErrorCode::NO_ERROR) {
return;
}
- _LOG_ERROR("Error info replied from the CA with Error code: " +
+ NDN_LOG_ERROR("Error info replied from the CA with Error code: " +
errorCodeToString(std::get<0>(errorInfo)) +
" and Error Info: " + std::get<1>(errorInfo));
BOOST_THROW_EXCEPTION(std::runtime_error("Error info replied from the CA with Error code: " +