mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-09 15:38:03 -05:00
When comments are empty, return empty byte
This commit is contained in:
@@ -12,6 +12,11 @@ import (
|
|||||||
|
|
||||||
// will decrypt cipher text to plain text using iv and tag
|
// will decrypt cipher text to plain text using iv and tag
|
||||||
func DecryptSymmetric(key []byte, cipherText []byte, tag []byte, iv []byte) ([]byte, error) {
|
func DecryptSymmetric(key []byte, cipherText []byte, tag []byte, iv []byte) ([]byte, error) {
|
||||||
|
// Case: empty string
|
||||||
|
if len(cipherText) == 0 && len(tag) == 0 && len(iv) == 0 {
|
||||||
|
return []byte{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
block, err := aes.NewCipher(key)
|
block, err := aes.NewCipher(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user