aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/os_utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Avoid MSVC warnings about dead code in FFI layerJack Lloyd2019-12-061-5/+5
| | | | Also fix warning about "insecure" getenv
* Fix some warnings with Clang 8Jack Lloyd2019-05-081-2/+2
| | | | | | Notably several from the new -Wdefaulted-function-deleted Also remove some compat macro checks for MSVC 2013
* Document get_auxvalJack Lloyd2019-04-231-1/+9
|
* Fix some Doxygen errorsJack Lloyd2019-04-221-2/+2
|
* Provides auxiliary vector support for FreeBSD.David Carlier2019-04-151-0/+2
| | | | somewhat similar to Linux's counterpart but mainly for cpu features.
* Using available cores rather than total for the pools.David Carlier2019-04-071-0/+3
| | | | | | Issue with the C++ api it might not reflect the reality of the H/W, and on Android, in battery saving mode for example, might be more reasonable to use what the system really offers.
* Add a thread poolJack Lloyd2019-01-311-0/+9
|
* Sandboxing feature from CLI pov.David Carlier2019-01-141-8/+0
| | | | | No resources to free with actual OS features but might be of use for later.
* Proposal of sandboxing feature.David Carlier2019-01-061-0/+9
| | | | For now only used by the TLS server.
* Split up allocations into pagesJack Lloyd2019-01-051-8/+27
|
* Add VC 2019 preview buildJack Lloyd2019-01-021-0/+1
|
* Add OS::read_env_variableJack Lloyd2018-12-291-0/+8
| | | | Combines the priv check and the getenv call on one.
* Rename OS::get_processor_timestamp to OS::get_cpu_cycle_counterJack Lloyd2018-12-231-1/+1
| | | | | Using phrase "timestamp" makes it sound like it has some relation to wall clock which it does not.
* Promote echo suppression of terminal to Botan::OSJack Lloyd2018-12-011-1/+26
|
* Add OS::running_in_privileged_stateJack Lloyd2018-09-271-0/+6
| | | | | | | | 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.
* Add OS::system_page_sizeJack Lloyd2018-03-091-0/+6
|
* Move socket implementation into module http_utilSimon Warta2017-10-031-33/+0
| | | | | This removes the requirement of linking socket libraries for applications that do not use http_util
* 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
* More annotationsJack Lloyd2017-09-191-8/+8
|
* Refactor network code used in http_utilJack Lloyd2017-09-031-0/+33
| | | | Move the actual socket stuff to os_utils.cpp
* No C++ exceptions from cpu probe functions. See GH #920Jack Lloyd2017-03-191-1/+2
|
* Change meaning of get_processor_timestampJack Lloyd2017-01-271-8/+20
| | | | | | | | | | | Now let it return 0 if we have no hardware timestamp, and add OS::get_high_resolution_clock for best available clock. This is mainly because it's confusing for get_processor_timestamp to return something that is not a processor timestamp and because it simplifies adding cycles/byte output if we know that something is or is not a cycle counter. Also adds Windows SEH version of run_cpu_instruction_probe. Untested, uncompiled.
* Add basic test for OS utilsJack Lloyd2017-01-221-4/+12
| | | | | Mainly driven by missing test for OS::run_cpu_instruction_probe. Currently only works on x86 and ARM. Tested on x86-64 native and aarch64 qemu.
* Fixes for OS X buildJack Lloyd2017-01-171-0/+1
| | | | | | os_utils.h was missing an include, only noticed on OS X sigemptyset is a macro on OS X so cannot be called as ::sigemptyset
* Add OS::run_cpu_instruction_probeJack Lloyd2017-01-151-13/+37
| | | | | | Needed for ARM detection, also probably useful on PowerPC for AltiVec Works fine for me on Linux x86-64 testing with ud2 instruction.
* Fix comment typo [ci skip]Jack Lloyd2017-01-031-1/+1
|
* Fix doc of get_processor_timestamp [ci skip]Jack Lloyd2016-11-211-4/+10
|
* RNG changes (GH #593)Jack Lloyd2016-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add explicit fork check to HMAC_RNGJack Lloyd2016-02-071-4/+24
| | | | | | | | | | | 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.
* Add OS utility headerJack Lloyd2015-12-051-0/+40
Provide abstractions for the locking allocator (allocate and free locked pages) to decouple it from the platform dependent code. Should make it easy to write a Windows version using VirtualAlloc+VirtualLock. Exposes max mlock limit as a build.h toggle