-
Notifications
You must be signed in to change notification settings - Fork 248
Open
Labels
Description
Example server logs:
...
AUTH PLAIN *masked*
454 4.7.0 auth failed
* -> produces 'Command too short: "*"'
501 5.5.2 Bad command
QUIT
221 2.0.0 Bye
Expected behavior:
...
AUTH PLAIN *masked*
454 4.7.0 auth failed
*
501 5.0.0 Negotiation cancelled
QUIT
221 2.0.0 Bye
See related code:
client:
Line 353 in 608f3c2
c.cmd(501, "*") |
server code which is triggered:
Line 18 in 608f3c2
return "", "", fmt.Errorf("Command too short: %q", line) |
via
Lines 175 to 181 in 608f3c2
line, err := c.ReadLine() | |
if err == nil { | |
cmd, arg, err := parseCmd(line) | |
if err != nil { | |
c.protocolError(501, EnhancedCode{5, 5, 2}, "Bad command") | |
continue | |
} |
server code, which expected be triggered:
Lines 568 to 572 in 608f3c2
if encoded == "*" { | |
// https://tools.ietf.org/html/rfc4954#page-4 | |
c.WriteResponse(501, EnhancedCode{5, 0, 0}, "Negotiation cancelled") | |
return | |
} |