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

feat: use cmp_version improved version comparisons #3430

Closed
wants to merge 4 commits into from

Conversation

terriko
Copy link
Contributor

@terriko terriko commented Oct 17, 2023

We had been using packaging's version compare in cve-bin-tool, but it's not designed to handle versions that don't adhere to PEP440, and plenty of packages don't adhere strictly to those rules. We had some workarounds for things like openssl but we're switching to cmp_version to have a more robust version comparison system.

Replaces #2679

Signed-off-by: Terri Oda <terri.oda@intel.com>
Signed-off-by: Terri Oda <terri.oda@intel.com>
Signed-off-by: Terri Oda <terri.oda@intel.com>
Signed-off-by: Terri Oda <terri.oda@intel.com>
@terriko terriko added this to the 3.3 milestone Oct 17, 2023
@terriko
Copy link
Contributor Author

terriko commented Oct 18, 2023

Note to self: it's not finding the 66 issues curl 7.34.0 that I'd expect to find, so there may be some logic issue with the new code. (e.g. 66 is what shows on https://www.cvedetails.com/version/517901/Haxx-Curl-7.34.0.html )

@novafacing
Copy link

Not sure if it's the cause of your issue, but there's at least one decision in cmp_version that seems quite dubious:

https://github.com/kata198/cmp_version/blob/bc295e175040684308bcc24c56ee8761825adeed/cmp_version/__init__.py#L193

I don't think 1.1a should generally be considered a higher version than 1.19, no? This would specifically break OpenSSL if they ever released a 1.1.2 because 1.1.1w would be treated as greater.

@terriko
Copy link
Contributor Author

terriko commented Oct 24, 2023

Darn, that's definitely not going to work. I guess I'm writing my own version compare functions, then.

@terriko
Copy link
Contributor Author

terriko commented Oct 25, 2023

Closing in favour of our new hope, #3470

@terriko terriko closed this Oct 25, 2023
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.

2 participants