Open
Conversation
- This allows `python-sshpubkeys` to work with `cryptography>=39.0.0`. - `ec.EllipticCurvePublicNumbers.encode_point()` had been deprecated for a long time, and was removed in commit pyca/cryptography@2b6e463 , or `cryptography==39.0.0`. - I manually tested to confirm that for all of the existing test cases that called `to_string()`, this new `public_bytes()` method yielded the same bytes as the old `encode_point()`. - Since the "compressed" `to_string()` was already using `public_bytes()` with `Encoding` and `PublicFormat`, it seems unlikely that this change will break support for any versions of `cryptography`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
python-sshpubkeysto work withcryptography>=39.0.0.ec.EllipticCurvePublicNumbers.encode_point()had been deprecated for a long time, and was removed in commit pyca/cryptography@2b6e463 , orcryptography==39.0.0.to_string(), this newpublic_bytes()method yielded the same bytes as the oldencode_point().to_string()was already usingpublic_bytes()withEncodingandPublicFormat, it seems unlikely that this change will break support for any versions ofcryptographyPending question about test cases
All of the unit tests still pass with
python -m unittest tests.I was unsure whether I should try adding unit tests for these
to_string()methods or not. Since I'm not super familiar with cryptography, I would simply have based any expected values off of whatever was already being produced by theto_string()methods. I don't think is the best way of writing tests. But, this would also at least guarantee that any future changes do not change the output ofto_string(), so perhaps it is still worth it?