summaryrefslogtreecommitdiff
path: root/internal/contentenc/content.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-12-10 11:50:16 +0100
committerJakob Unterwurzacher2016-12-10 11:54:36 +0100
commitc9f4400e6dc71a36df5dc9725f52a8968f5f9803 (patch)
tree601cff97e2f5d472a68e3a133da43237af032521 /internal/contentenc/content.go
parent6c86afb5cd63b099d1762da1a2ce3f76703dc4fb (diff)
Replace all calls to naked panic() with log.Panic()
We want all panics to show up in the syslog.
Diffstat (limited to 'internal/contentenc/content.go')
-rw-r--r--internal/contentenc/content.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/contentenc/content.go b/internal/contentenc/content.go
index c42a844..322163a 100644
--- a/internal/contentenc/content.go
+++ b/internal/contentenc/content.go
@@ -6,6 +6,7 @@ import (
"encoding/binary"
"encoding/hex"
"errors"
+ "log"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/tlog"
@@ -152,7 +153,7 @@ func (be *ContentEnc) EncryptBlock(plaintext []byte, blockNo uint64, fileID []by
// This function can only be used in SIV mode.
func (be *ContentEnc) EncryptBlockNonce(plaintext []byte, blockNo uint64, fileID []byte, nonce []byte) []byte {
if be.cryptoCore.AEADBackend != cryptocore.BackendAESSIV {
- panic("deterministic nonces are only secure in SIV mode")
+ log.Panic("deterministic nonces are only secure in SIV mode")
}
return be.doEncryptBlock(plaintext, blockNo, fileID, nonce)
}
@@ -166,7 +167,7 @@ func (be *ContentEnc) doEncryptBlock(plaintext []byte, blockNo uint64, fileID []
return plaintext
}
if len(nonce) != be.cryptoCore.IVLen {
- panic("wrong nonce length")
+ log.Panic("wrong nonce length")
}
// Authenticate block with block number and file ID