Skip to content

Commit

Permalink
When comments are empty, return empty byte
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Feb 9, 2023
1 parent b0c541f commit 9a22975
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/packages/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a22975

Please sign in to comment.