aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_rng.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Minor refactoring of Text_Based_TestJack Lloyd2016-12-191-2/+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-16/+16
| | | | | | 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.
* Simple tests for AutoSeeded_RNGJack Lloyd2016-11-261-0/+95
|
* Remove HMAC_RNG, X9.31-RNG, BeOS stats, EGD reader, Unix process runnerJack Lloyd2016-10-281-39/+0
| | | | | Change AutoSeeded_RNG to use SHA-384, SHA-256, SHA-3(256), or SHA-1, whichever is available (in that order).
* Merge GH #687 Avoid unused return value warning under GCCJack Lloyd2016-10-281-2/+3
|\
| * Fixes randombit/botan#677Matthias Gierlings2016-10-271-2/+3
| |
* | make max_number_of_bytes_per_request configurableDaniel Neus2016-10-281-1/+60
|/
* Fix HMAC_DRBG fork testJack Lloyd2016-10-251-8/+14
| | | | | | | The fork test actually closed the pipe early so this test had been busted. Previously missed because the return value of read was not checked. Missed by me in e8908d4fb671 because I changed the test but did not run it before checking in. Hey, it compiled. :(
* Static analyzer fixesJack Lloyd2016-10-251-16/+32
| | | | | | | | | Check return value of read, found by Clang. See also #677 Remove unused member variable in OpenSSL ECC, found by Clang. In ECDSA tests, if the pointer is null we should return rather than dereferencing it. Found by Coverity.
* Merge GH #605: Test for HMAC_DRBG randomize_with_ts_inputJack Lloyd2016-08-261-0/+39
|\
| * Add unit test for HMAC_DRBG::randomize_with_ts_input()René Korthaus2016-08-251-0/+39
| |
* | Correct commentJack Lloyd2016-08-251-1/+1
|/ | | | [ci skip]
* RNG changes (GH #593)Jack Lloyd2016-08-241-11/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* reseed test for hmac_drbgKai Michaelis2016-08-101-0/+41
|
* Remove useless L param from X9.31 test vector fileJack Lloyd2016-07-171-33/+10
| | | | Clean up test code
* Add Stateful_RNGJack Lloyd2016-07-171-35/+16
| | | | | | | | | | | | | | Handles fork checking for HMAC_RNG and HMAC_DRBG AutoSeeded_RNG change - switch to HMAC_DRBG as default. Start removing the io buffer from entropy poller. Update default RNG poll bits to 256. Fix McEliece test, was using wrong RNG API. Update docs.
* fix test failures and seg faults when Botan is configured with ↵René Korthaus2016-06-171-5/+26
| | | | --module-policy bsi
* cppcheck fixes: Class 'X' has a constructor with 1 argument that is not ↵Daniel Neus2016-03-051-1/+1
| | | | explicit.
* Add --data-dir option to test commandJack Lloyd2015-12-201-2/+2
| | | | | | | Understand using '-' on the command line to mean stdin Fix last few unit tests that wanted to write to the filesystem; removes outdata directory.
* Update and consolidate the test framework.Jack Lloyd2015-11-111-71/+60
| | | | | | | | | | | 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.
* Don't treat missing ciphers, hashes, etc as test failuresJack Lloyd2015-10-111-2/+8
| | | | | Just print an error message and return. Reduces false fails with smaller builds
* Remove use of lookup.h in favor of new T::create API.Jack Lloyd2015-09-211-3/+3
|
* tests: Add missing overridesDaniel Seither2015-07-301-1/+1
|
* tests: Convert &vec[0] to vec.data()Simon Warta2015-06-301-2/+2
|
* Replace \n by std::endl in tests to ensure proper flushingSimon Warta2015-06-191-2/+2
| | | | | | | - Remove additional newlines in CHECK_MESSAGE call - Remove redundant output of algo in aead_test() Closes #115
* Remove algo factory, engines, global RNG, global state, etc.lloyd2015-02-041-6/+3
| | | | | | | | | | | | | | | 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-1/+7
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* Add HMAC_DRBGlloyd2014-03-211-19/+78
|
* More fixes for minified buildslloyd2014-02-091-8/+16
|
* Split up docs into the reference manual, the website, and everything else.lloyd2014-01-101-0/+63
| | | | | | | | | | | Add `website` target to makefile. Some progress towards fixing minimized builds. TLS now hard requires ECDSA and GCM since otherwise a minimized build has only insecure options. Remove boost_thread dependency in command line tool
* Rename test sourceslloyd2014-01-071-63/+0
|
* Split up public key tests and data, use new test frameworklloyd2014-01-051-8/+8
|
* Shuffle things around. Add NIST X.509 test to build.lloyd2014-01-011-0/+63