Skip to content

Commit

Permalink
update ndnsec commands
Browse files Browse the repository at this point in the history
Change-Id: Ib802fd40d53e0405b9707e76dec4f2a92f9affc5
  • Loading branch information
suraviregmi committed Nov 9, 2023
1 parent af975e5 commit 9665f5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion minindn/apps/nfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, node, logLevel='NONE', csSize=65536,

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)
Expand Down
10 changes: 5 additions & 5 deletions minindn/apps/nlsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ def createFaces(self):

@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)
Expand All @@ -128,7 +128,7 @@ def createKeysAndCertificates(self):
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
Expand All @@ -151,15 +151,15 @@ def createKeysAndCertificates(self):
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)
dst = siteKeyFile
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:
Expand Down

0 comments on commit 9665f5c

Please sign in to comment.