Do not ignore ReadPrefixed() errors

This commit is contained in:
Frank Denis 2018-07-09 15:49:36 +02:00
parent 887f6ac299
commit 9b5948d697
1 changed files with 3 additions and 0 deletions

View File

@ -297,6 +297,9 @@ func (proxy *Proxy) exchangeWithTCPServer(serverInfo *ServerInfo, sharedKey *[32
pc.Write(encryptedQuery)
encryptedResponse, err := ReadPrefixed(&pc)
pc.Close()
if err != nil {
return nil, err
}
return proxy.Decrypt(serverInfo, sharedKey, encryptedResponse, clientNonce)
}