security: Fix Validator::verifySignature bug
Refs: #1467
Change-Id: I2b69ccf15ede35c8b201c74ddf786e7b136fe421
diff --git a/src/security/validator.hpp b/src/security/validator.hpp
index 2b55782..32a5ab6 100644
--- a/src/security/validator.hpp
+++ b/src/security/validator.hpp
@@ -114,10 +114,10 @@
if (interest.getName().size() < 2)
return false;
- Name signedName = interest.getName().getPrefix(-2);
+ const Name& name = interest.getName();
- return verifySignature(signedName.wireEncode().value(),
- signedName.wireEncode().value_size(),
+ return verifySignature(name.wireEncode().value(),
+ name.wireEncode().value_size() - name[-1].size(),
sig, publicKey);
}