go.crypto/ssh: use binary.BigEndian throughout

A small cleanup.

R=agl, gustav.paul
CC=golang-dev
https://golang.org/cl/6406043
This commit is contained in:
Dave Cheney
2012-07-20 10:33:35 +10:00
parent f77e98d970
commit d1bf83abcb
3 changed files with 11 additions and 8 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import (
"crypto"
"crypto/cipher"
"crypto/subtle"
"encoding/binary"
"errors"
"hash"
"io"
@@ -90,7 +91,7 @@ func (r *reader) readOnePacket() ([]byte, error) {
macSize = uint32(r.mac.Size())
}
length := uint32(lengthBytes[0])<<24 | uint32(lengthBytes[1])<<16 | uint32(lengthBytes[2])<<8 | uint32(lengthBytes[3])
length := binary.BigEndian.Uint32(lengthBytes[0:4])
paddingLength := uint32(lengthBytes[4])
if length <= paddingLength+1 {