aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
Commit message (Collapse)AuthorAgeFilesLines
* Check result of dynamic_castJack Lloyd2016-02-091-10/+17
| | | | | | Unlikely to fail in this case but anything's possible. Found by Coverity
* Removes randomization from choice of keys in X509 test.Jack Lloyd2016-02-091-17/+15
| | | | | | | Would be better to iterate over all of the key types for this type of coverage. Avoids Coverity dead code warning on the error-case throw.
* Fix memory leaks in FFI testsJack Lloyd2016-02-091-7/+16
| | | | | | | | | | Some tests only deallocated in the branch where some other test on the object succeeded. The ECDH FFI test didn't deallocate any of its objects, which was missed by valgrind before now because the test was not being run. Found by Coverity scanner
* V816 It is more efficient to catch exception by reference rather than by ↵Daniel Neus2016-02-081-1/+1
| | | | value. asn1_time.cpp 159
* V814 Decreased performance. The 'strlen' function was called multiple times ↵Daniel Neus2016-02-081-2/+1
| | | | inside the body of a loop. test_compression.cpp 78
* Remove dead write. Closes GH #401Jack Lloyd2016-02-071-2/+5
|
* Fix two bugs in 1.11.27 which caused test failures.1.11.28Jack Lloyd2016-02-011-0/+5
| | | | | | | | | | | | | The check on each individual size in curve_mul is too strict since we rely on redc(x*1) during the on the curve computation. Fix an off by one in ressol which caused it to occasionally reject valid values. Updating version 1.11.28 since existing 1.11.27 tag already pushed :( Fix an off-by-one in ressol which would cause it to occasionly give up too early.
* Fix heap overflow in ECC point multiplicationJack Lloyd2016-02-012-0/+52
| | | | | | | | | | | | | | If affine coordinates larger than the prime modulus were given, a later multiplication could overflow the size of an allocated output buffer, which was sized based on the size of the prime. This will cause an overflow into either the system heap or if the mlock/mmap pool allocator is in use, then into the adjacent key material stored in the pool. Reported by Alex Gaynor who found it with AFL Also fix a one word overwrite in P-521 reduction. Found with AFL
* Fix (nearly) infinite loop in RESSOL (modular square root).Jack Lloyd2016-02-012-0/+31
| | | | | | | It first computed the first i for q**(2**i) == 1, then checked that i was smaller than s. Given a composite modulus (for which the algorithm does not work), the loop might do a very large amount of work before returning the failure.
* Blake2b: add 'abc' test vectorcynecx2016-01-261-0/+3
|
* Add Blake2b hash functioncynecx2016-01-261-0/+3111
|
* Merge GH #410 enable -WpedanticJack Lloyd2016-01-171-1/+1
|\
| * Enable -Wpedantic on gcc and clangRené Korthaus2016-01-131-1/+1
| |
* | Avoid test failures in KEM when KDF is not found.Jack Lloyd2016-01-172-19/+44
|/ | | | GH #369
* Get rid of "extra ';'" warnings and force semicolon after macrosSimon Warta2016-01-111-1/+2
|
* Mass-prefix member vars with m_René Korthaus2016-01-081-8/+8
|
* add missing overridesDaniel Neus2016-01-087-7/+7
| | | | found by gcc with -Wsuggest-override
* String comparision fixesDaniel Neus2016-01-041-2/+2
| | | | fix PVS-Studio perfomance warnings
* Add ECDH via OpenSSLJack Lloyd2016-01-042-53/+66
| | | | | | | | | | Expose provider param in PK_Key_Agreement API Handle multiple providers in key agreement tests Fix some funky formatting of P-521 EC points in ecdh.vec which was being rejected by OpenSSL; for whatever reason the CAVS file had the affine coords with far more leading zeros than necessary.
* Add some more secp256k1 point mult testsJack Lloyd2016-01-031-0/+184
|
* Add ECDH testsJack Lloyd2016-01-035-7/+592
| | | | Only has vectors for NIST curves (data taken from NIST CAVS file)
* Fix PointGFp multiplication bugJack Lloyd2016-01-032-8/+1057
| | | | | | There was a special case for small scalars which managed to forget that the integer 3 also fits into two bits. Found by adding a new set of ECC point mul tests for the NIST curves.
* Merge pull request #381 from cordney/fix-load-unencryped-key-from-berJack Lloyd2015-12-311-3/+0
|\ | | | | Fix loading of unencrypted, BER encoded private keys via PKCS8 api
| * Fix loading of unencrypted, BER encoded private keys via PKCS8 apiRené Korthaus2015-12-251-3/+0
| |
* | Remove debug printfJack Lloyd2015-12-311-1/+0
| |
* | Avoid having Command* objects be created until requested.Jack Lloyd2015-12-301-2/+2
| | | | | | | | Avoids various static init and destruction hassles.
* | Correct copyright info in unit_ecc.cpp fileJack Lloyd2015-12-261-1/+6
| | | | | | | | | | | | | | | | At some point during the test changeover the (C) info got lost from this file. Also try randomizing the point repr in the copy test, just to spice things up a bit.
* | Merge pull request #378 from neusdan/warning_fixesJack Lloyd2015-12-2610-22/+15
|\ \ | | | | | | Some trivial compiler and PVS-Studio warning fixes
| * | some trivial compiler/PVS-Studio warning fixesDaniel Neus2015-12-2210-22/+15
| | |
* | | Add generalized KEM interfaceJack Lloyd2015-12-265-14/+119
| | | | | | | | | | | | | | | | | | Convert McEliece KEM to use it Add RSA-KEM
* | | Another Clang warningJack Lloyd2015-12-251-1/+1
| |/ |/|
* | Fix a few clang warnings. Set clang sanitizer flagsJack Lloyd2015-12-243-4/+5
| |
* | Improve roundtrip BER/PEM testsJack Lloyd2015-12-231-24/+71
| |
* | Update NIST X509 tests to handle --data-dir and read expected results from a ↵Jack Lloyd2015-12-232-223/+148
| | | | | | | | file
* | Use --data-dir in test X509test_PathSimon Warta2015-12-221-6/+5
|/ | | | This allows me to build and run tests out-of-tree :)
* Add missing try/catch in signature verification test.Jack Lloyd2015-12-214-14/+30
| | | | | | Improve diagnostics when an exception escapes a test GH #369
* Throw Lookup_Error instead of bare Exception when creating an obj failsJack Lloyd2015-12-201-4/+4
| | | | | | | in the algo factory. Fixes remaining issues of GH #369 - test_pubkey.cpp was expecting Lookup_Error when something isn't found.
* Merge pull request #371 from webmaster128/aes-gcm-testdataJack Lloyd2015-12-201-41/+122
|\ | | | | Add all 18 GCM tests provided in NIST GCM spec
| * Add all 18 Nist GCM testsSimon Warta2015-12-201-41/+122
| | | | | | | | | | | | | | | | This adds tests for key length 192 and 256. Test vector source: http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm /gcm-spec.pdf Closes: #344
* | Add --data-dir option to test commandJack Lloyd2015-12-2033-238/+200
|/ | | | | | | Understand using '-' on the command line to mean stdin Fix last few unit tests that wanted to write to the filesystem; removes outdata directory.
* Prevent FFI tests from failing if bcrypt is disabled. GH #369Jack Lloyd2015-12-191-4/+10
|
* Avoid test failures on missing algosJack Lloyd2015-12-192-5/+7
| | | | GH #369
* If skipping a test due to diabled algo, only print if in verbose mode.Jack Lloyd2015-12-194-33/+40
| | | | | | Also fix KDF tests which failed on missing algo GH #367
* CLI rewriteJack Lloyd2015-12-194-144/+171
| | | | | | | | | | | | | | | | | | The command line tools' origin as a collection of examples and test programs glued together led to some unfortunate problems; lots of hardcoded values, missing parameters, and obsolete crypto. Adds a small library for writing command line programs of the sort needed here (cli.h), which cuts the length of many of the commands in half and makes commands more pleasant to write and extend. Generalizes a lot of the commands also, eg previously only signing/verification with DSA/SHA-1 was included! Removes the fuzzer entry point since that's fairly useless outside of an instrumented build. Removes the in-library API for benchmarking.
* Fix for minimized buildsJack Lloyd2015-12-111-1/+1
|
* Missing addsJack Lloyd2015-12-111-10/+12
|
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-1110-27/+33
| | | | | | | | As the alternatives are unfortunate for applications trying to catch all library errors, and it seems deriving from std::runtime_error causes problems with MSVC DLLs (GH #340) Effectively reverts 2837e915d82e43
* Fix indent in test_passhashSimon Warta2015-12-081-1/+1
|
* Missing test update for ECC group removal.Jack Lloyd2015-12-021-4/+0
|
* Remove support for broken 112 and 128 bit SECP ECC groups.Jack Lloyd2015-12-021-4/+0
|