diff options
author | kinichiro <kinichiro.inoguchi@gmail.com> | 2021-12-26 15:42:47 +0900 |
---|---|---|
committer | kinichiro <kinichiro.inoguchi@gmail.com> | 2021-12-26 16:00:25 +0900 |
commit | adde656bb7a859fb4cc334cb89a00840a7023c2e (patch) | |
tree | f366c790f1e3afc3782b7f5224a823b2c9b8993b | |
parent | 1b95c5d584c5db4f08160299f5bf66acf654875d (diff) | |
download | portable-adde656bb7a859fb4cc334cb89a00840a7023c2e.tar.gz portable-adde656bb7a859fb4cc334cb89a00840a7023c2e.tar.bz2 portable-adde656bb7a859fb4cc334cb89a00840a7023c2e.zip |
Add strtonum to compat library and export it
crypto library requires strtonum now, and add it to compat library.
remove it from applications compat/ directories.
-rw-r--r-- | apps/nc/CMakeLists.txt | 8 | ||||
-rw-r--r-- | apps/nc/Makefile.am | 4 | ||||
-rw-r--r-- | apps/ocspcheck/CMakeLists.txt | 8 | ||||
-rw-r--r-- | apps/ocspcheck/Makefile.am | 4 | ||||
-rw-r--r-- | apps/openssl/CMakeLists.txt | 8 | ||||
-rw-r--r-- | apps/openssl/Makefile.am | 4 | ||||
-rw-r--r-- | crypto/CMakeLists.txt | 5 | ||||
-rw-r--r-- | crypto/Makefile.am | 7 | ||||
-rw-r--r-- | tests/optionstest.c | 1 | ||||
-rwxr-xr-x | update.sh | 4 |
10 files changed, 13 insertions, 40 deletions
diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt index e873de8..bd59211 100644 --- a/apps/nc/CMakeLists.txt +++ b/apps/nc/CMakeLists.txt | |||
@@ -29,14 +29,6 @@ else() | |||
29 | set(NC_SRC ${NC_SRC} compat/readpassphrase.c) | 29 | set(NC_SRC ${NC_SRC} compat/readpassphrase.c) |
30 | endif() | 30 | endif() |
31 | 31 | ||
32 | check_function_exists(strtonum HAVE_STRTONUM) | ||
33 | if(HAVE_STRTONUM AND CMAKE_SYSTEM_NAME MATCHES "Darwin" AND | ||
34 | CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20) | ||
35 | add_definitions(-DHAVE_STRTONUM) | ||
36 | else() | ||
37 | set(NC_SRC ${NC_SRC} compat/strtonum.c) | ||
38 | endif() | ||
39 | |||
40 | if(NOT "${OPENSSLDIR}" STREQUAL "") | 32 | if(NOT "${OPENSSLDIR}" STREQUAL "") |
41 | add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") | 33 | add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") |
42 | else() | 34 | else() |
diff --git a/apps/nc/Makefile.am b/apps/nc/Makefile.am index 58b5c01..e9db6e5 100644 --- a/apps/nc/Makefile.am +++ b/apps/nc/Makefile.am | |||
@@ -43,8 +43,4 @@ if !HAVE_READPASSPHRASE | |||
43 | nc_SOURCES += compat/readpassphrase.c | 43 | nc_SOURCES += compat/readpassphrase.c |
44 | endif | 44 | endif |
45 | 45 | ||
46 | if !HAVE_STRTONUM | ||
47 | nc_SOURCES += compat/strtonum.c | ||
48 | endif | ||
49 | |||
50 | endif | 46 | endif |
diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt index 249f0f4..2dddb6e 100644 --- a/apps/ocspcheck/CMakeLists.txt +++ b/apps/ocspcheck/CMakeLists.txt | |||
@@ -13,14 +13,6 @@ else() | |||
13 | set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c) | 13 | set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c) |
14 | endif() | 14 | endif() |
15 | 15 | ||
16 | check_function_exists(strtonum HAVE_STRTONUM) | ||
17 | if(HAVE_STRTONUM AND CMAKE_SYSTEM_NAME MATCHES "Darwin" AND | ||
18 | CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20) | ||
19 | add_definitions(-DHAVE_STRTONUM) | ||
20 | else() | ||
21 | set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/strtonum.c) | ||
22 | endif() | ||
23 | |||
24 | if(NOT "${OPENSSLDIR}" STREQUAL "") | 16 | if(NOT "${OPENSSLDIR}" STREQUAL "") |
25 | add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") | 17 | add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") |
26 | else() | 18 | else() |
diff --git a/apps/ocspcheck/Makefile.am b/apps/ocspcheck/Makefile.am index 71a73ea..7c7b454 100644 --- a/apps/ocspcheck/Makefile.am +++ b/apps/ocspcheck/Makefile.am | |||
@@ -22,7 +22,3 @@ noinst_HEADERS = http.h | |||
22 | if !HAVE_MEMMEM | 22 | if !HAVE_MEMMEM |
23 | ocspcheck_SOURCES += compat/memmem.c | 23 | ocspcheck_SOURCES += compat/memmem.c |
24 | endif | 24 | endif |
25 | |||
26 | if !HAVE_STRTONUM | ||
27 | ocspcheck_SOURCES += compat/strtonum.c | ||
28 | endif | ||
diff --git a/apps/openssl/CMakeLists.txt b/apps/openssl/CMakeLists.txt index bb058e1..2a84178 100644 --- a/apps/openssl/CMakeLists.txt +++ b/apps/openssl/CMakeLists.txt | |||
@@ -61,14 +61,6 @@ if(WIN32) | |||
61 | set(OPENSSL_SRC ${OPENSSL_SRC} compat/poll_win.c) | 61 | set(OPENSSL_SRC ${OPENSSL_SRC} compat/poll_win.c) |
62 | endif() | 62 | endif() |
63 | 63 | ||
64 | check_function_exists(strtonum HAVE_STRTONUM) | ||
65 | if(HAVE_STRTONUM AND CMAKE_SYSTEM_NAME MATCHES "Darwin" AND | ||
66 | CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20) | ||
67 | add_definitions(-DHAVE_STRTONUM) | ||
68 | else() | ||
69 | set(OPENSSL_SRC ${OPENSSL_SRC} compat/strtonum.c) | ||
70 | endif() | ||
71 | |||
72 | if(CMAKE_SYSTEM_NAME MATCHES "Darwin") | 64 | if(CMAKE_SYSTEM_NAME MATCHES "Darwin") |
73 | check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) | 65 | check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) |
74 | if(NOT HAVE_CLOCK_GETTIME) | 66 | if(NOT HAVE_CLOCK_GETTIME) |
diff --git a/apps/openssl/Makefile.am b/apps/openssl/Makefile.am index b98e08d..7cbac48 100644 --- a/apps/openssl/Makefile.am +++ b/apps/openssl/Makefile.am | |||
@@ -84,10 +84,6 @@ openssl_SOURCES += compat/clock_gettime_osx.c | |||
84 | endif | 84 | endif |
85 | endif | 85 | endif |
86 | 86 | ||
87 | if !HAVE_STRTONUM | ||
88 | openssl_SOURCES += compat/strtonum.c | ||
89 | endif | ||
90 | |||
91 | noinst_HEADERS = apps.h | 87 | noinst_HEADERS = apps.h |
92 | noinst_HEADERS += progs.h | 88 | noinst_HEADERS += progs.h |
93 | noinst_HEADERS += s_apps.h | 89 | noinst_HEADERS += s_apps.h |
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 12bc8ae..196ae4a 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -888,6 +888,11 @@ if(NOT HAVE_STRSEP) | |||
888 | set(EXTRA_EXPORT ${EXTRA_EXPORT} strsep) | 888 | set(EXTRA_EXPORT ${EXTRA_EXPORT} strsep) |
889 | endif() | 889 | endif() |
890 | 890 | ||
891 | if(NOT HAVE_STRTONUM) | ||
892 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/strtonum.c) | ||
893 | set(EXTRA_EXPORT ${EXTRA_EXPORT} strtonum) | ||
894 | endif() | ||
895 | |||
891 | if(NOT HAVE_SYSLOG_R) | 896 | if(NOT HAVE_SYSLOG_R) |
892 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/syslog_r.c) | 897 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/syslog_r.c) |
893 | endif() | 898 | endif() |
diff --git a/crypto/Makefile.am b/crypto/Makefile.am index 155df59..42d0dd9 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am | |||
@@ -76,6 +76,9 @@ endif | |||
76 | if !HAVE_STRSEP | 76 | if !HAVE_STRSEP |
77 | -echo strsep >> crypto_portable.sym | 77 | -echo strsep >> crypto_portable.sym |
78 | endif | 78 | endif |
79 | if !HAVE_STRTONUM | ||
80 | -echo strtonum >> crypto_portable.sym | ||
81 | endif | ||
79 | if !HAVE_TIMEGM | 82 | if !HAVE_TIMEGM |
80 | -echo timegm >> crypto_portable.sym | 83 | -echo timegm >> crypto_portable.sym |
81 | endif | 84 | endif |
@@ -175,6 +178,10 @@ if !HAVE_STRSEP | |||
175 | libcompat_la_SOURCES += compat/strsep.c | 178 | libcompat_la_SOURCES += compat/strsep.c |
176 | endif | 179 | endif |
177 | 180 | ||
181 | if !HAVE_STRTONUM | ||
182 | libcompat_la_SOURCES += compat/strtonum.c | ||
183 | endif | ||
184 | |||
178 | if !HAVE_ASPRINTF | 185 | if !HAVE_ASPRINTF |
179 | libcompat_la_SOURCES += compat/bsd-asprintf.c | 186 | libcompat_la_SOURCES += compat/bsd-asprintf.c |
180 | endif | 187 | endif |
diff --git a/tests/optionstest.c b/tests/optionstest.c index e860f0d..af9dc1e 100644 --- a/tests/optionstest.c +++ b/tests/optionstest.c | |||
@@ -24,7 +24,6 @@ | |||
24 | 24 | ||
25 | #include <apps.h> | 25 | #include <apps.h> |
26 | #include <apps.c> | 26 | #include <apps.c> |
27 | #include <strtonum.c> | ||
28 | 27 | ||
29 | /* Needed to keep apps.c happy... */ | 28 | /* Needed to keep apps.c happy... */ |
30 | BIO *bio_err; | 29 | BIO *bio_err; |
@@ -82,6 +82,7 @@ for i in crypto/compat; do | |||
82 | $libc_src/crypt/chacha_private.h \ | 82 | $libc_src/crypt/chacha_private.h \ |
83 | $libc_src/stdlib/reallocarray.c \ | 83 | $libc_src/stdlib/reallocarray.c \ |
84 | $libc_src/stdlib/recallocarray.c \ | 84 | $libc_src/stdlib/recallocarray.c \ |
85 | $libc_src/stdlib/strtonum.c \ | ||
85 | $libc_src/string/explicit_bzero.c \ | 86 | $libc_src/string/explicit_bzero.c \ |
86 | $libc_src/string/strcasecmp.c \ | 87 | $libc_src/string/strcasecmp.c \ |
87 | $libc_src/string/strlcpy.c \ | 88 | $libc_src/string/strlcpy.c \ |
@@ -243,7 +244,6 @@ echo "copying nc(1) source" | |||
243 | $CP $bin_src/nc/nc.1 apps/nc | 244 | $CP $bin_src/nc/nc.1 apps/nc |
244 | rm -f apps/nc/*.c apps/nc/*.h | 245 | rm -f apps/nc/*.c apps/nc/*.h |
245 | $CP_LIBC $libc_src/net/base64.c apps/nc/compat | 246 | $CP_LIBC $libc_src/net/base64.c apps/nc/compat |
246 | $CP_LIBC $libc_src/stdlib/strtonum.c apps/nc/compat | ||
247 | for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/nc/Makefile.am` ; do | 247 | for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/nc/Makefile.am` ; do |
248 | if [ -e $bin_src/nc/$i ]; then | 248 | if [ -e $bin_src/nc/$i ]; then |
249 | $CP $bin_src/nc/$i apps/nc | 249 | $CP $bin_src/nc/$i apps/nc |
@@ -255,7 +255,6 @@ echo "copying ocspcheck(1) source" | |||
255 | $CP $sbin_src/ocspcheck/ocspcheck.8 apps/ocspcheck | 255 | $CP $sbin_src/ocspcheck/ocspcheck.8 apps/ocspcheck |
256 | rm -f apps/ocspcheck/*.c apps/ocspcheck/*.h | 256 | rm -f apps/ocspcheck/*.c apps/ocspcheck/*.h |
257 | $CP_LIBC $libc_src/string/memmem.c apps/ocspcheck/compat | 257 | $CP_LIBC $libc_src/string/memmem.c apps/ocspcheck/compat |
258 | $CP_LIBC $libc_src/stdlib/strtonum.c apps/ocspcheck/compat | ||
259 | for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/ocspcheck/Makefile.am` ; do | 258 | for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/ocspcheck/Makefile.am` ; do |
260 | if [ -e $sbin_src/ocspcheck/$i ]; then | 259 | if [ -e $sbin_src/ocspcheck/$i ]; then |
261 | $CP $sbin_src/ocspcheck/$i apps/ocspcheck | 260 | $CP $sbin_src/ocspcheck/$i apps/ocspcheck |
@@ -265,7 +264,6 @@ done | |||
265 | # copy openssl(1) source | 264 | # copy openssl(1) source |
266 | echo "copying openssl(1) source" | 265 | echo "copying openssl(1) source" |
267 | $CP $bin_src/openssl/openssl.1 apps/openssl | 266 | $CP $bin_src/openssl/openssl.1 apps/openssl |
268 | $CP_LIBC $libc_src/stdlib/strtonum.c apps/openssl/compat | ||
269 | $CP $libcrypto_src/cert.pem . | 267 | $CP $libcrypto_src/cert.pem . |
270 | $CP $libcrypto_src/openssl.cnf . | 268 | $CP $libcrypto_src/openssl.cnf . |
271 | $CP $libcrypto_src/x509v3.cnf . | 269 | $CP $libcrypto_src/x509v3.cnf . |