aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils
Commit message (Collapse)AuthorAgeFilesLines
* Add missing netinet includes for sockaddr_inlouiz’2016-12-081-0/+1
|
* Fix BER decoder integer overflowJack Lloyd2016-11-282-1/+41
|\
| * Check for overflow in BER decoder EOC scanningJack Lloyd2016-11-272-1/+41
| |
* | define NOMINMAX 1 before every include of windows.hBaruch Burstein2016-11-283-0/+3
|/
* Add BOTAN_UNUSED when relevant OS support is missingJack Lloyd2016-11-272-0/+2
|
* Add compiler.h macro header extracted from build.hJack Lloyd2016-11-263-10/+176
| | | | | | | | All this is just standard C that the user should not touch, so it doesn't really make sense to have it in the build.h template file. Remove BOTAN_TARGET_CPU_HAS_KNOWN_ENDIANESS - only used twice (in loadstor.h) and that code is clearer without it.
* Merge GH #653 OCSP and X.509 path validation refactorJack Lloyd2016-11-251-5/+9
|\ | | | | | | | | | | Splits up path validation into several sub-functions for easier testing and creating customized validation code. Much improved OCSP handling and OCSP tests.
| * MSVC doesnt support #warningJack Lloyd2016-11-231-1/+1
| |
| * Somewhat better errors in HTTPJack Lloyd2016-11-231-5/+9
| |
* | Avoid having source files start with /**Jack Lloyd2016-11-251-1/+1
|/ | | | | | | This caused Doxygen to dump the copyright notices for those files into the Botan namespace description, which is not helpful. [ci skip]
* Fix doc of get_processor_timestamp [ci skip]Jack Lloyd2016-11-211-4/+10
|
* Remove remaining old style casts.Jack Lloyd2016-11-091-1/+1
| | | | | | Still not a hard error even in maintainer mode because sometimes system headers pull in C style casts via macros (eg MAP_FAILED). But, it not being a hard error makes it easy to backslide.
* Add BOTAN_WARN_UNUSED_RESULT macroJack Lloyd2016-11-091-3/+2
| | | | Only works for GCC and Clang
* Add CPUID::is_little_endianJack Lloyd2016-11-072-0/+35
| | | | | Having a runtime endian test to verify against the build setting is useful.
* Keep track of the number of synchronisations achievedJoel Low2016-11-062-3/+11
| | | | | This allows wait() to be called immediately after sync() returns, even if not all of the waiting threads have awoken.
* Implement barriers for Threaded ForkJoel Low2016-11-063-0/+77
| | | | | | | | This commit introduces a concept of a barrier, where all threads must synchronise before continuing. Threaded Fork uses this to ensure that all input is consumed by each sink exactly once. Fixes #695.
* Compile fixJack Lloyd2016-11-031-1/+1
|
* Rename zero_mem to secure_scrub_memoryJack Lloyd2016-11-034-22/+43
|
* Merge GH #699 Add socket-based HTTP clientJack Lloyd2016-10-312-32/+101
|\
| * HTTP for plain socketsJack Lloyd2016-10-302-32/+101
| |
* | Compile fixJack Lloyd2016-10-311-2/+2
| |
* | Import fuzzer driversJack Lloyd2016-10-301-0/+3
|/ | | | | | | | | | | Originally from https://github.com/randombit/botan-fuzzers but merging to the main tree (without the corpus files, since I suspect the corpus files in that repo are not useful anymore) Adds --unsafe-fuzzer-mode which can be used to selectively disable cryptographic checks which get in the way of fuzzer testing. This setting is reflected in build.h and in the version string. Right now it doesn't actually disable anything.
* Limit locking_allocator only to OSes that even might support it.Jack Lloyd2016-10-241-0/+8
| | | | | | The pool allocator itself is portable code, but it doesn't do anything useful unless we have the ability to mlock/VirtualLock memory, which is OS specific.
* Remove Algo_RegistryJack Lloyd2016-10-211-0/+7
| | | | | | | I repent my use of global constructors. I repent my use of global locks. Hopefully I will never touch this code again. :)
* Fix doxygen warnings [ci skip]René Korthaus2016-10-192-1/+2
|
* Merge GH #665 Add IncludeOS target, make filesystem/threads optionalJack Lloyd2016-10-1712-22/+97
|\
| * Abstract out mutex type. Make threads optional.Jack Lloyd2016-10-1210-21/+83
| |
| * Add IncludeOS target. Make filesystem support optional.Jack Lloyd2016-10-103-2/+15
| |
* | Remove constexpr use introduced in 20f7e4ecJack Lloyd2016-10-162-7/+7
| | | | | | | | Turns out MSVC 2013 doesn't have constexpr at all (!!)
* | util: Some simple constexpr usesJack Lloyd2016-10-133-31/+9
|/ | | | Remove unused and empty get_byte.h
* Fix Clang warningsJack Lloyd2016-10-091-2/+0
|
* Revert PK_Verifier change (don't require RNG there).Jack Lloyd2016-10-071-0/+10
| | | | | | | Verification is deterministic and public, so really no RNG is ever needed. Change provider handling - accepts "base", "openssl", or empty, otherwise throws a Provider_Not_Found exception.
* Certificate store using SQLiteKai Michaelis2016-10-023-0/+10
|
* Merge GH #516 Cipher_Mode API improvementsJack Lloyd2016-09-262-2/+21
|\
| * Cipher_Mode API improvementsJack Lloyd2016-09-012-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Cipher_Mode::update API is more general than needed to just support ciphers (this is due to it previously being an API of Transform which before 8b85b780515 was Cipher_Mode's base class) Define a less general interface `process` which either processes the blocks in-place, producing exactly as much output as there was input, or (SIV/CCM case) saves the entire message for processing in `finish`. These two uses cover all current or anticipated cipher modes. Leaves `update` for compatability with existing callers; all that is needed is an inline function forwarding to `process`. Removes the return type from `start` - in all cipher implementations, this always returned an empty vector. Adds BOTAN_ARG_CHECK macro; right now BOTAN_ASSERT is being used for argument checking in some places, which is not right at all.
* | Add cpuid overload to test frameworkJack Lloyd2016-09-152-57/+86
|/
* get_processor_timestamp should never return 0 if it can help it.Jack Lloyd2016-09-011-16/+59
| | | | | | | For example it used to return 0 on Linux/ARM... If no QPC or asm version, use clock_gettime if available, or else std::chrono::high_resolution_clock as a fallback.
* Fix some problems on ppc64leJack Lloyd2016-08-301-1/+9
| | | | Altivec code assumed big-endian.
* Fix get_process_id for MinGWJack Lloyd2016-08-291-2/+2
|
* Travis CI additions and cleanupJack Lloyd2016-08-282-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert Travis build configuration to a single var instead of 4 tuple. Makes it much easier to review the builds in the Travis web UI. Adds sanitizer builds for Clang on both Linux and OS X. Clang is a different compiler from GCC and its sanitizers may catch things GCC does not. I have no idea if Apple's Clang has some magic sanitizer sauce stock LLVM does not, so maybe sanitizer build on OS X can be skipped. Adds Linux cross compile targets for ARM32, ARM64, PPC64, and MinGW x86 using the cross compiler available in Trusty. All of them build and are set up to run through qemu/wine. All of the tests currently fail and so are marked as expected fail in the Travis matrix. The ARM test runs seem to have thread problems; ARM32 thread creation just fails with an exception, as if pthreads was disabled. All other tests pass ok for ARM32. On Aarch64, it looks like there is a hard crash the first time the library tries creating a thread. Both of these might be due to statically linking the binary? I have been unable to convince Ubuntu's qemu-ppc64 to execute binaries compiled by Ubuntu's ppc64 cross compiler. I'm downloading an Ubuntu ISO to try this in a VM. Running under Wine exposes several issues, both in Wine and Botan. Many functions are stubs and it appears that entropy collection fails as a result. This triggers a bug in the FFI tests which causes a crash there. A pox on time zones; _mkgmtime is a MSVC extension and is not available on MinGW GCC. Add a last resort call that just uses the localzone variant instead. Adds valgrind target, remove a bogus poison in pubkey.cpp (it was effectively asserting that all of RSA was const time which is sadly not true at all). Moves -Wshadow to maintainer mode for GCC - GCC 4.8 has a noisy variant of -Wshadow which warns if a parameter masks a function name, but this comes up all the time in constructors. Later GCCs no longer warn about this (even with -Wshadow), so the warnings are never fixed, but they cause noise in CI output and hide interesting warnings like warning: vec_lvsl is deprecated for little endian; use assignment for unaligned loads and stores [-Wdeprecated] __vector unsigned char perm = vec_lvsl(0, static_cast<u32bit*>(nullptr));
* RNG changes (GH #593)Jack Lloyd2016-08-242-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use stat instead of lstat in get_files_recursive.Jack Lloyd2016-07-301-1/+1
| | | | | | Otherwise symlinked files are ignored. GH #565
* Check for __SIZEOF_INT128__ before using TI modeJack Lloyd2016-07-301-6/+8
| | | | | Otherwise we run into problems on 64-bit CPUs with 32-bit userland. GH #563
* SSE2 had been disabled for testing, missed it on checkin of 6907e196Jack Lloyd2016-07-251-1/+1
|
* Merge asm into single mp_madd.h and mp_asmi.h filesJack Lloyd2016-07-219-638/+462
| | | | | | | Avoids some cut and paste, also removes the need for special logic in configure.py for handling mp module specially. Merge SIMD classes into a single type SIMD_4x32
* Revamp entropy pollingJack Lloyd2016-07-171-0/+7
| | | | | Remove Entropy_Accumulator, instead have entropy sources directly add entropy to the RNG.
* Fix undefined behavior in donna128 typeJack Lloyd2016-07-151-6/+12
| | | | | | | Caused Curve25519 tests to fail when compiled by Clang on ARM, may have affected other 32-bit platforms. GH #532
* add PKCS#11 supportDaniel Neus2016-06-173-11/+6
|
* Add Not_Implemented exceptionJack Lloyd2016-06-071-0/+10
|
* Change calls to 'get_byte' to explicitly cast parameters and eliminate ↵Dan Brown2016-04-271-1/+1
| | | | compiler warnings