wbond / certvalidator

Python library for validating X.509 certificates and paths
MIT License
107 stars 31 forks source link

Fix a crash during CRL verification #28

Closed teskje closed 1 year ago

teskje commented 3 years ago

If use_deltas was set to True as an input to the verify_crl function the code would proceed to build the following list of distribution point objects in sources: [[dp, dp, ...], dp, dp, ...]

The code after assumed the following format: [[dp, dp, ...], [dp, dp, ...]] (a list of lists)

This divide could lead to a crash due to a TypeError, as described in #9.

The fix implemented in this PR removes the nesting of lists as it is not needed, so the new format is: [dp, dp, ..., dp, dp, ...]

3lixy commented 3 years ago

I just came across this issue too and was about to submit a pull request for this and saw this one. My solution was slightly different by just changing sources.extend(cert.delta_crl_distribution_points) to sources.extend([cert.delta_crl_distribution_points])

It seems rare to see this for a cert for me.