Skip to content

Commit

Permalink
Handle invalid iv data
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekuruu committed Oct 10, 2024
1 parent a29af16 commit 5b60b50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ func DecryptScoreData(iv []byte, encryptedData []byte) ([]byte, error) {
return []byte{}, nil
}

if len(iv) != 16 {
return nil, errors.New("IV must be 16 bytes")
}

encryptionKey := "9viq4mujm86947ujxs7i5z82sa6rrzhz"
data, err := AESDecrypt(encryptionKey, iv, encryptedData)

Expand Down

0 comments on commit 5b60b50

Please sign in to comment.