Граф коммитов

61 Коммитов

Автор SHA1 Сообщение Дата
Keith Fung 7af206958c
Update the deprecated message and add badge 2020-06-19 11:30:03 -04:00
Keith Fung 747017cb49
⚠️ Mark as deprecated
C implementation is now deprecated
2020-06-19 10:43:39 -04:00
Ethan Chumley cc2b1be05a
Deprecation Notice (#89) 2020-06-15 12:40:40 -04:00
Matt Wilhelm 2d9d55d2ae
Use BCrypt for get byte on windows (#86)
* Use BCrypt for get byte on windows

* Revert "Use BCrypt for get byte on windows"

This reverts commit e664b927f2.

* Revert changes to method signature, move assert. remove mod operation
2020-04-29 15:37:09 -04:00
Raul Garcia 5054191902
Removing a dangerous fscanf usage (#84)
* Fixing a potential BO that could happen if the ID assigned by the trustee would exceed the limit in the ballot files.
Adding a test for the fix.

* Fixing a potential BO that could happen if the ID assigned by the trustee would exceed the limit in the ballot files and adding a test for the fix.

* Adding the parameter for ballot_samples to Makefile

* Update exploit
Update exploit

* test update ubuntu workflow runner & cmake version

* pin release runner version to 18.04

Co-authored-by: Matt Wilhelm <github@addressxception.com>
2020-03-31 09:18:37 -04:00
Keith Fung 539b6bd20a
📄 Update Readme (#79) 2020-02-05 10:25:01 -05:00
Matt Wilhelm 3115c412ec
Remove assert statements from bignum (#78)
* Remove assert statements from bignum

improve logging around bignum computation

* remove assert.h update max ballot payload

* reset max ballot payload to 2000

* Explicitly break loop on import end of file

add log.h to coordinator

* modify test selections
2020-02-03 14:52:23 -05:00
Matt Wilhelm 7f59e712a5
build shared libs in debug mode (#77)
useful for library consumers
2020-01-29 10:55:45 -05:00
Matt Wilhelm d9dd0a1037 Support external_ballot_identifer as a string (#71)
* Support external_ballot_identifer as a string.  Export/import ballots 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.

* Remove Simple Example, add api doc stubs

Add stubs for the api documentation.  Remove the simple example and use the api sample in the PR pipeline workflow

* Fix Merge Issue

* Verify malloc success

* Address PR Feedback

* Fix LGTM alerts

* Add soft delete of encrypter files

* Free CP Proof

* Fix windows Makefile

* test fix pr workflow on windows

* use secure api's

* explicitly compile release

* flush file write before read

* clean up makefile

* Document consumers resonsible for free

when calling an api that generates a filename as an out parameter, the caller is responsible for managing the memory of the out parameter when the call is successful

* Rename static coordinators in API to differentiate local vars

add an underscore prefix to static coordinator instance handles to differentiate vars until #62 is complete

* add new enum cases to the end on voting coordinator

* Add convenience logging

* Handle error cases on file access

use convenience logging

* use consistent file formatting when rebuilding tracker string

* optimize null check

* explicitly set tracker array positions to NULL on failure

* Reformat refactor Decryption_Coordinator_receive_share

* guard tallies_initialized when freeing resources

explicitly initialize num_tallies

* rename _encrypted_ballot_count

* don't return early

* do not fail soft delete if rename fails

* fix assignment

* adjust number of ballots to force a rebuild
2020-01-28 09:44:07 -05:00
Raul Garcia 6aa4464f2d 55655 - Unsafe usage of string related APIs (#70)
* 55655  - Unsafe usage of string related APIs
55655  - Usage of unsafe string related APIs could lead to potential buffer overflow.
For Windows & C11 compilers, we switched to the usage of *_s version of the APIs as recommended.
For other compilers, additional checks to prevent buffer overflow have been added.
2020-01-24 14:57:37 -05:00
Raul Garcia bb04be930d 54721 – Potential NULL pointer dereference
54788 & 54721 (duplicates) – Fixing potential NULL pointer dereference after calling malloc.
2020-01-23 15:20:52 -05:00
Matt Wilhelm 2288e878f9 Fix/tally votes trustee threshold (#61)
* Rename refactor decryption_trustee

add summary comments.  Consistently format files.

* Add Trustee index to decryption trustee

* ignore files in ballots results folder

* handle announce trutees less than max trustees

* use the threshold trustees in test to decrypt with missing trustees

only tally votes using the threshold number of trustees to validate that threshold decryption works as expected

* add test_ballot.  Use assert for some test conditions

check expected and actual tally results.

* fix extraneous arguments in call
2020-01-06 15:44:24 -05:00
Matt Wilhelm fb0fead26c Fix/configurable storage paths (#55)
* when writing files, create directories if they do not exist

* revert botched merge file

* modify tasks to include debug shared lib builds

* use FILENAME_MAX from stdio instead of PATH_MAX from linux/limits

* include header guard

* Fix windows support for mkdir
2019-12-05 13:10:00 -05:00
Matt 5ebe919588 add a preprocessor definition for DEBUG_PRINT in debug builds 2019-12-05 12:37:21 -05:00
Pamela Vong a2a707ee7a Implement return of tally results as uint array 2019-12-03 16:27:10 -05:00
Pamela Vong cf29bdd555 Change commands to use standard windows commandline syntax instead of powershell 2019-12-03 16:13:24 -05:00
Pamela Vong e76ea69058 Update README for windows to rename the old `vendor-sdk` folder to `ElectionGuard-SDK-C-Implementation` and added step in simple example to find the built binary on windows 2019-12-03 16:13:24 -05:00
Pamela Vong a8118f7ce9 Fix for encrypting ballot boolean arrays with multiple true selections (#49)
* Fix for encrypting ballot boolean arrays with multiple true selections; Repurpose Validate_selections; Update/simplify api test example with random selections

* Also remove extra Validate_selections call from simple example since its called anyway

* fix random ballots in example tests to be more random and valid ballots

* Have expected_num_selected passed in from higher level for encrypting ballot
2019-12-03 16:03:09 -05:00
Matt Wilhelm 77037e2fc1 Add .vscode tasks (#47)
* Add .vscode tasks
2019-12-03 15:48:57 -05:00
Matt 2c66ce78b2 Specify Github action checkout version v1
see: https://github.com/actions/checkout/issues/81
2019-12-03 15:13:26 -05:00
Pamela Vong 3743de8bed Implement returning arrays of strings for the ballots that have been casted or spoiled 2019-12-03 14:04:51 -05:00
Joey Dodds b1d367ae53 relax c standard warnings to allow non ANSI file/string functions 2019-12-03 09:34:26 -05:00
Joey Dodds 0484bf26aa fix initialization error in trustee public keys 2019-12-03 09:34:26 -05:00
Pamela Vong ceb3e10895 Implement API in the C library (#44)
This introduces an api layer to the C library which can be used to execute the entire election via single api methods to create election/key ceremony, encrypt ballot, register ballot, record cast/spoil ballot, and tally votes.

* Fix loop in computeTrusteePolynomial that results in segfault

* Implement API to Create Election from the C library and update simple example test

* Added missing include

* Add method to free bytes allocated for trustee states and joint public key

* Revert original simple example, create new simple example using api

* Intial implementation to encrypt ballot from C API; added new api to example

* Refactor create-election api in C to write joint key to config param; updated api example

* Update EncryptBallot API signature to work with PInvoke; updated api example

* Add API Tests to the test workflow

* Fix for EncryptBallot passing in array of selections because booleans are non-blittable from C# and the array is not a fixed size

* Implement RecordBallots and TallyVotes API in C library (Merge into PR #44) (#46)

* Implement RecordBallots API in C library

* Fix C example api tests for selection array; Refactor RecordBallot API to return the created file name

* Implement TallyVotes API and example test in C library

* Convert to using byte array for input instead of unsigned short array
2019-12-02 16:56:39 -05:00
Keith Fung a609890fae ♻ Rename Release Workflow (#31)
Release workflow and the badge needs to be renamed.
2019-12-02 16:07:22 -05:00
Raul Garcia 80bd9c234a
Merge pull request #41 from raulgarciamsft/raulgarcia_lgtm
Fixing lgtm.yml to include test code+ small fix
2019-11-25 21:08:18 -08:00
Raul Garcia (MSFT) 528fa771d5 Fix typo 2019-11-21 15:55:18 -08:00
Raul Garcia (MSFT) 0f5bbb9eea Fixing lgtm.yml to include test code
Fixing header guard for builtins.h
2019-11-21 15:50:17 -08:00
Raul Garcia 7bf64a3c7c Adding Semmle security analysis yml file 2019-11-21 10:36:14 -05:00
Pamela Vong 0a878be84c Update Windows README + gitignore test executable (#29)
* Update Windows README + gitignore test executable

* Update gitignore for simple_build folder
2019-11-13 03:45:12 -05:00
Keith Fung b58fb189cc 🚀 Create Release Workflow (#25)
* 🚀 Create Release Workflow

This github action makes use of original build tasks to create each of the artifacts and zips them up for easy consumption by the c# package

* 🔥 Delete unnecessary make install

Make install was failing and not completing. It is already installed on the system due to cmake. Removed the call for cleaner build logs.
2019-11-13 03:37:54 -05:00
Keith Fung 445773a4dc 🏗 Expose File Methods (#13)
* 🏗 Expose File Methods

Expose File methods to be used on external libraries. C File methods need to be exposed. The simple example file methods were used for simplicity.

* 🏗 Add Seek File Method
2019-11-13 03:31:59 -05:00
John Samuels 37a8bab67d Remove compiled binaries from src/ 2019-11-05 10:03:42 -05:00
Keith Fung f080e45111 🔥 Delete Azure Pipeline
Remove Azure pipeline in favor of Github actions
2019-11-01 15:59:13 -04:00
Keith Fung 776bd74bb9 📝 Update Contributing document 2019-11-01 10:23:17 -04:00
Keith Fung e00dfa5183 ⚙ Add Issue and PR Templates 2019-11-01 10:23:17 -04:00
Keith Fung b1873e2b5b 📝Update ReadMe and Contributing file
- ReadMe now has badges and includes a link to contributing file for new OSS devs. 
- release-workflow now exists
Test


Test
2019-11-01 10:23:17 -04:00
Keith Fung 4bd2c954b2 💚 Workflow tests Mac and Windows Build
Simple election tests is now run successfully on Windows and Mac builds
- Windows had issue with gmp location. This was resolved by adding them to the path
- Mac has a similar issue with gmp due to Mojave but is more convoluted. The direct library path had to be added.
2019-10-31 09:42:51 -04:00
Keith Fung 222bd80c8b 💚 Add Windows and Mac Build 2019-10-29 10:25:02 -04:00
Keith Fung fab3eb20f3 🚀 Git Action Workflow for Linux Build
Create GitHub equivalent of Azure Pipeline
2019-10-29 10:25:02 -04:00
Joey Dodds 75a2e66b80 Threshold Decryption
Implement threshold decryption
Threshold decryption proofs generate and check
Changed to 256 bit subgroup used in the spec
Addressed decryption DoS
Removed asserts from proof checks

Co-Authored-By: Dragan Stosic <dragan.stosic@gmail.com>
2019-10-29 09:47:47 -04:00
Raul Garcia 9fd75ef441 Adding a zeroing memory (best-effort) function that works on Windows/C11/other platform. (#7)
zeroing memory allocated for structures that may be padded to minimize probability of information leak through uninitialized memory.
2019-10-17 12:41:33 -04:00
Keith Fung a3bd743f2a 🙈 Update .gitignore for cmake
cmake files that are generated on build or cmake commands should be ignored. 

The files ignored are:
1. Default files prescribed by 
https://github.com/github/gitignore/blob/master/CMake.gitignore

2. ElectionGuardConfig.cmake
2019-10-17 12:36:43 -04:00
Keith Fung 6172dd33bb 🔧 Add Azure Pipeline
- Build library in Linux
- Build simple election in Linux
- Test by running simple election
2019-10-17 12:29:28 -04:00
Keith Fung 9c19765246 💚 Fix Windows Build
- Target MINGW to use changes due to use of MSYS
- Remove prefix for dll
- Ensure BCrypt library is linked
2019-10-17 12:16:38 -04:00
Keith Fung 53a36a1557 💚Fix MacOS Build
- Update submodule to latest commit
- Link gmp to ensure that builds have access to gmp.h
- uint4096.c: `a` reference gives error. Substituted with `out` similar to other code sections.
2019-10-17 12:16:38 -04:00
Ethan Chumley bffb770b45
Merge pull request #4 from supr/fix_build
Fixes merge clonflicts
2019-10-02 14:08:39 -04:00
Ethan Chumley d1dcacd631
Merge pull request #3 from justinleet/readmeSpelling
README spelling cleanup
2019-10-02 14:07:55 -04:00
p d80a927aea Fix BUILD 2019-09-30 21:54:05 -05:00
Justin Leet e72dfd423e README spelling cleanup 2019-09-25 11:44:46 -04:00