summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/certs.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-07-27 19:23:31 -0600
committerJason Gerard DeRose <jderose@redhat.com>2009-07-27 19:23:31 -0600
commit03a80f512cf9c0e6affb9a9d26b0fe5c3f375060 (patch)
tree99fbbd239f6bee8f1ad3555e4a093d2178a0fb58 /ipaserver/install/certs.py
parent5bbe1108d50f855842493ff0ef88b5eef2a4f7a6 (diff)
downloadfreeipa-03a80f512cf9c0e6affb9a9d26b0fe5c3f375060.tar.gz
freeipa-03a80f512cf9c0e6affb9a9d26b0fe5c3f375060.tar.xz
freeipa-03a80f512cf9c0e6affb9a9d26b0fe5c3f375060.zip
Fixed whitespace indentation error in certs.py
Diffstat (limited to 'ipaserver/install/certs.py')
-rw-r--r--ipaserver/install/certs.py68
1 files changed, 34 insertions, 34 deletions
diff --git a/ipaserver/install/certs.py b/ipaserver/install/certs.py
index 6578a2eae..9a3636e4d 100644
--- a/ipaserver/install/certs.py
+++ b/ipaserver/install/certs.py
@@ -605,40 +605,40 @@ class CertDB(object):
return root_nickname
- def find_root_cert_from_pkcs12(self, pkcs12_fname, passwd_fname=None):
- """Given a PKCS#12 file, try to find any certificates that do
- not have a key. The assumption is that these are the root CAs.
- """
- args = ["/usr/bin/pk12util", "-d", self.secdir,
- "-l", pkcs12_fname,
- "-k", passwd_fname]
- if passwd_fname:
- args = args + ["-w", passwd_fname]
- try:
- (stdout, stderr) = ipautil.run(args)
- except ipautil.CalledProcessError, e:
- if e.returncode == 17:
- raise RuntimeError("incorrect password")
- else:
- raise RuntimeError("unknown error using pkcs#12 file")
-
- lines = stdout.split('\n')
-
- # A simple state machine.
- # 1 = looking for "Certificate:"
- # 2 = looking for the Friendly name (nickname)
- nicknames = []
- state = 1
- for line in lines:
- if state == 2:
- m = re.match("\W+Friendly Name: (.*)", line)
- if m:
- nicknames.append( m.groups(0)[0])
- state = 1
- if line == "Certificate:":
- state = 2
-
- return nicknames
+ def find_root_cert_from_pkcs12(self, pkcs12_fname, passwd_fname=None):
+ """Given a PKCS#12 file, try to find any certificates that do
+ not have a key. The assumption is that these are the root CAs.
+ """
+ args = ["/usr/bin/pk12util", "-d", self.secdir,
+ "-l", pkcs12_fname,
+ "-k", passwd_fname]
+ if passwd_fname:
+ args = args + ["-w", passwd_fname]
+ try:
+ (stdout, stderr) = ipautil.run(args)
+ except ipautil.CalledProcessError, e:
+ if e.returncode == 17:
+ raise RuntimeError("incorrect password")
+ else:
+ raise RuntimeError("unknown error using pkcs#12 file")
+
+ lines = stdout.split('\n')
+
+ # A simple state machine.
+ # 1 = looking for "Certificate:"
+ # 2 = looking for the Friendly name (nickname)
+ nicknames = []
+ state = 1
+ for line in lines:
+ if state == 2:
+ m = re.match("\W+Friendly Name: (.*)", line)
+ if m:
+ nicknames.append( m.groups(0)[0])
+ state = 1
+ if line == "Certificate:":
+ state = 2
+
+ return nicknames
def trust_root_cert(self, root_nickname):
if root_nickname is None: