aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Restart state in Text_Based_Test after test is overJack Lloyd2017-10-061-0/+2
| | | | This allows --test-runs= to work as expected
* Further header cleanupsJack Lloyd2017-09-281-0/+9
|
* Remove some using declarations in test codeJack Lloyd2017-09-221-1/+3
|
* Header file cleanupsJack Lloyd2017-09-211-0/+1
| | | | Some help from include-what-you-use
* Merge GH #1212 Add support for 'raw' PSS signaturesJack Lloyd2017-09-201-4/+4
|\
| * Support PSSR_RawJack Lloyd2017-09-161-4/+4
| | | | | | | | | | | | | | Allows PSS-signing a raw hash while also still specifying the salt length. GH #1211
* | Add basic tests for const time utilsJack Lloyd2017-09-191-0/+5
| | | | | | | | Remove CT::min and CT::max which were unused and it turns out, broken.
* | Merge GH #1205 Support large blocks in OCB modeJack Lloyd2017-09-191-1/+4
|\ \ | |/ |/|
| * Change wide block OCBJack Lloyd2017-09-151-1/+4
| | | | | | | | | | Ted Krovetz confirmed there were bugs in the reference code for blocks > 128 bits so these values should be the correct ones.
* | Merge duplicated logic for clearing CPUID bitsJack Lloyd2017-09-161-40/+1
|/
* Add SHA-256 using ARMv8 instructionsJack Lloyd2017-05-201-6/+13
| | | | Based on patch from Jeffrey Walton in GH #841
* Add support for Intel SHA-1/SHA-2 instructionsJack Lloyd2017-05-191-0/+2
| | | | Based on GH #807 and #808
* Merge GH #1035 Support generating RSA keys with OpenSSLJack Lloyd2017-05-031-5/+5
|\
| * Generate private RSA key with OpenSSL.Alexander Bluhm2017-04-301-5/+5
| | | | | | | | | | Implement RSA private key generation with RSA_generate_key_ex(). Make PK_Key_Generation_Test iterate over all providers.
* | Reformat code with astyle + fix code styleTomasz Frydrych2017-05-011-33/+103
|/
* In text-based tests clear all data if algo changesJack Lloyd2017-04-271-0/+1
| | | | | | | Curious test failure, HMAC(MD5) failing with "invalid IV length" (HMAC doesn't support an IV), it turned out to be the IV was left around from the previously run GMAC test. Just clear out all vars if a new [algo] header is seen in the file.
* Filter provider in test loops, skip text based without provider.Alexander Bluhm2017-04-211-1/+12
| | | | | | | | The tests for block, hash, stream, pubkey, and mac loop over all possible crypto providers. If a specific provider is given on the botan-test command line, use only this one. If the provider to be tested is restricted, skip text based tests that do not have a possible provider.
* Run tests for a specific provider.Alexander Bluhm2017-04-211-0/+25
| | | | | | | | 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.
* Fix botan-test verbose modeRené Korthaus2017-02-141-1/+1
|
* Add support for NEON in SIMD_4x32Jack Lloyd2017-01-291-0/+7
| | | | Tested on qemu-aarch64
* Avoid blocking tests from running if no RNG enabledJack Lloyd2017-01-221-1/+1
| | | | Instead just let the individual tests that need the RNG fail.
* Add positive DH test vectors from NIST CAVPRené Korthaus2017-01-021-0/+21
|
* Improve filter testsJack Lloyd2016-12-311-1/+1
| | | | | | | Fix a bug in Pipe::check_available that must date back 15 years... Add destructors to compression filter so unique_ptr destructor runs without user having to include an extra header for the owned type.
* Add more tests for random prime and DL group generationJack Lloyd2016-12-301-0/+12
|
* Add test option --run-long-testsJack Lloyd2016-12-241-15/+25
| | | | | | Previously longer tests were hidden behind higher 'soak levels' but these arbitrary cutoffs are confusing compared to a simple short tests/long tests split.
* Minor refactoring of Text_Based_TestJack Lloyd2016-12-191-17/+5
| | | | | | Turns out astyle has some bugs wrt C++11 initialize lists. Rather than having astyle mangle all of the tests, convert to using a string which is split once at the start instead of a vector of keys.
* Fix off by one in PKCS #1 v1.5 decryption decodingJack Lloyd2016-12-081-0/+14
| | | | | | | | | | | | When the code was changed in b8966d0f89e, the offset was not changed, so it would reject ciphertexts with exactly 8 bytes of random padding (the required minimum). Found by pkcs1 fuzzer which also had problems due to not having been updated at the same time. Add a test suite for decoding of PK decryption padding to cover the problem cases.
* Add test for various functions previously missed (T::clone, PBKDF::name, ↵Jack Lloyd2016-11-261-1/+11
| | | | | | | AEAD::output_length) Fix a bug in CCM, GCM, and OCB decryption which caused `output_length(tag_size())` to fail even though empty plaintexts are certainly defined for all three modes.
* Better OCSP tests including online testsJack Lloyd2016-11-231-0/+9
| | | | Tests touching network are gated by --run-online-tests flag.
* Add missing try/catch blocks.Jack Lloyd2016-10-071-2/+10
| | | | Document that create_*_op is public but not for public consumption.
* New TLS positive and negative tests.Juraj Somorovsky2016-09-301-0/+23
| | | | | | | | | | | | | | | | | | | TLS message parsing: - CertificateVerify - HelloVerify - ClientHello (with extensions) - ServerHello (with extensions) - NewSessionTicket - Alert TLS message processing: - HelloVerify TLS Policy tests Unit tests with TLS client authentication Added test_throws method that checks the correct exception message.
* Add T::provider() to allow user to inquire about implementation usedJack Lloyd2016-09-151-0/+7
| | | | | For block ciphers, stream ciphers, hashes, MACs, and cipher modes. Cipher_Mode already had it, with a slightly different usage.
* Fix build on PowerPC. Fix test runs on non-x86Jack Lloyd2016-09-151-4/+1
|
* Add cpuid overload to test frameworkJack Lloyd2016-09-151-15/+98
|
* RNG changes (GH #593)Jack Lloyd2016-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* fix minimized build when pkcs11 module enabledDaniel Neus2016-08-201-0/+12
|
* add OctetString unit testsDaniel Neus2016-07-201-0/+17
| | | | and add the possibility to compare OctetStrings with the botan test-framework
* add PKCS#11 supportDaniel Neus2016-06-171-28/+9
|
* Add more tests for ffiRené Korthaus2016-03-251-0/+14
|
* String comparision fixesDaniel Neus2016-01-041-2/+2
| | | | fix PVS-Studio perfomance warnings
* some trivial compiler/PVS-Studio warning fixesDaniel Neus2015-12-221-3/+3
|
* Add missing try/catch in signature verification test.Jack Lloyd2015-12-211-6/+10
| | | | | | Improve diagnostics when an exception escapes a test GH #369
* Add --data-dir option to test commandJack Lloyd2015-12-201-26/+23
| | | | | | | 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-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