Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add size and type checks to coin deserialization #1379

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
AaronFeickert authored and levonpetrosyan93 committed Dec 18, 2023
commit 1c0c2916e3d98920690ee3c4592b3d8bc1b6d501
2 changes: 1 addition & 1 deletion src/libspark/aead.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct AEADEncryptedData {

// Key commitment must be the correct size, which also includes an encoded size
READWRITE(key_commitment);
if (key_commitment.size() != 1 + AEAD_COMMIT_SIZE) {
if (key_commitment.size() != AEAD_COMMIT_SIZE) {
std::cout << "Bad keycom size " << key_commitment.size() << std::endl;
throw std::invalid_argument("Cannot deserialize AEAD data due to bad key commitment size");
}
Expand Down