1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-30 23:52:07 +03:00

Merge pull request #338 from alrs/alrs-fix-client-swallowed-errs

src/croc: fix dropped errors
This commit is contained in:
Zack 2021-03-10 08:16:06 -08:00 committed by GitHub
commit cd6d9a5aa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -800,6 +800,9 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error
Type: "error", Type: "error",
Message: "refusing files", Message: "refusing files",
}) })
if err != nil {
return false, err
}
return true, fmt.Errorf("refused files") return true, fmt.Errorf("refused files")
} }
} else { } else {
@ -893,6 +896,9 @@ func (c *Client) processMessageSalt(m message.Message) (done bool, err error) {
Type: "salt", Type: "salt",
Bytes: m.Bytes, Bytes: m.Bytes,
}) })
if err != nil {
return true, err
}
} }
log.Debugf("session key is verified, generating encryption with salt: %x", m.Bytes) log.Debugf("session key is verified, generating encryption with salt: %x", m.Bytes)
key, err := c.Pake.SessionKey() key, err := c.Pake.SessionKey()
@ -994,7 +1000,6 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) {
Message: "refusing files", Message: "refusing files",
}) })
done = true done = true
err = fmt.Errorf("refused files")
return return
} }
} }