Skip to content

fix ed25519 ssh key unpad() when padding not present (not needed) - #1400

Closed
ploxiln wants to merge 1 commit into
paramiko:2.2from
ploxiln:ed25519_unpad_fix
Closed

ploxiln wants to merge 1 commit into
paramiko:2.2from
ploxiln:ed25519_unpad_fix

Conversation

@ploxiln

@ploxiln ploxiln commented Mar 2, 2019

Copy link
Copy Markdown
Contributor

fixes #1306

@ploxiln

ploxiln commented Mar 2, 2019 •

Copy link
Copy Markdown
Contributor Author

8-byte blocksize assumption based on https://coolaj86.com/articles/the-openssh-private-key-format/ and experiments in #1306 but test key seems to have 8 bytes padding (not sure if hand-crafted or realistic) and if this code is moved and used for new-openssh-format rsa keys too it might need to support more padding.

@ploxiln
ploxiln force-pushed the ed25519_unpad_fix branch from 5006243 to 4b064c5 Compare May 23, 2019 01:10
@ploxiln

ploxiln commented May 23, 2019

Copy link
Copy Markdown
Contributor Author

(squashed in and force-pushed a tiny fix to the comment ascii range)

@bitprophet

bitprophet commented Jun 21, 2019 •

Copy link
Copy Markdown
Member

Cherry-picked back to Paramiko 2.2+ (as that's apparently when we added Ed25519 support). Also added tests, by which I mean I just recreated the old Ed25519 test keys with ones whose comments exposed the original bug. (FWIW, in future please try to add tests for this kind of crucial fix - no tests == no way to prove it was really fixed 😇 )

@bitprophet bitprophet closed this Jun 21, 2019
@ploxiln
ploxiln deleted the ed25519_unpad_fix branch July 1, 2019 04:11
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