aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/cli.h
Commit message (Collapse)AuthorAgeFilesLines
* Use class instead of struct for objects with member functionsJack Lloyd2017-09-301-1/+1
| | | | Flagged by Sonar and quite reasonable
* 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
* Avoid using std::cout and std::cerr within cli codeJack Lloyd2017-09-021-5/+23
| | | | Prevents redirection using --output and --error-output
* Fix --error-output= option to cliJack Lloyd2017-09-011-3/+3
| | | | [ci skip]
* Simplify RNG logic in CLI a bitJack Lloyd2017-08-311-8/+3
|
* Refactor RNG seeding logic in command line interfaceJack Lloyd2017-08-301-33/+8
| | | | | This is needed for LLVM which doesn't have any usable entropy sources. Also useful for determinsitic private key creation, etc.
* Fix missing binary mode flag on compression ofstreamsVolker Aßmann2017-06-061-2/+2
|
* Reformat code with astyle + fix code styleTomasz Frydrych2017-05-011-21/+47
|
* In CLI, if system RNG is available prefer itJack Lloyd2017-02-231-1/+8
|
* RNG changes (GH #593)Jack Lloyd2016-08-241-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 a couple MSVC warnings.Jack Lloyd2016-04-091-1/+1
| | | | | | | | Cast std::streamsize to size_t since MSVC is worried gcount() might return a negative number. The entropy callbacks took the entropy estimate as a size_t instead of a double, which causes some verbose warnings due to the conversion.
* cppcheck fixes: Class 'X' has a constructor with 1 argument that is not ↵Daniel Neus2016-03-051-4/+4
| | | | explicit.
* Get rid of "extra ';'" warnings and force semicolon after macrosSimon Warta2016-01-111-1/+2
|
* Avoid having Command* objects be created until requested.Jack Lloyd2015-12-301-15/+41
| | | | Avoids various static init and destruction hassles.
* Add Command::rng()Jack Lloyd2015-12-271-0/+16
| | | | | | | for when a command wants an RNG but doesn't much care what kind. This adds a place where a future --rng-type= option can be consulted to eg use the system RNG or a user seeded DRBG.
* Merge pull request #378 from neusdan/warning_fixesJack Lloyd2015-12-261-1/+1
|\ | | | | Some trivial compiler and PVS-Studio warning fixes
| * some trivial compiler/PVS-Studio warning fixesDaniel Neus2015-12-221-1/+1
| |
* | Add virtual destructor to Botan_CLI::CommandSimon Warta2015-12-261-0/+1
| |
* | Add DSA keygen and --der-out flag to keygen and pkcs8 toolsJack Lloyd2015-12-231-24/+2
|/ | | | If no files are given on the command line to `hash`, default to stdin
* Add --data-dir option to test commandJack Lloyd2015-12-201-2/+24
| | | | | | | Understand using '-' on the command line to mean stdin Fix last few unit tests that wanted to write to the filesystem; removes outdata directory.
* Remove all remaining uses of throwing a std:: exception directlyJack Lloyd2015-12-191-2/+5
| | | | See GH #340 and 6b9a3a5 for background
* CLI rewriteJack Lloyd2015-12-191-0/+508
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.