浏览代码

ssh: return correct error on read failure

Change-Id: I6cc94ae8dbc65f394550551eaad88594d22eda42
Reviewed-on: https://go-review.googlesource.com/89095
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Han-Wen Nienhuys 7 年之前
父节点
当前提交
3d37316aaa
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      ssh/cipher.go

+ 1 - 1
ssh/cipher.go

@@ -693,7 +693,7 @@ func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte,
 	}
 
 	if _, err := io.ReadFull(r, c.buf[4:packetEnd]); err != nil {
-		return nil, errors.New("ssh: MAC failure")
+		return nil, err
 	}
 
 	var mac [poly1305.TagSize]byte