-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fixed header and write skipping to multiplexer #35762
Conversation
236a896
to
9496c1f
Compare
|
||
func TestFixedHeader(t *testing.T) { | ||
t.Parallel() | ||
require := require.New(t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
lib/multiplexer/wrappers.go
Outdated
@@ -37,6 +37,7 @@ type Conn struct { | |||
protocol Protocol | |||
proxyLine *ProxyLine | |||
reader *bufio.Reader | |||
writeSkip int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think just skipping amount of bytes without controlling those bytes match prefix is enough?
We most probably should be fine, but if something goes wrong there's possibility for some cryptic bugs 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I added a check for that.
@espadolini See the table below for backport results.
|
Add the ability to unconditionally send some fixed header to the client before protocol detection in
multiplexer.Mux
, together with the ability to skip the same amount of data sent from the application side; this lets us send a SSH version identification header before we run PROXY header detection, where appropriate.Fixes #35647.
Changelog: Restored direct dial SSH server compatibility with certain SSH tools such as
ssh-keyscan
(#35647)