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

ensure submitted ballot is correct size and with non empty ElG Pairs #25

Merged
merged 3 commits into from
Dec 22, 2021

Conversation

emduc
Copy link
Contributor

@emduc emduc commented Dec 21, 2021

Addresses issues #17 to ensure that when a vote is casted, it's non empty and it won't fail the shuffle

@emduc emduc added the security issue A bad thing... label Dec 21, 2021
@emduc emduc marked this pull request as ready for review December 21, 2021 21:18
@emduc emduc requested a review from nkcr December 21, 2021 21:19
Copy link
Contributor

@nkcr nkcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍
Just a question: what happens if the ballot is not encrypted with the public key ? I guess it would just end with a garbage decrypted ballot, but until we are sure about that I would create a new issue for this specific case, before closing #17 .

@@ -192,6 +192,56 @@ func TestCommand_CastVote(t *testing.T) {
dummyElection.Status = types.Open
jsElection, _ = json.Marshal(dummyElection)

_ = snap.Set(dummyElectionIdBuff, jsElection)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should not ignore an error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same bellow

@emduc
Copy link
Contributor Author

emduc commented Dec 22, 2021

what happens if the ballot is not encrypted with the public key ?

Good question, I added a ballot from a different public key in the scenario test and the decryption seems to never end :(. (#26 )
I commented this ballot in the scenario so that the it still works until we fix the issue, should I leave it ? Remove it ?

Copy link
Contributor

@nkcr nkcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, works fine like that!

@nkcr nkcr merged commit 9170259 into main Dec 22, 2021
@nkcr nkcr deleted the cast_vote_ballot_sanitization branch December 22, 2021 13:43
pierluca pushed a commit that referenced this pull request Oct 5, 2023
chore: fix Docker image build CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security issue A bad thing...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants