added proto for audit

voting-booth-gui
Laura Radaelli 2017-07-17 16:01:15 +03:00
parent ce2fe0e8f2
commit 24d00a89fb
4 changed files with 18 additions and 7 deletions

View File

@ -0,0 +1 @@
sdk.dir=C\:/Users/Laura/AppData/Local/Android/sdk

View File

@ -81,6 +81,7 @@ message BallotSecrets {
EncryptionRandomness encryption_randomness = 2; EncryptionRandomness encryption_randomness = 2;
RandomnessGenerationProof proof = 3; RandomnessGenerationProof proof = 3;
uint64 serial_number = 4; // Ballot serial number
} }
message SignedBallotSecrets { message SignedBallotSecrets {

View File

@ -41,6 +41,11 @@ message ScannedBallot {
} }
//Container for auditing messages
message ScannedAudit {
SignedBallotSecrets signed_ballot_secrets = 1;
}
// Container for error messages // Container for error messages
message ScanError { message ScanError {
string msg = 1; string msg = 1;
@ -49,12 +54,14 @@ message ScanError {
// Container for scanned data // Container for scanned data
message ScannedData { message ScannedData {
uint64 serial = 1; // Serial number of the message
bytes scannerId = 2; // hash of the scannerPK
oneof data { oneof data {
ScannedBallot ballot = 2; ScannedBallot ballot = 3;
ScanError error = 3; ScanError error = 4;
ScannedAudit audit_ballot = 5;
} }
uint64 serial = 4; // Serial number of the message
bytes scannerId = 5; // hash of the scannerPK
} }
message SignedScannedData { message SignedScannedData {

View File

@ -59,8 +59,8 @@ public class FXWindowOutputDevice extends AsyncRunnableOutputDevice {
logger.debug("entered method doAudit"); logger.debug("entered method doAudit");
VistaNavigator.printFXSeparator(); VistaNavigator.printFXSeparator();
BallotSecrets ballotSecrets = command.getBallotSecrets(); BallotSecrets ballotSecrets = command.getBallotSecrets();
printEncryptionRandomness(ballotSecrets.getEncryptionRandomness()); // printEncryptionRandomness(ballotSecrets.getEncryptionRandomness());
printRandomnessGenerationProof (ballotSecrets.getProof()); // printRandomnessGenerationProof (ballotSecrets.getProof());
printAuditBallot(ballotSecrets); printAuditBallot(ballotSecrets);
command.getCallback().onSuccess(null); command.getCallback().onSuccess(null);
} }
@ -146,7 +146,9 @@ public class FXWindowOutputDevice extends AsyncRunnableOutputDevice {
toPrint+="\n"; toPrint+="\n";
VistaNavigator.printFX(toPrint); VistaNavigator.printFX(toPrint);
//generate the PollingStation.<protobuf> corresponding to [plaintext, randomness, Signed(plaintext, randomness)] //generate the PollingStation.<protobuf> corresponding to [ballotID, plaintext, randomness, Signed(ballotID, plaintext, randomness)]
PollingStation.ScannedAudit scannedAudit = PollingStation.ScannedAudit.newBuilder()
.setSignedBallotSecrets(ballotSecrets);
// PollingStation.ScannedBallot scannedBallot = PollingStation.ScannedBallot.newBuilder() // PollingStation.ScannedBallot scannedBallot = PollingStation.ScannedBallot.newBuilder()
// .setChannel(command.getChannelIdentifierByteString()) // .setChannel(command.getChannelIdentifierByteString())
// .setSignedEncryptedBallot(command.getSignedEncryptedBallot()) // .setSignedEncryptedBallot(command.getSignedEncryptedBallot())