Index: tl-ldap-certalias =================================================================== --- tl-ldap-certalias (revision 27083) +++ tl-ldap-certalias (working copy) @@ -68,6 +68,9 @@ self.contents = load_cert(self.raw) + def is_cert(self): + return self.contents is not None + def __getitem__(self, item): """A bit of syntactic sugar to allow the Certificate class to look like the dict returned by load_cert.""" @@ -873,6 +876,11 @@ # Make sure that the certificate is valid. # c = Certificate(certificate) + + if not c.is_cert(): + eprint("Invalid cert on user %s" % dn) + continue + if not allow_invalid_certificates: (valid, reason) = certificate_is_valid(c) if not valid: @@ -882,6 +890,7 @@ vprint(" Reason: %s" % reason) continue + userlist[uid] += [c]