[ldapcertfs] Erreur dans le cas où un BaseCert n'est pas un CertX509
This commit is contained in:
parent
0922602a76
commit
0975796083
1 changed files with 4 additions and 4 deletions
|
@ -341,14 +341,14 @@ class LdapCertFS(fuse.Fuse):
|
||||||
data = ""
|
data = ""
|
||||||
for dtype in self.files[file]['file']:
|
for dtype in self.files[file]['file']:
|
||||||
if dtype == "chain":
|
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])]:
|
if 'path' in self.chain[str(cert['issuerCN'][0])]:
|
||||||
data += open(self.chain[str(cert['issuerCN'][0])]['path']).read()
|
data += open(self.chain[str(cert['issuerCN'][0])]['path']).read()
|
||||||
elif 'content' in self.chain[str(cert['issuerCN'][0])]:
|
elif 'content' in self.chain[str(cert['issuerCN'][0])]:
|
||||||
data += self.chain[str(cert['issuerCN'][0])]['content']
|
data += self.chain[str(cert['issuerCN'][0])]['content']
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
elif dtype == "certificat":
|
elif dtype == "certificat" and 'x509Cert' in cert['objectClass']:
|
||||||
data+=ssl.DER_cert_to_PEM_cert(str(cert['certificat'][0]))
|
data+=ssl.DER_cert_to_PEM_cert(str(cert['certificat'][0]))
|
||||||
elif dtype == "privatekey":
|
elif dtype == "privatekey":
|
||||||
if "privateKey" in cert['objectClass'] and cert['privatekey'] and not self.nopkey:
|
if "privateKey" in cert['objectClass'] and cert['privatekey'] and not self.nopkey:
|
||||||
|
@ -543,12 +543,12 @@ def main(usage):
|
||||||
ldap_filter = 'self'
|
ldap_filter = 'self'
|
||||||
|
|
||||||
# Récupération de l'option decrypt
|
# Récupération de l'option decrypt
|
||||||
if '--decrypt' in sys.argv[2:]:
|
if '--decrypt' in sys.argv[1:]:
|
||||||
decrypt=True
|
decrypt=True
|
||||||
del(sys.argv[sys.argv.index('--decrypt')])
|
del(sys.argv[sys.argv.index('--decrypt')])
|
||||||
|
|
||||||
# Récupération de l'option nopkey
|
# Récupération de l'option nopkey
|
||||||
if '--nopkey' in sys.argv[2:]:
|
if '--nopkey' in sys.argv[1:]:
|
||||||
nopkey=True
|
nopkey=True
|
||||||
del(sys.argv[sys.argv.index('--nopkey')])
|
del(sys.argv[sys.argv.index('--nopkey')])
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue