aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2015-04-30 04:44:35 -0500
committerBrent Cook <busterb@gmail.com>2015-05-23 19:26:51 -0500
commit28353c1df15c3d0482a10ffe33fa34c053af2c2e (patch)
tree580bf87a6db90c492dd55594f9612d2442331376
parent7de7605b95f2cd2d061720376544d511f71dc063 (diff)
downloadportable-28353c1df15c3d0482a10ffe33fa34c053af2c2e.tar.gz
portable-28353c1df15c3d0482a10ffe33fa34c053af2c2e.tar.bz2
portable-28353c1df15c3d0482a10ffe33fa34c053af2c2e.zip
stub in initial libtls standalone tree
-rw-r--r--.gitignore156
-rw-r--r--libtls-standalone/AUTHORS0
-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/VERSION1
-rw-r--r--libtls-standalone/configure.ac254
-rw-r--r--libtls-standalone/include/Makefile.am27
-rw-r--r--libtls-standalone/include/string.h28
-rw-r--r--libtls-standalone/libtls.pc.in16
-rw-r--r--libtls-standalone/src/Makefile.am18
-rw-r--r--tls/Makefile.am8
-rwxr-xr-xupdate.sh12
14 files changed, 406 insertions, 121 deletions
diff --git a/.gitignore b/.gitignore
index 28cf002..5c62f55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,34 +63,30 @@ tests/*.txt
63# ctags stuff 63# ctags stuff
64TAGS 64TAGS
65 65
66## The initial / makes these files only get ignored in particular directories. 66autom4te.cache
67/autom4te.cache
68 67
69# Libtool adds these, at least sometimes 68# Libtool adds these, at least sometimes
70INSTALL 69INSTALL
71/m4/libtool.m4 70COPYING
72/m4/ltoptions.m4 71m4
73/m4/ltsugar.m4 72
74/m4/ltversion.m4 73aclocal.m4
75/m4/lt~obsolete.m4 74compile
76 75doxygen
77/aclocal.m4 76config.guess
78/compile 77config.log
79/doxygen 78config.status
80/config.guess 79config.sub
81/config.log 80configure
82/config.status 81depcomp
83/config.sub 82config.h
84/configure 83config.h.in
85/depcomp 84install-sh
86/config.h 85libtool
87/config.h.in 86ltmain.sh
88/install-sh 87missing
89/libtool 88stamp-h1
90/ltmain.sh 89stamp-h2
91/missing
92/stamp-h1
93/stamp-h2
94 90
95include/openssl/Makefile.am 91include/openssl/Makefile.am
96 92
@@ -106,97 +102,31 @@ include/pqueue.h
106include/tls.h 102include/tls.h
107include/openssl/*.h 103include/openssl/*.h
108include/openssl/*.he 104include/openssl/*.he
109apps/*.h 105
110apps/*.c 106/apps/*.h
111apps/openssl 107/apps/*.c
112apps/openssl.cnf 108/apps/openssl
113!apps/apps_win.c 109/apps/openssl.cnf
114!apps/poll_win.c 110!/apps/apps_win.c
115!apps/certhash_disabled.c 111!/apps/poll_win.c
116 112!/apps/certhash_disabled.c
117crypto/compat/arc4random.c 113
118crypto/compat/chacha_private.h 114/crypto
119crypto/compat/explicit_bzero.c 115!/crypto/Makefile.am.*
120crypto/compat/getentropy_*.c 116!/crypto/compat/arc4random.h
121crypto/compat/reallocarray.c 117!/crypto/compat/b_win.c
122crypto/compat/strlcat.c 118!/crypto/compat/bsd_asprintf.c
123crypto/compat/strlcpy.c 119!/crypto/compat/ui_openssl_win.c
124crypto/compat/strndup.c 120
125crypto/compat/strnlen.c 121/libtls-standalone/include/*.h
126crypto/compat/timingsafe_bcmp.c 122/libtls-standalone/src/*.c
127crypto/compat/timingsafe_memcmp.c 123/libtls-standalone/src/*.h
128crypto/compat/arc4random_*.h 124/libtls-standalone/src/compat
129 125
130crypto/aes/
131crypto/asn1/
132crypto/bf/
133crypto/bio/
134crypto/bn/
135crypto/buffer/
136crypto/camellia/
137crypto/cast/
138crypto/camellia/
139crypto/chacha/
140crypto/cmac/
141crypto/comp/
142crypto/conf/
143crypto/cpt_err.c
144crypto/cryptlib.c
145crypto/cryptlib.h
146crypto/cversion.c
147crypto/des/
148crypto/dh/
149crypto/dsa/
150crypto/dso/
151crypto/ec/
152crypto/ecdh/
153crypto/ecdsa/
154crypto/engine/
155crypto/err/
156crypto/evp/
157crypto/ex_data.c
158crypto/gost/
159crypto/hmac/
160crypto/idea/
161crypto/krb5/
162crypto/lhash/
163crypto/malloc-wrapper.c
164crypto/md32_common.h
165crypto/md4/
166crypto/md5/
167crypto/mdc2/
168crypto/mem_clr.c
169crypto/mem_dbg.c
170crypto/modes/
171crypto/o_init.c
172crypto/o_str.c
173crypto/o_time.c
174crypto/o_time.h
175crypto/objects
176crypto/ocsp/
177crypto/pem/
178crypto/pkcs12/
179crypto/pkcs7/
180crypto/poly1305/
181crypto/pqueue/
182crypto/rand/
183crypto/rc2/
184crypto/rc4/
185crypto/ripemd/
186crypto/rsa/
187crypto/sha/
188crypto/stack/
189crypto/ts/
190crypto/txt_db/
191crypto/ui/
192crypto/whrlpool/
193crypto/x509/
194crypto/x509v3/
195openbsd/ 126openbsd/
127
196*.tar.gz 128*.tar.gz
197apps/*.1* 129apps/*.1*
198man/*.3 130man/*.3
199man/*.1 131man/*.1
200man/Makefile.am 132man/Makefile.am
201.gitmodules
202COPYING
diff --git a/libtls-standalone/AUTHORS b/libtls-standalone/AUTHORS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libtls-standalone/AUTHORS
diff --git a/libtls-standalone/ChangeLog b/libtls-standalone/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libtls-standalone/ChangeLog
diff --git a/libtls-standalone/Makefile.am b/libtls-standalone/Makefile.am
new file mode 100644
index 0000000..8881d8c
--- /dev/null
+++ b/libtls-standalone/Makefile.am
@@ -0,0 +1,7 @@
1SUBDIRS = include src
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
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libtls-standalone/NEWS
diff --git a/libtls-standalone/README b/libtls-standalone/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libtls-standalone/README
diff --git a/libtls-standalone/VERSION b/libtls-standalone/VERSION
new file mode 100644
index 0000000..81ece01
--- /dev/null
+++ b/libtls-standalone/VERSION
@@ -0,0 +1 @@
3:1:0
diff --git a/libtls-standalone/configure.ac b/libtls-standalone/configure.ac
new file mode 100644
index 0000000..babb266
--- /dev/null
+++ b/libtls-standalone/configure.ac
@@ -0,0 +1,254 @@
1AC_INIT([libtls], m4_esyscmd([tr -d '\n' < VERSION]))
2
3AC_CANONICAL_HOST
4AM_INIT_AUTOMAKE([subdir-objects])
5AC_CONFIG_MACRO_DIR([m4])
6
7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9# This must be called before AC_PROG_CC
10USER_CFLAGS="$CFLAGS"
11
12AC_PROG_CC
13AC_PROG_CC_STDC
14AM_PROG_CC_C_O
15AC_PROG_LIBTOOL
16LT_INIT
17
18CFLAGS="$CFLAGS -Wall -std=gnu99"
19
20case $host_os in
21 *aix*)
22 HOST_OS=aix
23 if test "`echo $CC | cut -d ' ' -f 1`" != "gcc" ; then
24 CFLAGS="$USER_CFLAGS"
25 fi
26 ;;
27 *cygwin*)
28 HOST_OS=cygwin
29 ;;
30 *darwin*)
31 HOST_OS=darwin
32 HOST_ABI=macosx
33 ;;
34 *freebsd*)
35 HOST_OS=freebsd
36 HOST_ABI=elf
37 ;;
38 *hpux*)
39 HOST_OS=hpux;
40 if test "`echo $CC | cut -d ' ' -f 1`" = "gcc" ; then
41 CFLAGS="$CFLAGS -mlp64"
42 else
43 CFLAGS="-g -O2 +DD64 $USER_CFLAGS"
44 fi
45 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT"
46 AC_SUBST([PLATFORM_LDADD], ['-lpthread'])
47 ;;
48 *linux*)
49 HOST_OS=linux
50 HOST_ABI=elf
51 CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
52 ;;
53 *netbsd*)
54 HOST_OS=netbsd
55 CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE"
56 ;;
57 *openbsd*)
58 HOST_ABI=elf
59 AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded])
60 ;;
61 *mingw*)
62 HOST_OS=win
63 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_POSIX -D_POSIX_SOURCE -D__USE_MINGW_ANSI_STDIO"
64 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS"
65 CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
66 CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG"
67 CFLAGS="$CFLAGS -static-libgcc"
68 LDFLAGS="$LDFLAGS -static-libgcc"
69 AC_SUBST([PLATFORM_LDADD], ['-lws2_32'])
70 ;;
71 *solaris*)
72 HOST_OS=solaris
73 HOST_ABI=elf
74 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP"
75 AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket'])
76 ;;
77 *) ;;
78esac
79
80AM_CONDITIONAL([HOST_AIX], [test x$HOST_OS = xaix])
81AM_CONDITIONAL([HOST_CYGWIN], [test x$HOST_OS = xcygwin])
82AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin])
83AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd])
84AM_CONDITIONAL([HOST_HPUX], [test x$HOST_OS = xhpux])
85AM_CONDITIONAL([HOST_LINUX], [test x$HOST_OS = xlinux])
86AM_CONDITIONAL([HOST_NETBSD], [test x$HOST_OS = xnetbsd])
87AM_CONDITIONAL([HOST_SOLARIS], [test x$HOST_OS = xsolaris])
88AM_CONDITIONAL([HOST_WIN], [test x$HOST_OS = xwin])
89
90AC_MSG_CHECKING([if compiling with clang])
91AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
92#ifndef __clang__
93 not clang
94#endif
95 ]])],
96 [CLANG=yes],
97 [CLANG=no]
98)
99AC_MSG_RESULT([$CLANG])
100AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments])
101
102CFLAGS="$CFLAGS $CLANG_FLAGS"
103LDFLAGS="$LDFLAGS $CLANG_FLAGS"
104
105# We want to check for compiler flag support. Prior to clang v5.1, there was no
106# way to make clang's "argument unused" warning fatal. So we invoke the
107# compiler through a wrapper script that greps for this message.
108saved_CC="$CC"
109saved_LD="$LD"
110flag_wrap="$srcdir/scripts/wrap-compiler-for-flag-check"
111CC="$flag_wrap $CC"
112LD="$flag_wrap $LD"
113
114AC_ARG_ENABLE([hardening],
115 [AS_HELP_STRING([--disable-hardening],
116 [Disable options to frustrate memory corruption exploits])],
117 [], [enable_hardening=yes])
118
119AC_ARG_ENABLE([windows-ssp],
120 [AS_HELP_STRING([--enable-windows-ssp],
121 [Enable building the stack smashing protection on
122 Windows. This currently distributing libssp-0.dll.])])
123
124AC_DEFUN([CHECK_CFLAG], [
125 AC_LANG_ASSERT(C)
126 AC_MSG_CHECKING([if $saved_CC supports "$1"])
127 old_cflags="$CFLAGS"
128 CFLAGS="$1 -Wall -Werror"
129 AC_TRY_LINK([
130 #include <stdio.h>
131 ],
132 [printf("Hello")],
133 AC_MSG_RESULT([yes])
134 CFLAGS=$old_cflags
135 HARDEN_CFLAGS="$HARDEN_CFLAGS $1",
136 AC_MSG_RESULT([no])
137 CFLAGS=$old_cflags
138 [$2])
139])
140
141AC_DEFUN([CHECK_LDFLAG], [
142 AC_LANG_ASSERT(C)
143 AC_MSG_CHECKING([if $saved_LD supports "$1"])
144 old_ldflags="$LDFLAGS"
145 LDFLAGS="$1 -Wall -Werror"
146 AC_TRY_LINK([
147 #include <stdio.h>
148 ],
149 [printf("Hello")],
150 AC_MSG_RESULT([yes])
151 LDFLAGS=$old_ldflags
152 HARDEN_LDFLAGS="$HARDEN_LDFLAGS $1",
153 AC_MSG_RESULT([no])
154 LDFLAGS=$old_ldflags
155 [$2])
156])
157
158AS_IF([test "x$enable_hardening" = "xyes"], [
159 # Tell GCC to NOT optimize based on signed arithmetic overflow
160 CHECK_CFLAG([[-fno-strict-overflow]])
161
162 # _FORTIFY_SOURCE replaces builtin functions with safer versions.
163 CHECK_CFLAG([[-D_FORTIFY_SOURCE=2]])
164
165 # Enable read only relocations
166 CHECK_LDFLAG([[-Wl,-z,relro]])
167 CHECK_LDFLAG([[-Wl,-z,now]])
168
169 # Windows security flags
170 AS_IF([test "x$HOST_OS" = "xwin"], [
171 CHECK_LDFLAG([[-Wl,--nxcompat]])
172 CHECK_LDFLAG([[-Wl,--dynamicbase]])
173 CHECK_LDFLAG([[-Wl,--high-entropy-va]])
174 ])
175
176 # Use stack-protector-strong if available; if not, fallback to
177 # stack-protector-all which is considered to be overkill
178 AS_IF([test "x$enable_windows_ssp" = "xyes" -o "x$HOST_OS" != "xwin"], [
179 CHECK_CFLAG([[-fstack-protector-strong]],
180 CHECK_CFLAG([[-fstack-protector-all]],
181 AC_MSG_WARN([compiler does not appear to support stack protection])
182 )
183 )
184 AS_IF([test "x$HOST_OS" = "xwin"], [
185 AC_SEARCH_LIBS([__stack_chk_guard],[ssp])
186 ])
187 ])
188])
189
190
191# Restore CC, LD
192CC="$saved_CC"
193LD="$saved_LD"
194
195CFLAGS="$CFLAGS $HARDEN_CFLAGS"
196LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS"
197
198# Removing the dependency on -Wno-pointer-sign should be a goal
199save_cflags="$CFLAGS"
200CFLAGS=-Wno-pointer-sign
201AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
202AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
203 [AC_MSG_RESULT([yes])]
204 [AM_CFLAGS=-Wno-pointer-sign],
205 [AC_MSG_RESULT([no])]
206)
207CFLAGS="$save_cflags $AM_CFLAGS"
208
209save_cflags="$CFLAGS"
210CFLAGS=
211AC_MSG_CHECKING([whether AS supports .note.GNU-stack])
212AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
213__asm__(".section .note.GNU-stack,\"\",@progbits");]])],
214 [AC_MSG_RESULT([yes])]
215 [AM_CFLAGS=-DHAVE_GNU_STACK],
216 [AC_MSG_RESULT([no])]
217)
218CFLAGS="$save_cflags $AM_CFLAGS"
219AM_PROG_AS
220
221AC_CHECK_FUNCS([explicit_bzero strsep])
222AM_CONDITIONAL([HAVE_EXPLICIT_BZERO], [test "x$ac_cv_func_explicit_bzero" = xyes])
223AM_CONDITIONAL([HAVE_STRSEP], [test "x$ac_cv_func_strsep" = xyes])
224
225#AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval])
226#AC_CHECK_FUNCS([getentropy memmem poll reallocarray])
227#AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strtonum])
228#AC_CHECK_FUNCS([symlink])
229#AC_CHECK_FUNCS([timingsafe_bcmp timingsafe_memcmp])
230#
231## Share test results with automake
232#AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF], [test "x$ac_cv_func_arc4random_buf" = xyes])
233#AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes])
234#AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = xyes])
235#AM_CONDITIONAL([HAVE_MEMMEM], [test "x$ac_cv_func_memmem" = xyes])
236#AM_CONDITIONAL([HAVE_POLL], [test "x$ac_cv_func_poll" = xyes])
237#AM_CONDITIONAL([HAVE_REALLOCARRAY], [test "x$ac_cv_func_reallocarray" = xyes])
238#AM_CONDITIONAL([HAVE_STRLCAT], [test "x$ac_cv_func_strlcat" = xyes])
239#AM_CONDITIONAL([HAVE_STRLCPY], [test "x$ac_cv_func_strlcpy" = xyes])
240#AM_CONDITIONAL([HAVE_STRNDUP], [test "x$ac_cv_func_strndup" = xyes])
241#AM_CONDITIONAL([HAVE_STRNLEN], [test "x$ac_cv_func_strnlen" = xyes])
242#AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes])
243#AM_CONDITIONAL([HAVE_TIMINGSAFE_BCMP], [test "x$ac_cv_func_timingsafe_bcmp" = xyes])
244#AM_CONDITIONAL([HAVE_TIMINGSAFE_MEMCMP], [test "x$ac_cv_func_timingsafe_memcmp" = xyes])
245#AM_CONDITIONAL([BUILD_CERTHASH], [test "x$ac_cv_func_symlink" = xyes])
246
247AC_CONFIG_FILES([
248 Makefile
249 include/Makefile
250 src/Makefile
251 libtls.pc
252])
253
254AC_OUTPUT
diff --git a/libtls-standalone/include/Makefile.am b/libtls-standalone/include/Makefile.am
new file mode 100644
index 0000000..7fbefdc
--- /dev/null
+++ b/libtls-standalone/include/Makefile.am
@@ -0,0 +1,27 @@
1#noinst_HEADERS = err.h
2#noinst_HEADERS += netdb.h
3#noinst_HEADERS += poll.h
4#noinst_HEADERS += pqueue.h
5#noinst_HEADERS += stdio.h
6#noinst_HEADERS += stdlib.h
7#noinst_HEADERS += string.h
8#noinst_HEADERS += syslog.h
9#noinst_HEADERS += unistd.h
10#noinst_HEADERS += win32netcompat.h
11#
12#noinst_HEADERS += arpa/inet.h
13#
14#noinst_HEADERS += machine/endian.h
15#
16#noinst_HEADERS += netinet/in.h
17#noinst_HEADERS += netinet/tcp.h
18#
19#noinst_HEADERS += sys/ioctl.h
20#noinst_HEADERS += sys/mman.h
21#noinst_HEADERS += sys/select.h
22#noinst_HEADERS += sys/socket.h
23#noinst_HEADERS += sys/times.h
24#noinst_HEADERS += sys/types.h
25#noinst_HEADERS += sys/uio.h
26
27include_HEADERS = tls.h
diff --git a/libtls-standalone/include/string.h b/libtls-standalone/include/string.h
new file mode 100644
index 0000000..c42fcba
--- /dev/null
+++ b/libtls-standalone/include/string.h
@@ -0,0 +1,28 @@
1/*
2 * Public domain
3 * string.h compatibility shim
4 */
5
6#include_next <string.h>
7
8#ifndef LIBCRYPTOCOMPAT_STRING_H
9#define LIBCRYPTOCOMPAT_STRING_H
10
11#include <sys/types.h>
12
13#if defined(__sun) || defined(__hpux)
14/* Some functions historically defined in string.h were placed in strings.h by
15 * SUS. Use the same hack as OS X and FreeBSD use to work around on Solaris and HPUX.
16 */
17#include <strings.h>
18#endif
19
20#ifndef HAVE_EXPLICIT_BZERO
21void explicit_bzero(void *, size_t);
22#endif
23
24#ifndef HAVE_STRSEP
25char *strsep(char **stringp, const char *delim);
26#endif
27
28#endif
diff --git a/libtls-standalone/libtls.pc.in b/libtls-standalone/libtls.pc.in
new file mode 100644
index 0000000..64d7457
--- /dev/null
+++ b/libtls-standalone/libtls.pc.in
@@ -0,0 +1,16 @@
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
new file mode 100644
index 0000000..d5bcc49
--- /dev/null
+++ b/libtls-standalone/src/Makefile.am
@@ -0,0 +1,18 @@
1AM_CFLAGS = -I$(top_srcdir)/include
2
3lib_LTLIBRARIES = libtls.la
4
5libtls_la_LDFLAGS = -no-undefined
6libtls_la_LIBADD = -lcrypto -lssl $(PLATFORM_LDADD)
7
8libtls_la_SOURCES = tls.c
9libtls_la_SOURCES += tls_client.c
10libtls_la_SOURCES += tls_config.c
11libtls_la_SOURCES += tls_server.c
12libtls_la_SOURCES += tls_util.c
13libtls_la_SOURCES += tls_verify.c
14noinst_HEADERS = tls_internal.h
15
16if !HAVE_STRSEP
17libtls_la_SOURCES += strsep.c
18endif
diff --git a/tls/Makefile.am b/tls/Makefile.am
index e8c4713..d5bcc49 100644
--- a/tls/Makefile.am
+++ b/tls/Makefile.am
@@ -1,11 +1,9 @@
1include $(top_srcdir)/Makefile.am.common 1AM_CFLAGS = -I$(top_srcdir)/include
2 2
3lib_LTLIBRARIES = libtls.la 3lib_LTLIBRARIES = libtls.la
4 4
5EXTRA_DIST = VERSION 5libtls_la_LDFLAGS = -no-undefined
6 6libtls_la_LIBADD = -lcrypto -lssl $(PLATFORM_LDADD)
7libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined
8libtls_la_LIBADD = ../crypto/libcrypto.la ../ssl/libssl.la $(PLATFORM_LDADD)
9 7
10libtls_la_SOURCES = tls.c 8libtls_la_SOURCES = tls.c
11libtls_la_SOURCES += tls_client.c 9libtls_la_SOURCES += tls_client.c
diff --git a/update.sh b/update.sh
index 7863b18..d2e74c7 100755
--- a/update.sh
+++ b/update.sh
@@ -43,6 +43,7 @@ source $libtls_src/shlib_version
43libtls_version=$major:$minor:0 43libtls_version=$major:$minor:0
44echo "libtls version $libtls_version" 44echo "libtls version $libtls_version"
45echo $libtls_version > tls/VERSION 45echo $libtls_version > tls/VERSION
46echo $libtls_version > libtls-standalone/VERSION
46 47
47do_mv() { 48do_mv() {
48 if ! cmp -s "$1" "$2" 49 if ! cmp -s "$1" "$2"
@@ -62,6 +63,7 @@ $CP $libssl_src/src/crypto/opensslfeatures.h include/openssl
62$CP $libssl_src/src/e_os2.h include/openssl 63$CP $libssl_src/src/e_os2.h include/openssl
63$CP $libssl_src/src/ssl/pqueue.h include 64$CP $libssl_src/src/ssl/pqueue.h include
64$CP $libtls_src/tls.h include 65$CP $libtls_src/tls.h include
66$CP $libtls_src/tls.h libtls-standalone/include
65 67
66for i in explicit_bzero.c strlcpy.c strlcat.c strndup.c strnlen.c \ 68for i in explicit_bzero.c strlcpy.c strlcat.c strndup.c strnlen.c \
67 timingsafe_bcmp.c timingsafe_memcmp.c; do 69 timingsafe_bcmp.c timingsafe_memcmp.c; do
@@ -73,6 +75,9 @@ $CP $libc_src/crypt/chacha_private.h crypto/compat
73$CP $libcrypto_src/crypto/getentropy_*.c crypto/compat 75$CP $libcrypto_src/crypto/getentropy_*.c crypto/compat
74$CP $libcrypto_src/crypto/arc4random_*.h crypto/compat 76$CP $libcrypto_src/crypto/arc4random_*.h crypto/compat
75 77
78$CP $libcrypto_src/crypto/getentropy_*.c libtls-standalone/src/compat
79$CP $libcrypto_src/crypto/arc4random_*.h libtls-standalone/src/compat
80
76(cd $libssl_src/src/crypto/objects/; 81(cd $libssl_src/src/crypto/objects/;
77 perl objects.pl objects.txt obj_mac.num obj_mac.h; 82 perl objects.pl objects.txt obj_mac.num obj_mac.h;
78 perl obj_dat.pl obj_mac.h obj_dat.h ) 83 perl obj_dat.pl obj_mac.h obj_dat.h )
@@ -166,14 +171,15 @@ done
166 171
167# copy libtls source 172# copy libtls source
168echo copying libtls source 173echo copying libtls source
169rm -f tls/*.c tls/*.h 174rm -f tls/*.c tls/*.h libtls/src/*.c libtls/src/*.h
170for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do 175for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do
171 if [ -e $libtls_src/$i ]; then 176 if [ -e $libtls_src/$i ]; then
172 $CP $libtls_src/$i tls 177 $CP $libtls_src/$i tls
173 else 178 $CP $libtls_src/$i libtls-standalone/src
174 $CP $libc_src/string/$i tls
175 fi 179 fi
176done 180done
181$CP $libc_src/string/strsep.c tls
182$CP $libc_src/string/strsep.c libtls-standalone/src/compat
177 183
178# copy openssl(1) source 184# copy openssl(1) source
179echo "copying openssl(1) source" 185echo "copying openssl(1) source"