aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/entropy
Commit message (Collapse)AuthorAgeFilesLines
* Trivial warning fixesJack Lloyd2016-03-092-2/+2
|
* Merge GH #373 RDRAND/RDSEED logic changesJack Lloyd2016-03-062-34/+35
|\ | | | | | | The Intel RNG may fail if heavily contended, so retry as needed.
| * move logic back into poll()Daniel Neus2016-01-262-60/+36
| | | | | | | | prevents filtering out any 0x00000000 outputs from RDRAND/RDSEED
| * review changesDaniel Neus2015-12-214-37/+39
| | | | | | | | | | | | | | | | * no spaces around if(), for() etc * snake_case for plain functions * anonymous namespace function instead private and static * don't propagate failed poll to the calling application * RdRand retires configurable in build.h
| * RdRand and RdSeed logic changesDaniel Neus2015-12-204-36/+59
| | | | | | | | | | * Make it configurable how often RdRand and RdSeed is polled * Make it configurable how many RdSeed retries are executed
* | Remaining cppcheck fixes that are not covered by GH #444Daniel Neus2016-03-051-2/+2
| |
* | cppcheck fixes: Class 'X' has a constructor with 1 argument that is not ↵Daniel Neus2016-03-054-5/+5
| | | | | | | | explicit.
* | GlobalMemoryStatusEx is on XP GH #419Jack Lloyd2016-02-091-2/+2
| |
* | Add explicit fork check to HMAC_RNGJack Lloyd2016-02-072-72/+6
| | | | | | | | | | | | | | | | | | | | | | Add OS functions get_process_id, get_processor_timestamp, and get_system_timestamp_ns. HMAC_RNG uses the pid call to detect forks to initiate a reseed. It also adds the output of all three functions (the pid, the CPU cycle counter, and the system timestamp) into the PRF input. Calls the new OS timer functions from hres_timer entropy source. Removes the call to QPC in es_win32 which is mostly redundant with the one in hres_timer.
* | Revert GH #365 Replace deprecated Win API calls in Win32_EntropySourceJack Lloyd2016-02-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thinking it over I've realized this was not a good move; XP may be EOLed but is still widely used and even VS 2015 still supports targeting XP. It's not really the same situation as going to extra efforts for supporting SunOS 5.1 or VAX/VMS, instead it actively broke support for something which is still widely deployed. And for those building for XP the options are patch out the call (GH #416) or disable win32_stats altogether in their build. I'd like to prevent downstream distributors from having to patch, because that can get messy. And while the design of CryptGenRandom is not disclosed it apparently has changed over time and at one point (IIRC) used RC4 to generate outputs, so if there is any OS that could use some extra help generating seed material it is XP. There may be future code that really makes use of APIs added after XP - CryptoNG, TPM support, etc and then people targetting XP will have to compile out those modules. But it doesn't make sense to break it here for this small gain.
* | Make Entropy_Sources and Entropy_Accumulator final.Jack Lloyd2016-01-171-4/+2
| | | | | | | | Remove bogus virtual destructor on Entropy_Accumulator (has no virtuals)
* | Merge GH #365 Replace deprecated Windows API calls in Win32_EntropySourceJack Lloyd2016-01-131-3/+3
|\ \ | | | | | | | | | | | | | | | By adopting MemoryStatusEx, this drops support for XP and Server 2003 which do not implement this API. This is considered a feature as these versions are already EOLed by Microsoft.
| * | Replace deprecated Win API calls in Win32_EntropySourceDaniel Neus2015-12-161-3/+3
| | | | | | | | | | | | | | | * GetTickCount is replaced by GetTickCount64(): see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx for details * GlobalMemoryStatus is replaced by GlobalMemoryStatusEx: see https://msdn.microsoft.com/en-us/library/windows/desktop/aa366589(v=vs.85).aspx for details
* | | Add final attribute to many classesJack Lloyd2016-01-1011-12/+12
| | | | | | | | | | | | | | | | | | | | | In some cases this can offer better optimization, via devirtualization. And it lets the user know the class is not intended for derivation. Some discussion in GH #402
* | | Mass-prefix member vars with m_René Korthaus2016-01-084-28/+28
| |/ |/|
* | Move estimate of RDRAND/RDSEED entropy to build.hJack Lloyd2015-12-192-22/+2
| | | | | | | | GH #370 for background
* | add support for Intel RdSeedDaniel Neus2015-12-184-0/+118
| |
* | Enable RdRand on Windows/MSVCDaniel Neus2015-12-161-0/+1
|/
* Missing addsJack Lloyd2015-12-112-1/+1
|
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-112-6/+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
* Add differential compression test.Jack Lloyd2015-11-281-1/+1
| | | | | Change getrusage output to static system data since it is sparse and changes rarely, and so actually does trigger the differential test.
* Push the hardcoded entropy estimates up to build.hJack Lloyd2015-11-289-65/+53
| | | | Defaults should be fine for everyone but it makes the values more transparent
* New reseed_with_sources call on RNGsJack Lloyd2015-11-2419-99/+181
| | | | | | | | | | | | | 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.
* Add the Darwin_SecRandom entropy sourceDaniel Seither2015-09-254-0/+84
| | | | | | | It uses the SecRandomCopyBytes function from the Security framework of OS X and iOS. We need this because it is the official way to get cryptographically secure random numbers on iOS, where /dev/random is not accessible due to sandboxing.
* Avoid concatination of charsSimon Warta2015-09-221-1/+1
| | | | | | | Ever tried? auto str = "some long string"; auto str2 = str + '\n'; It's not with the brainfuck finding the bug.
* Remove alloc module; move secmem.h to base and locking_allocator to utilsJack Lloyd2015-08-291-4/+0
|
* entropy: Add missing overridesDaniel Seither2015-07-3010-20/+20
|
* Fix typosSimon Warta2015-07-241-1/+1
| | | | Thanks to @vlajos https://github.com/vlajos/misspell_fixer
* Add Android OSDaniel Seither2015-07-174-0/+4
| | | | | | The android.txt is a copy of linux.txt minus the getsid feature (Android's libc, Bionic, doesn't support it) and the alias linux-gnu. It is supported anywhere where linux is supported.
* Add OS feature getsidDaniel Seither2015-07-171-0/+2
| | | | | It is added to all OS that use getsid currently, so it must be available there.
* Remove references to removed tru64 OSDaniel Seither2015-07-174-4/+0
| | | | There's no OS file in src/build-data/os for tru64
* lib/entropy: Convert &vec[0] to vec.data()Simon Warta2015-06-275-10/+10
|
* Avoid 0-defining BOTAN_USE_GCC_INLINE_ASMsimon2015-05-312-2/+2
| | | | GH #103
* Fix various bugs found by Coverity scanner.lloyd2015-05-151-17/+10
| | | | | | | Uninitialized variables, missing divide by zero checks, missing virtual destructor, etc. Only thing serious is bug in TLS maximum fragment decoder; missing breaks in switch statement meant receiver would treat any negotiated max frament as 4k limit.
* Use available MinGW APIs (CryptoAPI and Unix-style fds). GH#84joerg2015-04-271-1/+2
|
* Windows fixlloyd2015-03-202-5/+4
|
* This check doesn't make sense as the entropy source is sharedlloyd2015-03-181-15/+6
|
* Remove the shared IO buffer from EntropySource_Accumulator.lloyd2015-03-1813-60/+51
| | | | Instead each source that needs a buffer maintains their own.
* Avoid requiring a system header herelloyd2015-03-021-1/+1
|
* Add missing includelloyd2015-02-241-0/+1
|
* Hide all uses of boost filesystem in fs.cpp. Use readdir as anlloyd2015-02-211-6/+1
| | | | | alternate implementation for Unix and add some feature checks so a boost-free build of the tests and command line are possible again.
* Add version_cstr (returns const char*) and move tag_size from AEAD tolloyd2015-02-112-1/+2
| | | | Cipher_Mode. Add missing includes in entropy sources, noticed by clang.
* Enable OpenSSL for providing ciphers and hashes again.lloyd2015-02-051-1/+1
|
* Remove algo factory, engines, global RNG, global state, etc.lloyd2015-02-0410-7/+143
| | | | | | | | | | | | | | | 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).
* Centralize where string.h/cstring is included to mem_ops.hlloyd2015-01-233-4/+2
| | | | See github 42 for background
* Ensure all files have copyright and license info.lloyd2015-01-1020-20/+20
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* Add MinGW support for the CryptoAPI RNG. Also disable the dependencieslloyd2014-12-171-0/+1
| | | | | | | | in auto_rng for a working entropy source as in situations where it doesn't work almost none of the library builds. Disable boost by default from the library. Github issue 34. Unrelated - remove long dead Tru64 as a target.
* Various small fixes and cleanups, new is_prime utillloyd2014-11-033-12/+19
|
* Don't bother polling std:: clocks if we have clock_gettimelloyd2014-08-091-32/+22
|
* Avoid std::chrono::steady_clock, missing in some distro gccslloyd2014-04-251-1/+0
|