Switch to new KeyChain where possible
signed_interest::POS_RANDOM_VAL and signed_interest::POS_TIMESTAMP
constants are deprecated. Use command_interest:: equivalents instead.
This commit also includes fix for the backward compatibility regression
due to move of deprecated TPM/PublicInfo header files.
Change-Id: Ic3b008fc6758f3ac83f191158b6ac0789483f90d
Refs: #3098
diff --git a/src/security/conf/checker.hpp b/src/security/conf/checker.hpp
index 0bed1a9..b928906 100644
--- a/src/security/conf/checker.hpp
+++ b/src/security/conf/checker.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -48,12 +48,6 @@
typedef function<void(const shared_ptr<const Data>&)> OnDataChecked;
typedef function<void(const shared_ptr<const Data>&, const std::string&)> OnDataCheckFailed;
- enum {
- INTEREST_SIG_VALUE = -1,
- INTEREST_SIG_INFO = -2
- };
-
-
virtual
~Checker()
{
@@ -115,8 +109,8 @@
{
try {
const Name& interestName = interest.getName();
- Signature signature(interestName[Checker::INTEREST_SIG_INFO].blockFromValue(),
- interestName[Checker::INTEREST_SIG_VALUE].blockFromValue());
+ Signature signature(interestName[command_interest::POS_SIG_INFO].blockFromValue(),
+ interestName[command_interest::POS_SIG_VALUE].blockFromValue());
return check(interest, signature);
}
catch (const Signature::Error& e) {
@@ -222,8 +216,8 @@
{
try {
const Name& interestName = interest.getName();
- Signature signature(interestName[Checker::INTEREST_SIG_INFO].blockFromValue(),
- interestName[Checker::INTEREST_SIG_VALUE].blockFromValue());
+ Signature signature(interestName[command_interest::POS_SIG_INFO].blockFromValue(),
+ interestName[command_interest::POS_SIG_VALUE].blockFromValue());
return check(interest, signature);
}
catch (const Signature::Error& e) {
diff --git a/src/security/conf/filter.hpp b/src/security/conf/filter.hpp
index d191b1b..2ebc4e6 100644
--- a/src/security/conf/filter.hpp
+++ b/src/security/conf/filter.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -63,10 +63,10 @@
bool
match(const Interest& interest)
{
- if (interest.getName().size() < signed_interest::MIN_LENGTH)
+ if (interest.getName().size() < command_interest::MIN_SIZE)
return false;
- Name unsignedName = interest.getName().getPrefix(-signed_interest::MIN_LENGTH);
+ Name unsignedName = interest.getName().getPrefix(-command_interest::MIN_SIZE);
return matchName(unsignedName);
}
diff --git a/src/security/conf/key-locator-checker.hpp b/src/security/conf/key-locator-checker.hpp
index 7a9ff0b..04f43e0 100644
--- a/src/security/conf/key-locator-checker.hpp
+++ b/src/security/conf/key-locator-checker.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -75,13 +75,13 @@
const KeyLocator& keyLocator,
std::string& failInfo)
{
- if (interest.getName().size() < signed_interest::MIN_LENGTH)
+ if (interest.getName().size() < command_interest::MIN_SIZE)
{
failInfo = "No Signature";
return false;
}
- Name signedName = interest.getName().getPrefix(-signed_interest::MIN_LENGTH);
+ Name signedName = interest.getName().getPrefix(-command_interest::MIN_SIZE);
return check(signedName, keyLocator, failInfo);
}