Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Loop When Building Certificate Chains #13

Closed
Tw1sm opened this issue Oct 24, 2024 · 0 comments · Fixed by #16
Closed

Infinite Loop When Building Certificate Chains #13

Tw1sm opened this issue Oct 24, 2024 · 0 comments · Fixed by #16
Labels
bug Something isn't working

Comments

@Tw1sm
Copy link
Collaborator

Tw1sm commented Oct 24, 2024

This function called when building certificate chains can (and will) enter an infinite loop, causing parsing to never finish

    @staticmethod
    def build_certificate_chain(start_ca_obj, all_ca_obj):
        chain = [start_ca_obj]
        current_ca = start_ca_obj

        while True:
            if current_ca.x509Certificate['subject'] == current_ca.x509Certificate['issuer']:
                # Found a self-signed certificate (root CA)
                break
            
            issuer_ca = ADDS.find_issuer_ca(start_ca_obj, all_ca_obj)
            if not issuer_ca:
                break
            chain.append(issuer_ca)
            current_ca = issuer_ca

        return [cert.Properties['certthumbprint'] for cert in chain]
@Tw1sm Tw1sm added the bug Something isn't working label Oct 24, 2024
@Tw1sm Tw1sm linked a pull request Dec 13, 2024 that will close this issue
@Tw1sm Tw1sm closed this as completed in #16 Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant