| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Also fix warning about "insecure" getenv
|
|
|
|
|
|
| |
Notably several from the new -Wdefaulted-function-deleted
Also remove some compat macro checks for MSVC 2013
|
| |
|
| |
|
|
|
|
| |
somewhat similar to Linux's counterpart but mainly for cpu features.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
No resources to free with actual OS features but might be
of use for later.
|
|
|
|
| |
For now only used by the TLS server.
|
| |
|
| |
|
|
|
|
| |
Combines the priv check and the getenv call on one.
|
|
|
|
|
| |
Using phrase "timestamp" makes it sound like it has some relation
to wall clock which it does not.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This removes the requirement of linking socket libraries for
applications that do not use http_util
|
|
|
|
|
|
| |
ISO C++ reserves names with double underscores in them
Closes #512
|
| |
|
|
|
|
| |
Move the actual socket stuff to os_utils.cpp
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Needed for ARM detection, also probably useful on PowerPC for AltiVec
Works fine for me on Linux x86-64 testing with ud2 instruction.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
|
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
|