From 6c3f97399a01a2d8480b39978209099335efbf7d Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 15 Jun 2016 23:30:44 +0200 Subject: Rename internal "toggledlog" package to "tlog" tlog is used heavily everywhere and deserves a shorter name. Renamed using sed magic, without any manual rework: find * -type f -exec sed -i 's/toggledlog/tlog/g' {} + --- internal/contentenc/content.go | 10 +++++----- internal/contentenc/offsets.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'internal/contentenc') diff --git a/internal/contentenc/content.go b/internal/contentenc/content.go index dd6aa26..5bac2a2 100644 --- a/internal/contentenc/content.go +++ b/internal/contentenc/content.go @@ -8,7 +8,7 @@ import ( "encoding/hex" "errors" - "github.com/rfjakob/gocryptfs/internal/toggledlog" + "github.com/rfjakob/gocryptfs/internal/tlog" ) // DecryptBlocks - Decrypt a number of blocks @@ -42,12 +42,12 @@ func (be *ContentEnc) DecryptBlock(ciphertext []byte, blockNo uint64, fileId []b // All-zero block? if bytes.Equal(ciphertext, be.allZeroBlock) { - toggledlog.Debug.Printf("DecryptBlock: file hole encountered") + tlog.Debug.Printf("DecryptBlock: file hole encountered") return make([]byte, be.plainBS), nil } if len(ciphertext) < be.cryptoCore.IVLen { - toggledlog.Warn.Printf("DecryptBlock: Block is too short: %d bytes", len(ciphertext)) + tlog.Warn.Printf("DecryptBlock: Block is too short: %d bytes", len(ciphertext)) return nil, errors.New("Block is too short") } @@ -64,8 +64,8 @@ func (be *ContentEnc) DecryptBlock(ciphertext []byte, blockNo uint64, fileId []b plaintext, err := be.cryptoCore.Gcm.Open(plaintext, nonce, ciphertext, aData) if err != nil { - toggledlog.Warn.Printf("DecryptBlock: %s, len=%d", err.Error(), len(ciphertextOrig)) - toggledlog.Debug.Println(hex.Dump(ciphertextOrig)) + tlog.Warn.Printf("DecryptBlock: %s, len=%d", err.Error(), len(ciphertextOrig)) + tlog.Debug.Println(hex.Dump(ciphertextOrig)) return nil, err } diff --git a/internal/contentenc/offsets.go b/internal/contentenc/offsets.go index cfb1c69..da0551a 100644 --- a/internal/contentenc/offsets.go +++ b/internal/contentenc/offsets.go @@ -1,7 +1,7 @@ package contentenc import ( - "github.com/rfjakob/gocryptfs/internal/toggledlog" + "github.com/rfjakob/gocryptfs/internal/tlog" ) // Contentenc methods that translate offsets between ciphertext and plaintext @@ -35,12 +35,12 @@ func (be *ContentEnc) CipherSizeToPlainSize(cipherSize uint64) uint64 { } if cipherSize == HEADER_LEN { - toggledlog.Warn.Printf("cipherSize %d == header size: interrupted write?\n", cipherSize) + tlog.Warn.Printf("cipherSize %d == header size: interrupted write?\n", cipherSize) return 0 } if cipherSize < HEADER_LEN { - toggledlog.Warn.Printf("cipherSize %d < header size %d: corrupt file\n", cipherSize, HEADER_LEN) + tlog.Warn.Printf("cipherSize %d < header size %d: corrupt file\n", cipherSize, HEADER_LEN) return 0 } -- cgit v1.2.3