summaryrefslogtreecommitdiff
path: root/e_os.h
Commit message (Collapse)AuthorAgeFilesLines
* Move e_os.h to include/internalRichard Levitte2022-02-051-414/+0
| | | | | | | | | | | | Including e_os.h with a path from a header file doesn't work well on certain exotic platform. It simply fails to build. Since we don't seem to be able to stop ourselves, the better move is to move e_os.h to an include directory that's part of the inclusion path given to the compiler. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17641)
* Remove I_CAN_LIVE_WITH_LNK4049Rich Salz2021-06-091-15/+0
| | | | | | | | | Fixes #9332 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15649)
* Move ossl_sleep() to e_os.h and use it in appsDr. David von Oheimb2021-05-181-0/+48
| | | | | | | | Fixes #15304 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15308)
* Avoid #include with inline function on C++BuilderTanzinul Islam2021-04-271-1/+8
| | | | | | | | | | Commit 6b2978406 exposed a bug with C++Builder's Clang-based compilers, which cause inline function definitions in C translation units to not be found by the linker. Disable the inclusion of the triggering header. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15025)
* e_os.h: Include wspiapi.h to improve Windows backward compatibilityPrcuvu2021-04-221-0/+1
| | | | | | | | | CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/14550)
* Update copyright yearMatt Caswell2021-04-081-1/+1
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14801)
* Corrected missing definitions from NonStop SPT build.Randall S. Becker2021-04-011-1/+1
| | | | | | | | | | | | | | | | | This change includes swapping the PUT and SPT configuration, includes of sys/stat.h and sys/types.h in the correct scope to be picked up by SPT definitions. Fixes: #14698 Fixes: #14734 CLA: The author has the permission to grant the OpenSSL Team the right to use this change. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14736)
* Implement OpenSSL secure memory for WindowsJeremiah Gowdy2020-10-221-4/+5
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13172)
* NonStop port updates for 3.0.0.Randall S. Becker2020-09-121-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HPE NonStop Port Changes for 3.0.0 Includes unthreaded, PUT, and SPT for OSS. The port changes include wrapping where necessary for FLOSS and appropriate configuration changes to support that. Two tests are excluded as being inappropriate for the platform. The changes are: * Added /usr/local/include to nonstop-nsx_spt_floss to load floss.h * Added SPT Floss variant for NonStop * Wrapped FLOSS definitions in OPENSSL_TANDEM_FLOSS to allow selective enablement. * SPT build configuration for NonStop * Skip tests not relevant for NonStop * PUT configuration changes required for NonStop platforms * Configurations/50-nonstop.conf: updates for TNS/X platform. * FLOSS instrumentation for HPE NonStop TNS/X and TNS/E platforms. * Configurations/50-nonstop.conf: modifications for non-PUT TNS/E platform b * Fix use of DELAY in ssltestlib.c for HPNS. * Fixed commit merge issues and added floss to http_server.c CLA: Permission is granted by the author to the OpenSSL team to use these modifications. Fixes #5087. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12800)
* Enable WinCE build without deceiving _MSC_VER.aSoujyuTanaka2020-07-151-1/+1
| | | | | | Reviewed-by: Mark J. Cox <mark@awe.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11526)
* Update copyright yearMatt Caswell2020-04-231-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11616)
* Make secure-memory be a config optionRich Salz2020-02-141-6/+11
| | | | | | | | | | | Adding support for "no-secure-memory" was simple, a one-liner. Fixing all the "ifdef OPENSSL_SECURE_MEMORY" to be "ifndef NO_xxx" was a bit more work. My original goof, for not following the OpenSSL pattern "ifndef NO_" used everywhere else. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/11023)
* Remove unused HAS_LFN_SUPPORTRich Salz2020-02-071-1/+0
| | | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10959)
* Move random-related defines from e_os.h to rand_unix.cDr. Matthias St. Pierre2019-10-191-45/+0
| | | | | | | Fixes #10049 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10050)
* Fix typo in commentPauli2019-10-061-1/+1
| | | | | Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10105)
* Fix header file include guard namesDr. Matthias St. Pierre2019-09-281-2/+2
| | | | | | | | | | | | | Make the include guards consistent by renaming them systematically according to the naming conventions below For the public header files (in the 'include/openssl' directory), the guard names try to match the path specified in the include directives, with all letters converted to upper case and '/' and '.' replaced by '_'. For the private header files files, an extra 'OSSL_' is added as prefix. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
* Don't include the DEVRANDOM being seeded logic on Android.Pauli2019-08-301-1/+1
| | | | | | | | | It lacks exposure of the `shm*` functions and should prefer the GETRANDOM source. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/9735)
* Start up DEVRANDOM entropy improvement for older Linux devices.Pauli2019-08-201-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve handling of low entropy at start up from /dev/urandom by waiting for a read(2) call on /dev/random to succeed. Once one such call has succeeded, a shared memory segment is created and persisted as an indicator to other processes that /dev/urandom is properly seeded. This does not fully prevent against attacks weakening the entropy source. An attacker who has control of the machine early in its boot sequence could create the shared memory segment preventing detection of low entropy conditions. However, this is no worse than the current situation. An attacker would also be capable of removing the shared memory segment and causing seeding to reoccur resulting in a denial of service attack. This is partially mitigated by keeping the shared memory alive for the duration of the process's existence. Thus, an attacker would not only need to have called call shmctl(2) with the IPC_RMID command but the system must subsequently enter a state where no instances of libcrypto exist in any process. Even one long running process will prevent this attack. The System V shared memory calls used here go back at least as far as Linux kernel 2.0. Linux kernels 4.8 and later, don't have a reliable way to detect that /dev/urandom has been properly seeded, so a failure is raised for this case (i.e. the getentropy(2) call has already failed). Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/9595)
* Remove NextStep supportRich Salz2019-07-011-5/+1
| | | | | | | | | Because of that we can remove OPENSSL_UNISTD and some other macros from e_os2.h and opensslconf.h Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9204)
* Revert the DEVRANDOM_WAIT featureDr. Matthias St. Pierre2019-06-091-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | The DEVRANDOM_WAIT feature added a select() call to wait for the `/dev/random` device to become readable before reading from the `/dev/urandom` device. It was introduced in commit 38023b87f037 in order to mitigate the fact that the `/dev/urandom` device does not block until the initial seeding of the kernel CSPRNG has completed, contrary to the behaviour of the `getrandom()` system call. It turned out that this change had negative side effects on performance which were not acceptable. After some discussion it was decided to revert this feature and leave it up to the OS resp. the platform maintainer to ensure a proper initialization during early boot time. Fixes #9078 This partially reverts commit 38023b87f037. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9084)
* Use vxRandLib for VxWorks7Klotz, Tobias2019-05-021-1/+1
| | | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/8023)
* Limit DEVRANDOM_WAIT to linuxBernd Edlinger2019-03-071-1/+3
| | | | | | | Fixes #8416 Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/8428)
* Fix seeding from random device w/o getrandom syscallBernd Edlinger2019-03-011-6/+3
| | | | | | | | | | | | | | | Use select to wait for /dev/random in readable state, but do not actually read anything from /dev/random, use /dev/urandom first. Use linux define __NR_getrandom instead of the glibc define SYS_getrandom, in case the kernel headers are more current than the glibc headers. Fixes #8215 Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/8251)
* Make sure build_SYS_str_reasons() preserves errnoMatt Caswell2018-12-101-0/+3
| | | | | | | | | | This function can end up being called during ERR_get_error() if we are initialising. ERR_get_error() must preserve errno since it gets called via SSL_get_error(). If that function returns SSL_ERROR_SYSCALL then you are supposed to inspect errno. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7680)
* Following the license change, modify the boilerplates in last fewRichard Levitte2018-12-061-1/+1
| | | | | | | [skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7836)
* test/secmemtest: test secure memory only if it is implementedDr. Matthias St. Pierre2018-10-051-3/+10
| | | | | | | | Fixes #7322 Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/7351)
* typo-fixes: miscellaneous typo fixesagnosticdev2018-09-211-1/+1
| | | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/7277)
* Remove __cplusplus preamble from internal headersNicola Tuveri2018-06-221-8/+0
| | | | | | | | | | | These headers are internal and never exposed to a cpp compiler, hence no need for the preamble. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/6554)
* Update copyright yearMatt Caswell2018-02-271-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove OSSLzu, and fix the one place that used it.Rich Salz2018-02-231-27/+0
| | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5439)
* e_os.h: add prandom and hwrng to the list of random devices on s390x.Patrick Steuer2017-10-221-1/+5
| | | | | | | | | Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4534)
* struct timeval include guardsPauli2017-09-011-0/+6
| | | | | | | | | | Move struct timeval includes into e_os.h (where the Windows ones were). Enaure that the include is guarded canonically. Refer #4271 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4312)
* Move OPENSSL_CONF from e_os.h to cryptlib.hPauli2017-08-301-2/+0
| | | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4188)
* Move e_os.h to be the very first include.Pauli2017-08-301-0/+1
| | | | | | | | cryptilib.h is the second. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4188)
* Move the REF_PRINT support from e_os.h to internal/refcount.h.Pauli2017-08-301-20/+0
| | | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4188)
* MSC_VER <= 1200 isn't supported; remove dead codeRich Salz2017-08-271-8/+0
| | | | | | | VisualStudio 6 and earlier aren't supported. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4263)
* Remove NO_DIRENT; it isn't used anywhereRich Salz2017-08-251-1/+0
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4261)
* Move more socket stuffRichard Levitte2017-08-251-9/+0
| | | | | | | | | | The socket stuff for DJGPP and VMS was only partially moved to include/internal/sockets.h... Remains vxWorks. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4254)
* NO_SYS_TYPES_H isn't defined anywhere, stop using it as a guardRichard Levitte2017-08-251-3/+1
| | | | | | | This is a vestige from pre-1.1.0 OpenSSL Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4256)
* (Re)move some things from e_os.hRich Salz2017-08-221-170/+7
| | | | | | | | | | | Remove GETPID_IS_MEANINGLESS and osslargused. Move socket-related things to new file internal/sockets.h; this is now only needed by four(!!!) files. Compiles should be a bit faster. Remove USE_SOCKETS ifdef's Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4209)
* Use "" not <> for internal/ includesRich Salz2017-08-221-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4217)
* Remove tests dependence on e_os.hPauli2017-08-181-3/+3
| | | | | | | | | | | | Apart from ssltest_old.c, the test suite relied on e_os.h for the OSSL_NELEM macro and nothing else. The ssltest_old.c also requires EXIT and some socket macros. Create a new header to define the OSSL_NELEM macro and use that instead. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4186)
* fix some typosFdaSilvaYY2017-08-161-2/+2
| | | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4172)
* Fix two MSVC warnings in apps.cFdaSilvaYY2017-08-161-0/+1
| | | | | | | | warning C4996: 'fileno': The POSIX name for this item is deprecated. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4172)
* Move ossl_assertMatt Caswell2017-08-031-17/+0
| | | | | | | | | | Move the definition of ossl_assert() out of e_os.h which is intended for OS specific things. Instead it is moved into internal/cryptlib.h. This also changes the definition to remove the (int) cast. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4073)
* Use randomness not entropyRich Salz2017-06-271-2/+2
| | | | | Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/3773)
* Add parentheses around macro argument of OSSL_NELEM.Bernd Edlinger2017-06-201-1/+1
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3039)
* Add a macro for testing assertion in both debug and production buildsMatt Caswell2017-05-221-0/+18
| | | | | | | | | | | | | | | | If we have an assert then in a debug build we want an abort() to occur. In a production build we want the function to return an error. This introduces a new macro to assist with that. The idea is to replace existing use of OPENSSL_assert() with this new macro. The problem with OPENSSL_assert() is that it aborts() on an assertion failure in both debug and production builds. It should never be a library's decision to abort a process (we don't get to decide when to kill the life support machine or the nuclear reactor control system). Additionally if an attacker can cause a reachable assert to be hit then this can be a source of DoS attacks e.g. see CVE-2017-3733, CVE-2015-0293, CVE-2011-4577 and CVE-2002-1568. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3496)
* e_os.h: drop now-redundant PRIu64 [and fix OSSLzu].Andy Polyakov2017-03-301-20/+21
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3083)
* Cleaning UEFI Build with additional OPENSSL_SYS_UEFI flagsQin Long2017-03-291-1/+1
| | | | | | | | Add OPENSSL_SYS_UEFI to remove unused syslog and uid stuffs for more clean UEFI build. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2961)