run 'go get -u; make revendor'

Signed-off-by: Stephan Renatus <srenatus@chef.io>
This commit is contained in:
Stephan Renatus
2019-07-31 08:09:38 +02:00
parent 7c1b4b3005
commit 076cd77469
975 changed files with 347835 additions and 77390 deletions

View File

@@ -16,6 +16,7 @@ import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"errors"
"io"
)
@@ -67,6 +68,10 @@ func Decrypt(ciphertext []byte, key *[32]byte) (plaintext []byte, err error) {
return nil, err
}
if len(ciphertext) < gcm.NonceSize() {
return nil, errors.New("malformed ciphertext")
}
return gcm.Open(nil,
ciphertext[:gcm.NonceSize()],
ciphertext[gcm.NonceSize():],