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

Refactor AlternativeName internals #4034

Merged
merged 4 commits into from
May 10, 2024
Merged

Refactor AlternativeName internals #4034

merged 4 commits into from
May 10, 2024

Conversation

randombit
Copy link
Owner

This provides a completely new and rather more sensible interface, with the old (now deprecated) interface being implemented in terms of the new interface.

It also resolves a performance issue when parsing certificates with many (thousands) of alternative names; previously this triggered some accidentally quadratic code when checking for duplicates.

Performance issue was reported by Bing Shi.

@randombit randombit force-pushed the jack/refactor-alt-name branch 2 times, most recently from 76749a9 to eaf35a1 Compare April 26, 2024 23:24
@coveralls
Copy link

coveralls commented Apr 26, 2024

Coverage Status

coverage: 91.995% (-0.02%) from 92.019%
when pulling 75a0deb on jack/refactor-alt-name
into 8798305 on master.

@randombit randombit force-pushed the jack/refactor-alt-name branch 3 times, most recently from 7569eb6 to ab85979 Compare April 27, 2024 00:10
Copy link
Collaborator

@FAlbertDev FAlbertDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit I only worked with X509 a little, so I have no comparison to the previous version. What I see in this new version looks well structured and intuitive 👍
I didn't look into the existing tests. Do we need additional tests for the new interface?

src/lib/x509/alt_name.cpp Outdated Show resolved Hide resolved
src/lib/x509/asn1_alt_name.cpp Outdated Show resolved Hide resolved
src/lib/x509/asn1_alt_name.cpp Outdated Show resolved Hide resolved
src/lib/x509/pkix_types.h Outdated Show resolved Hide resolved
src/lib/x509/x509cert.cpp Outdated Show resolved Hide resolved
This provides a completely new and rather more sensible interface,
with the old (now deprecated) interface being implemented in terms
of the new interface.

It also resolves a performance issue when parsing certificates with
many (thousands) of alternative names; previously this triggered
some accidentally quadratic code when checking for duplicates.

Performance issue was reported by Bing Shi.
@randombit randombit merged commit 7606d70 into master May 10, 2024
43 checks passed
@randombit randombit deleted the jack/refactor-alt-name branch May 10, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants