update ndnsec commands

Change-Id: Ib802fd40d53e0405b9707e76dec4f2a92f9affc5
This commit is contained in:
suraviregmi committed 2023-11-09 20:05:26 +00:00
1 parent af975e5ed5
commit 9665f5c9c1
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -68,7 +68,7 @@ class Nfd(Application):
if not Minindn.ndnSecurityDisabled:
# Generate key and install cert for /localhost/operator to be used by NFD
node.cmd('ndnsec-keygen /localhost/operator | ndnsec-install-cert -')
node.cmd('ndnsec-key-gen /localhost/operator | ndnsec-cert-install -')
def start(self):
Application.start(self, 'nfd --config {}'.format(self.confFile), logfile=self.logFile)
+5 -5
View File
@@ -112,11 +112,11 @@ class Nlsr(Application):
@staticmethod
def createKey(host, name, outputFile):
host.cmd('ndnsec-keygen {} > {}'.format(name, outputFile))
host.cmd('ndnsec-key-gen {} > {}'.format(name, outputFile))
@staticmethod
def createCertificate(host, signer, keyFile, outputFile):
host.cmd('ndnsec-certgen -s {} -r {} > {}'.format(signer, keyFile, outputFile))
host.cmd('ndnsec-cert-gen -s {} -r {} > {}'.format(signer, keyFile, outputFile))
def createKeysAndCertificates(self):
securityDir = '{}/security'.format(Minindn.workDir)
@@ -128,7 +128,7 @@ class Nlsr(Application):
rootCertFile = '{}/root.cert'.format(securityDir)
if not os.path.isfile(rootCertFile):
# Create root certificate
sh('ndnsec-keygen {}'.format(rootName)) # Installs a self-signed cert into the system
sh('ndnsec-key-gen {}'.format(rootName)) # Installs a self-signed cert into the system
sh('ndnsec-cert-dump -i {} > {}'.format(rootName, rootCertFile))
# Create necessary certificates for each site
@@ -151,7 +151,7 @@ class Nlsr(Application):
siteCertFile = '{}/site.cert'.format(nodeSecurityFolder)
Nlsr.createKey(self.node, siteName, siteKeyFile)
# Copy siteKeyFile from remote for ndnsec-certgen
# Copy siteKeyFile from remote for ndnsec-cert-gen
if isinstance(self.node, RemoteMixin) and self.node.isRemote:
login = 'mininet@{}'.format(self.node.server)
src = '{}:{}'.format(login, siteKeyFile)
@@ -159,7 +159,7 @@ class Nlsr(Application):
scp(src, dst)
# Root key is in root namespace, must sign site key and then install on host
sh('ndnsec-certgen -s {} -r {} > {}'.format(rootName, siteKeyFile, siteCertFile))
sh('ndnsec-cert-gen -s {} -r {} > {}'.format(rootName, siteKeyFile, siteCertFile))
# Copy root.cert and site.cert from localhost to remote host
if isinstance(self.node, RemoteMixin) and self.node.isRemote: