uringmachine 0.24.0 → 0.26.0

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.
Files changed (279) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.gitmodules +0 -3
  4. data/CHANGELOG.md +13 -0
  5. data/Gemfile +11 -0
  6. data/README.md +266 -112
  7. data/Rakefile +8 -0
  8. data/TODO.md +14 -21
  9. data/benchmark/common.rb +2 -0
  10. data/benchmark/openssl.rb +77 -0
  11. data/benchmark/openssl_socketpair.rb +112 -0
  12. data/benchmark/sqlite.rb +1 -1
  13. data/docs/design/buffer_pool.md +1 -1
  14. data/docs/wroclove.rb.md +52 -0
  15. data/ext/um/extconf.rb +15 -0
  16. data/ext/um/um.c +392 -358
  17. data/ext/um/um.h +48 -23
  18. data/ext/um/um_async_op.c +9 -8
  19. data/ext/um/um_async_op_class.c +34 -3
  20. data/ext/um/um_class.c +705 -19
  21. data/ext/um/um_const.c +31 -0
  22. data/ext/um/um_mutex_class.c +12 -0
  23. data/ext/um/um_op.c +15 -1
  24. data/ext/um/um_queue_class.c +16 -0
  25. data/ext/um/um_ssl.c +109 -0
  26. data/ext/um/um_stream.c +9 -8
  27. data/ext/um/um_sync.c +18 -11
  28. data/ext/um/um_utils.c +17 -8
  29. data/grant-2025/interim-report.md +1 -1
  30. data/grant-2025/journal.md +4 -4
  31. data/grant-2025/tasks.md +6 -4
  32. data/lib/uringmachine/dns_resolver.rb +38 -0
  33. data/lib/uringmachine/fiber_scheduler.rb +7 -5
  34. data/lib/uringmachine/version.rb +1 -1
  35. data/lib/uringmachine.rb +106 -6
  36. data/test/helper.rb +15 -0
  37. data/test/test_async_op.rb +3 -2
  38. data/test/test_fiber_scheduler.rb +41 -1
  39. data/test/test_ssl.rb +85 -0
  40. data/test/test_stream.rb +11 -0
  41. data/test/test_um.rb +445 -11
  42. data/uringmachine.gemspec +1 -7
  43. data/vendor/liburing/examples/send-zerocopy.c +43 -31
  44. data/vendor/liburing/examples/zcrx.c +260 -69
  45. data/vendor/liburing/liburing.spec +1 -1
  46. data/vendor/liburing/src/include/liburing/io_uring.h +12 -0
  47. data/vendor/liburing/src/include/liburing.h +3 -2
  48. data/vendor/liburing/src/liburing-ffi.map +4 -0
  49. data/vendor/liburing/src/liburing.map +4 -0
  50. data/vendor/liburing/src/queue.c +12 -0
  51. data/vendor/liburing/src/register.c +1 -0
  52. data/vendor/liburing/src/setup.c +15 -7
  53. data/vendor/liburing/test/Makefile +8 -4
  54. data/vendor/liburing/test/conn-unreach.c +1 -1
  55. data/vendor/liburing/test/epwait.c +32 -6
  56. data/vendor/liburing/test/io-wq-exit.c +131 -0
  57. data/vendor/liburing/test/iowait.c +1 -1
  58. data/vendor/liburing/test/min-timeout.c +3 -1
  59. data/vendor/liburing/test/open-close.c +39 -0
  60. data/vendor/liburing/test/poll-update-trigger.c +85 -0
  61. data/vendor/liburing/test/recvsend_bundle.c +14 -11
  62. data/vendor/liburing/test/sendzc-bug.c +146 -0
  63. data/vendor/liburing/test/sqe-mixed-nop.c +151 -7
  64. data/vendor/liburing/test/test.h +2 -0
  65. data/vendor/liburing/test/timestamp-bug.c +135 -0
  66. data/vendor/liburing/test/timestamp.c +5 -0
  67. data/vendor/liburing/test/vec-regbuf.c +136 -1
  68. metadata +38 -283
  69. data/vendor/libressl/.github/scripts/changelog.sh +0 -74
  70. data/vendor/libressl/.github/workflows/android.yml +0 -35
  71. data/vendor/libressl/.github/workflows/cifuzz.yml +0 -33
  72. data/vendor/libressl/.github/workflows/cmake-config.yml +0 -98
  73. data/vendor/libressl/.github/workflows/coverity.yml +0 -69
  74. data/vendor/libressl/.github/workflows/emscripten.yml +0 -71
  75. data/vendor/libressl/.github/workflows/fedora-rawhide.yml +0 -39
  76. data/vendor/libressl/.github/workflows/freebsd.yml +0 -71
  77. data/vendor/libressl/.github/workflows/linux.yml +0 -71
  78. data/vendor/libressl/.github/workflows/macos.yml +0 -37
  79. data/vendor/libressl/.github/workflows/release.yml +0 -81
  80. data/vendor/libressl/.github/workflows/rust-openssl.yml +0 -47
  81. data/vendor/libressl/.github/workflows/solaris.yml +0 -37
  82. data/vendor/libressl/.github/workflows/windows.yml +0 -70
  83. data/vendor/libressl/.gitignore +0 -333
  84. data/vendor/libressl/CMakeLists.txt +0 -581
  85. data/vendor/libressl/COPYING +0 -133
  86. data/vendor/libressl/ChangeLog +0 -3280
  87. data/vendor/libressl/FindLibreSSL.cmake +0 -232
  88. data/vendor/libressl/LibreSSLConfig.cmake.in +0 -36
  89. data/vendor/libressl/Makefile.am +0 -60
  90. data/vendor/libressl/Makefile.am.common +0 -20
  91. data/vendor/libressl/OPENBSD_BRANCH +0 -1
  92. data/vendor/libressl/README.md +0 -238
  93. data/vendor/libressl/README.mingw.md +0 -43
  94. data/vendor/libressl/apps/CMakeLists.txt +0 -18
  95. data/vendor/libressl/apps/Makefile.am +0 -5
  96. data/vendor/libressl/apps/nc/CMakeLists.txt +0 -67
  97. data/vendor/libressl/apps/nc/Makefile.am +0 -64
  98. data/vendor/libressl/apps/nc/compat/accept4.c +0 -17
  99. data/vendor/libressl/apps/nc/compat/readpassphrase.c +0 -205
  100. data/vendor/libressl/apps/nc/compat/socket.c +0 -29
  101. data/vendor/libressl/apps/nc/compat/sys/socket.h +0 -30
  102. data/vendor/libressl/apps/ocspcheck/CMakeLists.txt +0 -44
  103. data/vendor/libressl/apps/ocspcheck/Makefile.am +0 -45
  104. data/vendor/libressl/apps/ocspcheck/compat/.gitignore +0 -0
  105. data/vendor/libressl/apps/openssl/CMakeLists.txt +0 -97
  106. data/vendor/libressl/apps/openssl/Makefile.am +0 -108
  107. data/vendor/libressl/apps/openssl/apps_win.c +0 -138
  108. data/vendor/libressl/apps/openssl/certhash_win.c +0 -13
  109. data/vendor/libressl/apps/openssl/compat/clock_gettime_osx.c +0 -26
  110. data/vendor/libressl/apps/openssl/compat/poll_win.c +0 -329
  111. data/vendor/libressl/appveyor.yml +0 -53
  112. data/vendor/libressl/autogen.sh +0 -15
  113. data/vendor/libressl/check-release.sh +0 -86
  114. data/vendor/libressl/cmake_export_symbol.cmake +0 -71
  115. data/vendor/libressl/cmake_uninstall.cmake.in +0 -36
  116. data/vendor/libressl/config +0 -17
  117. data/vendor/libressl/configure.ac +0 -165
  118. data/vendor/libressl/crypto/CMakeLists.txt +0 -863
  119. data/vendor/libressl/crypto/Makefile.am +0 -962
  120. data/vendor/libressl/crypto/Makefile.am.arc4random +0 -46
  121. data/vendor/libressl/crypto/Makefile.am.elf-mips +0 -14
  122. data/vendor/libressl/crypto/Makefile.am.elf-mips64 +0 -14
  123. data/vendor/libressl/crypto/Makefile.am.elf-x86_64 +0 -35
  124. data/vendor/libressl/crypto/Makefile.am.macosx-x86_64 +0 -35
  125. data/vendor/libressl/crypto/Makefile.am.masm-x86_64 +0 -22
  126. data/vendor/libressl/crypto/Makefile.am.mingw64-x86_64 +0 -23
  127. data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_darwin.c +0 -60
  128. data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_linux.c +0 -62
  129. data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_none.c +0 -26
  130. data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_windows.c +0 -36
  131. data/vendor/libressl/crypto/arch/loongarch64/crypto_arch.h +0 -21
  132. data/vendor/libressl/crypto/arch/mips/crypto_arch.h +0 -21
  133. data/vendor/libressl/crypto/bn/arch/loongarch64/bn_arch.h +0 -23
  134. data/vendor/libressl/crypto/bn/arch/mips/bn_arch.h +0 -24
  135. data/vendor/libressl/crypto/compat/.gitignore +0 -31
  136. data/vendor/libressl/crypto/compat/arc4random.h +0 -41
  137. data/vendor/libressl/crypto/compat/b_win.c +0 -55
  138. data/vendor/libressl/crypto/compat/bsd-asprintf.c +0 -96
  139. data/vendor/libressl/crypto/compat/crypto_lock_win.c +0 -56
  140. data/vendor/libressl/crypto/compat/explicit_bzero_win.c +0 -13
  141. data/vendor/libressl/crypto/compat/freezero.c +0 -32
  142. data/vendor/libressl/crypto/compat/getdelim.c +0 -78
  143. data/vendor/libressl/crypto/compat/getline.c +0 -40
  144. data/vendor/libressl/crypto/compat/getopt_long.c +0 -528
  145. data/vendor/libressl/crypto/compat/getpagesize.c +0 -18
  146. data/vendor/libressl/crypto/compat/getprogname_linux.c +0 -23
  147. data/vendor/libressl/crypto/compat/getprogname_unimpl.c +0 -7
  148. data/vendor/libressl/crypto/compat/getprogname_windows.c +0 -13
  149. data/vendor/libressl/crypto/compat/posix_win.c +0 -296
  150. data/vendor/libressl/crypto/compat/syslog_r.c +0 -19
  151. data/vendor/libressl/crypto/compat/ui_openssl_win.c +0 -334
  152. data/vendor/libressl/dist.sh +0 -22
  153. data/vendor/libressl/gen-coverage-report.sh +0 -58
  154. data/vendor/libressl/gen-openbsd-tags.sh +0 -20
  155. data/vendor/libressl/include/CMakeLists.txt +0 -61
  156. data/vendor/libressl/include/Makefile.am +0 -79
  157. data/vendor/libressl/include/arch/loongarch64/opensslconf.h +0 -150
  158. data/vendor/libressl/include/arch/mips/opensslconf.h +0 -150
  159. data/vendor/libressl/include/compat/arpa/inet.h +0 -15
  160. data/vendor/libressl/include/compat/arpa/nameser.h +0 -25
  161. data/vendor/libressl/include/compat/cet.h +0 -19
  162. data/vendor/libressl/include/compat/dirent.h +0 -17
  163. data/vendor/libressl/include/compat/dirent_msvc.h +0 -611
  164. data/vendor/libressl/include/compat/endian.h +0 -161
  165. data/vendor/libressl/include/compat/err.h +0 -95
  166. data/vendor/libressl/include/compat/fcntl.h +0 -32
  167. data/vendor/libressl/include/compat/getopt.h +0 -50
  168. data/vendor/libressl/include/compat/limits.h +0 -25
  169. data/vendor/libressl/include/compat/netdb.h +0 -10
  170. data/vendor/libressl/include/compat/netinet/in.h +0 -19
  171. data/vendor/libressl/include/compat/netinet/ip.h +0 -49
  172. data/vendor/libressl/include/compat/netinet/tcp.h +0 -10
  173. data/vendor/libressl/include/compat/poll.h +0 -63
  174. data/vendor/libressl/include/compat/pthread.h +0 -122
  175. data/vendor/libressl/include/compat/readpassphrase.h +0 -44
  176. data/vendor/libressl/include/compat/resolv.h +0 -24
  177. data/vendor/libressl/include/compat/stdint.h +0 -31
  178. data/vendor/libressl/include/compat/stdio.h +0 -65
  179. data/vendor/libressl/include/compat/stdlib.h +0 -57
  180. data/vendor/libressl/include/compat/string.h +0 -98
  181. data/vendor/libressl/include/compat/sys/_null.h +0 -18
  182. data/vendor/libressl/include/compat/sys/ioctl.h +0 -11
  183. data/vendor/libressl/include/compat/sys/mman.h +0 -19
  184. data/vendor/libressl/include/compat/sys/param.h +0 -15
  185. data/vendor/libressl/include/compat/sys/queue.h +0 -536
  186. data/vendor/libressl/include/compat/sys/select.h +0 -10
  187. data/vendor/libressl/include/compat/sys/socket.h +0 -18
  188. data/vendor/libressl/include/compat/sys/stat.h +0 -129
  189. data/vendor/libressl/include/compat/sys/time.h +0 -37
  190. data/vendor/libressl/include/compat/sys/tree.h +0 -1006
  191. data/vendor/libressl/include/compat/sys/types.h +0 -69
  192. data/vendor/libressl/include/compat/sys/uio.h +0 -17
  193. data/vendor/libressl/include/compat/syslog.h +0 -38
  194. data/vendor/libressl/include/compat/time.h +0 -59
  195. data/vendor/libressl/include/compat/unistd.h +0 -83
  196. data/vendor/libressl/include/compat/win32netcompat.h +0 -57
  197. data/vendor/libressl/include/openssl/Makefile.am.tpl +0 -45
  198. data/vendor/libressl/libcrypto.pc.in +0 -28
  199. data/vendor/libressl/libressl.pub +0 -2
  200. data/vendor/libressl/libssl.pc.in +0 -28
  201. data/vendor/libressl/libtls.pc.in +0 -28
  202. data/vendor/libressl/m4/ax_add_fortify_source.m4 +0 -80
  203. data/vendor/libressl/m4/ax_check_compile_flag.m4 +0 -53
  204. data/vendor/libressl/m4/check-hardening-options.m4 +0 -110
  205. data/vendor/libressl/m4/check-libc.m4 +0 -189
  206. data/vendor/libressl/m4/check-os-options.m4 +0 -181
  207. data/vendor/libressl/m4/disable-compiler-warnings.m4 +0 -44
  208. data/vendor/libressl/man/CMakeLists.txt +0 -26
  209. data/vendor/libressl/man/links +0 -2780
  210. data/vendor/libressl/man/update_links.sh +0 -25
  211. data/vendor/libressl/openssl.pc.in +0 -11
  212. data/vendor/libressl/patches/bn_shift.patch +0 -34
  213. data/vendor/libressl/patches/crypto_arch.h.patch +0 -34
  214. data/vendor/libressl/patches/crypto_namespace.h.patch +0 -22
  215. data/vendor/libressl/patches/netcat.c.patch +0 -178
  216. data/vendor/libressl/patches/openssl.c.patch +0 -12
  217. data/vendor/libressl/patches/opensslfeatures.h.patch +0 -49
  218. data/vendor/libressl/patches/patch-amd64-crypto-cpu-caps.c.patch +0 -20
  219. data/vendor/libressl/patches/patch-i386-crypto-cpu-caps.c.patch +0 -20
  220. data/vendor/libressl/patches/speed.c.patch +0 -114
  221. data/vendor/libressl/patches/ssl_namespace.h.patch +0 -21
  222. data/vendor/libressl/patches/tls.h.patch +0 -16
  223. data/vendor/libressl/patches/tls_config.c.patch +0 -15
  224. data/vendor/libressl/patches/win32_amd64_bn_arch.h.patch +0 -28
  225. data/vendor/libressl/patches/windows_headers.patch +0 -80
  226. data/vendor/libressl/scripts/config.guess +0 -1774
  227. data/vendor/libressl/scripts/config.sub +0 -1907
  228. data/vendor/libressl/scripts/i686-w64-mingw32.cmake +0 -9
  229. data/vendor/libressl/scripts/test +0 -210
  230. data/vendor/libressl/scripts/wrap-compiler-for-flag-check +0 -31
  231. data/vendor/libressl/scripts/x86_64-w64-mingw32.cmake +0 -9
  232. data/vendor/libressl/ssl/CMakeLists.txt +0 -183
  233. data/vendor/libressl/ssl/Makefile.am +0 -187
  234. data/vendor/libressl/tests/CMakeLists.txt +0 -970
  235. data/vendor/libressl/tests/Makefile.am +0 -944
  236. data/vendor/libressl/tests/aeadtest.sh +0 -30
  237. data/vendor/libressl/tests/arc4randomforktest.sh +0 -21
  238. data/vendor/libressl/tests/asn1time_small.test +0 -10
  239. data/vendor/libressl/tests/cmake/CMakeLists.txt +0 -52
  240. data/vendor/libressl/tests/cmake/crypto.c +0 -7
  241. data/vendor/libressl/tests/cmake/ssl.c +0 -6
  242. data/vendor/libressl/tests/cmake/tls.c +0 -6
  243. data/vendor/libressl/tests/compat/pipe2.c +0 -186
  244. data/vendor/libressl/tests/dtlstest.sh +0 -28
  245. data/vendor/libressl/tests/evptest.sh +0 -22
  246. data/vendor/libressl/tests/keypairtest.sh +0 -27
  247. data/vendor/libressl/tests/mlkem_tests.sh +0 -39
  248. data/vendor/libressl/tests/ocsptest.bat +0 -25
  249. data/vendor/libressl/tests/ocsptest.sh +0 -23
  250. data/vendor/libressl/tests/openssl.cnf +0 -29
  251. data/vendor/libressl/tests/optionstest.c +0 -381
  252. data/vendor/libressl/tests/pidwraptest.c +0 -85
  253. data/vendor/libressl/tests/pidwraptest.sh +0 -26
  254. data/vendor/libressl/tests/quictest.bat +0 -27
  255. data/vendor/libressl/tests/quictest.sh +0 -30
  256. data/vendor/libressl/tests/renegotiation_test.bat +0 -27
  257. data/vendor/libressl/tests/renegotiation_test.sh +0 -30
  258. data/vendor/libressl/tests/rfc5280time_small.test +0 -10
  259. data/vendor/libressl/tests/servertest.bat +0 -27
  260. data/vendor/libressl/tests/servertest.sh +0 -30
  261. data/vendor/libressl/tests/shutdowntest.bat +0 -27
  262. data/vendor/libressl/tests/shutdowntest.sh +0 -30
  263. data/vendor/libressl/tests/ssltest.bat +0 -32
  264. data/vendor/libressl/tests/ssltest.sh +0 -48
  265. data/vendor/libressl/tests/testdsa.bat +0 -47
  266. data/vendor/libressl/tests/testdsa.sh +0 -57
  267. data/vendor/libressl/tests/testenc.bat +0 -85
  268. data/vendor/libressl/tests/testenc.sh +0 -93
  269. data/vendor/libressl/tests/testrsa.bat +0 -47
  270. data/vendor/libressl/tests/testrsa.sh +0 -57
  271. data/vendor/libressl/tests/testssl.bat +0 -171
  272. data/vendor/libressl/tests/tlstest.bat +0 -27
  273. data/vendor/libressl/tests/tlstest.sh +0 -28
  274. data/vendor/libressl/tls/CMakeLists.txt +0 -125
  275. data/vendor/libressl/tls/Makefile.am +0 -76
  276. data/vendor/libressl/tls/compat/ftruncate.c +0 -17
  277. data/vendor/libressl/tls/compat/pread.c +0 -29
  278. data/vendor/libressl/tls/compat/pwrite.c +0 -29
  279. data/vendor/libressl/update.sh +0 -460
