99 Commits

Author SHA1 Message Date
imorgenstern
d7a9ca6d2f
Fix inconsistencies in accept4.c
Fix inconsistencies in accept4.c. If the underlying accept() fails the shim returns the listening socket s instead of −1.
2025-08-28 13:42:04 +02:00
Brent Cook
5d9229b169
adjust incorrect commit years
Co-authored-by: Theo Buehler <botovq@users.noreply.github.com>
2025-06-01 17:24:24 +03:00
Brent Cook
340037f69a add autotools build copyright headers 2025-06-01 08:22:33 +07:00
Brent Cook
c51665d429 add copyright headers to Cmake files
based on original committer and date
2025-06-01 08:22:33 +07:00
Theo Buehler
8dad5fe3b9 Update for speed.c and .h churn 2025-01-02 08:29:09 -07:00
Brent Cook
64f15ec589 use TIMEVAL typedef with select()
This prevents the compatibility struct timeval definition in
sys/time.h from potentially getting used with select() here.

https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-select
2024-10-06 18:56:01 -05:00
Brent Cook
0eceb61cc0 for poll timeout -1, set loop time more reasonably
Otherwise it sets looptime to -1, which was skipped by select()
and caused 100% cpu busy looping.
2024-10-06 18:56:01 -05:00
Theo Buehler
1ff9793dee Switch to check_symbol_exists() in simplest cases
There are a few exceptions. Some require _GNU_SOURCE, some are in the
weird strings.h header, some are probably too new to be found in the
standard locations.

Fixes #1077
2024-08-21 15:56:28 +02:00
Theo Buehler
050b6de79e spkac.c is no more 2024-07-08 00:52:49 -06:00
Viktor Szakats
fccbb9b556
nc needs compat_obj on some platforms 2023-12-14 04:39:35 +00:00
Viktor Szakats
848950877f
cmake: stop exporting compat functions 2023-12-14 03:36:09 +00:00
Viktor Szakats
89fcb1a3e5
also fix ocspcheck and nc, dedupe build logic 2023-11-05 08:56:09 +00:00
Pierre Wendling
c4bb6b79ea MSVC: Enable building ocspcheck.
- Add `STDIN_FILENO` to compat unistd header.
- Use quotes to include compat getopt header in the compat unistd.
- Export additional symbols needed by ocspcheck (optarg, optind,
  ftruncate)
2023-10-29 12:28:44 -05:00
Brent Cook
71ce0b8c3e generate opensslconf.h in build dir for cmake 2023-07-04 10:37:24 +03:00
Brent Cook
a316f8ab8c link internal apps statically 2023-05-27 01:20:54 -05:00
Theo Buehler
b3c1375588 A handful of files were removed 2023-04-25 16:50:18 -06:00
Sebastian Blunt
fe903fb7c5 Fix unreachable nc portability shim
This fixes nc failing to run on darwin due to it incorrectly setting the
linux-specific SOCK_NONBLOCK flag on connect.

nc already had a portability shim in apps/nc/compat/sys/socket.h, which
kicks in if SOCK_NONBLOCK is undefined. But that header includes
include/compat/sys/socket.h, which also has a portability shim that
defines a default value for SOCK_NONBLOCK if it's undefined. Thus the
first portability shim was unreachable.

Fixes this by moving the NEED_SOCKET_FLAGS flag into the outer shim, and
having the inner shim activate if NEED_SOCKET_FLAGS is defined.

