Add command line tools
Change-Id: I5bce4074324b35e5079b330dc20e14c22fc74c6b
diff --git a/src/challenge-module/challenge-pin.cpp b/src/challenge-module/challenge-pin.cpp
index d21420c..8507bcf 100644
--- a/src/challenge-module/challenge-pin.cpp
+++ b/src/challenge-module/challenge-pin.cpp
@@ -19,12 +19,15 @@
*/
#include "challenge-pin.hpp"
+#include "logging.hpp"
#include "json-helper.hpp"
#include <ndn-cxx/util/random.hpp>
namespace ndn {
namespace ndncert {
+_LOG_INIT(ndncert.challenge-pin);
+
NDNCERT_REGISTER_CHALLENGE(ChallengePin, "PIN");
const std::string ChallengePin::NEED_CODE = "need-code";
@@ -49,9 +52,11 @@
// interest format: /caName/CA/_SELECT/{"request-id":"id"}/PIN/<signature>
request.setStatus(NEED_CODE);
request.setChallengeType(CHALLENGE_TYPE);
+ std::string secretCode = generateSecretCode();
request.setChallengeSecrets(generateStoredSecrets(time::system_clock::now(),
- generateSecretCode(),
+ secretCode,
m_maxAttemptTimes));
+ _LOG_TRACE("Secret for request " << request.getRequestId() << " : " << secretCode);
return genResponseChallengeJson(request.getRequestId(), CHALLENGE_TYPE, NEED_CODE);
}