aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_utils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate many publically available headersJack Lloyd2019-09-061-0/+1
|
* Refactor CPUID to make it thread safeJack Lloyd2019-01-301-0/+6
| | | | | | | | | | Needed for #1819 and unfortunately Windows does not allow thread local data to be stored as a member of a DLL exported class. So hide it behind an accessor function instead. This slows down CPUID test somewhat and I would like to address that but it seems hard without breaking the CPUID API, which is for better or worse public.
* Make significant_words const time alsoJack Lloyd2018-12-231-0/+50
| | | | | | Only used in one place, where const time doesn't matter, but can't hurt. Remove low_bit, can be replaced by ctz.
* Address a couple of Coverity false positivesJack Lloyd2018-12-191-1/+47
| | | | Add tests for is_power_of_2
* Add base58 encoding/decodingJack Lloyd2018-12-091-0/+96
|
* Add CT::Mask typeJack Lloyd2018-11-281-34/+39
|
* Avoid calling memset, memcpy within library codeJack Lloyd2018-11-171-1/+2
| | | | | | | | | Prefer using wrappers in mem_utils for this. Current exception is where memcpy is being used to convert between two different types, since copy_mem requires input and output pointers have the same type. There should be a new function to handle conversion-via-memcpy operation.
* Fix Sonar warningJack Lloyd2018-11-171-1/+1
|
* Merge GH #1696 Fix bugs in UUID classJack Lloyd2018-09-301-0/+73
|\
| * Move UUID to utils, test it, and fix bugs.Jack Lloyd2018-09-301-0/+73
| | | | | | | | Fixes #1695
* | Add some tests of the versioning functionsJack Lloyd2018-09-301-0/+46
|/
* Add read_kv for parsing strings with key/value pairsJack Lloyd2018-09-091-0/+77
| | | | This is a contribution by Ribose Inc (@riboseinc)
* Create unit tests for Base32 encodingWambou2018-05-311-2/+87
|
* Make the tests VarMap an actual type instead of a hashmap typedef.Jack Lloyd2018-05-291-15/+15
|
* Fix bugs in wildcard matchingJack Lloyd2018-03-311-1/+1
| | | | | | | We would incorrectly accept invalid matches for example b*.example.net could match foobar.example.net Introduced in 289cc25709b08
* Catch exceptions by reference not valueJack Lloyd2018-03-161-1/+1
| | | | Fixes a new warning in GCC 8
* Add some basic tests of CPUID classJack Lloyd2017-12-061-0/+44
|
* Simplify date conversion by avoiding OS utilitiesJack Lloyd2017-12-041-14/+14
| | | | | | | We have to rely on non-portable OS calls to convert UTC times, and they are not available on many systems (including Solaris and MinGW). But instead there is a simple algorithm due to Howard Hinnant that does the same job. Woo.
* Better debug output in date conversion tests [ci skip]Jack Lloyd2017-12-041-13/+14
|
* Remove use of transcodeJack Lloyd2017-11-091-21/+14
|
* Add UCS-2 and UCS-4 to UTF-8 conversion functionsJack Lloyd2017-11-091-4/+15
| | | | | | Crosschecked by fuzzing and comparing with iconv Needed in #1250
* Avoid "using namespace" in test codeJack Lloyd2017-10-241-26/+24
|
* Make poly_dbl.h a submodule of utilsJack Lloyd2017-09-271-1/+8
| | | | | Only required by a few modules and if none of them are in use then the whole thing can just be skipped from the build.
* Add final annotations as appropriate in the test codeJack Lloyd2017-09-221-6/+6
|
* Add basic tests for const time utilsJack Lloyd2017-09-191-0/+35
| | | | Remove CT::min and CT::max which were unused and it turns out, broken.
* Improve polynomial doubling code, move to utilJack Lloyd2017-08-151-0/+22
| | | | | | | | | Now does 64-bits at a time instead of 8 bits, and avoids conditional timing channel on the XOR carry. Confirmed that at least GCC 7 and Clang 4 on x86-64 compile the functions without conditional jumps. Also removes CMAC as a dependency of OCB, which only needed it in order to call CMAC::poly_double
* Reformat code with astyle + fix code styleTomasz Frydrych2017-05-011-15/+13
|
* Complete wildcard handling for X.509 certificatesRené Korthaus2017-04-201-0/+28
| | | | | | | | | | | | Hostname validation is used to make sure the certificate hostname matches the hostname of the connected host. RFC 6125 allows one wildcard in the left-most label of a hostname. Up to now, we only supported only the wildcard as the left-most label, e.g., www.example.com would match *.example.com, but www.example.com would not match www*.example.com, although it is permitted. Also adds test vectors from RFC 6125 as well as the OpenSSL test suite.
* Fix some compiler warnings.Jack Lloyd2017-03-221-1/+1
|
* Fix #917: calendar_point::to_std_timepoint() does not support years after 2037Daniel Neus2017-03-211-2/+3
| | | | Only throw on systems where 32 bit std::time_t is used.
* Add a test of calendar_point::to_stringJack Lloyd2017-01-221-0/+8
|
* Minor refactoring of Text_Based_TestJack Lloyd2016-12-191-10/+4
| | | | | | 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-13/+13
| | | | | | 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 source file encoding ANSI -> UTF-8Daniel Neus2016-08-171-2/+2
| | | | | | | | | should fix: ``` WARN: Invalid character encountered in file /home/travis/build/randombit/botan/src/tests/test_utils.cpp at line 381 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'. WARN: Invalid character encountered in file /home/travis/build/randombit/botan/src/lib/pubkey/ecies/ecies.cpp at line 311 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'. ```
* add copyrightDaniel Neus2016-07-251-0/+1
|
* add some basic charset testsDaniel Neus2016-07-251-0/+124
| | | | | | - UCS-2 to ISO 8859-1 - UTF-8 to ISO 8859-1 - ISO 8859-1 to UTF-8
* some trivial compiler/PVS-Studio warning fixesDaniel Neus2015-12-221-1/+1
|
* Add --data-dir option to test commandJack Lloyd2015-12-201-4/+4
| | | | | | | Understand using '-' on the command line to mean stdin Fix last few unit tests that wanted to write to the filesystem; removes outdata directory.
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-111-2/+2
| | | | | | | | 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-4/+4
| | | | unless they are actually optional
* Update and consolidate the test framework.Jack Lloyd2015-11-111-0/+331
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.