security: Allow KeyChain to sign interest using SHA256 digest
Change-Id: I729c5e32aeb1b9e78582becec1bc183aada6ee95
Refs: #2218
diff --git a/src/security/validator.hpp b/src/security/validator.hpp
index 3fe58f3..5311795 100644
--- a/src/security/validator.hpp
+++ b/src/security/validator.hpp
@@ -180,10 +180,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);
}