From bbc0ce4e9c1bf21d7938bf3662b3e06f13467b0b Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 3 Sep 2020 12:45:40 -0700 Subject: [PATCH] better info about incorrect passwords Fixes 237 --- src/croc/croc.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/croc/croc.go b/src/croc/croc.go index bb8254f..622e739 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -433,6 +433,9 @@ func (c *Client) Send(options TransferOptions) (err error) { return } else { log.Debugf("error from errchan: %v", err) + if strings.Contains(err.Error(), "could not secure channel") { + return err + } } if !c.Options.DisableLocal { if strings.Contains(err.Error(), "refusing files") || strings.Contains(err.Error(), "EOF") || strings.Contains(err.Error(), "bad password") { @@ -672,6 +675,10 @@ func (c *Client) transfer(options TransferOptions) (err error) { } fmt.Print("\n") } + if err != nil && strings.Contains(err.Error(), "pake not successful") { + log.Debugf("pake error: %s", err.Error()) + err = fmt.Errorf("password mismatch") + } return }