uringmachine 0.16 → 0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.gitmodules +4 -0
- data/CHANGELOG.md +8 -0
- data/TODO.md +12 -3
- data/examples/bm_send.rb +86 -0
- data/ext/um/um.c +28 -1
- data/ext/um/um.h +3 -0
- data/ext/um/um_class.c +17 -0
- data/ext/um/um_utils.c +38 -15
- data/lib/uringmachine/version.rb +1 -1
- data/test/test_um.rb +76 -0
- data/vendor/libressl/.github/scripts/changelog.sh +74 -0
- data/vendor/libressl/.github/workflows/android.yml +35 -0
- data/vendor/libressl/.github/workflows/cifuzz.yml +33 -0
- data/vendor/libressl/.github/workflows/cmake-config.yml +98 -0
- data/vendor/libressl/.github/workflows/coverity.yml +69 -0
- data/vendor/libressl/.github/workflows/emscripten.yml +71 -0
- data/vendor/libressl/.github/workflows/fedora-rawhide.yml +39 -0
- data/vendor/libressl/.github/workflows/freebsd.yml +71 -0
- data/vendor/libressl/.github/workflows/linux.yml +71 -0
- data/vendor/libressl/.github/workflows/macos.yml +37 -0
- data/vendor/libressl/.github/workflows/release.yml +81 -0
- data/vendor/libressl/.github/workflows/rust-openssl.yml +47 -0
- data/vendor/libressl/.github/workflows/solaris.yml +37 -0
- data/vendor/libressl/.github/workflows/windows.yml +70 -0
- data/vendor/libressl/.gitignore +333 -0
- data/vendor/libressl/CMakeLists.txt +581 -0
- data/vendor/libressl/COPYING +133 -0
- data/vendor/libressl/ChangeLog +3280 -0
- data/vendor/libressl/FindLibreSSL.cmake +232 -0
- data/vendor/libressl/LibreSSLConfig.cmake.in +36 -0
- data/vendor/libressl/Makefile.am +60 -0
- data/vendor/libressl/Makefile.am.common +20 -0
- data/vendor/libressl/OPENBSD_BRANCH +1 -0
- data/vendor/libressl/README.md +238 -0
- data/vendor/libressl/README.mingw.md +43 -0
- data/vendor/libressl/apps/CMakeLists.txt +18 -0
- data/vendor/libressl/apps/Makefile.am +5 -0
- data/vendor/libressl/apps/nc/CMakeLists.txt +67 -0
- data/vendor/libressl/apps/nc/Makefile.am +64 -0
- data/vendor/libressl/apps/nc/compat/accept4.c +17 -0
- data/vendor/libressl/apps/nc/compat/readpassphrase.c +205 -0
- data/vendor/libressl/apps/nc/compat/socket.c +29 -0
- data/vendor/libressl/apps/nc/compat/sys/socket.h +30 -0
- data/vendor/libressl/apps/ocspcheck/CMakeLists.txt +44 -0
- data/vendor/libressl/apps/ocspcheck/Makefile.am +45 -0
- data/vendor/libressl/apps/ocspcheck/compat/.gitignore +0 -0
- data/vendor/libressl/apps/openssl/CMakeLists.txt +97 -0
- data/vendor/libressl/apps/openssl/Makefile.am +108 -0
- data/vendor/libressl/apps/openssl/apps_win.c +138 -0
- data/vendor/libressl/apps/openssl/certhash_win.c +13 -0
- data/vendor/libressl/apps/openssl/compat/clock_gettime_osx.c +26 -0
- data/vendor/libressl/apps/openssl/compat/poll_win.c +329 -0
- data/vendor/libressl/appveyor.yml +53 -0
- data/vendor/libressl/autogen.sh +15 -0
- data/vendor/libressl/check-release.sh +86 -0
- data/vendor/libressl/cmake_export_symbol.cmake +71 -0
- data/vendor/libressl/cmake_uninstall.cmake.in +36 -0
- data/vendor/libressl/config +17 -0
- data/vendor/libressl/configure.ac +165 -0
- data/vendor/libressl/crypto/CMakeLists.txt +863 -0
- data/vendor/libressl/crypto/Makefile.am +962 -0
- data/vendor/libressl/crypto/Makefile.am.arc4random +46 -0
- data/vendor/libressl/crypto/Makefile.am.elf-mips +14 -0
- data/vendor/libressl/crypto/Makefile.am.elf-mips64 +14 -0
- data/vendor/libressl/crypto/Makefile.am.elf-x86_64 +35 -0
- data/vendor/libressl/crypto/Makefile.am.macosx-x86_64 +35 -0
- data/vendor/libressl/crypto/Makefile.am.masm-x86_64 +22 -0
- data/vendor/libressl/crypto/Makefile.am.mingw64-x86_64 +23 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_darwin.c +60 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_linux.c +62 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_none.c +26 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_windows.c +36 -0
- data/vendor/libressl/crypto/arch/loongarch64/crypto_arch.h +21 -0
- data/vendor/libressl/crypto/arch/mips/crypto_arch.h +21 -0
- data/vendor/libressl/crypto/bn/arch/loongarch64/bn_arch.h +23 -0
- data/vendor/libressl/crypto/bn/arch/mips/bn_arch.h +24 -0
- data/vendor/libressl/crypto/compat/.gitignore +31 -0
- data/vendor/libressl/crypto/compat/arc4random.h +41 -0
- data/vendor/libressl/crypto/compat/b_win.c +55 -0
- data/vendor/libressl/crypto/compat/bsd-asprintf.c +96 -0
- data/vendor/libressl/crypto/compat/crypto_lock_win.c +56 -0
- data/vendor/libressl/crypto/compat/explicit_bzero_win.c +13 -0
- data/vendor/libressl/crypto/compat/freezero.c +32 -0
- data/vendor/libressl/crypto/compat/getdelim.c +78 -0
- data/vendor/libressl/crypto/compat/getline.c +40 -0
- data/vendor/libressl/crypto/compat/getopt_long.c +528 -0
- data/vendor/libressl/crypto/compat/getpagesize.c +18 -0
- data/vendor/libressl/crypto/compat/getprogname_linux.c +23 -0
- data/vendor/libressl/crypto/compat/getprogname_unimpl.c +7 -0
- data/vendor/libressl/crypto/compat/getprogname_windows.c +13 -0
- data/vendor/libressl/crypto/compat/posix_win.c +296 -0
- data/vendor/libressl/crypto/compat/syslog_r.c +19 -0
- data/vendor/libressl/crypto/compat/ui_openssl_win.c +334 -0
- data/vendor/libressl/dist.sh +22 -0
- data/vendor/libressl/gen-coverage-report.sh +58 -0
- data/vendor/libressl/gen-openbsd-tags.sh +20 -0
- data/vendor/libressl/include/CMakeLists.txt +61 -0
- data/vendor/libressl/include/Makefile.am +79 -0
- data/vendor/libressl/include/arch/loongarch64/opensslconf.h +150 -0
- data/vendor/libressl/include/arch/mips/opensslconf.h +150 -0
- data/vendor/libressl/include/compat/arpa/inet.h +15 -0
- data/vendor/libressl/include/compat/arpa/nameser.h +25 -0
- data/vendor/libressl/include/compat/cet.h +19 -0
- data/vendor/libressl/include/compat/dirent.h +17 -0
- data/vendor/libressl/include/compat/dirent_msvc.h +611 -0
- data/vendor/libressl/include/compat/endian.h +161 -0
- data/vendor/libressl/include/compat/err.h +95 -0
- data/vendor/libressl/include/compat/fcntl.h +32 -0
- data/vendor/libressl/include/compat/getopt.h +50 -0
- data/vendor/libressl/include/compat/limits.h +25 -0
- data/vendor/libressl/include/compat/netdb.h +10 -0
- data/vendor/libressl/include/compat/netinet/in.h +19 -0
- data/vendor/libressl/include/compat/netinet/ip.h +49 -0
- data/vendor/libressl/include/compat/netinet/tcp.h +10 -0
- data/vendor/libressl/include/compat/poll.h +63 -0
- data/vendor/libressl/include/compat/pthread.h +122 -0
- data/vendor/libressl/include/compat/readpassphrase.h +44 -0
- data/vendor/libressl/include/compat/resolv.h +24 -0
- data/vendor/libressl/include/compat/stdint.h +31 -0
- data/vendor/libressl/include/compat/stdio.h +65 -0
- data/vendor/libressl/include/compat/stdlib.h +57 -0
- data/vendor/libressl/include/compat/string.h +98 -0
- data/vendor/libressl/include/compat/sys/_null.h +18 -0
- data/vendor/libressl/include/compat/sys/ioctl.h +11 -0
- data/vendor/libressl/include/compat/sys/mman.h +19 -0
- data/vendor/libressl/include/compat/sys/param.h +15 -0
- data/vendor/libressl/include/compat/sys/queue.h +536 -0
- data/vendor/libressl/include/compat/sys/select.h +10 -0
- data/vendor/libressl/include/compat/sys/socket.h +18 -0
- data/vendor/libressl/include/compat/sys/stat.h +129 -0
- data/vendor/libressl/include/compat/sys/time.h +37 -0
- data/vendor/libressl/include/compat/sys/tree.h +1006 -0
- data/vendor/libressl/include/compat/sys/types.h +69 -0
- data/vendor/libressl/include/compat/sys/uio.h +17 -0
- data/vendor/libressl/include/compat/syslog.h +38 -0
- data/vendor/libressl/include/compat/time.h +59 -0
- data/vendor/libressl/include/compat/unistd.h +83 -0
- data/vendor/libressl/include/compat/win32netcompat.h +57 -0
- data/vendor/libressl/include/openssl/Makefile.am.tpl +45 -0
- data/vendor/libressl/libcrypto.pc.in +28 -0
- data/vendor/libressl/libressl.pub +2 -0
- data/vendor/libressl/libssl.pc.in +28 -0
- data/vendor/libressl/libtls.pc.in +28 -0
- data/vendor/libressl/m4/ax_add_fortify_source.m4 +80 -0
- data/vendor/libressl/m4/ax_check_compile_flag.m4 +53 -0
- data/vendor/libressl/m4/check-hardening-options.m4 +110 -0
- data/vendor/libressl/m4/check-libc.m4 +189 -0
- data/vendor/libressl/m4/check-os-options.m4 +181 -0
- data/vendor/libressl/m4/disable-compiler-warnings.m4 +44 -0
- data/vendor/libressl/man/CMakeLists.txt +26 -0
- data/vendor/libressl/man/links +2780 -0
- data/vendor/libressl/man/update_links.sh +25 -0
- data/vendor/libressl/openssl.pc.in +11 -0
- data/vendor/libressl/patches/bn_shift.patch +34 -0
- data/vendor/libressl/patches/crypto_arch.h.patch +34 -0
- data/vendor/libressl/patches/crypto_namespace.h.patch +22 -0
- data/vendor/libressl/patches/netcat.c.patch +178 -0
- data/vendor/libressl/patches/openssl.c.patch +12 -0
- data/vendor/libressl/patches/opensslfeatures.h.patch +49 -0
- data/vendor/libressl/patches/patch-amd64-crypto-cpu-caps.c.patch +20 -0
- data/vendor/libressl/patches/patch-i386-crypto-cpu-caps.c.patch +20 -0
- data/vendor/libressl/patches/speed.c.patch +114 -0
- data/vendor/libressl/patches/ssl_namespace.h.patch +21 -0
- data/vendor/libressl/patches/tls.h.patch +16 -0
- data/vendor/libressl/patches/tls_config.c.patch +15 -0
- data/vendor/libressl/patches/win32_amd64_bn_arch.h.patch +28 -0
- data/vendor/libressl/patches/windows_headers.patch +80 -0
- data/vendor/libressl/scripts/config.guess +1774 -0
- data/vendor/libressl/scripts/config.sub +1907 -0
- data/vendor/libressl/scripts/i686-w64-mingw32.cmake +9 -0
- data/vendor/libressl/scripts/test +210 -0
- data/vendor/libressl/scripts/wrap-compiler-for-flag-check +31 -0
- data/vendor/libressl/scripts/x86_64-w64-mingw32.cmake +9 -0
- data/vendor/libressl/ssl/CMakeLists.txt +183 -0
- data/vendor/libressl/ssl/Makefile.am +187 -0
- data/vendor/libressl/tests/CMakeLists.txt +970 -0
- data/vendor/libressl/tests/Makefile.am +944 -0
- data/vendor/libressl/tests/aeadtest.sh +30 -0
- data/vendor/libressl/tests/arc4randomforktest.sh +21 -0
- data/vendor/libressl/tests/asn1time_small.test +10 -0
- data/vendor/libressl/tests/cmake/CMakeLists.txt +52 -0
- data/vendor/libressl/tests/cmake/crypto.c +7 -0
- data/vendor/libressl/tests/cmake/ssl.c +6 -0
- data/vendor/libressl/tests/cmake/tls.c +6 -0
- data/vendor/libressl/tests/compat/pipe2.c +186 -0
- data/vendor/libressl/tests/dtlstest.sh +28 -0
- data/vendor/libressl/tests/evptest.sh +22 -0
- data/vendor/libressl/tests/keypairtest.sh +27 -0
- data/vendor/libressl/tests/mlkem_tests.sh +39 -0
- data/vendor/libressl/tests/ocsptest.bat +25 -0
- data/vendor/libressl/tests/ocsptest.sh +23 -0
- data/vendor/libressl/tests/openssl.cnf +29 -0
- data/vendor/libressl/tests/optionstest.c +381 -0
- data/vendor/libressl/tests/pidwraptest.c +85 -0
- data/vendor/libressl/tests/pidwraptest.sh +26 -0
- data/vendor/libressl/tests/quictest.bat +27 -0
- data/vendor/libressl/tests/quictest.sh +30 -0
- data/vendor/libressl/tests/renegotiation_test.bat +27 -0
- data/vendor/libressl/tests/renegotiation_test.sh +30 -0
- data/vendor/libressl/tests/rfc5280time_small.test +10 -0
- data/vendor/libressl/tests/servertest.bat +27 -0
- data/vendor/libressl/tests/servertest.sh +30 -0
- data/vendor/libressl/tests/shutdowntest.bat +27 -0
- data/vendor/libressl/tests/shutdowntest.sh +30 -0
- data/vendor/libressl/tests/ssltest.bat +32 -0
- data/vendor/libressl/tests/ssltest.sh +48 -0
- data/vendor/libressl/tests/testdsa.bat +47 -0
- data/vendor/libressl/tests/testdsa.sh +57 -0
- data/vendor/libressl/tests/testenc.bat +85 -0
- data/vendor/libressl/tests/testenc.sh +93 -0
- data/vendor/libressl/tests/testrsa.bat +47 -0
- data/vendor/libressl/tests/testrsa.sh +57 -0
- data/vendor/libressl/tests/testssl.bat +171 -0
- data/vendor/libressl/tests/tlstest.bat +27 -0
- data/vendor/libressl/tests/tlstest.sh +28 -0
- data/vendor/libressl/tls/CMakeLists.txt +125 -0
- data/vendor/libressl/tls/Makefile.am +76 -0
- data/vendor/libressl/tls/compat/ftruncate.c +17 -0
- data/vendor/libressl/tls/compat/pread.c +29 -0
- data/vendor/libressl/tls/compat/pwrite.c +29 -0
- data/vendor/libressl/update.sh +460 -0
- data/vendor/liburing/.github/workflows/ci.yml +8 -0
- data/vendor/liburing/configure +23 -2
- data/vendor/liburing/examples/helpers.c +1 -1
- data/vendor/liburing/examples/helpers.h +1 -1
- data/vendor/liburing/examples/reg-wait.c +3 -3
- data/vendor/liburing/examples/zcrx.c +5 -5
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/src/include/liburing/io_uring.h +16 -0
- data/vendor/liburing/src/include/liburing.h +20 -4
- data/vendor/liburing/src/lib.h +2 -4
- data/vendor/liburing/src/liburing-ffi.map +7 -0
- data/vendor/liburing/src/liburing.map +7 -0
- data/vendor/liburing/src/register.c +5 -0
- data/vendor/liburing/src/sanitize.c +5 -4
- data/vendor/liburing/src/setup.c +43 -28
- data/vendor/liburing/test/Makefile +7 -0
- data/vendor/liburing/test/cmd-discard.c +2 -2
- data/vendor/liburing/test/evfd-short-read.c +84 -0
- data/vendor/liburing/test/fdinfo-sqpoll.c +117 -0
- data/vendor/liburing/test/fdinfo.c +1 -1
- data/vendor/liburing/test/fixed-buf-merge.c +2 -2
- data/vendor/liburing/test/futex-kill.c +135 -0
- data/vendor/liburing/test/helpers.c +1 -1
- data/vendor/liburing/test/helpers.h +1 -1
- data/vendor/liburing/test/init-mem.c +50 -12
- data/vendor/liburing/test/io_uring_passthrough.c +25 -6
- data/vendor/liburing/test/msg-ring.c +123 -9
- data/vendor/liburing/test/recv-bundle-short-ooo.c +16 -1
- data/vendor/liburing/test/recv-inc-ooo.c +411 -0
- data/vendor/liburing/test/recv-mshot-fair.c +513 -0
- data/vendor/liburing/test/reg-wait.c +14 -14
- data/vendor/liburing/test/send-zerocopy.c +4 -4
- data/vendor/liburing/test/timerfd-short-read.c +81 -0
- data/vendor/liburing/test/timestamp.c +382 -0
- data/vendor/liburing/test/zcrx.c +22 -22
- metadata +222 -2
@@ -0,0 +1,232 @@
|
|
1
|
+
#[=======================================================================[
|
2
|
+
|
3
|
+
Copyright (c) 2019 John Norrbin <jlnorrbin@johnex.se>
|
4
|
+
|
5
|
+
Permission to use, copy, modify, and distribute this software for any
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
|
17
|
+
FindLibreSSL
|
18
|
+
------------
|
19
|
+
|
20
|
+
Find the LibreSSL encryption library.
|
21
|
+
|
22
|
+
Optional Components
|
23
|
+
^^^^^^^^^^^^^^^^^^^
|
24
|
+
|
25
|
+
This module supports two optional components: SSL and TLS. Both
|
26
|
+
components have associated imported targets, as described below.
|
27
|
+
|
28
|
+
Imported Targets
|
29
|
+
^^^^^^^^^^^^^^^^
|
30
|
+
|
31
|
+
This module defines the following imported targets:
|
32
|
+
|
33
|
+
LibreSSL::Crypto
|
34
|
+
The LibreSSL crypto library, if found.
|
35
|
+
|
36
|
+
LibreSSL::SSL
|
37
|
+
The LibreSSL ssl library, if found. Requires and includes LibreSSL::Crypto automatically.
|
38
|
+
|
39
|
+
LibreSSL::TLS
|
40
|
+
The LibreSSL tls library, if found. Requires and includes LibreSSL::SSL and LibreSSL::Crypto automatically.
|
41
|
+
|
42
|
+
Result Variables
|
43
|
+
^^^^^^^^^^^^^^^^
|
44
|
+
|
45
|
+
This module will set the following variables in your project:
|
46
|
+
|
47
|
+
LIBRESSL_FOUND
|
48
|
+
System has the LibreSSL library. If no components are requested it only requires the crypto library.
|
49
|
+
LIBRESSL_INCLUDE_DIR
|
50
|
+
The LibreSSL include directory.
|
51
|
+
LIBRESSL_CRYPTO_LIBRARY
|
52
|
+
The LibreSSL crypto library.
|
53
|
+
LIBRESSL_SSL_LIBRARY
|
54
|
+
The LibreSSL SSL library.
|
55
|
+
LIBRESSL_TLS_LIBRARY
|
56
|
+
The LibreSSL TLS library.
|
57
|
+
LIBRESSL_LIBRARIES
|
58
|
+
All LibreSSL libraries.
|
59
|
+
LIBRESSL_VERSION
|
60
|
+
This is set to $major.$minor.$revision (e.g. 2.6.8).
|
61
|
+
|
62
|
+
Hints
|
63
|
+
^^^^^
|
64
|
+
|
65
|
+
Set LIBRESSL_ROOT_DIR to the root directory of an LibreSSL installation.
|
66
|
+
|
67
|
+
]=======================================================================]
|
68
|
+
|
69
|
+
INCLUDE(FindPackageHandleStandardArgs)
|
70
|
+
|
71
|
+
# Set Hints
|
72
|
+
set(_LIBRESSL_ROOT_HINTS
|
73
|
+
${LIBRESSL_ROOT_DIR}
|
74
|
+
ENV LIBRESSL_ROOT_DIR
|
75
|
+
)
|
76
|
+
|
77
|
+
# Set Paths
|
78
|
+
if (WIN32)
|
79
|
+
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
|
80
|
+
set(_LIBRESSL_ROOT_PATHS
|
81
|
+
"${_programfiles}/LibreSSL"
|
82
|
+
)
|
83
|
+
unset(_programfiles)
|
84
|
+
elseif(APPLE)
|
85
|
+
# Homebrew installs LibreSSL here
|
86
|
+
set(_LIBRESSL_ROOT_PATHS
|
87
|
+
"/usr/local/opt/libressl"
|
88
|
+
)
|
89
|
+
else()
|
90
|
+
set(_LIBRESSL_ROOT_PATHS
|
91
|
+
"/usr/local/"
|
92
|
+
)
|
93
|
+
endif()
|
94
|
+
|
95
|
+
# Combine
|
96
|
+
set(_LIBRESSL_ROOT_HINTS_AND_PATHS
|
97
|
+
HINTS ${_LIBRESSL_ROOT_HINTS}
|
98
|
+
PATHS ${_LIBRESSL_ROOT_PATHS}
|
99
|
+
)
|
100
|
+
|
101
|
+
# Find Include Path
|
102
|
+
find_path(LIBRESSL_INCLUDE_DIR
|
103
|
+
NAMES
|
104
|
+
tls.h
|
105
|
+
${_LIBRESSL_ROOT_HINTS_AND_PATHS}
|
106
|
+
PATH_SUFFIXES
|
107
|
+
include
|
108
|
+
)
|
109
|
+
|
110
|
+
# Find Crypto Library
|
111
|
+
find_library(LIBRESSL_CRYPTO_LIBRARY
|
112
|
+
NAMES
|
113
|
+
libcrypto
|
114
|
+
crypto
|
115
|
+
NAMES_PER_DIR
|
116
|
+
${_LIBRESSL_ROOT_HINTS_AND_PATHS}
|
117
|
+
PATH_SUFFIXES
|
118
|
+
lib
|
119
|
+
)
|
120
|
+
|
121
|
+
# Find SSL Library
|
122
|
+
find_library(LIBRESSL_SSL_LIBRARY
|
123
|
+
NAMES
|
124
|
+
libssl
|
125
|
+
ssl
|
126
|
+
NAMES_PER_DIR
|
127
|
+
${_LIBRESSL_ROOT_HINTS_AND_PATHS}
|
128
|
+
PATH_SUFFIXES
|
129
|
+
lib
|
130
|
+
)
|
131
|
+
|
132
|
+
# Find TLS Library
|
133
|
+
find_library(LIBRESSL_TLS_LIBRARY
|
134
|
+
NAMES
|
135
|
+
libtls
|
136
|
+
tls
|
137
|
+
NAMES_PER_DIR
|
138
|
+
${_LIBRESSL_ROOT_HINTS_AND_PATHS}
|
139
|
+
PATH_SUFFIXES
|
140
|
+
lib
|
141
|
+
)
|
142
|
+
|
143
|
+
# Set Libraries
|
144
|
+
set(LIBRESSL_LIBRARIES ${LIBRESSL_CRYPTO_LIBRARY} ${LIBRESSL_SSL_LIBRARY} ${LIBRESSL_TLS_LIBRARY})
|
145
|
+
|
146
|
+
# Mark Variables As Advanced
|
147
|
+
mark_as_advanced(LIBRESSL_INCLUDE_DIR LIBRESSL_LIBRARIES LIBRESSL_CRYPTO_LIBRARY LIBRESSL_SSL_LIBRARY LIBRESSL_TLS_LIBRARY)
|
148
|
+
|
149
|
+
# Find Version File
|
150
|
+
if(LIBRESSL_INCLUDE_DIR AND EXISTS "${LIBRESSL_INCLUDE_DIR}/openssl/opensslv.h")
|
151
|
+
|
152
|
+
# Get Version From File
|
153
|
+
file(STRINGS "${LIBRESSL_INCLUDE_DIR}/openssl/opensslv.h" OPENSSLV.H REGEX "#define LIBRESSL_VERSION_TEXT[ ]+\".*\"")
|
154
|
+
|
155
|
+
# Match Version String
|
156
|
+
string(REGEX REPLACE ".*\".*([0-9]+)\\.([0-9]+)\\.([0-9]+)\"" "\\1;\\2;\\3" LIBRESSL_VERSION_LIST "${OPENSSLV.H}")
|
157
|
+
|
158
|
+
# Split Parts
|
159
|
+
list(GET LIBRESSL_VERSION_LIST 0 LIBRESSL_VERSION_MAJOR)
|
160
|
+
list(GET LIBRESSL_VERSION_LIST 1 LIBRESSL_VERSION_MINOR)
|
161
|
+
list(GET LIBRESSL_VERSION_LIST 2 LIBRESSL_VERSION_REVISION)
|
162
|
+
|
163
|
+
# Set Version String
|
164
|
+
set(LIBRESSL_VERSION "${LIBRESSL_VERSION_MAJOR}.${LIBRESSL_VERSION_MINOR}.${LIBRESSL_VERSION_REVISION}")
|
165
|
+
|
166
|
+
endif()
|
167
|
+
|
168
|
+
# Set Find Package Arguments
|
169
|
+
find_package_handle_standard_args(LibreSSL
|
170
|
+
REQUIRED_VARS
|
171
|
+
LIBRESSL_CRYPTO_LIBRARY
|
172
|
+
LIBRESSL_INCLUDE_DIR
|
173
|
+
VERSION_VAR
|
174
|
+
LIBRESSL_VERSION
|
175
|
+
HANDLE_COMPONENTS
|
176
|
+
FAIL_MESSAGE
|
177
|
+
"Could NOT find LibreSSL, try setting the path to LibreSSL using the LIBRESSL_ROOT_DIR environment variable"
|
178
|
+
)
|
179
|
+
|
180
|
+
# LibreSSL Found
|
181
|
+
if(LIBRESSL_FOUND)
|
182
|
+
|
183
|
+
# Set LibreSSL::Crypto
|
184
|
+
if(NOT TARGET LibreSSL::Crypto AND EXISTS "${LIBRESSL_CRYPTO_LIBRARY}")
|
185
|
+
|
186
|
+
# Add Library
|
187
|
+
add_library(LibreSSL::Crypto UNKNOWN IMPORTED)
|
188
|
+
|
189
|
+
# Set Properties
|
190
|
+
set_target_properties(
|
191
|
+
LibreSSL::Crypto
|
192
|
+
PROPERTIES
|
193
|
+
INTERFACE_INCLUDE_DIRECTORIES "${LIBRESSL_INCLUDE_DIR}"
|
194
|
+
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
195
|
+
IMPORTED_LOCATION "${LIBRESSL_CRYPTO_LIBRARY}"
|
196
|
+
)
|
197
|
+
|
198
|
+
endif() # LibreSSL::Crypto
|
199
|
+
|
200
|
+
# Set LibreSSL::SSL
|
201
|
+
if(NOT TARGET LibreSSL::SSL AND EXISTS "${LIBRESSL_SSL_LIBRARY}")
|
202
|
+
|
203
|
+
# Add Library
|
204
|
+
add_library(LibreSSL::SSL UNKNOWN IMPORTED)
|
205
|
+
|
206
|
+
# Set Properties
|
207
|
+
set_target_properties(
|
208
|
+
LibreSSL::SSL
|
209
|
+
PROPERTIES
|
210
|
+
INTERFACE_INCLUDE_DIRECTORIES "${LIBRESSL_INCLUDE_DIR}"
|
211
|
+
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
212
|
+
IMPORTED_LOCATION "${LIBRESSL_SSL_LIBRARY}"
|
213
|
+
INTERFACE_LINK_LIBRARIES LibreSSL::Crypto
|
214
|
+
)
|
215
|
+
|
216
|
+
endif() # LibreSSL::SSL
|
217
|
+
|
218
|
+
# Set LibreSSL::TLS
|
219
|
+
if(NOT TARGET LibreSSL::TLS AND EXISTS "${LIBRESSL_TLS_LIBRARY}")
|
220
|
+
add_library(LibreSSL::TLS UNKNOWN IMPORTED)
|
221
|
+
set_target_properties(
|
222
|
+
LibreSSL::TLS
|
223
|
+
PROPERTIES
|
224
|
+
INTERFACE_INCLUDE_DIRECTORIES "${LIBRESSL_INCLUDE_DIR}"
|
225
|
+
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
226
|
+
IMPORTED_LOCATION "${LIBRESSL_TLS_LIBRARY}"
|
227
|
+
INTERFACE_LINK_LIBRARIES LibreSSL::SSL
|
228
|
+
)
|
229
|
+
|
230
|
+
endif() # LibreSSL::TLS
|
231
|
+
|
232
|
+
endif(LIBRESSL_FOUND)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@PACKAGE_INIT@
|
2
|
+
|
3
|
+
set(LIBRESSL_VERSION @VERSION@)
|
4
|
+
set_and_check(LIBRESSL_INCLUDE_DIR @PACKAGE_INCLUDE_DIRECTORY@)
|
5
|
+
|
6
|
+
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/LibreSSL-Crypto.cmake")
|
7
|
+
include("${CMAKE_CURRENT_LIST_DIR}/LibreSSL-Crypto.cmake")
|
8
|
+
set(LIBRESSL_CRYPTO_LIBRARY LibreSSL::Crypto)
|
9
|
+
set(LibreSSL_Crypto_FOUND TRUE)
|
10
|
+
endif()
|
11
|
+
|
12
|
+
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/LibreSSL-SSL.cmake")
|
13
|
+
include("${CMAKE_CURRENT_LIST_DIR}/LibreSSL-SSL.cmake")
|
14
|
+
set(LIBRESSL_SSL_LIBRARY LibreSSL::SSL)
|
15
|
+
set(LibreSSL_SSL_FOUND TRUE)
|
16
|
+
endif()
|
17
|
+
|
18
|
+
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/LibreSSL-TLS.cmake")
|
19
|
+
include("${CMAKE_CURRENT_LIST_DIR}/LibreSSL-TLS.cmake")
|
20
|
+
set(LIBRESSL_TLS_LIBRARY LibreSSL::TLS)
|
21
|
+
set(LibreSSL_TLS_FOUND TRUE)
|
22
|
+
endif()
|
23
|
+
|
24
|
+
set(LIBRESSL_LIBRARIES
|
25
|
+
${LIBRESSL_CRYPTO_LIBRARY}
|
26
|
+
${LIBRESSL_SSL_LIBRARY}
|
27
|
+
${LIBRESSL_TLS_LIBRARY}
|
28
|
+
)
|
29
|
+
|
30
|
+
check_required_components(LibreSSL)
|
31
|
+
|
32
|
+
if(DEFINED LibreSSL_FOUND)
|
33
|
+
set(LIBRESSL_FOUND ${LibreSSL_FOUND})
|
34
|
+
else()
|
35
|
+
set(LIBRESSL_FOUND TRUE)
|
36
|
+
endif()
|
@@ -0,0 +1,60 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2014 Brent Cook
|
3
|
+
#
|
4
|
+
# Permission to use, copy, modify, and distribute this software for any
|
5
|
+
# purpose with or without fee is hereby granted, provided that the above
|
6
|
+
# copyright notice and this permission notice appear in all copies.
|
7
|
+
#
|
8
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
9
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
10
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
11
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
12
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
13
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
14
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
|
16
|
+
SUBDIRS = include crypto ssl tls apps man
|
17
|
+
if ENABLE_TESTS
|
18
|
+
SUBDIRS += tests
|
19
|
+
endif
|
20
|
+
ACLOCAL_AMFLAGS = -I m4
|
21
|
+
|
22
|
+
pkgconfigdir = $(libdir)/pkgconfig
|
23
|
+
pkgconfig_DATA = libtls.pc
|
24
|
+
if !ENABLE_LIBTLS_ONLY
|
25
|
+
pkgconfig_DATA += libcrypto.pc libssl.pc openssl.pc
|
26
|
+
endif
|
27
|
+
|
28
|
+
EXTRA_DIST = README.md README.mingw.md VERSION config scripts
|
29
|
+
EXTRA_DIST += CMakeLists.txt cmake_export_symbol.cmake cmake_uninstall.cmake.in FindLibreSSL.cmake LibreSSLConfig.cmake.in
|
30
|
+
EXTRA_DIST += cert.pem openssl.cnf x509v3.cnf
|
31
|
+
|
32
|
+
.PHONY: install_sw
|
33
|
+
install_sw: install
|
34
|
+
|
35
|
+
install-exec-hook:
|
36
|
+
@if [ "@OPENSSLDIR@x" != "x" ]; then \
|
37
|
+
OPENSSLDIR="$(DESTDIR)@OPENSSLDIR@"; \
|
38
|
+
else \
|
39
|
+
OPENSSLDIR="$(DESTDIR)$(sysconfdir)/ssl"; \
|
40
|
+
fi; \
|
41
|
+
mkdir -p "$$OPENSSLDIR/certs"; \
|
42
|
+
for i in cert.pem openssl.cnf x509v3.cnf; do \
|
43
|
+
if [ ! -f "$$OPENSSLDIR/$i" ]; then \
|
44
|
+
$(INSTALL) -m 644 "$(srcdir)/$$i" "$$OPENSSLDIR/$$i"; \
|
45
|
+
else \
|
46
|
+
echo " $$OPENSSLDIR/$$i already exists, install will not overwrite"; \
|
47
|
+
fi \
|
48
|
+
done
|
49
|
+
|
50
|
+
uninstall-local:
|
51
|
+
@if [ "@OPENSSLDIR@x" != "x" ]; then \
|
52
|
+
OPENSSLDIR="$(DESTDIR)@OPENSSLDIR@"; \
|
53
|
+
else \
|
54
|
+
OPENSSLDIR="$(DESTDIR)$(sysconfdir)/ssl"; \
|
55
|
+
fi; \
|
56
|
+
for i in cert.pem openssl.cnf x509v3.cnf; do \
|
57
|
+
if cmp -s "$$OPENSSLDIR/$$i" "$(srcdir)/$$i"; then \
|
58
|
+
rm -f "$$OPENSSLDIR/$$i"; \
|
59
|
+
fi \
|
60
|
+
done
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2014 Brent Cook
|
3
|
+
#
|
4
|
+
# Permission to use, copy, modify, and distribute this software for any
|
5
|
+
# purpose with or without fee is hereby granted, provided that the above
|
6
|
+
# copyright notice and this permission notice appear in all copies.
|
7
|
+
#
|
8
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
9
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
10
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
11
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
12
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
13
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
14
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
|
16
|
+
AM_CFLAGS =
|
17
|
+
AM_CPPFLAGS = -I$(top_srcdir)/include
|
18
|
+
AM_CPPFLAGS += -I$(abs_top_builddir)/include
|
19
|
+
AM_CPPFLAGS += -I$(top_srcdir)/include/compat -DLIBRESSL_INTERNAL
|
20
|
+
AM_CPPFLAGS += -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS=
|
@@ -0,0 +1 @@
|
|
1
|
+
master
|
@@ -0,0 +1,238 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
## Official portable version of [LibreSSL](https://www.libressl.org)
|
4
|
+
|
5
|
+
[](https://github.com/libressl/portable/actions/workflows/linux.yml)
|
6
|
+
[](https://github.com/libressl/portable/actions/workflows/macos.yml)
|
7
|
+
[](https://github.com/libressl/portable/actions/workflows/windows.yml)
|
8
|
+
[](https://github.com/libressl/portable/actions/workflows/android.yml)
|
9
|
+
[](https://github.com/libressl/portable/actions/workflows/solaris.yml)
|
10
|
+
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:libressl)
|
11
|
+
|
12
|
+
LibreSSL is a fork of [OpenSSL](https://www.openssl.org) 1.0.1g developed by the
|
13
|
+
[OpenBSD](https://www.openbsd.org) project. Our goal is to modernize the codebase,
|
14
|
+
improve security, and apply best practice development processes from OpenBSD.
|
15
|
+
|
16
|
+
## Compatibility with OpenSSL
|
17
|
+
|
18
|
+
LibreSSL provides much of the OpenSSL 1.1 API. The OpenSSL 3 API is not currently
|
19
|
+
supported. Incompatibilities between the projects exist and are unavoidable since
|
20
|
+
both evolve with different goals and priorities. Important incompatibilities will
|
21
|
+
be addressed if possible and as long as they are not too detrimental to LibreSSL's
|
22
|
+
goals of simplicity, security and sanity. We do not add new features, ciphers and
|
23
|
+
API without a solid reason and require that new code be clean and of high quality.
|
24
|
+
|
25
|
+
LibreSSL is not ABI compatible with any release of OpenSSL, or necessarily
|
26
|
+
earlier releases of LibreSSL. You will need to relink your programs to
|
27
|
+
LibreSSL in order to use it, just as in moving between major versions of OpenSSL.
|
28
|
+
LibreSSL's installed library version numbers are incremented to account for
|
29
|
+
ABI and API changes.
|
30
|
+
|
31
|
+
## Compatibility with other operating systems
|
32
|
+
|
33
|
+
While primarily developed on and taking advantage of APIs available on OpenBSD,
|
34
|
+
the LibreSSL portable project attempts to provide working alternatives for
|
35
|
+
other operating systems, and assists with improving OS-native implementations
|
36
|
+
where possible.
|
37
|
+
|
38
|
+
At the time of this writing, LibreSSL is known to build and work on:
|
39
|
+
|
40
|
+
* Linux (kernel 3.17 or later recommended)
|
41
|
+
* FreeBSD (tested with 9.2 and later)
|
42
|
+
* NetBSD (7.0 or later recommended)
|
43
|
+
* HP-UX (11i)
|
44
|
+
* Solaris 11 and later
|
45
|
+
* Mac OS X (tested with 10.8 and later)
|
46
|
+
* AIX (5.3 and later)
|
47
|
+
* Emscripten (3.1.44 and later)
|
48
|
+
|
49
|
+
LibreSSL also supports the following Windows environments:
|
50
|
+
|
51
|
+
* Microsoft Windows (Windows 7 / Windows Server 2008r2 or later, x86 and x64)
|
52
|
+
* Wine (32-bit and 64-bit)
|
53
|
+
* MinGW-w64, Cygwin, and Visual Studio
|
54
|
+
|
55
|
+
Official release tarballs are available at your friendly neighborhood
|
56
|
+
OpenBSD mirror in directory
|
57
|
+
[LibreSSL](https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/),
|
58
|
+
although we suggest that you use a [mirror](https://www.openbsd.org/ftp.html).
|
59
|
+
|
60
|
+
The LibreSSL portable build framework is also
|
61
|
+
[mirrored](https://github.com/libressl/portable) on GitHub.
|
62
|
+
|
63
|
+
Please report bugs either to the public libressl@openbsd.org mailing list,
|
64
|
+
or to the GitHub
|
65
|
+
[issue tracker](https://github.com/libressl/portable/issues)
|
66
|
+
|
67
|
+
Severe vulnerabilities or bugs requiring coordination with OpenSSL can be
|
68
|
+
sent to the core team at libressl-security@openbsd.org.
|
69
|
+
|
70
|
+
# Building LibreSSL
|
71
|
+
|
72
|
+
## Building from a Git checkout
|
73
|
+
|
74
|
+
If you have checked out this source using Git, or have downloaded a source
|
75
|
+
tarball from GitHub, follow these initial steps to prepare the source tree for
|
76
|
+
building. _Note: Your build will fail if you do not follow these instructions!
|
77
|
+
If you cannot follow these instructions or cannot meet these prerequisites,
|
78
|
+
please download an official release distribution from
|
79
|
+
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ instead. Using official
|
80
|
+
releases is strongly advised if you are not a developer._
|
81
|
+
|
82
|
+
1. Ensure that you have a bash shell. This is also required on Windows.
|
83
|
+
2. Ensure that you have the following packages installed:
|
84
|
+
automake, autoconf, git, libtool, perl.
|
85
|
+
3. Run `./autogen.sh` to prepare the source tree for building.
|
86
|
+
|
87
|
+
## Build steps using configure
|
88
|
+
|
89
|
+
Once you have the source tree prepared, run these commands to build and install:
|
90
|
+
|
91
|
+
```sh
|
92
|
+
./configure # see ./configure --help for configuration options
|
93
|
+
make check # runs builtin unit tests
|
94
|
+
make install # set DESTDIR= to install to an alternate location
|
95
|
+
```
|
96
|
+
|
97
|
+
Alternatively, it is possible to run `./dist.sh` to prepare a tarball.
|
98
|
+
|
99
|
+
## Build steps using CMake
|
100
|
+
|
101
|
+
Once you have the source tree prepared, run these commands to build and install:
|
102
|
+
|
103
|
+
```sh
|
104
|
+
mkdir build
|
105
|
+
cd build
|
106
|
+
cmake ..
|
107
|
+
make
|
108
|
+
make test
|
109
|
+
```
|
110
|
+
|
111
|
+
For faster builds, you can use Ninja:
|
112
|
+
|
113
|
+
```sh
|
114
|
+
mkdir build-ninja
|
115
|
+
cd build-ninja
|
116
|
+
cmake -G"Ninja" ..
|
117
|
+
ninja
|
118
|
+
ninja test
|
119
|
+
```
|
120
|
+
|
121
|
+
Or another supported build system like Visual Studio:
|
122
|
+
|
123
|
+
```sh
|
124
|
+
mkdir build-vs2022
|
125
|
+
cd build-vs2022
|
126
|
+
cmake -G"Visual Studio 17 2022" ..
|
127
|
+
```
|
128
|
+
|
129
|
+
#### Additional CMake Options
|
130
|
+
|
131
|
+
| Option Name | Default | Description |
|
132
|
+
|-------------------------|--------:|-----------------------------------------------------------------------------------------------------------------|
|
133
|
+
| `LIBRESSL_SKIP_INSTALL` | `OFF` | allows skipping install() rules. Can be specified from command line using <br>```-DLIBRESSL_SKIP_INSTALL=ON``` |
|
134
|
+
| `LIBRESSL_APPS` | `ON` | allows skipping application builds. Apps are required to run tests |
|
135
|
+
| `LIBRESSL_TESTS` | `ON` | allows skipping of tests. Tests are only available in static builds |
|
136
|
+
| `BUILD_SHARED_LIBS` | `OFF` | CMake option for building shared libraries. |
|
137
|
+
| `ENABLE_ASM` | `ON` | builds assembly optimized rules. |
|
138
|
+
| `ENABLE_EXTRATESTS` | `OFF` | Enable extra tests that may be unreliable on some platforms |
|
139
|
+
| `ENABLE_NC` | `OFF` | Enable installing TLS-enabled nc(1) |
|
140
|
+
| `OPENSSLDIR` | Blank | Set the default openssl directory. Can be specified from command line using <br>```-DOPENSSLDIR=<dirname>``` |
|
141
|
+
|
142
|
+
## Build information for specific systems
|
143
|
+
|
144
|
+
### HP-UX (11i)
|
145
|
+
|
146
|
+
Set the UNIX_STD environment variable to `2003` before running `configure`
|
147
|
+
in order to build with the HP C/aC++ compiler. See the "standards(5)" man
|
148
|
+
page for more details.
|
149
|
+
|
150
|
+
```sh
|
151
|
+
export UNIX_STD=2003
|
152
|
+
./configure
|
153
|
+
make
|
154
|
+
```
|
155
|
+
|
156
|
+
### MinGW-w64 - Windows
|
157
|
+
|
158
|
+
LibreSSL builds against relatively recent versions of [MinGW-w64](https://www.mingw-w64.org/), not to be
|
159
|
+
confused with the original mingw.org project. MinGW-w64 3.2 or later
|
160
|
+
should work. See [README.mingw.md](README.mingw.md) for more information.
|
161
|
+
|
162
|
+
### Emscripten
|
163
|
+
|
164
|
+
When configuring LibreSSL for use with Emscripten, make sure to prepend
|
165
|
+
`emcmake` to your `cmake` configuration command. Once configured, you can
|
166
|
+
proceed with your usual `cmake` commands. For example:
|
167
|
+
|
168
|
+
```sh
|
169
|
+
emcmake cmake . -Bbuild
|
170
|
+
cmake --build build --config Release
|
171
|
+
ctest --test-dir build -C Release --output-on-failure
|
172
|
+
```
|
173
|
+
|
174
|
+
# Using LibreSSL
|
175
|
+
|
176
|
+
## CMake
|
177
|
+
|
178
|
+
Make a new folder in your project root (where your main `CMakeLists.txt` file is
|
179
|
+
located) called CMake. Copy the `FindLibreSSL.cmake` file to that folder, and
|
180
|
+
add the following line to your main `CMakeLists.txt`:
|
181
|
+
|
182
|
+
```cmake
|
183
|
+
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
|
184
|
+
```
|
185
|
+
|
186
|
+
After your `add_executable` or `add_library` line in your `CMakeLists.txt` file
|
187
|
+
add the following:
|
188
|
+
|
189
|
+
```cmake
|
190
|
+
find_package(LibreSSL REQUIRED)
|
191
|
+
```
|
192
|
+
|
193
|
+
It will tell CMake to find LibreSSL and if found will let you use the following
|
194
|
+
3 interfaces in your `CMakeLists.txt` file:
|
195
|
+
|
196
|
+
* LibreSSL::Crypto
|
197
|
+
* LibreSSL::SSL
|
198
|
+
* LibreSSL::TLS
|
199
|
+
|
200
|
+
If you for example want to use the LibreSSL TLS library in your test program,
|
201
|
+
include it like so (SSL and Crypto are required by TLS and included
|
202
|
+
automatically too):
|
203
|
+
|
204
|
+
```cmake
|
205
|
+
target_link_libraries(test LibreSSL::TLS)
|
206
|
+
```
|
207
|
+
|
208
|
+
Full example:
|
209
|
+
|
210
|
+
```cmake
|
211
|
+
cmake_minimum_required(VERSION 3.10.0)
|
212
|
+
|
213
|
+
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
|
214
|
+
|
215
|
+
project(test)
|
216
|
+
|
217
|
+
add_executable(test Main.cpp)
|
218
|
+
|
219
|
+
find_package(LibreSSL REQUIRED)
|
220
|
+
|
221
|
+
target_link_libraries(test LibreSSL::TLS)
|
222
|
+
```
|
223
|
+
|
224
|
+
#### Linux
|
225
|
+
|
226
|
+
Following the guide in the sections above to compile LibreSSL using make and
|
227
|
+
running `sudo make install` will install LibreSSL to the `/usr/local/` folder,
|
228
|
+
and will be found automatically by find_package. If your system installs it to
|
229
|
+
another location, or you have placed them yourself in a different location, you
|
230
|
+
can set the CMake variable `LIBRESSL_ROOT_DIR` to the correct path, to help
|
231
|
+
CMake find the library.
|
232
|
+
|
233
|
+
#### Windows
|
234
|
+
|
235
|
+
Placing the library files in `C:/Program Files/LibreSSL/lib` and the include
|
236
|
+
files in `C:/Program Files/LibreSSL/include` should let CMake find them
|
237
|
+
automatically, but it is recommended that you use CMake-GUI to set the paths.
|
238
|
+
It is more convenient as you can have the files in any folder you choose.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
## Building with MinGW-w64 for 32- and 64-bit
|
2
|
+
|
3
|
+
For Windows systems, LibreSSL supports the MinGW-w64 toolchain, which can use
|
4
|
+
GCC or Clang as the compiler. Contrary to its name, MinGW-w64 supports both
|
5
|
+
32-bit and 64-bit build environments. If your project already uses MinGW-w64,
|
6
|
+
then LibreSSL should integrate very nicely. Old versions of the MinGW-w64
|
7
|
+
toolchain, such as the one packaged with Ubuntu 12.04, may have trouble
|
8
|
+
building LibreSSL. Please try it with a recent toolchain if you encounter
|
9
|
+
troubles. Cygwin provides an easy method of installing the latest MinGW-w64
|
10
|
+
cross-compilers on Windows.
|
11
|
+
|
12
|
+
To configure and build LibreSSL for a 32-bit system, use the following
|
13
|
+
build steps:
|
14
|
+
|
15
|
+
CC=i686-w64-mingw32-gcc CPPFLAGS=-D__MINGW_USE_VC2005_COMPAT \
|
16
|
+
./configure --host=i686-w64-mingw32
|
17
|
+
make
|
18
|
+
make check
|
19
|
+
|
20
|
+
For 64-bit builds, use these instead:
|
21
|
+
|
22
|
+
CC=x86_64-w64-mingw32-gcc ./configure --host=x86_64-w64-mingw32
|
23
|
+
make
|
24
|
+
make check
|
25
|
+
|
26
|
+
### Why the -D__MINGW_USE_VC2005_COMPAT flag on 32-bit systems?
|
27
|
+
|
28
|
+
An ABI change introduced with Microsoft Visual C++ 2005 (also known as
|
29
|
+
Visual C++ 8.0) switched time_t from 32-bit to 64-bit. It is important to
|
30
|
+
build LibreSSL with 64-bit time_t whenever possible, because 32-bit time_t
|
31
|
+
is unable to represent times past 2038 (this is commonly known as the
|
32
|
+
Y2K38 problem).
|
33
|
+
|
34
|
+
If LibreSSL is built with 32-bit time_t, when verifying a certificate whose
|
35
|
+
expiry date is set past 19 January 2038, it will be unable to tell if the
|
36
|
+
certificate has expired or not, and thus take the safe stance and reject it.
|
37
|
+
|
38
|
+
In order to avoid this, you need to build LibreSSL (and everything that links
|
39
|
+
with it) with the -D__MINGW_USE_VC2005_COMPAT flag. This tells MinGW-w64 to
|
40
|
+
use the new ABI.
|
41
|
+
|
42
|
+
64-bit systems always have a 64-bit time_t and are not affected by this
|
43
|
+
problem.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2014 Brent Cook
|
3
|
+
#
|
4
|
+
# Permission to use, copy, modify, and distribute this software for any
|
5
|
+
# purpose with or without fee is hereby granted, provided that the above
|
6
|
+
# copyright notice and this permission notice appear in all copies.
|
7
|
+
#
|
8
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
9
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
10
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
11
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
12
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
13
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
14
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
|
16
|
+
add_subdirectory(ocspcheck)
|
17
|
+
add_subdirectory(openssl)
|
18
|
+
add_subdirectory(nc)
|