Fix #143 Allow the combination of X509Data and KeyValue when they represent the same public key #169
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, this is a shot at implementing the suggested logic fix for issue #143. Basically the code now extracts the key parameters for both key representations and compares them to decide whether they are the same key or not.
If the match is positive, then the code goes on as if there were no ambiguity. If the match is negative, the
ignore_ambiguous_key_info
parameter lets the user decide whether to validate using the X509 data only.Please bear in mind that this is my first python code ever, so I apologize in advance for any stupid mistake I may have made. I have tested it only using RSA signatures. Also some minor code duplication is introduced and it probably could use some refactoring, but I have to say I don't know python well enough to improve this code. Please review it carefully.
Thanks in advance for your work and your time!