Election-Tech-Initiative / Election-Tech-Initiative/electionguard-python

🐞 When serializing decrypted spoiled ballots, placeholder selections should be removed

Offen
#521 4 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @rc-ms Auf GitHub ansehen
bug
Vorherrschende Sprache
Python
Sterne
168
Forks
103
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

in **election_record/spoiled_ballots/spoiled_ballot_.json,** decrypted spoiled ballots still contain placeholder selections.

1. this is likely confusing for people examining spoiled ballots to verify they are correctly decrypted.

1. this causes validation 12.B ("An election verifier should also confirm that for each decrypted spoiled ballot, the selections
listed in text match the corresponding text in the ballot coding file.") to fail, eg:

```
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (referendum-pineapple-2-placeholder) not contained in contest (referendum-pineapple).
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (referendum-pineapple-2-placeholder) not contained in contest (referendum-pineapple).
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (referendum-pineapple-2-placeholder) not contained in contest (referendum-pineapple).
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***12.B Spoiled PlaintextTally Names Validation failed.
```

### Expected Behavior

placeholder selections should not appear in decrypted spoiled ballots

### Steps To Reproduce

run TestEndToEndElection
examine election_record/spoiled_ballots/spoiled_ballot_.json

### Environment

```markdown
OS: Ubuntu 20.04
```

### Anything else?

In decrypt_with_shares.py, skip any placeholder selection:

```
def decrypt_contest_with_decryption_shares(
contest: CiphertextContest,
shares: Dict[GuardianId, DecryptionShare],
crypto_extended_base_hash: ElementModQ,
) -> Optional[PlaintextTallyContest]:
plaintext_selections: Dict[SelectionId, PlaintextTallySelection] = {}

for selection in contest.selections
if selection.is_placeholder is True:
continue
...
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.