Changes to adopt to latest ndn-cxx
refs: #4292, #4155
Change-Id: Ifb0d94e23cb3a4efc82246b45578b1d5fc04ac67
diff --git a/install.sh b/install.sh
index c9a4b3c..ecf0d0f 100755
--- a/install.sh
+++ b/install.sh
@@ -99,13 +99,8 @@
$install libpcap-devel
fi
- git clone https://github.com/named-data/NFD
+ git clone --depth 1 https://github.com/named-data/NFD
cd NFD
- current=$(git rev-parse HEAD)
- if [[ $current != "f4056d0242536f85b7d7b4de1b5ac50dad65c233" ]]; then
- git checkout f4056d0242536f85b7d7b4de1b5ac50dad65c233
- git checkout -b fix-commit
- fi
./waf configure --without-websocket
./waf
sudo ./waf install
@@ -126,13 +121,8 @@
$install log4cxx log4cxx-devel openssl-devel
fi
- git clone https://github.com/named-data/ChronoSync
+ git clone --depth 1 https://github.com/named-data/ChronoSync
cd ChronoSync
- current=$(git rev-parse HEAD)
- if [[ $current != "097bb448f46b8bd9a5c1f431e824f8f6a169b650" ]]; then
- git checkout 097bb448f46b8bd9a5c1f431e824f8f6a169b650
- git checkout -b fix-commit
- fi
./waf configure
./waf
sudo ./waf install
@@ -154,20 +144,15 @@
fi
if [[ $DIST == Ubuntu || $DIST == Debian ]]; then
- $install git libsqlite3-dev libboost-all-dev make g++ libssl-dev libcrypto++-dev
+ $install git libsqlite3-dev libboost-all-dev make g++ libssl-dev
fi
if [[ $DIST == Fedora ]]; then
- $install gcc-c++ sqlite-devel boost-devel openssl-devel cryptopp-devel
+ $install gcc-c++ sqlite-devel boost-devel openssl-devel
fi
- git clone https://github.com/named-data/ndn-cxx
+ git clone --depth 1 https://github.com/named-data/ndn-cxx
cd ndn-cxx
- current=$(git rev-parse HEAD)
- if [[ $current != "b555b00c280b9c9ed46f24a1fbebc73b720601af" ]]; then
- git checkout b555b00c280b9c9ed46f24a1fbebc73b720601af
- git checkout -b fix-commit
- fi
./waf configure
./waf
sudo ./waf install
@@ -183,7 +168,7 @@
git clone --depth 1 https://github.com/named-data/ndn-tools
cd ndn-tools
- ./waf configure --enable-dump --enable-ping
+ ./waf configure
./waf
sudo ./waf install
cd ../
diff --git a/ndn/nfd.py b/ndn/nfd.py
index 0e10ef1..9eb1eb7 100644
--- a/ndn/nfd.py
+++ b/ndn/nfd.py
@@ -65,6 +65,7 @@
# Change home folder
node.cmd("export HOME={}".format(node.homeFolder))
+ node.cmd("ndnsec-keygen /localhost/operator | ndnsec-install-cert -")
def start(self):
NdnApplication.start(self, "setsid nfd --config {} >> {} 2>&1 &".format(self.confFile, self.logFile))
diff --git a/ndn/nlsr.py b/ndn/nlsr.py
index 1d4150c..0fb73a7 100644
--- a/ndn/nlsr.py
+++ b/ndn/nlsr.py
@@ -64,11 +64,8 @@
host.cmd("ndnsec-keygen {} > {}".format(name, outputFile))
@staticmethod
- def createCertificate(host, name, prefix, keyFile, outputFile, signer=None):
- if signer is None:
- host.cmd("ndnsec-certgen -N {} -p {} {} > {}".format(name, prefix, keyFile, outputFile))
- else:
- host.cmd("ndnsec-certgen -N {} -p {} -s {} {} > {}".format(name, prefix, signer, keyFile, outputFile))
+ def createCertificate(host, signer, keyFile, outputFile):
+ host.cmd("ndnsec-certgen -s {} -r {} > {}".format(signer, keyFile, outputFile))
@staticmethod
def createKeysAndCertificates(net, workDir):
@@ -79,8 +76,8 @@
# Create root certificate
rootName = NETWORK
- sh("ndnsec-keygen {} > {}/root.keys".format(rootName, securityDir))
- sh("ndnsec-certgen -N {} -p {} {}/root.keys > {}/root.cert".format(rootName, rootName, securityDir, securityDir))
+ sh("ndnsec-keygen {}".format(rootName)) # Installs a self-signed cert into the system
+ sh("ndnsec-cert-dump -i {} > {}/root.cert".format(rootName, securityDir, securityDir))
# Create necessary certificates for each site
for host in net.hosts:
@@ -109,7 +106,7 @@
scp(src, dst)
# Root key is in root namespace, must sign site key and then install on host
- sh("ndnsec-certgen -N {} -s {} -p {} {} > {}".format(siteName, rootName, siteName, siteKeyFile, siteCertFile))
+ sh("ndnsec-certgen -s {} -r {} > {}".format(rootName, siteKeyFile, siteCertFile))
# Copy root.cert and site.cert from localhost to remote host
if isinstance(host, RemoteMixin) and host.isRemote:
@@ -127,7 +124,7 @@
opKeyFile = "{}/op.keys".format(nodeSecurityFolder)
opCertFile = "{}/op.cert".format(nodeSecurityFolder)
Nlsr.createKey(host, opName, opKeyFile)
- Nlsr.createCertificate(host, opName, opName, opKeyFile, opCertFile, signer=siteName)
+ Nlsr.createCertificate(host, siteName, opKeyFile, opCertFile)
host.cmd("ndnsec-cert-install -f {}".format(opCertFile))
# Create and install router certificate
@@ -135,7 +132,7 @@
routerKeyFile = "{}/router.keys".format(nodeSecurityFolder)
routerCertFile = "{}/router.cert".format(nodeSecurityFolder)
Nlsr.createKey(host, routerName, routerKeyFile)
- Nlsr.createCertificate(host, routerName, routerName, routerKeyFile, routerCertFile, signer=opName)
+ Nlsr.createCertificate(host, opName, routerKeyFile, routerCertFile)
host.cmd("ndnsec-cert-install -f {}".format(routerCertFile))
class NlsrConfigGenerator:
@@ -306,7 +303,7 @@
type name
hyper-relation
{
- k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><ksk-.*><ID-CERT>$
+ k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><>$
k-expand \\\\1
h-relation equal
p-regex ^([^<NLSR><INFO>]*)<NLSR><INFO><><>$
@@ -334,7 +331,7 @@
type name
hyper-relation
{
- k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><ksk-.*><ID-CERT>$
+ k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><>$
k-expand \\\\1
h-relation equal
p-regex ^<localhop>([^<NLSR><LSA>]*)<NLSR><LSA>(<>*)<><><><>$
@@ -351,7 +348,7 @@
filter
{
type name
- regex ^[^<KEY><%C1.Router>]*<%C1.Router>[^<KEY><NLSR>]*<KEY><ksk-.*><ID-CERT><>$
+ regex ^[^<KEY><%C1.Router>]*<%C1.Router>[^<KEY><NLSR>]*<KEY><><><>$
}
checker
{
@@ -362,10 +359,10 @@
type name
hyper-relation
{
- k-regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><ksk-.*><ID-CERT>$
+ k-regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><>$
k-expand \\\\1
h-relation equal
- p-regex ^([^<KEY><%C1.Router>]*)<%C1.Router>[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
+ p-regex ^([^<KEY><%C1.Router>]*)<%C1.Router>[^<KEY>]*<KEY><><><>$
p-expand \\\\1
}
}
@@ -379,7 +376,7 @@
filter
{
type name
- regex ^[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
+ regex ^[^<KEY>]*<KEY><><><>$
}
checker
{
@@ -404,7 +401,7 @@
filter
{
type name
- regex ^<localhost><nlsr><prefix-update>[<advertise><withdraw>]<>$
+ regex ^<localhost><nlsr><prefix-update>[<advertise><withdraw>]<><><>$
}
checker
{
@@ -413,7 +410,7 @@
key-locator
{
type name
- regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><ksk-.*><ID-CERT>$
+ regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><>$
}
}
}
@@ -425,7 +422,7 @@
filter
{
type name
- regex ^[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
+ regex ^[^<KEY>]*<KEY><><><>$
}
checker
{