Protocol version negotiation currently doesn't result in agreement
As far as I can tell, here is how the "serve protocol" and "worker protocol" both do it:
- Each side send the higher version they support to the other side.
- The other side tries to use that version if it supports it.
But that means if the two versions are not the same, the two ends of the connection will be using different versions! Madness!
I think we forgot one simple step:
- Take the minimum of the version you sent and version you received.
Then both sides will end up with the same version. Problem solved!
#6134, and doing the equivalent for the handshake for ssh-ng://, can allow us to write some good unit test for this.
@Ericson2314 Is this still an issue now that #6134 is merged?
@edolstra yes it is. I did something for this in hydra but it needs to be moved to Nix and made part of the unit tests. The factoring out of serializers did not cover the handshakes. I just factored out the legacy ssh handshake so far.
This can stay assigned to me.