ssh: sanitize various error messages
Similar to CL 780180, sanitize other error messages that are controlled by the remote peer, to avoid potential injection of control characters. Also remove sanitizeString usage as it is not strictly needed to escape error messages safely, and for consistency with how we sanitize other error messages throughout the codebase. BannerDisplayStderr is left unsanitized for now, as it is one instance where we might actually want control characters for valid reasons (see golang/go#80302). Updates golang/go#80302 Fixes golang/go#80301 Change-Id: Ie40f4ac2f76afed740dceb548a4b0fa96a6a6964 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/798420 Auto-Submit: Nicholas Husin <nsh@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Nicola Murino <nicola.murino@gmail.com> Reviewed-by: Nicholas Husin <husin@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
b27e1504e3
commit
0f039f3a4a
+1
-1
@@ -710,7 +710,7 @@ userAuthLoop:
|
||||
}
|
||||
|
||||
if userAuthReq.Service != serviceSSH {
|
||||
return nil, errors.New("ssh: client attempted to negotiate for unknown service: " + userAuthReq.Service)
|
||||
return nil, fmt.Errorf("ssh: client attempted to negotiate for unknown service: %q", userAuthReq.Service)
|
||||
}
|
||||
|
||||
if s.user != userAuthReq.User && partialSuccessReturned {
|
||||
|
||||
Reference in New Issue
Block a user