@@ -1,67 +0,0 @@
1
- #
2
- # Copyright (c) 2016 Kinichiro Inoguchi
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
- if(BUILD_NC)
17
-
18
- set(
19
- NC_SRC
20
- atomicio.c
21
- netcat.c
22
- socks.c
23
- compat/socket.c
24
- )
25
-
26
- check_function_exists(b64_ntop HAVE_B64_NTOP)
27
- if(HAVE_B64_NTOP)
28
- add_definitions(-DHAVE_B64_NTOP)
29
- else()
30
- set(NC_SRC ${NC_SRC} compat/base64.c)
31
- endif()
32
-
33
- check_function_exists(accept4 HAVE_ACCEPT4)
34
- if(HAVE_ACCEPT4)
35
- add_definitions(-DHAVE_ACCEPT4)
36
- else()
37
- set(NC_SRC ${NC_SRC} compat/accept4.c)
38
- endif()
39
-
40
- check_symbol_exists(readpassphrase "readpassphrase.h" HAVE_READPASSPHRASE)
41
- if(HAVE_READPASSPHRASE)
42
- add_definitions(-DHAVE_READPASSPHRASE)
43
- else()
44
- set(NC_SRC ${NC_SRC} compat/readpassphrase.c)
45
- endif()
46
-
47
- add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
48
-
49
- add_executable(nc ${NC_SRC})
50
- target_include_directories(nc
51
- PRIVATE
52
- .
53
- ./compat
54
- ../../include/compat
55
- PUBLIC
56
- ../../include
57
- ${CMAKE_BINARY_DIR}/include)
58
- target_link_libraries(nc ${LIBTLS_LIBS} compat_obj)
59
-
60
- if(ENABLE_NC)
61
- if(ENABLE_LIBRESSL_INSTALL)
62
- install(TARGETS nc DESTINATION ${CMAKE_INSTALL_BINDIR})
63
- install(FILES nc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
64
- endif(ENABLE_LIBRESSL_INSTALL)
65
- endif()
66
-
67
- endif()
@@ -1,64 +0,0 @@
1
- #
2
- # Copyright (c) 2015 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
- include $(top_srcdir)/Makefile.am.common
17
-
18
- -include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
19
- -include $(abs_top_builddir)/ssl/libssl_la_objects.mk
20
- -include $(abs_top_builddir)/tls/libtls_la_objects.mk
21
-
22
- if BUILD_NC
23
-
24
- if ENABLE_NC
25
- bin_PROGRAMS = nc
26
- dist_man_MANS = nc.1
27
- else
28
- noinst_PROGRAMS = nc
29
- endif
30
-
31
- EXTRA_DIST = nc.1
32
- EXTRA_DIST += CMakeLists.txt
33
-
34
- nc_LDADD = $(libcrypto_la_objects)
35
- nc_LDADD += $(libcompat_la_objects)
36
- nc_LDADD += $(libcompatnoopt_la_objects)
37
- nc_LDADD += $(libssl_la_objects)
38
- nc_LDADD += $(libtls_la_objects)
39
-
40
- nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)
41
-
42
- AM_CPPFLAGS += -I$(top_srcdir)/apps/nc/compat
43
-
44
- nc_SOURCES = atomicio.c
45
- nc_SOURCES += netcat.c
46
- nc_SOURCES += socks.c
47
- noinst_HEADERS = atomicio.h
48
- noinst_HEADERS += compat/sys/socket.h
49
-
50
- nc_SOURCES += compat/socket.c
51
-
52
- if !HAVE_B64_NTOP
53
- nc_SOURCES += compat/base64.c
54
- endif
55
-
56
- if !HAVE_ACCEPT4
57
- nc_SOURCES += compat/accept4.c
58
- endif
59
-
60
- if !HAVE_READPASSPHRASE
61
- nc_SOURCES += compat/readpassphrase.c
62
- endif
63
-
64
- endif
@@ -1,17 +0,0 @@
1
- #include <sys/socket.h>
2
- #include <fcntl.h>
3
-
4
- int
5
- accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
6
- {
7
- int rets = accept(s, addr, addrlen);
8
- if (rets == -1)
9
- return s;
10
-
11
- if (flags & SOCK_CLOEXEC) {
12
- flags = fcntl(s, F_GETFD);
13
- fcntl(rets, F_SETFD, flags | FD_CLOEXEC);
14
- }
15
-
16
- return rets;
17
- }
@@ -1,205 +0,0 @@
1
- /* $OpenBSD: readpassphrase.c,v 1.22 2010/01/13 10:20:54 dtucker Exp $ */
2
-
3
- /*
4
- * Copyright (c) 2000-2002, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
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
- * Sponsored in part by the Defense Advanced Research Projects
19
- * Agency (DARPA) and Air Force Research Laboratory, Air Force
20
- * Materiel Command, USAF, under agreement number F39502-99-1-0512.
21
- */
22
-
23
- /* OPENBSD ORIGINAL: lib/libc/gen/readpassphrase.c */
24
-
25
- #include <termios.h>
26
- #include <signal.h>
27
- #include <ctype.h>
28
- #include <fcntl.h>
29
- #include <errno.h>
30
- #include <string.h>
31
- #include <unistd.h>
32
-
33
- #include <readpassphrase.h>
34
-
35
- #ifndef _PATH_TTY
36
- # define _PATH_TTY "/dev/tty"
37
- #endif
38
-
39
- #ifdef TCSASOFT
40
- # define _T_FLUSH (TCSAFLUSH|TCSASOFT)
41
- #else
42
- # define _T_FLUSH (TCSAFLUSH)
43
- #endif
44
-
45
- /* SunOS 4.x which lacks _POSIX_VDISABLE, but has VDISABLE */
46
- #if !defined(_POSIX_VDISABLE) && defined(VDISABLE)
47
- # define _POSIX_VDISABLE VDISABLE
48
- #endif
49
-
50
- #ifndef _NSIG
51
- # ifdef NSIG
52
- # define _NSIG NSIG
53
- # else
54
- # define _NSIG 128
55
- # endif
56
- #endif
57
-
58
- static volatile sig_atomic_t signo[_NSIG];
59
-
60
- static void handler(int);
61
-
62
- char *
63
- readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
64
- {
65
- ssize_t bytes_written = 0;
66
- ssize_t nr;
67
- int input, output, save_errno, i, need_restart;
68
- char ch, *p, *end;
69
- struct termios term, oterm;
70
- struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm;
71
- struct sigaction savetstp, savettin, savettou, savepipe;
72
-
73
- /* I suppose we could alloc on demand in this case (XXX). */
74
- if (bufsiz == 0) {
75
- errno = EINVAL;
76
- return(NULL);
77
- }
78
-
79
- restart:
80
- for (i = 0; i < _NSIG; i++)
81
- signo[i] = 0;
82
- nr = -1;
83
- save_errno = 0;
84
- need_restart = 0;
85
- /*
86
- * Read and write to /dev/tty if available. If not, read from
87
- * stdin and write to stderr unless a tty is required.
88
- */
89
- if ((flags & RPP_STDIN) ||
90
- (input = output = open(_PATH_TTY, O_RDWR)) == -1) {
91
- if (flags & RPP_REQUIRE_TTY) {
92
- errno = ENOTTY;
93
- return(NULL);
94
- }
95
- input = STDIN_FILENO;
96
- output = STDERR_FILENO;
97
- }
98
-
99
- /*
100
- * Catch signals that would otherwise cause the user to end
101
- * up with echo turned off in the shell. Don't worry about
102
- * things like SIGXCPU and SIGVTALRM for now.
103
- */
104
- sigemptyset(&sa.sa_mask);
105
- sa.sa_flags = 0; /* don't restart system calls */
106
- sa.sa_handler = handler;
107
- (void)sigaction(SIGALRM, &sa, &savealrm);
108
- (void)sigaction(SIGHUP, &sa, &savehup);
109
- (void)sigaction(SIGINT, &sa, &saveint);
110
- (void)sigaction(SIGPIPE, &sa, &savepipe);
111
- (void)sigaction(SIGQUIT, &sa, &savequit);
112
- (void)sigaction(SIGTERM, &sa, &saveterm);
113
- (void)sigaction(SIGTSTP, &sa, &savetstp);
114
- (void)sigaction(SIGTTIN, &sa, &savettin);
115
- (void)sigaction(SIGTTOU, &sa, &savettou);
116
-
117
- /* Turn off echo if possible. */
118
- if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) {
119
- memcpy(&term, &oterm, sizeof(term));
120
- if (!(flags & RPP_ECHO_ON))
121
- term.c_lflag &= ~(ECHO | ECHONL);
122
- #ifdef VSTATUS
123
- if (term.c_cc[VSTATUS] != _POSIX_VDISABLE)
124
- term.c_cc[VSTATUS] = _POSIX_VDISABLE;
125
- #endif
126
- (void)tcsetattr(input, _T_FLUSH, &term);
127
- } else {
128
- memset(&term, 0, sizeof(term));
129
- term.c_lflag |= ECHO;
130
- memset(&oterm, 0, sizeof(oterm));
131
- oterm.c_lflag |= ECHO;
132
- }
133
-
134
- /* No I/O if we are already backgrounded. */
135
- if (signo[SIGTTOU] != 1 && signo[SIGTTIN] != 1) {
136
- if (!(flags & RPP_STDIN))
137
- bytes_written = write(output, prompt, strlen(prompt));
138
- end = buf + bufsiz - 1;
139
- p = buf;
140
- while ((nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') {
141
- if (p < end) {
142
- if ((flags & RPP_SEVENBIT))
143
- ch &= 0x7f;
144
- if (isalpha((unsigned char)ch)) {
145
- if ((flags & RPP_FORCELOWER))
146
- ch = (char)tolower((unsigned char)ch);
147
- if ((flags & RPP_FORCEUPPER))
148
- ch = (char)toupper((unsigned char)ch);
149
- }
150
- *p++ = ch;
151
- }
152
- }
153
- *p = '\0';
154
- save_errno = errno;
155
- if (!(term.c_lflag & ECHO))
156
- bytes_written = write(output, "\n", 1);
157
- }
158
-
159
- (void) bytes_written;
160
-
161
- /* Restore old terminal settings and signals. */
162
- if (memcmp(&term, &oterm, sizeof(term)) != 0) {
163
- while (tcsetattr(input, _T_FLUSH, &oterm) == -1 &&
164
- errno == EINTR)
165
- continue;
166
- }
167
- (void)sigaction(SIGALRM, &savealrm, NULL);
168
- (void)sigaction(SIGHUP, &savehup, NULL);
169
- (void)sigaction(SIGINT, &saveint, NULL);
170
- (void)sigaction(SIGQUIT, &savequit, NULL);
171
- (void)sigaction(SIGPIPE, &savepipe, NULL);
172
- (void)sigaction(SIGTERM, &saveterm, NULL);
173
- (void)sigaction(SIGTSTP, &savetstp, NULL);
174
- (void)sigaction(SIGTTIN, &savettin, NULL);
175
- (void)sigaction(SIGTTOU, &savettou, NULL);
176
- if (input != STDIN_FILENO)
177
- (void)close(input);
178
-
179
- /*
180
- * If we were interrupted by a signal, resend it to ourselves
181
- * now that we have restored the signal handlers.
182
- */
183
- for (i = 0; i < _NSIG; i++) {
184
- if (signo[i]) {
185
- kill(getpid(), i);
186
- switch (i) {
187
- case SIGTSTP:
188
- case SIGTTIN:
189
- case SIGTTOU:
190
- need_restart = 1;
191
- }
192
- }
193
- }
194
- if (need_restart)
195
- goto restart;
196
-
197
- if (save_errno)
198
- errno = save_errno;
199
- return(nr == -1 ? NULL : buf);
200
- }
201
-
202
- static void handler(int s)
203
- {
204
- signo[s] = 1;
205
- }
@@ -1,29 +0,0 @@
1
- #define SOCKET_FLAGS_PRIV
2
-
3
- #include <sys/socket.h>
4
-
5
- #ifdef NEED_SOCKET_FLAGS
6
-
7
- #include <fcntl.h>
8
-
9
- int
10
- _socket(int domain, int type, int protocol)
11
- {
12
- int s = socket(domain, type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK), protocol);
13
- int flags;
14
- if (s == -1)
15
- return s;
16
-
17
- if (type & SOCK_CLOEXEC) {
18
- flags = fcntl(s, F_GETFD);
19
- fcntl(s, F_SETFD, flags | FD_CLOEXEC);
20
- }
21
-
22
- if (type & SOCK_NONBLOCK) {
23
- flags = fcntl(s, F_GETFL);
24
- fcntl(s, F_SETFL, flags | O_NONBLOCK);
25
- }
26
- return s;
27
- }
28
-
29
- #endif
@@ -1,30 +0,0 @@
1
- /*
2
- * Public domain
3
- * sys/socket.h compatibility shim
4
- */
5
-
6
- #ifndef _WIN32
7
- #include_next <sys/socket.h>
8
-
9
- #if defined(NEED_SOCKET_FLAGS)
10
- int _socket(int domain, int type, int protocol);
11
- #ifndef SOCKET_FLAGS_PRIV
12
- #define socket(d, t, p) _socket(d, t, p)
13
- #endif
14
- #endif
15
-
16
- #ifndef SOCK_NONBLOCK
17
- #define SOCK_NONBLOCK 0x4000 /* set O_NONBLOCK */
18
- #endif
19
-
20
- #ifndef SOCK_CLOEXEC
21
- #define SOCK_CLOEXEC 0x8000 /* set FD_CLOEXEC */
22
- #endif
23
-
24
- #ifndef HAVE_ACCEPT4
25
- int accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags);
26
- #endif
27
-
28
- #else
29
- #include <win32netcompat.h>
30
- #endif
@@ -1,44 +0,0 @@
1
- #
2
- # Copyright (c) 2017 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
- set(
17
- OCSPCHECK_SRC
18
- http.c
19
- ocspcheck.c
20
- )
21
-
22
- check_function_exists(memmem HAVE_MEMMEM)
23
- if(HAVE_MEMMEM)
24
- add_definitions(-DHAVE_MEMMEM)
25
- else()
26
- set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c)
27
- endif()
28
-
29
- add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
30
-
31
- add_executable(ocspcheck ${OCSPCHECK_SRC})
32
- target_include_directories(ocspcheck
33
- PRIVATE
34
- ../../include/compat
35
- PUBLIC
36
- ../../include
37
- ${CMAKE_BINARY_DIR}/include)
38
- target_link_libraries(ocspcheck tls ${OPENSSL_LIBS} compat_obj tls_compat_obj)
39
-
40
- if(ENABLE_LIBRESSL_INSTALL)
41
- install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
42
- install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
43
-
44
- endif(ENABLE_LIBRESSL_INSTALL)
@@ -1,45 +0,0 @@
1
- #
2
- # Copyright (c) 2017 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
- include $(top_srcdir)/Makefile.am.common
17
-
18
- -include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
19
- -include $(abs_top_builddir)/ssl/libssl_la_objects.mk
20
- -include $(abs_top_builddir)/tls/libtls_la_objects.mk
21
-
22
- if !ENABLE_LIBTLS_ONLY
23
- bin_PROGRAMS = ocspcheck
24
- dist_man_MANS = ocspcheck.8
25
- else
26
- noinst_PROGRAMS = ocspcheck
27
- endif
28
-
29
- EXTRA_DIST = ocspcheck.8
30
- EXTRA_DIST += CMakeLists.txt
31
-
32
- ocspcheck_LDADD = $(libcrypto_la_objects)
33
- ocspcheck_LDADD += $(libcompat_la_objects)
34
- ocspcheck_LDADD += $(libcompatnoopt_la_objects)
35
- ocspcheck_LDADD += $(libssl_la_objects)
36
- ocspcheck_LDADD += $(libtls_la_objects)
37
- ocspcheck_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)
38
-
39
- ocspcheck_SOURCES = http.c
40
- ocspcheck_SOURCES += ocspcheck.c
41
- noinst_HEADERS = http.h
42
-
43
- if !HAVE_MEMMEM
44
- ocspcheck_SOURCES += compat/memmem.c
45
- endif
File without changes
@@ -1,97 +0,0 @@
1
- #
2
- # Copyright (c) 2016 Kinichiro Inoguchi
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
- set(
17
- OPENSSL_SRC
18
- apps.c
19
- asn1pars.c
20
- ca.c
21
- ciphers.c
22
- crl.c
23
- crl2p7.c
24
- cms.c
25
- dgst.c
26
- dh.c
27
- dhparam.c
28
- dsa.c
29
- dsaparam.c
30
- ec.c
31
- ecparam.c
32
- enc.c
33
- errstr.c
34
- gendh.c
35
- gendsa.c
36
- genpkey.c
37
- genrsa.c
38
- ocsp.c
39
- openssl.c
40
- passwd.c
41
- pkcs12.c
42
- pkcs7.c
43
- pkcs8.c
44
- pkey.c
45
- pkeyparam.c
46
- pkeyutl.c
47
- prime.c
48
- rand.c
49
- req.c
50
- rsa.c
51
- rsautl.c
52
- s_cb.c
53
- s_client.c
54
- s_server.c
55
- s_socket.c
56
- s_time.c
57
- sess_id.c
58
- smime.c
59
- speed.c
60
- ts.c
61
- verify.c
62
- version.c
63
- x509.c
64
- )
65
-
66
- if(UNIX)
67
- set(OPENSSL_SRC ${OPENSSL_SRC} apps_posix.c)
68
- set(OPENSSL_SRC ${OPENSSL_SRC} certhash.c)
69
- endif()
70
-
71
- if(WIN32)
72
- set(OPENSSL_SRC ${OPENSSL_SRC} apps_win.c)
73
- set(OPENSSL_SRC ${OPENSSL_SRC} certhash_win.c)
74
- set(OPENSSL_SRC ${OPENSSL_SRC} compat/poll_win.c)
75
- endif()
76
-
77
- if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
78
- check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
79
- if(NOT HAVE_CLOCK_GETTIME)
80
- set(OPENSSL_SRC ${OPENSSL_SRC} compat/clock_gettime_osx.c)
81
- endif()
82
- endif()
83
-
84
- add_executable(openssl ${OPENSSL_SRC})
85
- target_include_directories(openssl
86
- PRIVATE
87
- .
88
- ../../include/compat
89
- PUBLIC
90
- ../../include
91
- ${CMAKE_BINARY_DIR}/include)
92
- target_link_libraries(openssl ${OPENSSL_LIBS} compat_obj)
93
-
94
- if(ENABLE_LIBRESSL_INSTALL)
95
- install(TARGETS openssl DESTINATION ${CMAKE_INSTALL_BINDIR})
96
- install(FILES openssl.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
97
- endif(ENABLE_LIBRESSL_INSTALL)