Fix bug in challenge module about component index. Also add some LOG points
Change-Id: I8ec737ef9d7177becbe84055efa2438efab02225
diff --git a/src/challenge-module/challenge-pin.cpp b/src/challenge-module/challenge-pin.cpp
index 1aa96ce..d21420c 100644
--- a/src/challenge-module/challenge-pin.cpp
+++ b/src/challenge-module/challenge-pin.cpp
@@ -46,7 +46,7 @@
JsonSection
ChallengePin::processSelectInterest(const Interest& interest, CertificateRequest& request)
{
- // interest format: /CA/_SELECT/{"request-id":"id"}/PIN/<signature>
+ // interest format: /caName/CA/_SELECT/{"request-id":"id"}/PIN/<signature>
request.setStatus(NEED_CODE);
request.setChallengeType(CHALLENGE_TYPE);
request.setChallengeSecrets(generateStoredSecrets(time::system_clock::now(),
@@ -58,8 +58,8 @@
JsonSection
ChallengePin::processValidateInterest(const Interest& interest, CertificateRequest& request)
{
- // interest format: /CA/_VALIDATION/{"request-id":"id"}/PIN/{"code":"code"}/<signature>
- JsonSection infoJson = getJsonFromNameComponent(interest.getName(), request.getCaName().size() + 3);
+ // interest format: /caName/CA/_VALIDATION/{"request-id":"id"}/PIN/{"code":"code"}/<signature>
+ JsonSection infoJson = getJsonFromNameComponent(interest.getName(), request.getCaName().size() + 4);
std::string givenCode = infoJson.get<std::string>(JSON_PIN_CODE);
const auto parsedSecret = parseStoredSecrets(request.getChallengeSecrets());