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

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

Abierto
#521 4 comentarios 0 reacciones 1 asignado Reclamado por @rc-ms Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
168
Forks
103
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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
...
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.