Don't decrypt if there is definitely no nonce

This commit is contained in:
Tobie Morgan Hitchcock 2016-08-28 09:29:14 +01:00
parent 629bd7dd92
commit 814fee772f

View file

@ -51,6 +51,11 @@ func Decrypt(key []byte, src []byte) (dst []byte, err error) {
return src, nil return src, nil
} }
// Corrupt
if len(src) < 12 {
return src, nil
}
// Initiate AES // Initiate AES
block, err := aes.NewCipher(key) block, err := aes.NewCipher(key)
if err != nil { if err != nil {