From 9e8e0b390897c84cad53ebe9ed2d1d331a5394d9 Mon Sep 17 00:00:00 2001 From: Aidan Coyle Date: Wed, 14 Oct 2020 15:02:37 +0000 Subject: [PATCH] ssh: improve error message for KeyboardInteractiveChallenge Fixes golang/go#41823 Change-Id: I4653f23239bdf2ab472d3d15c6653b89ebf7ccd4 GitHub-Last-Rev: 179b3ee0efc7b4733da9fbbd8e5ec73a72ef8156 GitHub-Pull-Request: golang/crypto#158 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/259902 Trust: Roland Shoemaker Run-TryBot: Filippo Valsorda TryBot-Result: Go Bot Reviewed-by: Filippo Valsorda --- ssh/client_auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssh/client_auth.go b/ssh/client_auth.go index f326565..c611aeb 100644 --- a/ssh/client_auth.go +++ b/ssh/client_auth.go @@ -471,7 +471,7 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe } if len(answers) != len(prompts) { - return authFailure, nil, errors.New("ssh: not enough answers from keyboard-interactive callback") + return authFailure, nil, fmt.Errorf("ssh: incorrect number of answers from keyboard-interactive callback %d (expected %d)", len(answers), len(prompts)) } responseLength := 1 + 4 for _, a := range answers {