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,30 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2014 Brent Cook
|
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
|
+
set -e
|
18
|
+
TEST=./aeadtest
|
19
|
+
if [ -e ./aeadtest.exe ]; then
|
20
|
+
TEST=./aeadtest.exe
|
21
|
+
elif [ -e ./aeadtest.js ]; then
|
22
|
+
TEST="node ./aeadtest.js"
|
23
|
+
fi
|
24
|
+
$TEST aead $srcdir/aeadtests.txt
|
25
|
+
$TEST aes-128-gcm $srcdir/aes_128_gcm_tests.txt
|
26
|
+
$TEST aes-192-gcm $srcdir/aes_192_gcm_tests.txt
|
27
|
+
$TEST aes-256-gcm $srcdir/aes_256_gcm_tests.txt
|
28
|
+
$TEST chacha20-poly1305 $srcdir/chacha20_poly1305_tests.txt
|
29
|
+
$TEST xchacha20-poly1305 $srcdir/xchacha20_poly1305_tests.txt
|
30
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2014 Brent Cook
|
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
|
+
set -e
|
18
|
+
./arc4randomforktest
|
19
|
+
./arc4randomforktest -b
|
20
|
+
./arc4randomforktest -p
|
21
|
+
./arc4randomforktest -bp
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2023 Pierre Wendling
|
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
|
+
cmake_minimum_required(VERSION 3.5)
|
17
|
+
|
18
|
+
project(LibreSSL_Consumer LANGUAGES C)
|
19
|
+
|
20
|
+
find_package(
|
21
|
+
LibreSSL
|
22
|
+
CONFIG
|
23
|
+
REQUIRED
|
24
|
+
COMPONENTS Crypto SSL TLS
|
25
|
+
)
|
26
|
+
|
27
|
+
set(RESULTS_TO_CHECK
|
28
|
+
"LIBRESSL_VERSION"
|
29
|
+
"LIBRESSL_FOUND"
|
30
|
+
"LIBRESSL_INCLUDE_DIR"
|
31
|
+
"LIBRESSL_LIBRARIES"
|
32
|
+
"LIBRESSL_CRYPTO_LIBRARY"
|
33
|
+
"LIBRESSL_SSL_LIBRARY"
|
34
|
+
"LIBRESSL_TLS_LIBRARY"
|
35
|
+
)
|
36
|
+
|
37
|
+
foreach(RESULT_VAR IN LISTS RESULTS_TO_CHECK)
|
38
|
+
if(${RESULT_VAR})
|
39
|
+
message(STATUS "${RESULT_VAR}: ${${RESULT_VAR}}")
|
40
|
+
else()
|
41
|
+
message(FATAL_ERROR "${RESULT_VAR} was not set by the package.")
|
42
|
+
endif()
|
43
|
+
endforeach()
|
44
|
+
|
45
|
+
add_executable(crypto crypto.c)
|
46
|
+
target_link_libraries(crypto PRIVATE LibreSSL::Crypto)
|
47
|
+
|
48
|
+
add_executable(ssl ssl.c)
|
49
|
+
target_link_libraries(ssl PRIVATE LibreSSL::SSL)
|
50
|
+
|
51
|
+
add_executable(tls tls.c)
|
52
|
+
target_link_libraries(tls PRIVATE LibreSSL::TLS)
|
@@ -0,0 +1,186 @@
|
|
1
|
+
/*
|
2
|
+
* Public domain
|
3
|
+
*
|
4
|
+
* pipe2/pipe/socketpair emulation
|
5
|
+
* Brent Cook <bcook@openbsd.org>
|
6
|
+
*/
|
7
|
+
|
8
|
+
#include <errno.h>
|
9
|
+
#include <fcntl.h>
|
10
|
+
#include <unistd.h>
|
11
|
+
#include <sys/socket.h>
|
12
|
+
|
13
|
+
#undef socketpair
|
14
|
+
|
15
|
+
#ifdef _WIN32
|
16
|
+
|
17
|
+
static int setfd(int fd, int flag)
|
18
|
+
{
|
19
|
+
int rc = -1;
|
20
|
+
if (flag & FD_CLOEXEC) {
|
21
|
+
HANDLE h = (HANDLE)_get_osfhandle(fd);
|
22
|
+
if (h != NULL)
|
23
|
+
rc = SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0) == 0 ? -1 : 0;
|
24
|
+
}
|
25
|
+
return rc;
|
26
|
+
}
|
27
|
+
|
28
|
+
static int setfl(int fd, int flag)
|
29
|
+
{
|
30
|
+
int rc = -1;
|
31
|
+
if (flag & O_NONBLOCK) {
|
32
|
+
long mode = 1;
|
33
|
+
rc = ioctlsocket(fd, FIONBIO, &mode);
|
34
|
+
}
|
35
|
+
return rc;
|
36
|
+
}
|
37
|
+
|
38
|
+
/*
|
39
|
+
* Have open() temporarily use up file descriptors until reaching beyond the
|
40
|
+
* allocated sockets, then leak the ones conflicting with any of the latter.
|
41
|
+
*/
|
42
|
+
static void create_issue_1069_sentinels(int socket_vector[2])
|
43
|
+
{
|
44
|
+
int fd = open("CONIN$", O_RDONLY);
|
45
|
+
if (fd == -1 || fd > socket_vector[0] && fd > socket_vector[1]) {
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
create_issue_1069_sentinels(socket_vector);
|
49
|
+
if (fd != socket_vector[0] && fd != socket_vector[1]) {
|
50
|
+
close(fd);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
int socketpair(int domain, int type, int protocol, int socket_vector[2])
|
55
|
+
{
|
56
|
+
if (domain != AF_UNIX || !(type & SOCK_STREAM) || protocol != PF_UNSPEC)
|
57
|
+
return -1;
|
58
|
+
|
59
|
+
socket_vector[0] = -1;
|
60
|
+
socket_vector[1] = -1;
|
61
|
+
|
62
|
+
int listener = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
63
|
+
if (listener == -1) {
|
64
|
+
return -1;
|
65
|
+
}
|
66
|
+
|
67
|
+
struct sockaddr_in addr = {
|
68
|
+
.sin_family = AF_INET,
|
69
|
+
.sin_addr.s_addr = htonl(INADDR_LOOPBACK),
|
70
|
+
.sin_port = 0,
|
71
|
+
};
|
72
|
+
|
73
|
+
int yes = 1, e;
|
74
|
+
if (setsockopt(listener, SOL_SOCKET, SO_REUSEADDR,
|
75
|
+
(void *)&yes, sizeof yes) == -1)
|
76
|
+
goto err;
|
77
|
+
|
78
|
+
if (bind(listener, (struct sockaddr *)&addr, sizeof addr) != 0)
|
79
|
+
goto err;
|
80
|
+
|
81
|
+
memset(&addr, 0, sizeof addr);
|
82
|
+
socklen_t addrlen = sizeof addr;
|
83
|
+
if (getsockname(listener, (struct sockaddr *)&addr, &addrlen) != 0)
|
84
|
+
goto err;
|
85
|
+
|
86
|
+
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
87
|
+
addr.sin_family = AF_INET;
|
88
|
+
|
89
|
+
if (listen(listener, 1) != 0)
|
90
|
+
goto err;
|
91
|
+
|
92
|
+
socket_vector[0] = WSASocket(AF_INET, SOCK_STREAM, 0, NULL, 0, 0);
|
93
|
+
if (socket_vector[0] == -1)
|
94
|
+
goto err;
|
95
|
+
|
96
|
+
if (connect(socket_vector[0], (struct sockaddr *)&addr, sizeof addr) != 0)
|
97
|
+
goto err;
|
98
|
+
|
99
|
+
socket_vector[1] = accept(listener, NULL, NULL);
|
100
|
+
if (socket_vector[1] == -1)
|
101
|
+
goto err;
|
102
|
+
|
103
|
+
closesocket(listener);
|
104
|
+
|
105
|
+
create_issue_1069_sentinels(socket_vector);
|
106
|
+
|
107
|
+
return 0;
|
108
|
+
|
109
|
+
err:
|
110
|
+
e = WSAGetLastError();
|
111
|
+
closesocket(listener);
|
112
|
+
closesocket(socket_vector[0]);
|
113
|
+
closesocket(socket_vector[1]);
|
114
|
+
WSASetLastError(e);
|
115
|
+
socket_vector[0] = -1;
|
116
|
+
socket_vector[1] = -1;
|
117
|
+
return -1;
|
118
|
+
}
|
119
|
+
|
120
|
+
int pipe(int fildes[2])
|
121
|
+
{
|
122
|
+
return socketpair(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, PF_UNSPEC, fildes);
|
123
|
+
}
|
124
|
+
|
125
|
+
#else
|
126
|
+
|
127
|
+
static int setfd(int fd, int flag)
|
128
|
+
{
|
129
|
+
int flags = fcntl(fd, F_GETFD);
|
130
|
+
flags |= flag;
|
131
|
+
return fcntl(fd, F_SETFD, flags);
|
132
|
+
}
|
133
|
+
|
134
|
+
static int setfl(int fd, int flag)
|
135
|
+
{
|
136
|
+
int flags = fcntl(fd, F_GETFL);
|
137
|
+
flags |= flag;
|
138
|
+
return fcntl(fd, F_SETFL, flags);
|
139
|
+
}
|
140
|
+
#endif
|
141
|
+
|
142
|
+
int pipe2(int fildes[2], int flags)
|
143
|
+
{
|
144
|
+
int rc = pipe(fildes);
|
145
|
+
if (rc == 0) {
|
146
|
+
if (flags & O_NONBLOCK) {
|
147
|
+
rc |= setfl(fildes[0], O_NONBLOCK);
|
148
|
+
rc |= setfl(fildes[1], O_NONBLOCK);
|
149
|
+
}
|
150
|
+
if (flags & O_CLOEXEC) {
|
151
|
+
rc |= setfd(fildes[0], FD_CLOEXEC);
|
152
|
+
rc |= setfd(fildes[1], FD_CLOEXEC);
|
153
|
+
}
|
154
|
+
if (rc != 0) {
|
155
|
+
int e = errno;
|
156
|
+
close(fildes[0]);
|
157
|
+
close(fildes[1]);
|
158
|
+
errno = e;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
return rc;
|
162
|
+
}
|
163
|
+
|
164
|
+
int bsd_socketpair(int domain, int type, int protocol, int socket_vector[2])
|
165
|
+
{
|
166
|
+
int flags = type & ~0xf;
|
167
|
+
type &= 0xf;
|
168
|
+
int rc = socketpair(domain, type, protocol, socket_vector);
|
169
|
+
if (rc == 0) {
|
170
|
+
if (flags & SOCK_NONBLOCK) {
|
171
|
+
rc |= setfl(socket_vector[0], O_NONBLOCK);
|
172
|
+
rc |= setfl(socket_vector[1], O_NONBLOCK);
|
173
|
+
}
|
174
|
+
if (flags & SOCK_CLOEXEC) {
|
175
|
+
rc |= setfd(socket_vector[0], FD_CLOEXEC);
|
176
|
+
rc |= setfd(socket_vector[1], FD_CLOEXEC);
|
177
|
+
}
|
178
|
+
if (rc != 0) {
|
179
|
+
int e = errno;
|
180
|
+
close(socket_vector[0]);
|
181
|
+
close(socket_vector[1]);
|
182
|
+
errno = e;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
return rc;
|
186
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2021 Kinichiro Inoguchi
|
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
|
+
set -e
|
18
|
+
|
19
|
+
dtlstest_bin=./dtlstest
|
20
|
+
if [ -e ./dtlstest.exe ]; then
|
21
|
+
dtlstest_bin=./dtlstest.exe
|
22
|
+
fi
|
23
|
+
|
24
|
+
if [ -z $srcdir ]; then
|
25
|
+
srcdir=.
|
26
|
+
fi
|
27
|
+
|
28
|
+
$dtlstest_bin $srcdir/server1-rsa.pem $srcdir/server1-rsa.pem $srcdir/ca-int-rsa.pem
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2014 Brent Cook
|
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
|
+
set -e
|
18
|
+
TEST=./evptest
|
19
|
+
if [ -e ./evptest.exe ]; then
|
20
|
+
TEST=./evptest.exe
|
21
|
+
fi
|
22
|
+
$TEST $srcdir/evptests.txt
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018 Kinichiro Inoguchi
|
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
|
+
set -e
|
18
|
+
TEST=./keypairtest
|
19
|
+
if [ -e ./keypairtest.exe ]; then
|
20
|
+
TEST=./keypairtest.exe
|
21
|
+
fi
|
22
|
+
|
23
|
+
if [ -z $srcdir ]; then
|
24
|
+
srcdir=.
|
25
|
+
fi
|
26
|
+
|
27
|
+
$TEST $srcdir/ca-root-rsa.pem $srcdir/server1-rsa.pem $srcdir/server1-rsa.pem
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2024 Theo Buehler
|
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
|
+
set -e
|
18
|
+
|
19
|
+
TEST=./mlkem_tests
|
20
|
+
if [ -e ./mlkem_tests.exe ]; then
|
21
|
+
TEST=./mlkem_tests.exe
|
22
|
+
elif [ -e ./mlkem_tests.js ]; then
|
23
|
+
TEST="node ./mlkem_tests.js"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ -z $srcdir ]; then
|
27
|
+
srcdir=.
|
28
|
+
fi
|
29
|
+
|
30
|
+
$TEST mlkem768_decap_tests $srcdir/mlkem768_decap_tests.txt
|
31
|
+
$TEST mlkem768_encap_tests $srcdir/mlkem768_encap_tests.txt
|
32
|
+
$TEST mlkem768_keygen_tests $srcdir/mlkem768_keygen_tests.txt
|
33
|
+
$TEST mlkem768_nist_decap_tests $srcdir/mlkem768_nist_decap_tests.txt
|
34
|
+
$TEST mlkem768_nist_keygen_tests $srcdir/mlkem768_nist_keygen_tests.txt
|
35
|
+
$TEST mlkem1024_decap_tests $srcdir/mlkem1024_decap_tests.txt
|
36
|
+
$TEST mlkem1024_encap_tests $srcdir/mlkem1024_encap_tests.txt
|
37
|
+
$TEST mlkem1024_keygen_tests $srcdir/mlkem1024_keygen_tests.txt
|
38
|
+
$TEST mlkem1024_nist_decap_tests $srcdir/mlkem1024_nist_decap_tests.txt
|
39
|
+
$TEST mlkem1024_nist_keygen_tests $srcdir/mlkem1024_nist_keygen_tests.txt
|
@@ -0,0 +1,25 @@
|
|
1
|
+
@echo off
|
2
|
+
setlocal enabledelayedexpansion
|
3
|
+
|
4
|
+
:: Copyright (c) 2016 Kinichiro Inoguchi
|
5
|
+
::
|
6
|
+
:: Permission to use, copy, modify, and distribute this software for any
|
7
|
+
:: purpose with or without fee is hereby granted, provided that the above
|
8
|
+
:: copyright notice and this permission notice appear in all copies.
|
9
|
+
::
|
10
|
+
:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
11
|
+
:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
12
|
+
:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
13
|
+
:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
14
|
+
:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
15
|
+
:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
16
|
+
:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
17
|
+
|
18
|
+
set ocsp_test_bin=%1
|
19
|
+
set ocsp_test_bin=%ocsp_test_bin:/=\%
|
20
|
+
if not exist %ocsp_test_bin% exit /b 1
|
21
|
+
|
22
|
+
%ocsp_test_bin% www.amazon.com 443 & if !errorlevel! neq 0 exit /b 1
|
23
|
+
%ocsp_test_bin% cloudflare.com 443 & if !errorlevel! neq 0 exit /b 1
|
24
|
+
|
25
|
+
endlocal
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016 Brent Cook
|
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
|
+
set -e
|
18
|
+
TEST=./ocsp_test
|
19
|
+
if [ -e ./ocsp_test.exe ]; then
|
20
|
+
TEST=./ocsp_test.exe
|
21
|
+
fi
|
22
|
+
$TEST www.amazon.com 443
|
23
|
+
$TEST cloudflare.com 443
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# $OpenBSD: openssl.cnf,v 1.1 2014/08/26 17:50:07 jsing Exp $
|
2
|
+
|
3
|
+
#
|
4
|
+
# SSLeay example configuration file.
|
5
|
+
# This is mostly being used for generation of certificate requests.
|
6
|
+
#
|
7
|
+
# hacked by iang to do DSA certs - Server
|
8
|
+
|
9
|
+
RANDFILE = ./.rnd
|
10
|
+
|
11
|
+
####################################################################
|
12
|
+
[ req ]
|
13
|
+
distinguished_name = req_distinguished_name
|
14
|
+
encrypt_rsa_key = no
|
15
|
+
|
16
|
+
[ req_distinguished_name ]
|
17
|
+
countryName = Country Name (2 letter code)
|
18
|
+
countryName_default = CA
|
19
|
+
countryName_value = CA
|
20
|
+
|
21
|
+
organizationName = Organization Name (eg, company)
|
22
|
+
organizationName_value = Shake it Vera
|
23
|
+
|
24
|
+
0.commonName = Common Name (eg, YOUR name)
|
25
|
+
0.commonName_value = Wastelandus
|
26
|
+
|
27
|
+
1.commonName = Common Name (eg, YOUR name)
|
28
|
+
1.commonName_value = Maximus
|
29
|
+
|