aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/entropy
Commit message (Collapse)AuthorAgeFilesLines
* Make exceptions easier to translate to error codesJack Lloyd2018-11-231-3/+2
| | | | | | | | | | | Avoid throwing base Botan::Exception type, as it is difficult to determine what the error is in that case. Add Exception::error_code and Exception::error_type which allows (for error code) more information about the error and (for error type) allows knowing the error type without requiring a sequence of catches. See GH #1742
* Add OS::running_in_privileged_stateJack Lloyd2018-09-271-1/+2
| | | | | | | | Avoid any getenv toggles or reading /proc if we are setuid/setgid. It is possible there is or will someday be some file in /proc that is world-readable, but if read by a privileged user causes some side effect.
* Remove Darwin SecRandomCopyBytesJack Lloyd2018-09-044-85/+0
| | | | | It is the same RNG as arc4random and /dev/urandom. And arc4random seems to be working well for iOS and macOS.
* Expose RDRAND RNG through FFIJack Lloyd2018-08-132-4/+5
|
* Add a warning about win32 stats making antivirus unhappy [ci skip]Jack Lloyd2018-06-251-0/+4
| | | | GH #1614
* Add missing errno.h include to entropy/dev_randomfwsGonzo2018-04-111-0/+1
|
* Fix header for getentropy on macOSJack Lloyd2018-03-091-1/+5
| | | | Re #1481
* One comment fix and one formatting fix [ci skip]René Korthaus2018-02-281-1/+1
|
* Merge GH #1378 Use OS feature flags instead of OS name for enabling system ↵Jack Lloyd2018-01-095-41/+15
|\ | | | | | | specific code
| * Test OS features by the feature vs the OS nameJack Lloyd2017-12-305-41/+15
| |
* | Remove needless <arch> blocks for RDRAND/RDSEEDJack Lloyd2018-01-041-5/+0
|/ | | | These were already implicit due to requiring the relevant ISA
* Use a better name for the entropy source that reads the system RNGJack Lloyd2017-12-231-1/+1
| | | | Now the value round trips with Entropy_Source::create
* FreeBSD removed support for proc filesystem a while agoJack Lloyd2017-12-231-1/+0
|
* Avoid uninitialized param warningJack Lloyd2017-12-231-0/+1
|
* Break out of Win32 entropy poll as soon as entropy goal is reached.Jack Lloyd2017-12-221-7/+15
| | | | | | Rather than running over the entire heap list which may be long. Fixes #1369
* Drop IRIX supportJack Lloyd2017-12-132-2/+0
| | | | | | It turns out that GCC dropped support for IRIX in 4.8, so likely there was never even a C++11 compiler that could have been used to compile 2.x in any case.
* Avoid empty methods, use =default or add a commentJack Lloyd2017-10-031-5/+3
| | | | Sonar
* Use explicit on more single-argument constructorsJack Lloyd2017-09-302-2/+2
|
* Attempt to make MSVC happyJack Lloyd2017-09-221-0/+12
|
* Use RAII, avoid explicit deleteJack Lloyd2017-09-222-16/+4
|
* Apply final annotations to the library alsoJack Lloyd2017-09-222-2/+2
| | | | | Done by a perl script which converted all classes to final, followed by selective reversion where it caused compilation failures.
* Header file cleanupsJack Lloyd2017-09-211-1/+0
| | | | Some help from include-what-you-use
* Clean up header includesJack Lloyd2017-09-212-2/+0
| | | | | | | Avoid including build.h or assert.h directly, instead always take them though types.h Avoid math.h in favor of cmath
* Change header guard format to BOTAN_FOO_H_Jack Lloyd2017-09-208-16/+16
| | | | | | ISO C++ reserves names with double underscores in them Closes #512
* Add API stability annotations.Jack Lloyd2017-09-191-2/+2
| | | | | Defined in build.h, all equal to BOTAN_DLL so ties into existing system for exporting symbols.
* Define macro so windows.h doesn't include winsock.hJack Lloyd2017-09-031-0/+2
| | | | Ugh Windows headers y u so nasty.
* Refactor RNGs to support Windows PhoneJack Lloyd2017-09-024-183/+45
| | | | | | | | | | | | | | | | | | | This OS has its own crypto API and does not support CryptGenRandom. Splits System_RNG_Impl into distinct declarations one per implementation type. Easier to read now that we are up to 4 distinct versions. Removes the CryptoAPI entropy source, and replaces it with an entropy source that calls the system RNG. This is nominally a bit less flexible in that the entropy source allowed polling multiple providers (though we didn't actually make use of that). Plus side is it works on all systems. Currently the dev_random entropy source is still there because we do actually use it to poll both /dev/random and /dev/urandom, and it might be useful (on certain systems) to also poll a HW RNG, which are often assigned their own device node. This could debatably also be removed in favor of just reading the system RNG.
* Fix missing virtual destructor on CSP_HandleJack Lloyd2017-08-312-2/+3
| | | | Caught by GCC cross compiling. Also fix a couple 0-as-null warnings.
* Fix for amalgamation build on WindowsRené Korthaus2017-08-041-0/+1
|
* Remove low compiler version restrictionsSimon Warta2017-07-311-3/+3
| | | | | | All minimum compiler versions in rdseed are less or equal the minimum compiler version for the Botan 2.x branch. Remove those explicit restrictions to allow users with unknown cc_version to compile rdseed
* Fixes for MSVC version detectionJack Lloyd2017-05-191-1/+1
| | | | | See comments in https://github.com/randombit/botan/commit/7f019174bfcf3c2b31bda74fe40ce35727db1cef
* Let modules specify minimum compiler version, add runtime compiler version checkJack Lloyd2017-05-181-3/+3
| | | | | | | | | | | | | This comes up recently to support CPU extensions by Intel (#826) and ARM (#844) since the intrinsic functions were only added in compiler versions more recent than the minimums we generally support, but might actually be useful for all kinds of things in the future since one can add a (new, otherwise optional) C++14 or C++17 module in 2.x branch while continuing to support the current set of supported compiler versions for the main library functionality. Uses RDSEED as the test case, to ensure version detection/comparisons work on all platforms.
* Content:Tomasz Frydrych2017-04-031-1/+1
| | | | | | | | | * fixes for deprecated constructions in c++11 and later (explicit rule of 3/5 or implicit rule of 0 and other violations) * `default` specifier instead of `{}` in some places(probably all) * removal of unreachable code (for example `return` after `throw`) * removal of compilation unit only visible, but not used functions * fix for `throw()` specifier - used instead `BOTAN_NOEXCEPT` * removed not needed semicolons
* Remove "Dirty hack" for multiple defines in lex_me_harder()Simon Warta2017-04-029-9/+27
|
* Always poll 256 bytes from Getentropy.Alexander Bluhm2017-03-301-3/+4
| | | | | | The OpenBSD system limit for getentropy(2) is 256 bytes. It does not make sense to use the BOTAN_SYSTEM_RNG_POLL_REQUEST define here. As it is only used in one place, another define would be overkill.
* Disable entropy proc_walk on OpenBSD.Alexander Bluhm2017-03-301-1/+0
| | | | | The /proc file system was disabled for years. With OpenBSD 5.7 the implementation has been removed from the kernel sources.
* Use getentropy(2) as random source.Alexander Bluhm2017-03-294-0/+78
| | | | | | | | Gather entropy from system call getentropy(2). This is available since in OpenBSD 5.6 and Solaris 11.3. It can provide up to 256 bytes entropy from the kernel without blocking. As a system call it does not need a file descriptor and works in chroot(2) environments without device nodes.
* Small fixes in API docs [ci skip]René Korthaus2017-03-091-3/+3
|
* Merge GH #813 Remove obsolete entropy source infoJack Lloyd2017-01-061-18/+0
|\
| * removed two more obsolete entropy source referencesDaniel Neus2017-01-061-14/+0
| |
| * Remove obsolete hres_timer includeDaniel Neus2017-01-061-4/+0
| | | | | | | | module doesn't exist anymore
* | Return 0 bits in Darwin_SecRandom::poll on SecRandomCopyBytes failureDaniel Neus2017-01-061-0/+2
|/
* Add os iosSimon Warta2017-01-031-0/+2
|
* Convert to using standard uintN_t integer typesJack Lloyd2016-12-183-4/+4
| | | | | | 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.
* Remove <source> block from info.txt filesJack Lloyd2016-12-087-29/+1
| | | | | | Kind of a vestigial thing from an earlier iteration of the module design, and never useful to specify anymore since taking all the cpp files is what you want exactly 100% of the time.
* define NOMINMAX 1 before every include of windows.hBaruch Burstein2016-11-282-2/+2
|
* Compile fixJack Lloyd2016-11-031-1/+1
|
* Remove unused values from build.hJack Lloyd2016-11-031-1/+3
| | | | | | | Have the /proc setting in build.h actually control the entropy source configuration (!) GH #708
* Remove HMAC_RNG, X9.31-RNG, BeOS stats, EGD reader, Unix process runnerJack Lloyd2016-10-2811-855/+0
| | | | | Change AutoSeeded_RNG to use SHA-384, SHA-256, SHA-3(256), or SHA-1, whichever is available (in that order).
* Fix handling of file descriptor zeroJack Lloyd2016-10-221-13/+11
| | | | | If opening /dev/*random resulted in fd 0, we would both not use that RNG and leak the file descriptor. Found with Coverity.