diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-12-17 11:30:14 -0500 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2009-12-18 05:18:50 -0700 |
commit | af20a1a2da19a43d2dd7a28c596c0e2f908e8d3e (patch) | |
tree | c5d1fad8b9a8d3be9728f98d9aa7bdbac26c9648 /ipalib/plugins/cert.py | |
parent | 29f243bf4e2f6cd82362849872d1481dab8543b8 (diff) | |
download | freeipa-af20a1a2da19a43d2dd7a28c596c0e2f908e8d3e.tar.gz freeipa-af20a1a2da19a43d2dd7a28c596c0e2f908e8d3e.tar.xz freeipa-af20a1a2da19a43d2dd7a28c596c0e2f908e8d3e.zip |
Handle base64-encoded certificates better, import missing function
Diffstat (limited to 'ipalib/plugins/cert.py')
-rw-r--r-- | ipalib/plugins/cert.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py index 21d0ebcd..a7cd4155 100644 --- a/ipalib/plugins/cert.py +++ b/ipalib/plugins/cert.py @@ -53,6 +53,11 @@ def get_serial(certificate): if type(certificate) in (list, tuple): certificate = certificate[0] try: + certificate = base64.b64decode(certificate) + except Exception, e: + pass + try: + serial = x509.get_serial_number(certificate) except PyAsn1Error: raise errors.CertificateOperationError(error=_('Unable to decode certificate in entry')) |