uringmachine 0.15 → 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 +12 -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_stream_class.c +0 -1
- data/ext/um/um_utils.c +38 -15
- data/lib/uringmachine/version.rb +1 -1
- data/lib/uringmachine.rb +4 -3
- 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,27 @@
|
|
1
|
+
@echo off
|
2
|
+
setlocal enabledelayedexpansion
|
3
|
+
|
4
|
+
:: Copyright (c) 2024 Theo Beuhler
|
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 shutdowntest_bin=%1
|
19
|
+
set shutdowntest_bin=%shutdowntest_bin:/=\%
|
20
|
+
if not exist %shutdowntest_bin% exit /b 1
|
21
|
+
|
22
|
+
%shutdowntest_bin% %srcdir%\server1-rsa.pem %srcdir%\server1-rsa-chain.pem %srcdir%\ca-root-rsa.pem
|
23
|
+
if !errorlevel! neq 0 (
|
24
|
+
exit /b 1
|
25
|
+
)
|
26
|
+
|
27
|
+
endlocal
|
@@ -0,0 +1,30 @@
|
|
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
|
+
shutdowntest_bin=./shutdowntest
|
20
|
+
if [ -e ./shutdowntest.exe ]; then
|
21
|
+
shutdowntest_bin=./shutdowntest.exe
|
22
|
+
elif [ -e ./shutdowntest.js ]; then
|
23
|
+
shutdowntest_bin="node ./shutdowntest.js"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ -z $srcdir ]; then
|
27
|
+
srcdir=.
|
28
|
+
fi
|
29
|
+
|
30
|
+
$shutdowntest_bin $srcdir/server1-rsa.pem $srcdir/server1-rsa-chain.pem $srcdir/ca-root-rsa.pem
|
@@ -0,0 +1,32 @@
|
|
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 ssltest_bin=%1
|
19
|
+
set ssltest_bin=%ssltest_bin:/=\%
|
20
|
+
if not exist %ssltest_bin% exit /b 1
|
21
|
+
|
22
|
+
set openssl_bin=%2
|
23
|
+
set openssl_bin=%openssl_bin:/=\%
|
24
|
+
if not exist %openssl_bin% exit /b 1
|
25
|
+
|
26
|
+
%srcdir%\testssl.bat %srcdir%\server1-rsa.pem %srcdir%\server1-rsa-chain.pem ^
|
27
|
+
%srcdir%\ca-root-rsa.pem %ssltest_bin% %openssl_bin%
|
28
|
+
if !errorlevel! neq 0 (
|
29
|
+
exit /b 1
|
30
|
+
)
|
31
|
+
|
32
|
+
endlocal
|
@@ -0,0 +1,48 @@
|
|
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
|
+
|
19
|
+
ssltest_bin=./ssltest
|
20
|
+
if [ -e ./ssltest.exe ]; then
|
21
|
+
ssltest_bin=./ssltest.exe
|
22
|
+
elif [ -e ./ssltest.js ]; then
|
23
|
+
ssltest_bin="node ./ssltest.js"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ -d ../apps/openssl ]; then
|
27
|
+
openssl_bin=../apps/openssl/openssl
|
28
|
+
if [ -e ../apps/openssl/openssl.exe ]; then
|
29
|
+
openssl_bin=../apps/openssl/openssl.exe
|
30
|
+
elif [ -e ../apps/openssl/openssl.js ]; then
|
31
|
+
openssl_bin="node ../apps/openssl/openssl.js"
|
32
|
+
fi
|
33
|
+
else
|
34
|
+
openssl_bin=../apps/openssl
|
35
|
+
if [ -e ../apps/openssl.exe ]; then
|
36
|
+
openssl_bin=../apps/openssl.exe
|
37
|
+
elif [ -e ../apps/openssl.js ]; then
|
38
|
+
openssl_bin="node ../apps/openssl.js"
|
39
|
+
fi
|
40
|
+
fi
|
41
|
+
|
42
|
+
if [ -z $srcdir ]; then
|
43
|
+
srcdir=.
|
44
|
+
fi
|
45
|
+
|
46
|
+
$srcdir/testssl $srcdir/server1-rsa.pem $srcdir/server1-rsa-chain.pem \
|
47
|
+
$srcdir/ca-root-rsa.pem \
|
48
|
+
"$ssltest_bin" "$openssl_bin"
|
@@ -0,0 +1,47 @@
|
|
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
|
+
:: Test DSA certificate generation of openssl
|
19
|
+
|
20
|
+
set openssl_bin=%1
|
21
|
+
set openssl_bin=%openssl_bin:/=\%
|
22
|
+
if not exist %openssl_bin% exit /b 1
|
23
|
+
|
24
|
+
REM # Generate DSA paramter set
|
25
|
+
%openssl_bin% dsaparam 512 -out dsa512.pem
|
26
|
+
if !errorlevel! neq 0 (
|
27
|
+
exit /b 1
|
28
|
+
)
|
29
|
+
|
30
|
+
|
31
|
+
REM # Generate a DSA certificate
|
32
|
+
%openssl_bin% req -config %srcdir%\openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key
|
33
|
+
if !errorlevel! neq 0 (
|
34
|
+
exit /b 1
|
35
|
+
)
|
36
|
+
|
37
|
+
|
38
|
+
REM # Now check the certificate
|
39
|
+
%openssl_bin% x509 -text -in testdsa.pem
|
40
|
+
if !errorlevel! neq 0 (
|
41
|
+
exit /b 1
|
42
|
+
)
|
43
|
+
|
44
|
+
del testdsa.key dsa512.pem testdsa.pem
|
45
|
+
|
46
|
+
exit /b 0
|
47
|
+
endlocal
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2015 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
|
+
#Test DSA certificate generation of openssl
|
18
|
+
|
19
|
+
if [ -d ../apps/openssl ]; then
|
20
|
+
cmd=../apps/openssl/openssl
|
21
|
+
if [ -e ../apps/openssl/openssl.exe ]; then
|
22
|
+
cmd=../apps/openssl/openssl.exe
|
23
|
+
fi
|
24
|
+
else
|
25
|
+
cmd=../apps/openssl
|
26
|
+
if [ -e ../apps/openssl.exe ]; then
|
27
|
+
cmd=../apps/openssl.exe
|
28
|
+
fi
|
29
|
+
fi
|
30
|
+
|
31
|
+
if [ -z $srcdir ]; then
|
32
|
+
srcdir=.
|
33
|
+
fi
|
34
|
+
|
35
|
+
# Generate DSA paramter set
|
36
|
+
$cmd dsaparam 512 -out dsa512.pem
|
37
|
+
if [ $? != 0 ]; then
|
38
|
+
exit 1;
|
39
|
+
fi
|
40
|
+
|
41
|
+
|
42
|
+
# Denerate a DSA certificate
|
43
|
+
$cmd req -config $srcdir/openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key
|
44
|
+
if [ $? != 0 ]; then
|
45
|
+
exit 1;
|
46
|
+
fi
|
47
|
+
|
48
|
+
|
49
|
+
# Now check the certificate
|
50
|
+
$cmd x509 -text -in testdsa.pem
|
51
|
+
if [ $? != 0 ]; then
|
52
|
+
exit 1;
|
53
|
+
fi
|
54
|
+
|
55
|
+
rm testdsa.key dsa512.pem testdsa.pem
|
56
|
+
|
57
|
+
exit 0
|
@@ -0,0 +1,85 @@
|
|
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 test=P
|
19
|
+
|
20
|
+
set openssl_bin=%1
|
21
|
+
set openssl_bin=%openssl_bin:/=\%
|
22
|
+
if not exist %openssl_bin% exit /b 1
|
23
|
+
|
24
|
+
echo copy %srcdir%\openssl.cnf %test%
|
25
|
+
copy %srcdir%\openssl.cnf %test%
|
26
|
+
|
27
|
+
echo cat
|
28
|
+
echo %openssl_bin% enc -in %test% -out %test%.CIPHER
|
29
|
+
%openssl_bin% enc -in %test% -out %test%.CIPHER
|
30
|
+
%openssl_bin% enc -in %test%.CIPHER -out %test%.CLEAR
|
31
|
+
fc /b %test% %test%.CLEAR
|
32
|
+
if !errorlevel! neq 0 (
|
33
|
+
exit /b 1
|
34
|
+
) else (
|
35
|
+
del %test%.CIPHER %test%.CLEAR
|
36
|
+
)
|
37
|
+
|
38
|
+
echo base64
|
39
|
+
%openssl_bin% enc -a -e -in %test% -out %test%.CIPHER
|
40
|
+
%openssl_bin% enc -a -d -in %test%.CIPHER -out %test%.CLEAR
|
41
|
+
dir
|
42
|
+
fc /b %test% %test%.CLEAR
|
43
|
+
if !errorlevel! neq 0 (
|
44
|
+
exit /b 1
|
45
|
+
) else (
|
46
|
+
del %test%.CIPHER %test%.CLEAR
|
47
|
+
)
|
48
|
+
|
49
|
+
for %%i in (
|
50
|
+
aes-128-cbc aes-128-cfb aes-128-cfb1 aes-128-cfb8
|
51
|
+
aes-128-ecb aes-128-ofb aes-192-cbc aes-192-cfb
|
52
|
+
aes-192-cfb1 aes-192-cfb8 aes-192-ecb aes-192-ofb
|
53
|
+
aes-256-cbc aes-256-cfb aes-256-cfb1 aes-256-cfb8
|
54
|
+
aes-256-ecb aes-256-ofb
|
55
|
+
bf-cbc bf-cfb bf-ecb bf-ofb
|
56
|
+
cast-cbc cast5-cbc cast5-cfb cast5-ecb cast5-ofb
|
57
|
+
des-cbc des-cfb des-cfb8 des-ecb des-ede
|
58
|
+
des-ede-cbc des-ede-cfb des-ede-ofb des-ede3
|
59
|
+
des-ede3-cbc des-ede3-cfb des-ede3-ofb des-ofb desx-cbc
|
60
|
+
rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb
|
61
|
+
rc4 rc4-40
|
62
|
+
) do (
|
63
|
+
echo %%i
|
64
|
+
%openssl_bin% %%i -e -k test -in %test% -out %test%.%%i.CIPHER
|
65
|
+
%openssl_bin% %%i -d -k test -in %test%.%%i.CIPHER -out %test%.%%i.CLEAR
|
66
|
+
fc /b %test% %test%.%%i.CLEAR
|
67
|
+
if !errorlevel! neq 0 (
|
68
|
+
exit /b 1
|
69
|
+
) else (
|
70
|
+
del %test%.%%i.CIPHER %test%.%%i.CLEAR
|
71
|
+
)
|
72
|
+
|
73
|
+
echo %%i base64
|
74
|
+
%openssl_bin% %%i -a -e -k test -in %test% -out %test%.%%i.CIPHER
|
75
|
+
%openssl_bin% %%i -a -d -k test -in %test%.%%i.CIPHER -out %test%.%%i.CLEAR
|
76
|
+
fc /b %test% %test%.%%i.CLEAR
|
77
|
+
if !errorlevel! neq 0 (
|
78
|
+
exit /b 1
|
79
|
+
) else (
|
80
|
+
del %test%.%%i.CIPHER %test%.%%i.CLEAR
|
81
|
+
)
|
82
|
+
)
|
83
|
+
|
84
|
+
del %test%
|
85
|
+
endlocal
|
@@ -0,0 +1,93 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2015 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
|
+
test=p
|
18
|
+
if [ -d ../apps/openssl ]; then
|
19
|
+
cmd=../apps/openssl/openssl
|
20
|
+
if [ -e ../apps/openssl/openssl.exe ]; then
|
21
|
+
cmd=../apps/openssl/openssl.exe
|
22
|
+
fi
|
23
|
+
else
|
24
|
+
cmd=../apps/openssl
|
25
|
+
if [ -e ../apps/openssl.exe ]; then
|
26
|
+
cmd=../apps/openssl.exe
|
27
|
+
fi
|
28
|
+
fi
|
29
|
+
|
30
|
+
if [ -z $srcdir ]; then
|
31
|
+
srcdir=.
|
32
|
+
fi
|
33
|
+
|
34
|
+
cat $srcdir/openssl.cnf >$test;
|
35
|
+
|
36
|
+
echo cat
|
37
|
+
$cmd enc < $test > $test.cipher
|
38
|
+
$cmd enc < $test.cipher >$test.clear
|
39
|
+
cmp $test $test.clear
|
40
|
+
if [ $? != 0 ]
|
41
|
+
then
|
42
|
+
exit 1
|
43
|
+
else
|
44
|
+
/bin/rm $test.cipher $test.clear
|
45
|
+
fi
|
46
|
+
echo base64
|
47
|
+
$cmd enc -a -e < $test > $test.cipher
|
48
|
+
$cmd enc -a -d < $test.cipher >$test.clear
|
49
|
+
cmp $test $test.clear
|
50
|
+
if [ $? != 0 ]
|
51
|
+
then
|
52
|
+
exit 1
|
53
|
+
else
|
54
|
+
/bin/rm $test.cipher $test.clear
|
55
|
+
fi
|
56
|
+
|
57
|
+
for i in \
|
58
|
+
aes-128-cbc aes-128-cfb aes-128-cfb1 aes-128-cfb8 \
|
59
|
+
aes-128-ecb aes-128-ofb aes-192-cbc aes-192-cfb \
|
60
|
+
aes-192-cfb1 aes-192-cfb8 aes-192-ecb aes-192-ofb \
|
61
|
+
aes-256-cbc aes-256-cfb aes-256-cfb1 aes-256-cfb8 \
|
62
|
+
aes-256-ecb aes-256-ofb \
|
63
|
+
bf-cbc bf-cfb bf-ecb bf-ofb \
|
64
|
+
cast-cbc cast5-cbc cast5-cfb cast5-ecb cast5-ofb \
|
65
|
+
des-cbc des-cfb des-cfb8 des-ecb des-ede \
|
66
|
+
des-ede-cbc des-ede-cfb des-ede-ofb des-ede3 \
|
67
|
+
des-ede3-cbc des-ede3-cfb des-ede3-ofb des-ofb desx-cbc \
|
68
|
+
rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb \
|
69
|
+
rc4 rc4-40
|
70
|
+
do
|
71
|
+
echo $i
|
72
|
+
$cmd $i -e -k test < $test > $test.$i.cipher
|
73
|
+
$cmd $i -d -k test < $test.$i.cipher >$test.$i.clear
|
74
|
+
cmp $test $test.$i.clear
|
75
|
+
if [ $? != 0 ]
|
76
|
+
then
|
77
|
+
exit 1
|
78
|
+
else
|
79
|
+
/bin/rm $test.$i.cipher $test.$i.clear
|
80
|
+
fi
|
81
|
+
|
82
|
+
echo $i base64
|
83
|
+
$cmd $i -a -e -k test < $test > $test.$i.cipher
|
84
|
+
$cmd $i -a -d -k test < $test.$i.cipher >$test.$i.clear
|
85
|
+
cmp $test $test.$i.clear
|
86
|
+
if [ $? != 0 ]
|
87
|
+
then
|
88
|
+
exit 1
|
89
|
+
else
|
90
|
+
/bin/rm $test.$i.cipher $test.$i.clear
|
91
|
+
fi
|
92
|
+
done
|
93
|
+
rm -f $test
|
@@ -0,0 +1,47 @@
|
|
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
|
+
:: Test RSA certificate generation of openssl
|
19
|
+
|
20
|
+
set openssl_bin=%1
|
21
|
+
set openssl_bin=%openssl_bin:/=\%
|
22
|
+
if not exist %openssl_bin% exit /b 1
|
23
|
+
|
24
|
+
REM # Generate RSA private key
|
25
|
+
%openssl_bin% genrsa -out rsakey.pem
|
26
|
+
if !errorlevel! neq 0 (
|
27
|
+
exit /b 1
|
28
|
+
)
|
29
|
+
|
30
|
+
|
31
|
+
REM # Generate an RSA certificate
|
32
|
+
%openssl_bin% req -config %srcdir%\openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem
|
33
|
+
if !errorlevel! neq 0 (
|
34
|
+
exit /b 1
|
35
|
+
)
|
36
|
+
|
37
|
+
|
38
|
+
REM # Now check the certificate
|
39
|
+
%openssl_bin% x509 -text -in rsacert.pem
|
40
|
+
if !errorlevel! neq 0 (
|
41
|
+
exit /b 1
|
42
|
+
)
|
43
|
+
|
44
|
+
del rsacert.pem rsakey.pem
|
45
|
+
|
46
|
+
exit /b 0
|
47
|
+
endlocal
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2015 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
|
+
#Test RSA certificate generation of openssl
|
18
|
+
|
19
|
+
if [ -d ../apps/openssl ]; then
|
20
|
+
cmd=../apps/openssl/openssl
|
21
|
+
if [ -e ../apps/openssl/openssl.exe ]; then
|
22
|
+
cmd=../apps/openssl/openssl.exe
|
23
|
+
fi
|
24
|
+
else
|
25
|
+
cmd=../apps/openssl
|
26
|
+
if [ -e ../apps/openssl.exe ]; then
|
27
|
+
cmd=../apps/openssl.exe
|
28
|
+
fi
|
29
|
+
fi
|
30
|
+
|
31
|
+
if [ -z $srcdir ]; then
|
32
|
+
srcdir=.
|
33
|
+
fi
|
34
|
+
|
35
|
+
# Generate RSA private key
|
36
|
+
$cmd genrsa -out rsakey.pem
|
37
|
+
if [ $? != 0 ]; then
|
38
|
+
exit 1;
|
39
|
+
fi
|
40
|
+
|
41
|
+
|
42
|
+
# Generate an RSA certificate
|
43
|
+
$cmd req -config $srcdir/openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem
|
44
|
+
if [ $? != 0 ]; then
|
45
|
+
exit 1;
|
46
|
+
fi
|
47
|
+
|
48
|
+
|
49
|
+
# Now check the certificate
|
50
|
+
$cmd x509 -text -in rsacert.pem
|
51
|
+
if [ $? != 0 ]; then
|
52
|
+
exit 1;
|
53
|
+
fi
|
54
|
+
|
55
|
+
rm -f rsacert.pem rsakey.pem
|
56
|
+
|
57
|
+
exit 0
|