aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add -Werror mode for CI buildJack Lloyd2019-12-031-1/+1
|
* In threaded mode tests, disable mlock pool unless requestedJack Lloyd2019-08-211-0/+11
|
* Default to running the tests in threaded modeJack Lloyd2019-08-171-10/+1
|
* Using preprocessor for the testsDavid Carlier2019-04-121-2/+1
|
* Run the test suite in multiple threadsJack Lloyd2019-01-311-1/+11
| | | | Refactor areas where data was being shared
* Add ability to skip a few named testsJack Lloyd2018-12-311-1/+2
| | | | This is sometimes useful when debugging
* Make exceptions easier to translate to error codesJack Lloyd2018-11-231-1/+1
| | | | | | | | | | | Avoid throwing base Botan::Exception type, as it is difficult to determine what the error is in that case. Add Exception::error_code and Exception::error_type which allows (for error code) more information about the error and (for error type) allows knowing the error type without requiring a sequence of catches. See GH #1742
* Resolve a leak in OpenSSL ECDSA verification for old OpenSSLJack Lloyd2018-10-031-1/+11
| | | | | | The code was using the 1.0 API incorrectly and causing a leak. https://github.com/riboseinc/rnp/issues/757
* Fix the botan-test --verbose flag, which did nothingJack Lloyd2018-04-111-0/+1
| | | | It used to do something, then I broke it.
* Make tests pass by default in UBSAN modeMatthias Gierlings2018-04-061-2/+2
| | | | | | | | - Adds macros to check if botan was compiled with a certain sanitizers. - Automatically excludes the tests that are intended to provoke undefined behaviour from the test bench, when botan is compiled with UBSAN. - Changes option `--avoid-undefined` to `--no-avoid-undefined` so the failing tests can be explicitly activated when needed.
* Add Test_Options classJack Lloyd2018-04-021-18/+14
|
* Add --avoid-undefined optionJack Lloyd2018-03-311-3/+6
| | | | GH #1518
* Add new test option --abort-on-first-failJack Lloyd2018-03-281-2/+3
| | | | | Calls std::abort the first time a test fails. Not for general consumption but sometimes very useful when tracking down a tricky bug.
* Fix botan-test --helpJack Lloyd2017-10-241-3/+48
| | | | [ci skip]
* Refactor option parsing in cli and test codeJack Lloyd2017-10-241-411/+28
| | | | Allows cleaning up header includes, also somewhat smaller binaries.
* Work around some MSVC 2013 sillynessJack Lloyd2017-09-291-1/+3
|
* Avoid using std::rand in test codeJack Lloyd2017-09-291-2/+4
| | | | It makes static analyzers mad
* Further header cleanupsJack Lloyd2017-09-281-1/+0
|
* Fix for threadless buildsJack Lloyd2017-09-251-0/+5
| | | | [ci skip]
* Further build/test fixes for restricted configurationsJack Lloyd2017-09-241-8/+10
|
* Refactor how test RNG is createdJack Lloyd2017-09-241-81/+82
|
* Add final annotations as appropriate in the test codeJack Lloyd2017-09-221-2/+2
|
* Output errors to cerrJack Lloyd2017-09-021-4/+4
|
* Add support for LLVM bitcode targetJack Lloyd2017-08-301-2/+15
|
* Add a bogus fallback RNG for the testsJack Lloyd2017-05-211-0/+37
| | | | This allows all tests to run even if no RNG type enabled in the build
* Reformat code with astyle + fix code styleTomasz Frydrych2017-05-011-23/+34
|
* Show OpenSSL error messages if test fails.Alexander Bluhm2017-04-281-0/+10
| | | | | | Call ERR_load_crypto_strings() during test initialization if the openssl provider is also tested. This gives human readable error messages.
* Run tests for a specific provider.Alexander Bluhm2017-04-211-2/+10
| | | | | | | | Currently botan runs the tests for all crypto providers it can find. Add a --provider option for botan-test to specify exactly one provider. This allows to see which parts of a specific implementation have been tested. Pass down the given provider to a specific test class.
* Merge GH #960 Check name of test suite.Jack Lloyd2017-04-021-0/+11
|\
| * Check name of test suite.Alexander Bluhm2017-03-311-0/+11
| | | | | | | | | | If botan-test is invoked with an invalid test name, fail with a usage error. This is more obvious than not running the test.
* | Print test name before running test.Alexander Bluhm2017-03-311-0/+1
|/ | | | | | To make it easy to repeat classes of tests, print the name of the test suite before starting it. This name can be used on the botan-test command line. If a test hangs, it is also obvious which.
* Add --test-runs option to test binaryJack Lloyd2017-03-291-5/+9
| | | | Just runs the specified test several times, or until first failure.
* Fix various SunCC and Solaris warnings and build problems.Jack Lloyd2017-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Based on build output sent by @noloader. If RLIMIT_MEMLOCK is not defined, assume regular user is not able to call mlock. This probably also affected Clang/GCC on Solaris. Work around resolution issue in SIMD_4x32 where it finds ambiguity between arg taking uint32_t and __m128i. This is probably some artifact of how SunCC represents vector types, and seems highly bogus in general but is easy to work around here. Change constructor taking a single value to instead be `SIMD_4x32::splat` function. The SIMD class is internal, so no API implications. Fix various warnings about lambda functions that were missing return types and which were not a single return statement. AIUI C++11 doesn't guarantee that lambda return type will be deduced in that situation, though in practice every compiler including SunCC seems to handle it. Disable AVX2 usage, since SunCC's intrinsics seem to be broken - its _mm_loadu_si256 takes non-const pointer. Rename a few variables in the tests to avoid shadowed var warnings.
* Avoid blocking tests from running if no RNG enabledJack Lloyd2017-01-221-5/+0
| | | | Instead just let the individual tests that need the RNG fail.
* Add test option --run-long-testsJack Lloyd2016-12-241-7/+9
| | | | | | Previously longer tests were hidden behind higher 'soak levels' but these arbitrary cutoffs are confusing compared to a simple short tests/long tests split.
* Better OCSP tests including online testsJack Lloyd2016-11-231-2/+4
| | | | Tests touching network are gated by --run-online-tests flag.
* Add TPM and PKCS #11 to coverage buildJack Lloyd2016-10-241-8/+11
| | | | | | | SoftHSMv1 included in 14.04 is too old and many tests fail, so grabs prebuilt SoftHSMv2 binaries from www.randombit.net. This can change to use the packaged SoftHSM in 16.04, whenever Travis makes that available.
* Add missing try/catch blocks.Jack Lloyd2016-10-071-7/+22
| | | | Document that create_*_op is public but not for public consumption.
* Add try/catch block at top-level test runnerJack Lloyd2016-09-161-3/+17
|
* RNG changes (GH #593)Jack Lloyd2016-08-241-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change reseed interval logic to count calls to `randomize` rather than bytes, to match SP 800-90A Changes RNG reseeding API: there is no implicit reference to the global entropy sources within the RNGs anymore. The entropy sources must be supplied with the API call. Adds support for reseding directly from another RNG (such as a system or hardware RNG). Stateful_RNG keeps optional references to both an RNG and a set of entropy sources. During a reseed, both sources are used if set. These can be provided to HMAC_DRBG constructor. For HMAC_DRBG, SP800-90A requires we output no more than 2**16 bytes per DRBG request. We treat requests longer than that as if the caller had instead made several sequential maximum-length requests. This means it is possible for one or more reseeds to trigger even in the course of generating a single (long) output (generate a 256-bit key and use ChaCha or HKDF if this is a problem). Adds RNG::randomize_with_ts_input which takes timestamps and uses them as the additional_data DRBG field. Stateful_RNG overrides this to also include the process ID and the reseed counter. AutoSeeded_RNG's `randomize` uses this. Officially deprecates RNG::make_rng and the Serialized_RNG construtor which creates an AutoSeeded_RNG. With these removed, it would be possible to perform a build with no AutoSeeded_RNG/HMAC_DRBG at all (eg, for applications which only use the system RNG). Tests courtesy @cordney in GH PRs #598 and #600
* Switch to HMAC_DRBG for all RNG generation.Jack Lloyd2016-07-171-2/+3
| | | | | | | | Add support and tests for additional_data param to HMAC_DRBG Add Stateful_RNG class which has fork detection and periodic reseeding. AutoSeeded_RNG passes the current pid and time as additional_data
* add PKCS#11 supportDaniel Neus2016-06-171-2/+26
|
* Avoid having Command* objects be created until requested.Jack Lloyd2015-12-301-2/+2
| | | | Avoids various static init and destruction hassles.
* Fix a few clang warnings. Set clang sanitizer flagsJack Lloyd2015-12-241-2/+4
|
* Add missing try/catch in signature verification test.Jack Lloyd2015-12-211-1/+1
| | | | | | Improve diagnostics when an exception escapes a test GH #369
* Add --data-dir option to test commandJack Lloyd2015-12-201-71/+61
| | | | | | | Understand using '-' on the command line to mean stdin Fix last few unit tests that wanted to write to the filesystem; removes outdata directory.
* If skipping a test due to diabled algo, only print if in verbose mode.Jack Lloyd2015-12-191-30/+32
| | | | | | Also fix KDF tests which failed on missing algo GH #367
* CLI rewriteJack Lloyd2015-12-191-119/+148
| | | | | | | | | | | | | | | | | | 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
|
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-111-1/+1
| | | | | | | | 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