diff options
author | Valient Gough | 2016-10-01 21:14:18 -0700 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-10-04 23:18:33 +0200 |
commit | b764917cd5c1b1d61b8ce08e7af0b29793fbbb80 (patch) | |
tree | 22222f3f245d43c1c534a38d7d57b900f50d0e08 /gocryptfs-xray/xray_main.go | |
parent | 31a8f8b83973867a50ac08106effb1bba3fdcb2d (diff) |
lint fixes
Diffstat (limited to 'gocryptfs-xray/xray_main.go')
-rw-r--r-- | gocryptfs-xray/xray_main.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gocryptfs-xray/xray_main.go b/gocryptfs-xray/xray_main.go index d58f1a6..0073c3d 100644 --- a/gocryptfs-xray/xray_main.go +++ b/gocryptfs-xray/xray_main.go @@ -12,8 +12,8 @@ import ( ) const ( - IVLen = contentenc.DefaultIVBits / 8 - blockSize = contentenc.DefaultBS + IVLen + cryptocore.AuthTagLen + ivLen = contentenc.DefaultIVBits / 8 + blockSize = contentenc.DefaultBS + ivLen + cryptocore.AuthTagLen ) func errExit(err error) { @@ -22,7 +22,7 @@ func errExit(err error) { } func prettyPrintHeader(h *contentenc.FileHeader) { - id := hex.EncodeToString(h.Id) + id := hex.EncodeToString(h.ID) fmt.Printf("Header: Version: %d, Id: %s\n", h.Version, id) } @@ -38,13 +38,13 @@ func main() { errExit(err) } - headerBytes := make([]byte, contentenc.HEADER_LEN) + headerBytes := make([]byte, contentenc.HeaderLen) n, err := fd.ReadAt(headerBytes, 0) if err == io.EOF && n == 0 { fmt.Println("empty file") os.Exit(0) } else if err == io.EOF { - fmt.Printf("incomplete file header: read %d bytes, want %d\n", n, contentenc.HEADER_LEN) + fmt.Printf("incomplete file header: read %d bytes, want %d\n", n, contentenc.HeaderLen) os.Exit(1) } else if err != nil { errExit(err) @@ -57,8 +57,8 @@ func main() { var i int64 for i = 0; ; i++ { blockLen := int64(blockSize) - off := contentenc.HEADER_LEN + i*blockSize - iv := make([]byte, IVLen) + off := contentenc.HeaderLen + i*blockSize + iv := make([]byte, ivLen) _, err := fd.ReadAt(iv, off) if err == io.EOF { break @@ -76,7 +76,7 @@ func main() { if err2 != nil { errExit(err2) } - blockLen = (fi.Size() - contentenc.HEADER_LEN) % blockSize + blockLen = (fi.Size() - contentenc.HeaderLen) % blockSize } else if err != nil { errExit(err) } |