Repository navigation
Accept rsa-sha2-256 and rsa-sha2-512 labels in RSAKey public-key parsing - #2738
Open
sudonishant wants to merge 1 commit into
Open
sudonishant wants to merge 1 commit into
sudonishant wants to merge 1 commit into
Conversation
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.
Summary
When an SSH server sends an RSA public-key blob whose leading type string is
rsa-sha2-256orrsa-sha2-512(instead ofssh-rsa),RSAKey.__init__()previously rejected it in_check_type_and_load_cert()because onlykey_type=self.name("ssh-rsa") was accepted.This change updates
RSAKey.__init__()(paramiko/rsakey.py) to accept(self.name, "rsa-sha2-256", "rsa-sha2-512")(and the corresponding[email protected]cert types) when loading the key material, while keepingself.name == "ssh-rsa".Closes #2735.
Validation
test_rsa_public_key_accepts_rsa_sha2_labelsintests/test_pkey.pycoveringssh-rsa,rsa-sha2-256, andrsa-sha2-512.python3 -m pytest --noconftest tests/test_pkey.py tests/test_hostkeys.py -q(52 passed, 1 skipped, 3 subtests passed).git diff --checkpassed.