From 24a3218467ac9ed1181b234ac005f074d5056053 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 20 Aug 2020 09:53:08 -0500 Subject: remove libtls-standalone, it's unmaintained libtls-standalone was originally intended to make something that could link to any other OpenSSL fork or OpenSSL itself, but I don't think there's anyone who is terribly interested in that after all, so let's clean this up. #610 may be the better solution anyway. --- libtls-standalone/AUTHORS | 0 libtls-standalone/COPYING | 13 ------ libtls-standalone/ChangeLog | 0 libtls-standalone/Makefile.am | 7 --- libtls-standalone/NEWS | 0 libtls-standalone/README | 0 libtls-standalone/compat/Makefile.am | 45 ------------------ libtls-standalone/configure.ac | 52 --------------------- libtls-standalone/include/Makefile.am | 5 -- libtls-standalone/include/string.h | 87 ----------------------------------- libtls-standalone/libtls.pc.in | 16 ------- libtls-standalone/src/Makefile.am | 17 ------- libtls-standalone/tests/Makefile.am | 7 --- libtls-standalone/tests/test.c | 51 -------------------- 14 files changed, 300 deletions(-) delete mode 100644 libtls-standalone/AUTHORS delete mode 100644 libtls-standalone/COPYING delete mode 100644 libtls-standalone/ChangeLog delete mode 100644 libtls-standalone/Makefile.am delete mode 100644 libtls-standalone/NEWS delete mode 100644 libtls-standalone/README delete mode 100644 libtls-standalone/compat/Makefile.am delete mode 100644 libtls-standalone/configure.ac delete mode 100644 libtls-standalone/include/Makefile.am delete mode 100644 libtls-standalone/include/string.h delete mode 100644 libtls-standalone/libtls.pc.in delete mode 100644 libtls-standalone/src/Makefile.am delete mode 100644 libtls-standalone/tests/Makefile.am delete mode 100644 libtls-standalone/tests/test.c diff --git a/libtls-standalone/AUTHORS b/libtls-standalone/AUTHORS deleted file mode 100644 index e69de29..0000000 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 @@ -libtls is ISC licensed as per OpenBSD's normal licensing policy. - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR 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 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 @@ -SUBDIRS = include compat src tests man -ACLOCAL_AMFLAGS = -I m4 - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libtls.pc - -EXTRA_DIST = README VERSION diff --git a/libtls-standalone/NEWS b/libtls-standalone/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/libtls-standalone/README b/libtls-standalone/README deleted file mode 100644 index e69de29..0000000 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 @@ -# -# Copyright (c) 2014-2015 Brent Cook -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src - -noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la - -# compatibility functions that need to be built without optimizations -libcompatnoopt_la_CFLAGS = -O0 -libcompatnoopt_la_SOURCES = - -if !HAVE_EXPLICIT_BZERO -libcompatnoopt_la_SOURCES += explicit_bzero.c -endif - -# other compatibility functions -libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) -libcompat_la_SOURCES = -libcompat_la_LIBADD = $(PLATFORM_LDADD) - -if !HAVE_ASPRINTF -libcompat_la_SOURCES += bsd-asprintf.c -endif - -if !HAVE_STRLCPY -libcompat_la_SOURCES += strlcpy.c -endif - -if !HAVE_STRSEP -libcompat_la_SOURCES += strsep.c -endif - -include 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 @@ -# Copyright (c) 2014-2015 Brent Cook -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -AC_INIT([libtls], m4_esyscmd([tr -d '\n' < VERSION])) -AC_SUBST([LIBTLS_VERSION], m4_esyscmd([sed -e 's/\./:/g' VERSION | tr -d '\n'])) - -AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([subdir-objects]) -AC_CONFIG_MACRO_DIR([m4]) - -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -# This must be called before AC_PROG_CC -USER_CFLAGS="$CFLAGS" - -AC_PROG_CC -AC_PROG_CC_STDC -AM_PROG_CC_C_O -AC_PROG_LIBTOOL -LT_INIT - -CHECK_OS_OPTIONS - -CHECK_C_HARDENING_OPTIONS - -DISABLE_COMPILER_WARNINGS - -CHECK_LIBC_COMPAT -CHECK_LIBC_CRYPTO_COMPAT - -AC_CONFIG_FILES([ - Makefile - include/Makefile - compat/Makefile - man/Makefile - src/Makefile - tests/Makefile - libtls.pc -]) - -AC_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 @@ -noinst_HEADERS = stdlib.h -noinst_HEADERS += string.h -noinst_HEADERS += unistd.h - -include_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 @@ -/* - * Public domain - * string.h compatibility shim - */ - -#ifndef LIBCRYPTOCOMPAT_STRING_H -#define LIBCRYPTOCOMPAT_STRING_H - -#ifdef _MSC_VER -#if _MSC_VER >= 1900 -#include <../ucrt/string.h> -#else -#include <../include/string.h> -#endif -#else -#include_next -#endif - -#include - -#if defined(__sun) || defined(_AIX) || defined(__hpux) -/* Some functions historically defined in string.h were placed in strings.h by - * SUS. Use the same hack as OS X and FreeBSD use to work around on AIX, - * Solaris, and HPUX. - */ -#include -#endif - -#ifndef HAVE_STRCASECMP -int strcasecmp(const char *s1, const char *s2); -int strncasecmp(const char *s1, const char *s2, size_t len); -#endif - -#ifndef HAVE_STRLCPY -size_t strlcpy(char *dst, const char *src, size_t siz); -#endif - -#ifndef HAVE_STRLCAT -size_t strlcat(char *dst, const char *src, size_t siz); -#endif - -#ifndef HAVE_STRNDUP -char * strndup(const char *str, size_t maxlen); -/* the only user of strnlen is strndup, so only build it if needed */ -#ifndef HAVE_STRNLEN -size_t strnlen(const char *str, size_t maxlen); -#endif -#endif - -#ifndef HAVE_STRSEP -char *strsep(char **stringp, const char *delim); -#endif - -#ifndef HAVE_EXPLICIT_BZERO -void explicit_bzero(void *, size_t); -#endif - -#ifndef HAVE_TIMINGSAFE_BCMP -int timingsafe_bcmp(const void *b1, const void *b2, size_t n); -#endif - -#ifndef HAVE_TIMINGSAFE_MEMCMP -int timingsafe_memcmp(const void *b1, const void *b2, size_t len); -#endif - -#ifndef HAVE_MEMMEM -void * memmem(const void *big, size_t big_len, const void *little, - size_t little_len); -#endif - -#ifdef _WIN32 -#include - -static inline char * -posix_strerror(int errnum) -{ - if (errnum == ECONNREFUSED) { - return "Connection refused"; - } - return strerror(errnum); -} - -#define strerror(errnum) posix_strerror(errnum) - -#endif - -#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 @@ -#libtls pkg-config source file - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: LibreSSL-libtls -Description: Secure communications using the TLS socket protocol. -Version: @LIBTLS_VERSION@ -Requires: -Requires.private: libcrypto libssl -Conflicts: -Libs: -L${libdir} -ltls -Libs.private: @LIBS@ -lcrypto -lssl -Cflags: -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 @@ -AM_CFLAGS = -I$(top_srcdir)/include - -lib_LTLIBRARIES = libtls.la - -libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -libtls_la_LIBADD = -lcrypto -lssl -lcrypto $(PLATFORM_LDADD) -libtls_la_LIBADD += $(top_builddir)/compat/libcompat.la -libtls_la_LIBADD += $(top_builddir)/compat/libcompatnoopt.la - -libtls_la_SOURCES = tls.c -libtls_la_SOURCES += tls_bio_cb.c -libtls_la_SOURCES += tls_client.c -libtls_la_SOURCES += tls_config.c -libtls_la_SOURCES += tls_server.c -libtls_la_SOURCES += tls_util.c -libtls_la_SOURCES += tls_verify.c -noinst_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 @@ -AM_CFLAGS = -I$(top_srcdir)/include - -check_PROGRAMS = test - -TESTS = test -test_SOURCES = test.c -test_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 @@ -#include -#include - -int main() -{ - struct tls *tls; - struct tls_config *tls_config; - ssize_t written, read; - char buf[4096]; - - if (tls_init() != 0) { - fprintf(stderr, "tls_init failed"); - return 1; - } - - if ((tls = tls_client()) == NULL) - goto err; - - if ((tls_config = tls_config_new()) == NULL) - goto err; - - if (tls_config_set_ciphers(tls_config, "compat") != 0) - goto err; - - tls_config_insecure_noverifycert(tls_config); - tls_config_insecure_noverifyname(tls_config); - - if (tls_configure(tls, tls_config) != 0) - goto err; - - if (tls_connect(tls, "google.com", "443") != 0) - goto err; - - if ((written = tls_write(tls, "GET /\r\n", 7)) < 0) - goto err; - - if ((read = tls_read(tls, buf, sizeof(buf))) < 0) - goto err; - - buf[read - 1] = '\0'; - puts(buf); - - if (tls_close(tls) != 0) - goto err; - - return 0; - -err: - fprintf(stderr, "%s\n", tls_error(tls)); - return 1; -} -- cgit v1.2.3-55-g6feb From 85eea94598ff4b543777df4bf34d44ef5dfc06c6 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 20 Aug 2020 10:19:23 -0500 Subject: disable some additional libtls-standalone bits --- patches/tls.h.patch | 20 ++------------------ update.sh | 21 +-------------------- 2 files changed, 3 insertions(+), 38 deletions(-) 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 @@ @@ -22,6 +22,13 @@ extern "C" { #endif - + +#ifdef _MSC_VER +#ifndef LIBRESSL_INTERNAL +#include @@ -12,21 +12,5 @@ +#endif + #include - - #include ---- libtls-standalone/include/tls.h.orig 2017-02-13 20:21:48.297958529 +0900 -+++ libtls-standalone/include/tls.h 2017-02-13 20:21:48.296958502 +0900 -@@ -22,6 +22,13 @@ - extern "C" { - #endif - -+#ifdef _MSC_VER -+#ifndef LIBRESSL_INTERNAL -+#include -+typedef SSIZE_T ssize_t; -+#endif -+#endif -+ - #include - + #include diff --git a/update.sh b/update.sh index cc1deb7..afff2f4 100755 --- a/update.sh +++ b/update.sh @@ -46,7 +46,6 @@ echo $libssl_version > ssl/VERSION libtls_version=$major:$minor:0 echo "libtls version $libtls_version" echo $libtls_version > tls/VERSION -echo $major.$minor.0 > libtls-standalone/VERSION do_mv() { if ! cmp -s "$1" "$2" @@ -76,9 +75,8 @@ $CP $libcrypto_src/opensslfeatures.h include/openssl $CP $libssl_src/pqueue.h include $CP $libtls_src/tls.h include -$CP $libtls_src/tls.h libtls-standalone/include -for i in crypto/compat libtls-standalone/compat; do +for i in crypto/compat; do for j in $libc_src/crypt/arc4random.c \ $libc_src/crypt/arc4random_uniform.c \ $libc_src/crypt/chacha_private.h \ @@ -99,15 +97,6 @@ for i in crypto/compat libtls-standalone/compat; do done done -$CP include/compat/stdlib.h \ - include/compat/string.h \ - include/compat/unistd.h \ - libtls-standalone/include - -$CP crypto/compat/arc4random*.h \ - crypto/compat/bsd-asprintf.c \ - libtls-standalone/compat - (cd $libcrypto_src/objects/; perl objects.pl objects.txt obj_mac.num obj_mac.h; 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 for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do if [ -e $libtls_src/$i ]; then $CP $libtls_src/$i tls - $CP $libtls_src/$i libtls-standalone/src fi done # add the libtls symbol export list $GREP '^[A-Za-z0-9_]' < $libtls_src/Symbols.list > tls/tls.sym -mkdir -p libtls-standalone/m4 -$CP m4/check*.m4 \ - m4/disable*.m4 \ - libtls-standalone/m4 -sed -e "s/compat\///" crypto/Makefile.am.arc4random > \ - libtls-standalone/compat/Makefile.am.arc4random - # copy nc(1) source echo "copying nc(1) source" $CP $bin_src/nc/nc.1 apps/nc -- cgit v1.2.3-55-g6feb