Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

When comments are empty, return empty byte

Maidul Islam9a2297573273
diff --git a/cli/packages/crypto/crypto.go b/cli/packages/crypto/crypto.go
index f9589347a9..2f507ed4c8 100644
--- a/cli/packages/crypto/crypto.go
+++ b/cli/packages/crypto/crypto.go
@@ -12,6 +12,11 @@ import (
// will decrypt cipher text to plain text using iv and tag
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)
if err != nil {
return nil, err