From 0975796083f6192ccba9c62c1f1c76800bc37cb7 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Wed, 17 Dec 2014 20:48:15 +0100 Subject: [PATCH] =?UTF-8?q?[ldapcertfs]=20Erreur=20dans=20le=20cas=20o?= =?UTF-8?q?=C3=B9=20un=20BaseCert=20n'est=20pas=20un=20CertX509?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/ldapcertfs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/ldapcertfs.py b/utils/ldapcertfs.py index ceeade11..d614fdc6 100755 --- a/utils/ldapcertfs.py +++ b/utils/ldapcertfs.py @@ -341,14 +341,14 @@ class LdapCertFS(fuse.Fuse): data = "" for dtype in self.files[file]['file']: if dtype == "chain": - if cert['issuerCN'][0] in self.chain: + if 'x509Cert' in cert['objectClass'] and cert['issuerCN'][0] in self.chain: if 'path' in self.chain[str(cert['issuerCN'][0])]: data += open(self.chain[str(cert['issuerCN'][0])]['path']).read() elif 'content' in self.chain[str(cert['issuerCN'][0])]: data += self.chain[str(cert['issuerCN'][0])]['content'] else: return None - elif dtype == "certificat": + elif dtype == "certificat" and 'x509Cert' in cert['objectClass']: data+=ssl.DER_cert_to_PEM_cert(str(cert['certificat'][0])) elif dtype == "privatekey": if "privateKey" in cert['objectClass'] and cert['privatekey'] and not self.nopkey: @@ -543,12 +543,12 @@ def main(usage): ldap_filter = 'self' # Récupération de l'option decrypt - if '--decrypt' in sys.argv[2:]: + if '--decrypt' in sys.argv[1:]: decrypt=True del(sys.argv[sys.argv.index('--decrypt')]) # Récupération de l'option nopkey - if '--nopkey' in sys.argv[2:]: + if '--nopkey' in sys.argv[1:]: nopkey=True del(sys.argv[sys.argv.index('--nopkey')])