This closes https://github.com/libressl-portable/portable/issues/631
2022-04-15 23:59:33 -07:00
kinichiro
adde656bb7 Add strtonum to compat library and export it
crypto library requires strtonum now, and add it to compat library.
remove it from applications compat/ directories.
2021-12-26 16:00:25 +09:00
kinichiro
c211d97ecb Remove unneeded target_include_directories with cmake
This could remove recurring of the same statement for include directories.
Instead of this removals, apps/* and tests  should have include path that
had been provided by INTERFACE_INCLUDE_DIRECTORIES of target libs and
internal static libs.
2021-12-04 14:36:39 +09:00
kinichiro
39c7fa8ad6 Force cmake to link strtonum shim with Darwin less than 20
check_function_exists misinterprets as if strtonum exists on macos 10.15.
2021-05-22 13:31:04 +09:00
kinichiro
4c56df46de Statically link libcrypto/ssl into libtls with cmake 2021-05-07 20:31:22 +09:00
Brent Cook
921c0675a2 Add '--enable-libtls-only' build option 2021-04-07 07:51:45 -05:00
Brent Cook
9abd36e3af modify nc build to link libcompat objects directly
Rather than assuming the static version of libcrypto exists for pulling in the compatibility functions, link the compat objects directly. This modifies the object file generation script a bit to handle the empty-case properly as well.
2020-10-20 03:50:23 -05:00
Brent Cook
6359d9404d include strtonum for ocspcheck 2020-10-19 09:09:36 -05:00
kinichiro
5a29b0472d Link crypto and ssl object files directly instead of static library
- Output object files list variable for libcrypto and libssl to .mk file.
- Include object files list variable .mk from tls/Makefile
- Link .lo files directly instead of static library for libtls.
2020-10-04 03:50:18 -05:00
Brent Cook
fe42a8011b Configure libtls and nc(1) to statically link to libcrypto/ssl
An issue that Reyk Floeter noted while building a Debian package for
LibreSSL is that installing libtls along with OpenSSL causes linker
issues since it will often pick up the wrong libcrypto/libssl. This
change makes libtls statically link the object files it needs rather
than relying on the shared libraries, effectively making libtls
self-contained and able to be packaged independently.

This should make it possible for other projects that also use libtls to
be able to package support without requiring the target OS to ship
libcrypto / libssl from LibreSSL.

678278df55
2020-10-04 03:50:18 -05:00
kinichiro
6dc8d2be3b Install ocspcheck.8 manual 2020-01-09 21:33:28 +09:00
Brent Cook
73fb0f8991 re-add CMS to openssl(1) 2019-11-07 18:24:37 -06:00
kinichiro
30e91bc6d2 Enable speed on win32
- Use thread and sleep instead of signal and alarm, on win32
- Disable -multi option on win32 since fork is hard to implement
2019-07-14 19:45:34 +09:00
paul4334
a7265dd139
Fix MacOSX cmake missing symbol _clock_gettime
On El Capitan:
     [exec] [100%] Linking C executable openssl
     [exec] Undefined symbols for architecture x86_64:
     [exec]   "_clock_gettime", referenced from:
     [exec]       _app_timer_real in apps_posix.c.o
     [exec] ld: symbol(s) not found for architecture x86_64
     [exec] clang: error: linker command failed with exit code 1 (use -v to see invocation)
     [exec] make[2]: *** [apps/openssl/openssl] Error 1
     [exec] make[1]: *** [apps/openssl/CMakeFiles/openssl.dir/all] Error 2
     [exec] make: *** [all] Error 2
2019-04-30 16:35:04 -07:00
Brent Cook
b7a580e86a implement app_timer_real 2018-09-23 14:04:26 -05:00
Brent Cook
bf368e58e7 add private includes for apps and tests 2018-06-14 05:59:20 -05:00
Brent Cook
4fcfc82d83 scope private/public headers when embedding into other projects
thanks to Cameron Palmer
2018-05-29 05:46:54 -05:00
Brent Cook
6b513a1c78 add proper guard and typedef 2018-03-23 13:45:05 -05:00
Brent Cook
4b2a8cd1c1 adjust definition of compat clock_gettime 2018-03-23 11:10:16 -05:00
Brent Cook
987aa6a084 add clock_gettime for macos 10.11 and earlier 2018-03-22 21:04:43 -05:00
Don
09590953d0 Remove CMAKE_HOST_ references
CMAKE_HOST_ describes the host system not the target. For cross compilation to work the actual target system should be used for making decisions in CMake.
2018-03-16 14:59:53 -07:00
Brent Cook
3fb9e63b90 bump base requirement to Windows Vista, use builtin inet_ntop/pton 2018-03-14 07:29:04 -05:00
kinichiro
82ce59838e Add app_timer_user for Windows build 2017-12-26 22:49:01 +09:00
Aric Belsito
653ba21752
Create correct directory in CMake install.
Was creating ${CONFDIR}/cert instead of ${CONFDIR}/certs.
2017-11-06 11:52:03 -08:00
kinichiro
9bb3e03722 Fix checking memmem in apps/ocspcheck/CMakeLists.txt
- Issue #352 pointed out by @d3x0r
2017-09-26 22:02:21 +09:00
Brent Cook
4916f940c8 use standard initialization for poll loop delay 2017-08-13 16:09:32 -05:00
d3x0r
a4d80ca56a Merge branch 'master' of https://github.com/libressl-portable/portable into SkipInstall
Fix merge conflicts from GNUInstallDirs merge to master.
2017-07-06 23:11:11 -07:00
d3x0r
2557dd7439 Add option LIBRESSL_SKIP_INSTALL
Internally LIBRESSL_SKIP_INSTALL, if not set becomes ENABLE_LIBRESSL_INSTALL so this by default is enabled.  defining LIBRESSL_SKIP_INSTALL before hand will disable all install() rules.
This is useful if another project includes and links to this statically.
I chose to add a prefix to avoid potential name collision because the options are cached globally.

If the installation is skipped, maybe it should also disable building apps?  I didn't do that.
2017-07-06 02:09:44 -07:00
d3x0r
a2bd5ebaba use GNUInstallDirs from cmake to specify install paths.
Primarily this is to select whether 'lib64' or 'lib' is used on linux type systems.
2017-07-06 01:49:43 -07:00
Brent Cook
9d2418ae3a add nc(1) manpage to install if enabled 2017-04-12 08:18:20 -05:00
kinichiro
58eb645fdb Copy libc compat files rather than adding into the repository
- remove the CP_LIBC files from repo
- move tests/memmem.c to tests/compat/
2017-01-28 03:40:38 +09:00
Brent Cook
cb57534af8 skip building ocspcheck on MSCV 2017-01-27 07:14:43 -06:00
kinichiro
05cf1ee697 Copy openbsd library file every time rather than statically checking in 2017-01-27 01:21:37 +09:00
kinichiro
7dd0650d33 Add inet_ntop and memmem for ocspcheck 2017-01-26 17:51:35 +09:00