security: Include timestamp and nonce in signed interest and provide timestamp checking in ValidatorConf
Change-Id: I0adebd5c06b2d8d35ba13c5c03828b03334b7cec
Refs: #1642
diff --git a/src/security/conf/key-locator-checker.hpp b/src/security/conf/key-locator-checker.hpp
index 21ff8b6..52cf888 100644
--- a/src/security/conf/key-locator-checker.hpp
+++ b/src/security/conf/key-locator-checker.hpp
@@ -27,6 +27,7 @@
#include "../../common.hpp"
#include "../../data.hpp"
#include "../../interest.hpp"
+#include "../security-common.hpp"
#include <boost/algorithm/string.hpp>
#include "common.hpp"
@@ -37,6 +38,15 @@
class KeyLocatorCheckerFactory;
+/**
+ * @brief KeyLocatorChecker is one of the classes used by ValidatorConfig.
+ *
+ * The ValidatorConfig class consists of a set of rules.
+ * The KeyLocatorChecker class is part of a rule and is used to check if the KeyLocator field of a
+ * packet satisfy the requirements.
+ */
+
+
class KeyLocatorChecker
{
public:
@@ -65,13 +75,13 @@
const KeyLocator& keyLocator,
std::string& failInfo)
{
- if (interest.getName().size() < 2)
+ if (interest.getName().size() < signed_interest::MIN_LENGTH)
{
failInfo = "No Signature";
return false;
}
- Name signedName = interest.getName().getPrefix(-2);
+ Name signedName = interest.getName().getPrefix(-signed_interest::MIN_LENGTH);
return check(signedName, keyLocator, failInfo);
}