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

12 Коммитов

Автор SHA1 Сообщение Дата
Henry Corrigan-Gibbs bfa543bfaa
Run code through clang-format 9.0. (#97)
Generated by running the following command in the top-level dir:

> clang-format --style=Mozilla \
   -i include/*.h pclient/*.c prio/*.c prio/*.h ptest/*.c ptest/*.h

Update .travis.yml and clang-format.sh to use 9.0
2020-06-01 23:38:23 -07:00
Gabriel Ganne 9a30c743c0 remove unnecessary runtime call to strlen()
PRIO_TAG is a fixed-size string, we can use sizeof to the same effect.
This also has the nice side-effect of removing a variable-length-array
since AAD_LEN could not be known at compile-time
2019-08-07 09:48:04 -07:00
Henry Corrigan-Gibbs 2bfea2aaee Functions for import/export of private keys (#51)
* Allow DEBUG mode without sanitizers

Valgrind is incompatible with AddressSanitizer, so it is nice to turn
on DEBUG mode without the sanitizers.

* PrivateKey import/export functions

* Define PT_CHECK*() macros for better test output

When using P_CHECKC(), you get no information about where
or why the test failed. These macros also call `mu_check()`
so that you can more easily figure out what went wrong.

* Fix clang-format issues

* Configure travis to use NSS 3.39

* Update README with new version dependencies.

* Fixes per rhelmer's review

* Fix typos.
* Use (pointer,length)-style arguments for import and export functions.
2018-10-02 12:13:39 -07:00
Henry Corrigan-Gibbs 8cb93da723 Move `PK11_FreeSlot` below `cleanup` label (#49) 2018-09-26 14:00:12 -07:00
Henry Corrigan-Gibbs 02a81fb652 Remove all variable-length arrays on the stack (#45)
* Remove all variable-length arrays

* Fix indenting
2018-09-24 09:34:53 -07:00
Robert Helmer 488da2d729
Linux distros expect NSS headers to not have nss/ prefix on include, … (#40)
* Linux distros expect NSS headers to not have nss/ prefix on include, see https://bugzilla.mozilla.org/show_bug.cgi?id=1491289

* put /usr/include/nss on default path

* make clang-format happy
2018-09-17 14:54:15 -07:00
Robert Helmer 3ecb4a074f avoid undefined behavior on platforms where char is signed (which would result in integer overflow before) 2018-08-30 11:43:48 -07:00
Robert Helmer ded8b1054b
issue #25 - format libprio with clang-format, using Mozilla style (#26)
* issue #25 - format libprio with clang-format, using Mozilla style

* force clang 3.9 (latest available on Ubuntu Trusty)

* remove clang-format file, 3.9 is confused by some settings. try using built-in Mozilla style instead
2018-08-29 13:47:18 -07:00
Henry Corrigan-Gibbs 022985daae Fix formatting nits 2018-08-27 21:37:10 -07:00
Robert Helmer 10aeb86dc8 issue #20 - do not use locale-dependent versions of isxdigit and toupper 2018-08-27 15:48:59 -07:00
Robert Helmer b9d21e977c free PK11 slot as this appears to be leaking NSS resources at shutdown 2018-08-23 06:40:41 -07:00
Henry Corrigan-Gibbs 5779b9cde2 Code for libprio pilot (#1)
* The core libprio code for Prio client and server.

These files contain the core cryptographic routines needed
to implement the Prio client and Prio server.

* Tests and example code for libprio.

* A copy of NSS's MPI library.

Since NSS does not export the MPI bignum library, we ship a copy
with the standalone version of libprio.

* Build file and README for libprio.

* Edits per code review by franziskuskiefer

* More edits per code review by franziskuskiefer

* Fix memory bugs found by clang-analyzer

* Remove ugly hack from PublicKey_import method

Now we can import a 32-byte curve25519 public key into NSS without
having to generate a new keypair from scratch.

* Replace SConstruct file with simpler one

* Update README to incorporate code review edits

* Allow importing and exporting public keys in hex

- Public functions PublicKey_import_hex and PublicKey_export_hex
- Tests for these functions

* Add end-to-end test program for PrioEncoder.

Add browser-test utility that
1) generates new server keypairs,
2) uses xpcshell to call the PrioEncoder DOM routines,
3) parses the output of PrioEncoder,
4) validates the encoded packet, and
5) checks that the submitted data is what we expected.

* Fixes to make browser-test compile on Linux
2018-07-17 11:26:39 -07:00