Commit 09757960 authored by Valentin Samir's avatar Valentin Samir

[ldapcertfs] Erreur dans le cas où un BaseCert n'est pas un CertX509

parent 0922602a
......@@ -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')])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment