aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2020-10-06 19:41:18 -0500
committerBrent Cook <busterb@gmail.com>2020-10-06 19:41:18 -0500
commitdb8b30ae510793c65681d8786f94669e40d821a1 (patch)
treea3e3d353998efdbbc28a008d3ebf9aacabcdaafb
parentb9918fc1ecfa74d6d3d9a3c533603a9677108d24 (diff)
parent85eea94598ff4b543777df4bf34d44ef5dfc06c6 (diff)
downloadportable-db8b30ae510793c65681d8786f94669e40d821a1.tar.gz
portable-db8b30ae510793c65681d8786f94669e40d821a1.tar.bz2
portable-db8b30ae510793c65681d8786f94669e40d821a1.zip
Land #611, remove libtls-standalone
-rw-r--r--libtls-standalone/AUTHORS0
-rw-r--r--libtls-standalone/COPYING13
-rw-r--r--libtls-standalone/ChangeLog0
-rw-r--r--libtls-standalone/Makefile.am7
-rw-r--r--libtls-standalone/NEWS0
-rw-r--r--libtls-standalone/README0
-rw-r--r--libtls-standalone/compat/Makefile.am45
-rw-r--r--libtls-standalone/configure.ac52
-rw-r--r--libtls-standalone/include/Makefile.am5
-rw-r--r--libtls-standalone/include/string.h87
-rw-r--r--libtls-standalone/libtls.pc.in16
-rw-r--r--libtls-standalone/src/Makefile.am17
-rw-r--r--libtls-standalone/tests/Makefile.am7
-rw-r--r--libtls-standalone/tests/test.c51
-rw-r--r--patches/tls.h.patch20
-rwxr-xr-xupdate.sh21
16 files changed, 3 insertions, 338 deletions
diff --git a/libtls-standalone/AUTHORS b/libtls-standalone/AUTHORS
deleted file mode 100644
index e69de29..0000000
--- a/libtls-standalone/AUTHORS
+++ /dev/null
diff --git a/libtls-standalone/COPYING b/libtls-standalone/COPYING
deleted file mode 100644
index c203efe..0000000
--- a/libtls-standalone/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
1libtls is ISC licensed as per OpenBSD's normal licensing policy.
2
3Permission to use, copy, modify, and distribute this software for any
4purpose with or without fee is hereby granted, provided that the above
5copyright notice and this permission notice appear in all copies.
6
7THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/libtls-standalone/ChangeLog b/libtls-standalone/ChangeLog
deleted file mode 100644
index e69de29..0000000
--- a/libtls-standalone/ChangeLog
+++ /dev/null
diff --git a/libtls-standalone/Makefile.am b/libtls-standalone/Makefile.am
deleted file mode 100644
index 2581717..0000000
--- a/libtls-standalone/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
1SUBDIRS = include compat src tests man
2ACLOCAL_AMFLAGS = -I m4
3
4pkgconfigdir = $(libdir)/pkgconfig
5pkgconfig_DATA = libtls.pc
6
7EXTRA_DIST = README VERSION
diff --git a/libtls-standalone/NEWS b/libtls-standalone/NEWS
deleted file mode 100644
index e69de29..0000000
--- a/libtls-standalone/NEWS
+++ /dev/null
diff --git a/libtls-standalone/README b/libtls-standalone/README
deleted file mode 100644
index e69de29..0000000
--- a/libtls-standalone/README
+++ /dev/null
diff --git a/libtls-standalone/compat/Makefile.am b/libtls-standalone/compat/Makefile.am
deleted file mode 100644
index e1ec939..0000000
--- a/libtls-standalone/compat/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
1#
2# Copyright (c) 2014-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
16AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src
17
18noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la
19
20# compatibility functions that need to be built without optimizations
21libcompatnoopt_la_CFLAGS = -O0
22libcompatnoopt_la_SOURCES =
23
24if !HAVE_EXPLICIT_BZERO
25libcompatnoopt_la_SOURCES += explicit_bzero.c
26endif
27
28# other compatibility functions
29libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS)
30libcompat_la_SOURCES =
31libcompat_la_LIBADD = $(PLATFORM_LDADD)
32
33if !HAVE_ASPRINTF
34libcompat_la_SOURCES += bsd-asprintf.c
35endif
36
37if !HAVE_STRLCPY
38libcompat_la_SOURCES += strlcpy.c
39endif
40
41if !HAVE_STRSEP
42libcompat_la_SOURCES += strsep.c
43endif
44
45include Makefile.am.arc4random
diff --git a/libtls-standalone/configure.ac b/libtls-standalone/configure.ac
deleted file mode 100644
index ebdd850..0000000
--- a/libtls-standalone/configure.ac
+++ /dev/null
@@ -1,52 +0,0 @@
1# Copyright (c) 2014-2015 Brent Cook
2#
3# Permission to use, copy, modify, and distribute this software for any
4# purpose with or without fee is hereby granted, provided that the above
5# copyright notice and this permission notice appear in all copies.
6#
7# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14
15AC_INIT([libtls], m4_esyscmd([tr -d '\n' < VERSION]))
16AC_SUBST([LIBTLS_VERSION], m4_esyscmd([sed -e 's/\./:/g' VERSION | tr -d '\n']))
17
18AC_CANONICAL_HOST
19AM_INIT_AUTOMAKE([subdir-objects])
20AC_CONFIG_MACRO_DIR([m4])
21
22m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
23
24# This must be called before AC_PROG_CC
25USER_CFLAGS="$CFLAGS"
26
27AC_PROG_CC
28AC_PROG_CC_STDC
29AM_PROG_CC_C_O
30AC_PROG_LIBTOOL
31LT_INIT
32
33CHECK_OS_OPTIONS
34
35CHECK_C_HARDENING_OPTIONS
36
37DISABLE_COMPILER_WARNINGS
38
39CHECK_LIBC_COMPAT
40CHECK_LIBC_CRYPTO_COMPAT
41
42AC_CONFIG_FILES([
43 Makefile
44 include/Makefile
45 compat/Makefile
46 man/Makefile
47 src/Makefile
48 tests/Makefile
49 libtls.pc
50])
51
52AC_OUTPUT
diff --git a/libtls-standalone/include/Makefile.am b/libtls-standalone/include/Makefile.am
deleted file mode 100644
index 0783318..0000000
--- a/libtls-standalone/include/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
1noinst_HEADERS = stdlib.h
2noinst_HEADERS += string.h
3noinst_HEADERS += unistd.h
4
5include_HEADERS = tls.h
diff --git a/libtls-standalone/include/string.h b/libtls-standalone/include/string.h
deleted file mode 100644
index 4bf7519..0000000
--- a/libtls-standalone/include/string.h
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * Public domain
3 * string.h compatibility shim
4 */
5
6#ifndef LIBCRYPTOCOMPAT_STRING_H
7#define LIBCRYPTOCOMPAT_STRING_H
8
9#ifdef _MSC_VER
10#if _MSC_VER >= 1900
11#include <../ucrt/string.h>
12#else
13#include <../include/string.h>
14#endif
15#else
16#include_next <string.h>
17#endif
18
19#include <sys/types.h>
20
21#if defined(__sun) || defined(_AIX) || defined(__hpux)
22/* Some functions historically defined in string.h were placed in strings.h by
23 * SUS. Use the same hack as OS X and FreeBSD use to work around on AIX,
24 * Solaris, and HPUX.
25 */
26#include <strings.h>
27#endif
28
29#ifndef HAVE_STRCASECMP
30int strcasecmp(const char *s1, const char *s2);
31int strncasecmp(const char *s1, const char *s2, size_t len);
32#endif
33
34#ifndef HAVE_STRLCPY
35size_t strlcpy(char *dst, const char *src, size_t siz);
36#endif
37
38#ifndef HAVE_STRLCAT
39size_t strlcat(char *dst, const char *src, size_t siz);
40#endif
41
42#ifndef HAVE_STRNDUP
43char * strndup(const char *str, size_t maxlen);
44/* the only user of strnlen is strndup, so only build it if needed */
45#ifndef HAVE_STRNLEN
46size_t strnlen(const char *str, size_t maxlen);
47#endif
48#endif
49
50#ifndef HAVE_STRSEP
51char *strsep(char **stringp, const char *delim);
52#endif
53
54#ifndef HAVE_EXPLICIT_BZERO
55void explicit_bzero(void *, size_t);
56#endif
57
58#ifndef HAVE_TIMINGSAFE_BCMP
59int timingsafe_bcmp(const void *b1, const void *b2, size_t n);
60#endif
61
62#ifndef HAVE_TIMINGSAFE_MEMCMP
63int timingsafe_memcmp(const void *b1, const void *b2, size_t len);
64#endif
65
66#ifndef HAVE_MEMMEM
67void * memmem(const void *big, size_t big_len, const void *little,
68 size_t little_len);
69#endif
70
71#ifdef _WIN32
72#include <errno.h>
73
74static inline char *
75posix_strerror(int errnum)
76{
77 if (errnum == ECONNREFUSED) {
78 return "Connection refused";
79 }
80 return strerror(errnum);
81}
82
83#define strerror(errnum) posix_strerror(errnum)
84
85#endif
86
87#endif
diff --git a/libtls-standalone/libtls.pc.in b/libtls-standalone/libtls.pc.in
deleted file mode 100644
index 64d7457..0000000
--- a/libtls-standalone/libtls.pc.in
+++ /dev/null
@@ -1,16 +0,0 @@
1#libtls pkg-config source file
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5libdir=@libdir@
6includedir=@includedir@
7
8Name: LibreSSL-libtls
9Description: Secure communications using the TLS socket protocol.
10Version: @LIBTLS_VERSION@
11Requires:
12Requires.private: libcrypto libssl
13Conflicts:
14Libs: -L${libdir} -ltls
15Libs.private: @LIBS@ -lcrypto -lssl
16Cflags: -I${includedir}
diff --git a/libtls-standalone/src/Makefile.am b/libtls-standalone/src/Makefile.am
deleted file mode 100644
index 5f8f55f..0000000
--- a/libtls-standalone/src/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
1AM_CFLAGS = -I$(top_srcdir)/include
2
3lib_LTLIBRARIES = libtls.la
4
5libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined
6libtls_la_LIBADD = -lcrypto -lssl -lcrypto $(PLATFORM_LDADD)
7libtls_la_LIBADD += $(top_builddir)/compat/libcompat.la
8libtls_la_LIBADD += $(top_builddir)/compat/libcompatnoopt.la
9
10libtls_la_SOURCES = tls.c
11libtls_la_SOURCES += tls_bio_cb.c
12libtls_la_SOURCES += tls_client.c
13libtls_la_SOURCES += tls_config.c
14libtls_la_SOURCES += tls_server.c
15libtls_la_SOURCES += tls_util.c
16libtls_la_SOURCES += tls_verify.c
17noinst_HEADERS = tls_internal.h
diff --git a/libtls-standalone/tests/Makefile.am b/libtls-standalone/tests/Makefile.am
deleted file mode 100644
index 1a08aef..0000000
--- a/libtls-standalone/tests/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
1AM_CFLAGS = -I$(top_srcdir)/include
2
3check_PROGRAMS = test
4
5TESTS = test
6test_SOURCES = test.c
7test_LDADD = -lcrypto -lssl $(top_builddir)/src/libtls.la
diff --git a/libtls-standalone/tests/test.c b/libtls-standalone/tests/test.c
deleted file mode 100644
index 4069332..0000000
--- a/libtls-standalone/tests/test.c
+++ /dev/null
@@ -1,51 +0,0 @@
1#include <stdio.h>
2#include <tls.h>
3
4int main()
5{
6 struct tls *tls;
7 struct tls_config *tls_config;
8 ssize_t written, read;
9 char buf[4096];
10
11 if (tls_init() != 0) {
12 fprintf(stderr, "tls_init failed");
13 return 1;
14 }
15
16 if ((tls = tls_client()) == NULL)
17 goto err;
18
19 if ((tls_config = tls_config_new()) == NULL)
20 goto err;
21
22 if (tls_config_set_ciphers(tls_config, "compat") != 0)
23 goto err;
24
25 tls_config_insecure_noverifycert(tls_config);
26 tls_config_insecure_noverifyname(tls_config);
27
28 if (tls_configure(tls, tls_config) != 0)
29 goto err;
30
31 if (tls_connect(tls, "google.com", "443") != 0)
32 goto err;
33
34 if ((written = tls_write(tls, "GET /\r\n", 7)) < 0)
35 goto err;
36
37 if ((read = tls_read(tls, buf, sizeof(buf))) < 0)
38 goto err;
39
40 buf[read - 1] = '\0';
41 puts(buf);
42
43 if (tls_close(tls) != 0)
44 goto err;
45
46 return 0;
47
48err:
49 fprintf(stderr, "%s\n", tls_error(tls));
50 return 1;
51}
diff --git a/patches/tls.h.patch b/patches/tls.h.patch
index 3d72749..180101d 100644
--- a/patches/tls.h.patch
+++ b/patches/tls.h.patch
@@ -3,7 +3,7 @@
3@@ -22,6 +22,13 @@ 3@@ -22,6 +22,13 @@
4 extern "C" { 4 extern "C" {
5 #endif 5 #endif
6 6
7+#ifdef _MSC_VER 7+#ifdef _MSC_VER
8+#ifndef LIBRESSL_INTERNAL 8+#ifndef LIBRESSL_INTERNAL
9+#include <basetsd.h> 9+#include <basetsd.h>
@@ -12,21 +12,5 @@
12+#endif 12+#endif
13+ 13+
14 #include <sys/types.h> 14 #include <sys/types.h>
15 15
16 #include <stddef.h>
17--- libtls-standalone/include/tls.h.orig 2017-02-13 20:21:48.297958529 +0900
18+++ libtls-standalone/include/tls.h 2017-02-13 20:21:48.296958502 +0900
19@@ -22,6 +22,13 @@
20 extern "C" {
21 #endif
22
23+#ifdef _MSC_VER
24+#ifndef LIBRESSL_INTERNAL
25+#include <basetsd.h>
26+typedef SSIZE_T ssize_t;
27+#endif
28+#endif
29+
30 #include <sys/types.h>
31
32 #include <stddef.h> 16 #include <stddef.h>
diff --git a/update.sh b/update.sh
index 20d32f8..0ed7834 100755
--- a/update.sh
+++ b/update.sh
@@ -46,7 +46,6 @@ echo $libssl_version > ssl/VERSION
46libtls_version=$major:$minor:0 46libtls_version=$major:$minor:0
47echo "libtls version $libtls_version" 47echo "libtls version $libtls_version"
48echo $libtls_version > tls/VERSION 48echo $libtls_version > tls/VERSION
49echo $major.$minor.0 > libtls-standalone/VERSION
50 49
51do_mv() { 50do_mv() {
52 if ! cmp -s "$1" "$2" 51 if ! cmp -s "$1" "$2"
@@ -76,9 +75,8 @@ $CP $libcrypto_src/opensslfeatures.h include/openssl
76$CP $libssl_src/pqueue.h include 75$CP $libssl_src/pqueue.h include
77 76
78$CP $libtls_src/tls.h include 77$CP $libtls_src/tls.h include
79$CP $libtls_src/tls.h libtls-standalone/include
80 78
81for i in crypto/compat libtls-standalone/compat; do 79for i in crypto/compat; do
82 for j in $libc_src/crypt/arc4random.c \ 80 for j in $libc_src/crypt/arc4random.c \
83 $libc_src/crypt/arc4random_uniform.c \ 81 $libc_src/crypt/arc4random_uniform.c \
84 $libc_src/crypt/chacha_private.h \ 82 $libc_src/crypt/chacha_private.h \
@@ -99,15 +97,6 @@ for i in crypto/compat libtls-standalone/compat; do
99 done 97 done
100done 98done
101 99
102$CP include/compat/stdlib.h \
103 include/compat/string.h \
104 include/compat/unistd.h \
105 libtls-standalone/include
106
107$CP crypto/compat/arc4random*.h \
108 crypto/compat/bsd-asprintf.c \
109 libtls-standalone/compat
110
111(cd $libcrypto_src/objects/; 100(cd $libcrypto_src/objects/;
112 perl objects.pl objects.txt obj_mac.num obj_mac.h; 101 perl objects.pl objects.txt obj_mac.num obj_mac.h;
113 perl obj_dat.pl obj_mac.h obj_dat.h ) 102 perl obj_dat.pl obj_mac.h obj_dat.h )
@@ -243,19 +232,11 @@ rm -f tls/*.c tls/*.h libtls/src/*.c libtls/src/*.h
243for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do 232for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do
244 if [ -e $libtls_src/$i ]; then 233 if [ -e $libtls_src/$i ]; then
245 $CP $libtls_src/$i tls 234 $CP $libtls_src/$i tls
246 $CP $libtls_src/$i libtls-standalone/src
247 fi 235 fi
248done 236done
249# add the libtls symbol export list 237# add the libtls symbol export list
250$GREP '^[A-Za-z0-9_]' < $libtls_src/Symbols.list > tls/tls.sym 238$GREP '^[A-Za-z0-9_]' < $libtls_src/Symbols.list > tls/tls.sym
251 239
252mkdir -p libtls-standalone/m4
253$CP m4/check*.m4 \
254 m4/disable*.m4 \
255 libtls-standalone/m4
256sed -e "s/compat\///" crypto/Makefile.am.arc4random > \
257 libtls-standalone/compat/Makefile.am.arc4random
258
259# copy nc(1) source 240# copy nc(1) source
260echo "copying nc(1) source" 241echo "copying nc(1) source"
261$CP $bin_src/nc/nc.1 apps/nc 242$CP $bin_src/nc/nc.1 apps/nc