aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* If skipping a test due to diabled algo, only print if in verbose mode.Jack Lloyd2015-12-191-1/+5
| | | | | | Also fix KDF tests which failed on missing algo GH #367
* CLI rewriteJack Lloyd2015-12-191-18/+6
| | | | | | | | | | | | | | | | | | 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.
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-111-14/+14
| | | | | | | | 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
* Convert const char* arguments on Test:: to std::stringsJack Lloyd2015-11-281-32/+21
| | | | unless they are actually optional
* Add helper for test output files. Remove last uses of hardcoded data dir macrosJack Lloyd2015-11-161-2/+15
|
* Add TLS_PSK testsJack Lloyd2015-11-131-2/+2
| | | | | | | | | | | Fix a bug which rejected any short server key exchanges. These can occur with a plain PSK with short or empty identity hints. Disable SHA-224 by default. Remove some vestigal RC4 cruft. Push more on the TLS corruption tests.
* Avoid calling get_files_recursive on a possible non-directory.Jack Lloyd2015-11-111-8/+9
| | | | | | | | | The Boost directory iterator throws an exception in that case. Interestingly the current VC version does not seem to. In the interests of portability just avoid this operation rather than trying to hack around it in the Boost fs version. GH #328
* Fix occasional test failsJack Lloyd2015-11-111-0/+17
| | | | | | | | Increase the iterations of the BigInt::random_integer test. Since things get slow quickly, leave the larger range tests to higher soak levels. In TLS, if the corrupted data causes an exception immediately that's ok because it's corrupted data.
* Update and consolidate the test framework.Jack Lloyd2015-11-111-241/+643
| | | | | | | | | | | The tests previously had used 4 to 6 different schemes internally (the vec file reader framework, Catch, the old InSiTo Boost.Test tests, the PK/BigInt tests which escaped the rewrite in 1.11.7, plus a number of one-offs). Converge on a design that works everywhere, and update all the things. Fix also a few bugs found by the test changes: SHA-512-256 name incorrect, OpenSSL RC4 name incorrect, signature of FFI function botan_pubkey_destroy was wrong.
* Fix cert validation bugs found by x509test.Jack Lloyd2015-10-231-2/+3
| | | | Add test suite with certs from x509test
* McEliece cleanupsJack Lloyd2015-09-291-0/+2
| | | | | | | | | | | | | | | | | | | | Remove and consolidate various headers Reduce memory usage of GF2m_Field by sharing the log and exponent tables across all instances of a particular word size. Remove McEliece_Public_Operation and McEliece_Private_Operation which were difficult to use safely. Instead only the KEM operations are exposed. Add McEliece_PublicKey::random_plaintext_element Add command line `mce` tool and some McEliece documentation Convert the speed program to check McEliece keys of the suggested size Add McEliece KATs for both key generation and KEM Fix HMAC_DRBG constructor which derefed a pointer before its time
* Add power analysis countermeasures for ECC point multiplications.Jack Lloyd2015-08-211-0/+1
| | | | | | | | The plain PointGFp operator* now uses Montgomery ladder exclusively. Adds a blinded point multiply algorithm which uses exponent and point randomization, as well as a Montgomery ladder technique that takes a random walk of the possible addition chains for k.
* Fix two crashes in the BER decoder found with afl.Jack Lloyd2015-08-021-0/+1
| | | | | One a read at 0 of an empty vector, the other causing allocation of an arbitrary amount of memory.
* Refactor internal/filesystem.hSimon Warta2015-07-161-6/+15
| | | | Closes #198
* Add initial catchy test: base64Simon Warta2015-07-151-0/+19
|
* Check if there are test vector files in a given test dirSimon Warta2015-07-151-2/+8
|
* Improve test reportingSimon Warta2015-07-151-6/+8
|
* Add seperator above test summarySimon Warta2015-07-031-0/+1
|
* Add missing test report for TSS testsSimon Warta2015-06-251-0/+1
|
* Replace \n by std::endl in tests to ensure proper flushingSimon Warta2015-06-191-10/+10
| | | | | | | - Remove additional newlines in CHECK_MESSAGE call - Remove redundant output of algo in aead_test() Closes #115
* Add tests for compression and SRP.lloyd2015-05-131-0/+2
| | | | | | | | Fix zlib decompression which was not ignoring Z_BUF_ERROR which is harmless in this context as process is already checking avail_in and avail_out after run returns. Bump version to 1.11.17
* Hide all uses of boost filesystem in fs.cpp. Use readdir as anlloyd2015-02-211-24/+4
| | | | | alternate implementation for Unix and add some feature checks so a boost-free build of the tests and command line are possible again.
* Convert HKDF to the normal KDF interfacelloyd2015-02-181-1/+0
|
* Remove algo factory, engines, global RNG, global state, etc.lloyd2015-02-041-3/+0
| | | | | | | | | | | | | | | Convert all uses of Algorithm_Factory and the engines to using Algo_Registry The shared pool of entropy sources remains but is moved to EntropySource. With that and few remaining initializations (default OIDs and aliases) moved elsewhere, the global state is empty and init and shutdown are no-ops. Remove almost all of the headers and code for handling the global state, except LibraryInitializer which remains as a compatability stub. Update seeding for blinding so only one hacky almost-global RNG instance needs to be setup instead of across all pubkey uses (it uses either the system RNG or an AutoSeeded_RNG if the system RNG is not available).
* Ensure all files have copyright and license info.lloyd2015-01-101-0/+6
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* All tests now share an RNG. Uses system RNG if availablelloyd2014-12-281-0/+16
|
* Add Curve25519 based on curve25519-donna by Adam Langley.lloyd2014-12-271-0/+1
| | | | | | This uses only the c64 version from curve25519-donna; on systems that don't have a native uint128_t type, a donna128 type stands in for just enough 128-bit operations to satisfy donna.cpp
* Add an implementation of McEliece encryption based on HyMESfstrenzke2014-11-261-0/+1
| | | | | | | (https://www.rocq.inria.fr/secret/CBCrypto/index.php?pg=hymes). The original version is LGPL but cryptsource GmbH has secured permission to release it under a BSD license. Also includes the Overbeck CCA2 message encoding scheme.
* Add some secp256k1 KATs and a randomized ECC test suggested inlloyd2014-10-101-0/+1
| | | | http://crypto.stackexchange.com/questions/784
* Add RFC 6979 nonce generator. Also some HMAC_DRBG cleanups.lloyd2014-03-221-0/+1
|
* Add HMAC_DRBGlloyd2014-03-211-2/+2
|
* Fix a bug introduced in 1.11.6 where we tried to check CRL signatureslloyd2014-02-081-1/+2
| | | | | | against the wrong key, causing any check to fail. Clean up the NIST X.509 path validation tests and run them by default.
* Add initializer for test mainlloyd2014-01-181-0/+3
|
* Split off the keyed interfaces of transform to Keyed_Transformlloyd2014-01-181-1/+1
| | | | | Remove the unhelpful 'Algorithm' base class which had previously acted more or less as a global base.
* Split up test vectors into per-algo files and app into botan-test forlloyd2014-01-101-10/+81
| | | | the tests and botan for everything else.
* Split up public key tests and data, use new test frameworklloyd2014-01-051-10/+22
|
* Make test target selectablelloyd2014-01-041-38/+41
|
* Make tss example a test of sortslloyd2014-01-011-0/+1
|
* Shuffle things around. Add NIST X.509 test to build.lloyd2014-01-011-0/+190