summaryrefslogtreecommitdiffstats
path: root/base/common/python
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-08-20 10:47:15 +0200
committerEndi S. Dewata <edewata@redhat.com>2016-08-22 21:39:02 +0200
commiteb28cf05cfad246383dbda054c8cd477bc7acc73 (patch)
tree388cd3c0f1dce9559948fd73f19de06bd931970f /base/common/python
parentbde2cd1d3e65850c82a6ea7a6cebcae46a4408f2 (diff)
downloadpki-eb28cf05cfad246383dbda054c8cd477bc7acc73.tar.gz
pki-eb28cf05cfad246383dbda054c8cd477bc7acc73.tar.xz
pki-eb28cf05cfad246383dbda054c8cd477bc7acc73.zip
Updated pki-server subsystem-cert-update CLI.
The pki-server subsystem-cert-update CLI has been updated to use certutil to retrieve the certificate data from the proper token. It will also show a warning if the certificate request cannot be found. The NSSDatabase constructor has been modified to normalize the name of internal NSS token to None. If the token name is None, the certutil will be executed without the -h option. The NSSDatabase.get_cert() has been modified to prepend the token name to the certificate nickname. https://fedorahosted.org/pki/ticket/2440
Diffstat (limited to 'base/common/python')
-rw-r--r--base/common/python/pki/nssdb.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/base/common/python/pki/nssdb.py b/base/common/python/pki/nssdb.py
index ed456540b..736efcac3 100644
--- a/base/common/python/pki/nssdb.py
+++ b/base/common/python/pki/nssdb.py
@@ -105,7 +105,11 @@ class NSSDatabase(object):
directory = os.path.join(os.path.expanduser("~"), '.dogtag', 'nssdb')
self.directory = directory
- self.token = token
+
+ if token == 'internal' or token == 'Internal Key Storage Token':
+ self.token = None
+ else:
+ self.token = token
self.tmpdir = tempfile.mkdtemp()
@@ -425,12 +429,15 @@ class NSSDatabase(object):
'-d', self.directory
]
+ fullname = nickname
+
if self.token:
cmd.extend(['-h', self.token])
+ fullname = self.token + ':' + fullname
cmd.extend([
'-f', self.password_file,
- '-n', nickname,
+ '-n', fullname,
output_format_option
])