From 814fee772f4b12f8dbab9cfe4ea478699e20e965 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sun, 28 Aug 2016 09:29:14 +0100 Subject: [PATCH] Don't decrypt if there is definitely no nonce --- util/cryp/cryp.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/cryp/cryp.go b/util/cryp/cryp.go index 44b91c25..78501ed6 100644 --- a/util/cryp/cryp.go +++ b/util/cryp/cryp.go @@ -51,6 +51,11 @@ func Decrypt(key []byte, src []byte) (dst []byte, err error) { return src, nil } + // Corrupt + if len(src) < 12 { + return src, nil + } + // Initiate AES block, err := aes.NewCipher(key) if err != nil {