Avoid deprecated encode_point() method #106
Open
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?