aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.h
Commit message (Collapse)AuthorAgeFilesLines
* Add test for non-null pointerJack Lloyd2018-01-301-0/+9
|
* Remove BOTAN_FORCE_SEMICOLON macroJack Lloyd2017-12-301-2/+1
| | | | | | Only needed in two headers (cli.h and test.h) not in the main library. Just change those two uses to not use anonymous namespaces.
* Move utils for reading test data files up to Test:: from OCSPJack Lloyd2017-12-291-0/+3
|
* Use a simple PRNG for the testsJack Lloyd2017-10-291-9/+11
| | | | | | | | | | | Not cryptographically secure, but fast! Cuts several seconds off the test suite even on a very fast machine. Probably even more effective for 32-bit systems since the default for HMAC_DRBG is SHA-384. Also it means deterministic tests are used regardless of build configuration which is nice. Improve output for --test-runs which was useful for me when debugging SM2 encryption issue.
* Inline Test::run_test into only callerJack Lloyd2017-10-241-3/+1
|
* Avoid empty methods, use =default or add a commentJack Lloyd2017-10-031-1/+0
| | | | Sonar
* Further header cleanupsJack Lloyd2017-09-281-11/+14
|
* Additional finalsJack Lloyd2017-09-221-3/+3
|
* Add final annotations as appropriate in the test codeJack Lloyd2017-09-221-1/+1
|
* Remove some using declarations in test codeJack Lloyd2017-09-221-3/+3
|
* Change header guard format to BOTAN_FOO_H_Jack Lloyd2017-09-201-2/+2
| | | | | | ISO C++ reserves names with double underscores in them Closes #512
* Add basic tests for const time utilsJack Lloyd2017-09-191-0/+1
| | | | Remove CT::min and CT::max which were unused and it turns out, broken.
* Merge GH #1035 Support generating RSA keys with OpenSSLJack Lloyd2017-05-031-1/+1
|\
| * Generate private RSA key with OpenSSL.Alexander Bluhm2017-04-301-1/+1
| | | | | | | | | | 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-13/+37
|/
* Filter provider in test loops, skip text based without provider.Alexander Bluhm2017-04-211-1/+1
| | | | | | | | 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/+13
| | | | | | | | 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.
* Content:Tomasz Frydrych2017-04-031-2/+2
| | | | | | | | | * fixes for deprecated constructions in c++11 and later (explicit rule of 3/5 or implicit rule of 0 and other violations) * `default` specifier instead of `{}` in some places(probably all) * removal of unreachable code (for example `return` after `throw`) * removal of compilation unit only visible, but not used functions * fix for `throw()` specifier - used instead `BOTAN_NOEXCEPT` * removed not needed semicolons
* Fix botan-test verbose modeRené Korthaus2017-02-141-1/+1
|
* Add support for NEON in SIMD_4x32Jack Lloyd2017-01-291-0/+6
| | | | Tested on qemu-aarch64
* Add positive DH test vectors from NIST CAVPRené Korthaus2017-01-021-0/+1
|
* 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.
* Missing addJack Lloyd2016-12-311-0/+1
|
* Add test option --run-long-testsJack Lloyd2016-12-241-5/+10
| | | | | | 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-10/+2
| | | | | | 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.
* Convert to using standard uintN_t integer typesJack Lloyd2016-12-181-4/+2
| | | | | | Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them.
* Fix off by one in PKCS #1 v1.5 decryption decodingJack Lloyd2016-12-081-0/+2
| | | | | | | | | | | | 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-0/+2
| | | | | | | 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-1/+3
| | | | Tests touching network are gated by --run-online-tests flag.
* This range check was in the wrong directionJack Lloyd2016-11-171-1/+1
|
* Fix TLS corruption tests.Jack Lloyd2016-11-151-4/+7
| | | | | | | | | There is a simple bit flip corruption test for the TLS stack: we shouldn't negotiate correctly if any random bit gets flipped. But it turns out this is not entirely true as the record layer version field is effectively ignored except for distinguishing TLS vs DTLS. So a small bitflip in that field is sometimes ignored, causing the test to fail. Make sure we modify something in the body instead.
* New TLS positive and negative tests.Juraj Somorovsky2016-09-301-0/+3
| | | | | | | | | | | | | | | | | | | 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/+2
| | | | | For block ciphers, stream ciphers, hashes, MACs, and cipher modes. Cipher_Mode already had it, with a slightly different usage.
* Add cpuid overload to test frameworkJack Lloyd2016-09-151-0/+3
|
* fix minimized build when pkcs11 module enabledDaniel Neus2016-08-201-0/+2
|
* add OctetString unit testsDaniel Neus2016-07-201-0/+5
| | | | and add the possibility to compare OctetStrings with the botan test-framework
* Switch to HMAC_DRBG for all RNG generation.Jack Lloyd2016-07-171-1/+1
| | | | | | | | 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/+37
|
* Add more tests for ffiRené Korthaus2016-03-251-0/+1
|
* cppcheck fixes: Class 'X' has a constructor with 1 argument that is not ↵Daniel Neus2016-03-051-2/+2
| | | | explicit.
* Add constant time conditional swap, add, sub for bigint wordsJack Lloyd2016-02-171-0/+7
| | | | | | | | | Not optimized and relies on asm support for const time word_add/word_sub instructions. Fix a bug introduced in 46e9a89 - unpoison needs to call the valgrind API with the pointer rather than the reference. Caused values not to be unpoisoned.
* Get rid of "extra ';'" warnings and force semicolon after macrosSimon Warta2016-01-111-1/+2
|
* Fix a few clang warnings. Set clang sanitizer flagsJack Lloyd2015-12-241-1/+0
|
* 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-3/+7
| | | | | | | 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/+1
| | | | | | Also fix KDF tests which failed on missing algo GH #367
* CLI rewriteJack Lloyd2015-12-191-6/+15
| | | | | | | | | | | | | | | | | | 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-0/+6
| | | | | | | | 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-28/+24
| | | | unless they are actually optional
* New reseed_with_sources call on RNGsJack Lloyd2015-11-241-1/+8
| | | | | | | | | | | | | Provides an easier way for an application to configure a list of entropy sources they'd like to use, or add a custom entropy source to their seeding. Exposes some toggles for the global/default entropy sources to build.h Adds basic entropy tests which runs the polls and does sanity checking on the results, including compression tests if available. These are less useful for the CSPRNG outputs but a good check for the ones producing plain ASCII like the /proc reader.