simplify client new/revoke
Change-Id: Ieffad88163393ec6f5a1e04e200df524dbf2c447
diff --git a/src/client-module.cpp b/src/client-module.cpp
index 024c23e..96d4dfe 100644
--- a/src/client-module.cpp
+++ b/src/client-module.cpp
@@ -212,13 +212,7 @@
}
std::list<std::string>
-ClientModule::onNewResponse(const Data& reply)
-{
- return onRequestInitResponse(reply, RequestType::NEW);
-}
-
-std::list<std::string>
-ClientModule::onRequestInitResponse(const Data& reply, RequestType requestType)
+ClientModule::onNewRenewRevokeResponse(const Data& reply)
{
if (!security::verifySignature(reply, m_ca.m_anchor)) {
_LOG_ERROR("Cannot verify data signature from " << m_ca.m_caPrefix.toUri());
@@ -278,12 +272,6 @@
return interest;
}
-std::list<std::string>
-ClientModule::onRevokeResponse(const Data& reply)
-{
- return onRequestInitResponse(reply, RequestType::REVOKE);
-}
-
shared_ptr<Interest>
ClientModule::generateChallengeInterest(const Block& challengeRequest)
{
diff --git a/src/client-module.hpp b/src/client-module.hpp
index 394c584..e75e190 100644
--- a/src/client-module.hpp
+++ b/src/client-module.hpp
@@ -93,17 +93,11 @@
const time::system_clock::TimePoint& notAfter,
const Name& identityName = Name(), const shared_ptr<Data>& probeToken = nullptr);
- std::list<std::string>
- onNewResponse(const Data& reply);
-
shared_ptr<Interest>
generateRevokeInterest(const security::v2::Certificate& certificate);
std::list<std::string>
- onRevokeResponse(const Data& reply);
-
- std::list<std::string>
- onRequestInitResponse(const Data& reply, RequestType requestType);
+ onNewRenewRevokeResponse(const Data& reply);
shared_ptr<Interest>
generateChallengeInterest(const Block& paramTLV);
diff --git a/tests/unit-tests/bench.t.cpp b/tests/unit-tests/bench.t.cpp
index 81f9cf4..d2b37a6 100644
--- a/tests/unit-tests/bench.t.cpp
+++ b/tests/unit-tests/bench.t.cpp
@@ -109,7 +109,7 @@
face.onSendData.connect([&](const Data& response) {
if (Name("/ndn/CA/NEW").isPrefixOf(response.getName())) {
std::cout << "NEW Data Size: " << response.wireEncode().size() << std::endl;
- client.onNewResponse(response);
+ client.onNewRenewRevokeResponse(response);
auto paramList = pinChallenge.getRequestedParameterList(client.m_status, client.m_challengeStatus);
challengeInterest = client.generateChallengeInterest(pinChallenge.genChallengeRequestTLV(client.m_status,
client.m_challengeStatus,
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index 4f2c092..f3fde9d 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -201,7 +201,7 @@
BOOST_CHECK(challengeBlockCount != 0);
- client.onNewResponse(response);
+ client.onNewRenewRevokeResponse(response);
BOOST_CHECK_EQUAL_COLLECTIONS(client.m_aesKey, client.m_aesKey + sizeof(client.m_aesKey),
ca.m_aesKey, ca.m_aesKey + sizeof(ca.m_aesKey));
});
@@ -364,7 +364,7 @@
int count = 0;
face.onSendData.connect([&](const Data& response) {
if (Name("/ndn/CA/NEW").isPrefixOf(response.getName())) {
- client.onNewResponse(response);
+ client.onNewRenewRevokeResponse(response);
auto paramList = pinChallenge.getRequestedParameterList(client.m_status, client.m_challengeStatus);
challengeInterest = client.generateChallengeInterest(pinChallenge.genChallengeRequestTLV(client.m_status,
client.m_challengeStatus,
@@ -472,7 +472,7 @@
BOOST_CHECK(challengeBlockCount != 0);
- client.onRevokeResponse(response);
+ client.onNewRenewRevokeResponse(response);
BOOST_CHECK_EQUAL_COLLECTIONS(client.m_aesKey, client.m_aesKey + sizeof(client.m_aesKey),
ca.m_aesKey, ca.m_aesKey + sizeof(ca.m_aesKey));
});
diff --git a/tools/ndncert-client.cpp b/tools/ndncert-client.cpp
index 096ceb2..2266a25 100644
--- a/tools/ndncert-client.cpp
+++ b/tools/ndncert-client.cpp
@@ -146,7 +146,7 @@
newCb(const Data& reply)
{
int challengeIndex = 0;
- auto challengeList = client.onNewResponse(reply);
+ auto challengeList = client.onNewRenewRevokeResponse(reply);
if (challengeList.size() < 1) {
std::cerr << "There is no available challenge provided by the CA. Exit" << std::endl;
return;