Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Support external_ballot_identifer as a string #71

Merged
merged 31 commits into from
Jan 28, 2020

Conversation

AddressXception
Copy link
Contributor

@AddressXception AddressXception commented Jan 23, 2020

Fixes #65

Checklist

🚨Please review the guidelines for contributing to this repository.

  • 🤔 CONSIDER adding a unit test if your PR resolves an issue.
  • DO check open PR's to avoid duplicates.
  • DO keep pull requests small so they can be easily reviewed.
  • DO build locally before pushing.
  • DO make sure tests pass.
  • DO make sure any new changes are documented.
  • DO make sure not to introduce any compiler warnings.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

Description

This PR adds support for providing an external_ballot_identifer as a string. The identifier is saved as part of the encrypter ballot record on the encrypter device, and is then cached in a hash table when running through ballot registration, cast, and spoil.

We also add support to export/import the ballot from the encrypter device as that was missing from the existing implementation.

Additionally a few memory leaks are fixed in in bignum.c, crypto.c, decryption/coordinator.c, decryption/trustee.c, voting/coordinator.c, voting/encrypter.c, etc.

Improve debug logging. Add more api documentation. Modify MAX_BALLOT_PAYLOAD to 2000.

Explicitly add // TODO: to track remaining work.

Remaining Work

Note this PR is a work in progress and currently breaks the simple example.

  • Remove the simple_example
  • fix CI/CD integration
  • fix LG2M integration
  • update readme to reflect changes
  • instrument test run times on the console
  • verify on windows

To Test

  1. Run the api example
  2. Expected: the api example succeeds

…from encrypter

Add support for encrypter to export ballots to the file system.  Import encrypter ballots into coordinator.  Add a hashtable implementation that tracks ballot cast/spoil state against the external identifier (ballot_collection.c).  Support loading ballots into a buffer.  

Fix memory leaks in bignum.c, crypto.c, decryption/coordinator.c, decryption/trustee.c, voting/coordinator.c, voting/encrypter.c, etc.

Rework the API example to demonstrate the new external id and file system changes.

Improve debug logging.  Add more api documentation.  Modify MAX_BALLOT_PAYLOAD to 2000.  Explicitly add // TODO: to track remaining work.

Note this commit is a work in progress and currently breaks the simple example.
@AddressXception AddressXception added the draft Do not merge yet label Jan 23, 2020
@AddressXception
Copy link
Contributor Author

I apologize for the size of this PR. generally we should avoid making PR's so large

examples/api/main.c Outdated Show resolved Hide resolved
@AddressXception AddressXception added this to the Phase 3 milestone Jan 23, 2020
Add stubs for the api documentation.  Remove the simple example and use the api sample in the PR pipeline workflow
@lgtm-com
Copy link

lgtm-com bot commented Jan 24, 2020

This pull request introduces 4 alerts when merging 04ac827 into bb04be9 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect
  • 1 for Local variable hides global variable
  • 1 for Dubious NULL check
  • 1 for Use of potentially dangerous function

@lgtm-com
Copy link

lgtm-com bot commented Jan 24, 2020

This pull request introduces 2 alerts when merging e7d4f8b into bb04be9 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect
  • 1 for Use of potentially dangerous function

@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2020

This pull request introduces 5 alerts when merging ab0ba22 into 6aa4464 - view on LGTM.com

new alerts:

  • 3 for Comparison where assignment was intended
  • 1 for Expression has no effect
  • 1 for Use of potentially dangerous function

@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2020

This pull request introduces 5 alerts when merging 9f6fc27 into 6aa4464 - view on LGTM.com

new alerts:

  • 3 for Comparison where assignment was intended
  • 1 for Expression has no effect
  • 1 for Use of potentially dangerous function

@AddressXception
Copy link
Contributor Author

AddressXception commented Jan 27, 2020

@raulgarciamsft PR feedback addressed to the extent it can be for this effort. Added #74 to address the result code issues you mentioned, and #75 to address error states in an API example. Just a couple of questions outstanding. Thanks for taking the time to look at this so thoroughly.

@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2020

This pull request introduces 2 alerts when merging 7a6a588 into 6aa4464 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect
  • 1 for Use of potentially dangerous function

@AddressXception AddressXception added enhancement New feature or request and removed draft Do not merge yet labels Jan 27, 2020
@lgtm-com
Copy link

lgtm-com bot commented Jan 28, 2020

This pull request introduces 2 alerts when merging bc26137 into 6aa4464 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect
  • 1 for Use of potentially dangerous function

@echumley-msft echumley-msft merged commit d9dd0a1 into master Jan 28, 2020
@echumley-msft echumley-msft deleted the feature/ballot-identifier branch January 28, 2020 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API_EncryptBallot accepts string identifier
4 participants