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 #1374

Closed
wants to merge 3 commits into from

Conversation

AaronFeickert
Copy link
Contributor

PR intention

Adds size and type checks during coin deserialization that fail on known bad data.

Closes #1373.

Code changes brief

Certain aspects of coin data must be checked during deserialization. These include the validity of the coin type (mint or spend) and the size of encrypted recipient data. This PR adds these checks directly into deserializers, and will throw errors on bad data.

@AaronFeickert AaronFeickert marked this pull request as draft December 5, 2023 16:06
@AaronFeickert
Copy link
Contributor Author

This still fails non-libspark tests, where AEAD key commitments are 64 bytes instead of 32 bytes. Not sure why this occurs.

@AaronFeickert
Copy link
Contributor Author

Superseded by #1379, which fixes test failures.

@AaronFeickert AaronFeickert deleted the coin-deser-checks branch December 18, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spark coin deserialization should enforce fixed sizes
1 participant