security: Disable security temporarily
Refs: #1530
Change-Id: If46346f424c7413d29aa312a2d924dbcb97ee04e
diff --git a/src/communication/data-manager.cpp b/src/communication/data-manager.cpp
index bcae456..f56dd79 100644
--- a/src/communication/data-manager.cpp
+++ b/src/communication/data-manager.cpp
@@ -9,7 +9,7 @@
#include "data-manager.hpp"
#include "utility/tokenizer.hpp"
#include "lsdb.hpp"
-#include "security/key-manager.hpp"
+// #include "security/key-manager.hpp"
namespace nlsr {
@@ -30,7 +30,7 @@
}
else
{
- if (m_nlsr.getKeyManager().verify(data))
+ // if (m_nlsr.getKeyManager().verify(data))
{
std::cout << "Verified Data Content" << std::endl;
chkString = "info";
@@ -46,10 +46,10 @@
processContentLsa(dataName, dataContent);
}
}
- else
- {
- std::cout << "Unverified Data Content. Discarded" << std::endl;
- }
+ // else
+ // {
+ // std::cout << "Unverified Data Content. Discarded" << std::endl;
+ // }
}
}
@@ -200,14 +200,14 @@
uint32_t seqNum = boost::lexical_cast<uint32_t>(nt.getToken(
nt.getTokenNumber() - 2));
std::cout << "Cert Name: " << certName << " Seq Num: " << seqNum << std::endl;
- if (m_nlsr.getKeyManager().verify(m_nlsr, *(cert)))
- {
- m_nlsr.getKeyManager().addCertificate(cert, seqNum, true);
- }
- else
- {
- m_nlsr.getKeyManager().addCertificate(cert, seqNum, false);
- }
- m_nlsr.getKeyManager().printCertStore();
+ // if (m_nlsr.getKeyManager().verify(m_nlsr, *(cert)))
+ // {
+ // m_nlsr.getKeyManager().addCertificate(cert, seqNum, true);
+ // }
+ // else
+ // {
+ // m_nlsr.getKeyManager().addCertificate(cert, seqNum, false);
+ // }
+ // m_nlsr.getKeyManager().printCertStore();
}
}//namespace nlsr
diff --git a/src/communication/interest-manager.cpp b/src/communication/interest-manager.cpp
index 226efaf..070c92b 100644
--- a/src/communication/interest-manager.cpp
+++ b/src/communication/interest-manager.cpp
@@ -52,7 +52,8 @@
Data data(ndn::Name(interest.getName()).appendVersion());
data.setFreshnessPeriod(time::seconds(10)); // 10 sec
data.setContent((const uint8_t*)"info", sizeof("info"));
- m_nlsr.getKeyManager().signData(data);
+ // m_nlsr.getKeyManager().signData(data);
+ m_keyChain.sign(data);
cout << ">> D: " << data << endl;
m_nlsr.getNlsrFace()->put(data);
int status = m_nlsr.getAdl().getStatusOfNeighbor(neighbor);
@@ -125,7 +126,8 @@
data.setFreshnessPeriod(time::seconds(10)); // 10 sec
string content = nameLsa->getData();
data.setContent((const uint8_t*)content.c_str(), content.size());
- m_nlsr.getKeyManager().signData(data);
+ // m_nlsr.getKeyManager().signData(data);
+ m_keyChain.sign(data);
std::cout << ">> D: " << data << std::endl;
m_nlsr.getNlsrFace()->put(data);
}
@@ -145,7 +147,8 @@
data.setFreshnessPeriod(time::seconds(10)); // 10 sec
string content = adjLsa->getData();
data.setContent((const uint8_t*)content.c_str(), content.size());
- m_nlsr.getKeyManager().signData(data);
+ // m_nlsr.getKeyManager().signData(data);
+ m_keyChain.sign(data);
std::cout << ">> D: " << data << std::endl;
m_nlsr.getNlsrFace()->put(data);
}
@@ -165,7 +168,8 @@
data.setFreshnessPeriod(time::seconds(10)); // 10 sec
string content = corLsa->getData();
data.setContent((const uint8_t*)content.c_str(), content.size());
- m_nlsr.getKeyManager().signData(data);
+ // m_nlsr.getKeyManager().signData(data);
+ m_keyChain.sign(data);
std::cout << ">> D: " << data << std::endl;
m_nlsr.getNlsrFace()->put(data);
}
@@ -176,56 +180,56 @@
InterestManager::processInterestKeys(const ndn::Interest& interest)
{
std::cout << "processInterestKeys called " << std::endl;
- string intName = interest.getName().toUri();
- std::cout << "Interest Name for Key: " << intName << std::endl;
- Tokenizer nt(intName, "/");
- std::string chkString("ID-CERT");
- std::string certName;
- uint32_t seqNum;
- ndn::Name dataName;
- std::pair<ndn::shared_ptr<ndn::IdentityCertificate>, bool> chkCert;
- if (nt.getTokenPosition(chkString) == nt.getTokenNumber() - 1)
- {
- certName = nt.getTokenString(0, nt.getTokenNumber() - 1);
- cout << "Cert Name: " << certName << std::endl;
- chkCert = m_nlsr.getKeyManager().getCertificateFromStore(certName);
- }
- else
- {
- certName = nt.getTokenString(0, nt.getTokenNumber() - 2);
- seqNum = boost::lexical_cast<uint32_t>(nt.getToken(nt.getTokenNumber() - 1));
- std::cout << "Cert Name: " << certName << " Seq Num: " << seqNum << std::endl;
- chkCert = m_nlsr.getKeyManager().getCertificateFromStore(certName, seqNum);
- }
- if (chkCert.second)
- {
- if (nt.getTokenPosition(chkString) == nt.getTokenNumber() - 1)
- {
- std::string dn;
- dataName = ndn::Name(interest.getName()).appendVersion();
- std::pair<uint32_t, bool> seqChk =
- m_nlsr.getKeyManager().getCertificateSeqNum(certName);
- if (seqChk.second)
- {
- dn = dataName.toUri() + "/" + boost::lexical_cast<std::string>(seqChk.first);
- dataName = ndn::Name(dn);
- }
- else
- {
- dn = dataName.toUri() + "/" + boost::lexical_cast<std::string>(10);
- dataName = ndn::Name(dn);
- }
- }
- else
- {
- dataName = ndn::Name(interest.getName());
- }
- Data data(dataName.appendVersion());
- data.setFreshnessPeriod(time::seconds(10)); //10 sec
- data.setContent(chkCert.first->wireEncode());
- m_nlsr.getKeyManager().signData(data);
- m_nlsr.getNlsrFace()->put(data);
- }
+ // string intName = interest.getName().toUri();
+ // std::cout << "Interest Name for Key: " << intName << std::endl;
+ // Tokenizer nt(intName, "/");
+ // std::string chkString("ID-CERT");
+ // std::string certName;
+ // uint32_t seqNum;
+ // ndn::Name dataName;
+ // std::pair<ndn::shared_ptr<ndn::IdentityCertificate>, bool> chkCert;
+ // if (nt.getTokenPosition(chkString) == nt.getTokenNumber() - 1)
+ // {
+ // certName = nt.getTokenString(0, nt.getTokenNumber() - 1);
+ // cout << "Cert Name: " << certName << std::endl;
+ // chkCert = m_nlsr.getKeyManager().getCertificateFromStore(certName);
+ // }
+ // else
+ // {
+ // certName = nt.getTokenString(0, nt.getTokenNumber() - 2);
+ // seqNum = boost::lexical_cast<uint32_t>(nt.getToken(nt.getTokenNumber() - 1));
+ // std::cout << "Cert Name: " << certName << " Seq Num: " << seqNum << std::endl;
+ // chkCert = m_nlsr.getKeyManager().getCertificateFromStore(certName, seqNum);
+ // }
+ // if (chkCert.second)
+ // {
+ // if (nt.getTokenPosition(chkString) == nt.getTokenNumber() - 1)
+ // {
+ // std::string dn;
+ // dataName = ndn::Name(interest.getName()).appendVersion();
+ // std::pair<uint32_t, bool> seqChk =
+ // m_nlsr.getKeyManager().getCertificateSeqNum(certName);
+ // if (seqChk.second)
+ // {
+ // dn = dataName.toUri() + "/" + boost::lexical_cast<std::string>(seqChk.first);
+ // dataName = ndn::Name(dn);
+ // }
+ // else
+ // {
+ // dn = dataName.toUri() + "/" + boost::lexical_cast<std::string>(10);
+ // dataName = ndn::Name(dn);
+ // }
+ // }
+ // else
+ // {
+ // dataName = ndn::Name(interest.getName());
+ // }
+ // Data data(dataName.appendVersion());
+ // data.setFreshnessPeriod(time::seconds(10)); //10 sec
+ // data.setContent(chkCert.first->wireEncode());
+ // m_nlsr.getKeyManager().signData(data);
+ // m_nlsr.getNlsrFace()->put(data);
+ // }
}
diff --git a/src/communication/interest-manager.hpp b/src/communication/interest-manager.hpp
index 86d590b..725103d 100644
--- a/src/communication/interest-manager.hpp
+++ b/src/communication/interest-manager.hpp
@@ -62,6 +62,7 @@
private:
Nlsr& m_nlsr;
+ ndn::KeyChain m_keyChain;
};
}//namespace nlsr
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 696f06a..16b92bc 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -1,6 +1,6 @@
#include "nlsr.hpp"
#include "sync-logic-handler.hpp"
-#include "security/key-manager.hpp"
+// #include "security/key-manager.hpp"
#include "utility/tokenizer.hpp"
@@ -61,7 +61,7 @@
{
//process keys update here
std::string certName = nt.getTokenString(0);
- processKeysUpdateFromSync(certName, seqNo, pnlsr);
+ // processKeysUpdateFromSync(certName, seqNo, pnlsr);
}
}
@@ -107,19 +107,19 @@
}
}
-void
-SyncLogicHandler::processKeysUpdateFromSync(std::string certName,
- uint64_t seqNo, Nlsr& pnlsr)
-{
- std::cout << "Cert Name: " << certName << std::endl;
- if (pnlsr.getKeyManager().isNewCertificate(certName, seqNo))
- {
- string certNamePrefix = certName + "/" +
- boost::lexical_cast<string>(seqNo);
- pnlsr.getIm().expressInterest(certNamePrefix, 3,
- pnlsr.getConfParameter().getInterestResendTime());
- }
-}
+// void
+// SyncLogicHandler::processKeysUpdateFromSync(std::string certName,
+// uint64_t seqNo, Nlsr& pnlsr)
+// {
+// std::cout << "Cert Name: " << certName << std::endl;
+// // if (pnlsr.getKeyManager().isNewCertificate(certName, seqNo))
+// {
+// string certNamePrefix = certName + "/" +
+// boost::lexical_cast<string>(seqNo);
+// pnlsr.getIm().expressInterest(certNamePrefix, 3,
+// pnlsr.getConfParameter().getInterestResendTime());
+// }
+// }
void
SyncLogicHandler::publishRoutingUpdate(SequencingManager& sm,
@@ -129,11 +129,11 @@
publishSyncUpdate(updatePrefix, sm.getCombinedSeqNo());
}
-void
-SyncLogicHandler::publishKeyUpdate(KeyManager& km)
-{
- publishSyncUpdate(km.getProcessCertName().toUri(), km.getCertSeqNo());
-}
+// void
+// SyncLogicHandler::publishKeyUpdate(KeyManager& km)
+// {
+// publishSyncUpdate(km.getProcessCertName().toUri(), km.getCertSeqNo());
+// }
void
SyncLogicHandler::publishIdentityUpdate(string identityName)
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index 8fd29fe..05123ff 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -10,7 +10,7 @@
#include "sequencing-manager.hpp"
-class KeyManager;
+// class KeyManager;
extern "C" {
#include <unistd.h>
@@ -46,8 +46,8 @@
void
publishRoutingUpdate(SequencingManager& sm, string updatePrefix);
- void
- publishKeyUpdate(KeyManager& km);
+ // void
+ // publishKeyUpdate(KeyManager& km);
void
publishIdentityUpdate(string identityName);
@@ -67,8 +67,8 @@
processRoutingUpdateFromSync(std::string routerName, uint64_t seqNo,
Nlsr& pnlsr);
- void
- processKeysUpdateFromSync(std::string certName, uint64_t seqNo, Nlsr& pnlsr);
+ // void
+ // processKeysUpdateFromSync(std::string certName, uint64_t seqNo, Nlsr& pnlsr);
void
publishSyncUpdate(string updatePrefix, uint64_t seqNo);