Repository navigation
SSHClient: request host key type from known_hosts - #910
Conversation
59285b8 to
c4519ec
Compare
|
Nah, at this point anything that makes backporting to 1.x hard is a good argument for "don't bother". If someone who's stuck on 1.x (despite the security concerns, which was one reason we even did the backend switch in 2.0) is super upset they don't have such a change, they can submit their own PR :D |
|
I can rebase this and resolve conflicts if you like (... #974 causes conflicts for pretty much all pull requests against 2.0+ ...) |
|
That'd be great, thanks! (And, yes, it does, but I'd rather not let compatibility with PRs prevent necessary change. For example all of Fabric 1's PRs will get broked good once 2.0 becomes the new master... 🙃 ) |
281d248 to
5fc547b
Compare
|
Rebased, resolved conflicts, and also removed a commit which tweaked a log message which I realized is not related to host keys (it's related to user auth keys). Manually tested and verified, but I'm working on a proper automated test... |
|
Added proper tests for this. If I run them against the 2.1 branch (without this PR), the ones which I expect to fail do so: |
|
Now that #981 is merged, I can revise this to use the SecurityOptions api to change the order of the preferred host key types (to put the available key first). I may do very soon that if it's not too late... |
10306da to
4fd1af0
Compare
|
changed to use SecurityOptions, will squash down a bit if that looks good |
If we have a host keys that will be checked, we need to negotiate for the type we have. Commonly, openssh could have saved an ecdsa key in known_hosts, but SSHClient will let the Transport negotiate for an rsa key. Then it would consider a key of a non-corresponding type to be "missing". That situation is also now a BadHostKeyException. Before this change, a man-in-the-middle attack on the paramiko ssh client was possible by having only a host key type which differs from what the client has in known_hosts (and then giving any key of that type).
7cc1f22 to
4526052
Compare
|
Hrm, this appears to conflict with the ResourceManager removal due to the same chunk moving around, but I think it's just re-applying 2 line nukes after merging your changes, so I've done that. |
|
Your merge conflict resolution looks correct - thanks! |
fixes #865
one part of an alternative set of PRs to #899
I only backported this to 2.1 because there were some changes around
t.start_client()in 2.0 and 2.1 which make forward-merging have possibly tricky conflicts there. I can backport further if you would like, and won't mind the conflict resolution when forward-merging :)