aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog186
-rw-r--r--apps/nc/Makefile.am6
-rw-r--r--configure.ac3
-rw-r--r--crypto/Makefile.am13
-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--libtls.pc.in3
-rw-r--r--patches/tls.h.patch20
-rw-r--r--ssl/Makefile.am9
-rw-r--r--tls/Makefile.am9
-rwxr-xr-xupdate.sh21
23 files changed, 223 insertions, 347 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a70b14..24de35e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,192 @@ history is also available from Git.
28 28
29LibreSSL Portable Release Notes: 29LibreSSL Portable Release Notes:
30 30
313.2.2 - Stable release
32
33 * Define OPENSSL_NO_SSL_TRACE in opensslfeatures.h.
34
35 * Start replacing the existing TLSv1.2 record layer.
36
37 * Send alert on ssl_get_prev_session() failure.
38
39 * Simplify return codes for tls1_process_ticket() and
40 tls_decrypt_ticket().
41
42 * Simplify tls_decrypt_ticket() exit path.
43
44 * Copy the session id directly in ssl_get_prev_session() instead of
45 handing it through several functions for copying.
46
47 * Split session retrieval out of ssl_get_prev_session().
48
49 * Zero out variable on the stack to avoid leaving garbage in the tail
50 of short session ids.
51
52 * Remove unnecessary zeroing after recallocarray() in
53 ASN1_BIT_STRING_set_bit().
54
55 * Rewrite X509_INFO_{new,free}() more idiomatically.
56
57 * Import commented versions of the latest OPENSSL_NO_* flags from
58 OpenSSL 1.1.1g.
59
60 * Document return value from EC_KEY_get0_public_key(3).
61
62 * Set alpn_selected_len = 0 whenever alpn_selected is NULL.
63
64 * Add option type OPTION_UL_VALUE_OR to openssl(1) option parser.
65
66 * Convert openssl(1) ocsp option handling.
67
68 * Major style cleanup in ocsp.c.
69
70 * Assorted ciphers related cleanup in ssl_lib.c.
71
72 * Add issuer cache in preparation for changes to the validation code.
73
74 * Replace some SSL_AD_* with TLS13_ALERT_* defines in the new TLSv1.3
75 code.
76
77 * Rename ssl_cipher_is_permitted() to the more accurate and specific
78 ssl_cipher_allowed_in_version_range().
79
80 * Simplify SSL_get_ciphers().
81
82 * Remove cipher_list_by_id.
83
84 * Add a new implementation of X509 name constraints with regression
85 tests.
86
87 * Fix and re-enable cert and cipher interop tests.
88
89 * Include machine/endian.h gost2814789.c in order to pick up the
90 __STRICT_ALIGNMENT define.
91
92 * Enable the new X509 name constraints verification.
93
94 * Avoid an out-of-bounds write in BN_rand().
95
96 * Simplify tls1_set_ec_id().
97
98 * Use uint16_t for curve_id.
99
100 * Improve the handling of BIO_read()/BIO_write() failures in the
101 TLSv1.3 stack.
102
103 * Add a new certificate chain validator.
104
105 The new validator finds multiple validated chains to handle the
106 modern PKI cases which may frequently have multiple paths via
107 different intermediates to different roots. It is loosely based on
108 golang's X509 validator.
109
110 This includes integration so that the new validator can be used via
111 X509_verify_cert() as well as a new API x509_verify() which will
112 return multiple chains (similar to go).
113
114 The new public API is not yet exposed, and will be finalized and
115 exposed with a man page and a library minor bump later.
116
117 * Implement SSL_{CTX_,}set_ciphersuites() and add regress. This is not
118 yet public API and will be enabled in a future release.
119
120 * Enable the use of the new X509 chain validator by default.
121
122 * Fix double frees and a NULL dereference introduced on review of the
123 new validator.
124
125 * Remove various unused variables in the X509 code.
126
127 * Fix memory leaks in x509_constraints_chain() and
128 X509V3_ext_add_alias().
129
130 * Add initial manual page for the x509_verify() chain validator which
131 will be installed once the new API is publically exposed.
132
133 * Avoid NULL deref in SSL_{,CTX_}set_ciphersuites().
134
135 * Clean up and simplify SSL_set_session().
136
137 * Move state initialization from SSL_clear() to ssl3_clear() to ensure
138 that it gets correctly reinitialized across a SSL_set_ssl_method()
139 call.
140
141 * Test the Botan TLS client with LibreSSL, OpenSSL 1.0.2 and 1.1.1
142 servers.
143
144 * Mop up the get_ssl_method function pointer.
145
146 * Clean up and simplify SSL_set_ssl_method().
147
148 * Deduplicate the time validation code between the legacy and the new
149 verification code.
150
151 * Set error_depth and current_cert to avoid problems in legacy
152 callbacks that don't do proper error checking.
153
154 * Correct a failure case in tls12_record_layer_seal_record_protected().
155
156 * Do not destroy an existing cipher list when ssl_parse_ciphersuites()
157 fails to match the behavior of ssl_create_cipher_list() and
158 SSL_set_ciphersuites() of OpenSSL.
159
160 * Split the tls12_record_layer_write_mac() for future reuse on the
161 read side.
162
163 * Dedup code in x509_verify_ctx_new_from_xsc().
164
165 * Make check in x509_verify_ctx_set_max_signatures() consistent with
166 others.
167
168 * Avoid memset() before memcpy() for CBS_add_bytes().
169
170 * Make SSL_CTX_get_ciphers(NULL) return NULL rather than crash.
171
172 * Simplify SSL method lookups.
173
174 * Prepare to provide most of the TLSv1.3-related OpenSSL 1.1.1 API.
175 This will be finished in an upcoming release.
176
177 * Fix an overflow in the CN subject line parsing.
178
179 * Correctly handle ssl_cert_dup() failure in SSL_set_SSL_CTX().
180
181 * Fix memory leaks in x509_constraints_extract_names().
182
183 * Correct a 1 byte read overflow in x509_constraints_uri().
184
185 * Ensure the chain is set on the X509_STORE_CTX before triggering
186 callback.
187
188 * Release read and write buffers using freezero()
189
190 * Simplify the cleanup of init_buf via an ssl3_release_init_buffer()
191 function.
192
193 * Fix numerous leaks in the UI_dup_* functions.
194
195 * Simplify and tidy up hte code in ui_lib.c.
196
197 * Refactor dtls1_clear_queues() to make it NULL safe.
198
199 * Have dtls1_hm_fragment_new() call dtls1_hm_fragment_free() on
200 failure.
201
202 * Have dtls1_new() call dtls1_free() on failure.
203
204 * Call dtls1_hm_fragment_free() from dtls1_drain_fragments() to fix
205 potential memory leaks.
206
207 * Ensure that leaf is set up on X509_STORE_CTX before verification.
208
209 * Document SSL_set1_host(3).
210
211 * Document SSL_set_SSL_CTX(3).
212
213 * Make pthread_mutex static initialisation work on Windows.
214
215 * Get __STRICT_ALIGNMENT from machine/endian.h with portable build.
216
313.2.1 - Development release 2173.2.1 - Development release
32 218
33 * Propagate alerts from the read half of the TLSv1.3 record layer to I/O 219 * Propagate alerts from the read half of the TLSv1.3 record layer to I/O
diff --git a/apps/nc/Makefile.am b/apps/nc/Makefile.am
index 4b5b561..d678f1e 100644
--- a/apps/nc/Makefile.am
+++ b/apps/nc/Makefile.am
@@ -12,9 +12,9 @@ endif
12EXTRA_DIST = nc.1 12EXTRA_DIST = nc.1
13EXTRA_DIST += CMakeLists.txt 13EXTRA_DIST += CMakeLists.txt
14 14
15nc_LDADD = $(abs_top_builddir)/crypto/libcrypto.la 15nc_LDFLAGS = $(abs_top_builddir)/crypto/.libs/libcrypto.a
16nc_LDADD += $(abs_top_builddir)/ssl/libssl.la 16
17nc_LDADD += $(abs_top_builddir)/tls/libtls.la 17nc_LDADD = $(abs_top_builddir)/tls/libtls.la
18nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD) 18nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)
19 19
20AM_CPPFLAGS += -I$(top_srcdir)/apps/nc/compat 20AM_CPPFLAGS += -I$(top_srcdir)/apps/nc/compat
diff --git a/configure.ac b/configure.ac
index 75b88fe..3aca617 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,8 +29,7 @@ USER_CFLAGS="$CFLAGS"
29AC_PROG_CC([cc gcc]) 29AC_PROG_CC([cc gcc])
30AC_PROG_CC_STDC 30AC_PROG_CC_STDC
31AM_PROG_CC_C_O 31AM_PROG_CC_C_O
32AC_PROG_LIBTOOL 32LT_INIT([pic-only])
33LT_INIT
34 33
35CHECK_OS_OPTIONS 34CHECK_OS_OPTIONS
36 35
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index 7fcfc02..97a84e1 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -20,6 +20,7 @@ EXTRA_DIST += compat/strcasecmp.c
20 20
21BUILT_SOURCES = crypto_portable.sym 21BUILT_SOURCES = crypto_portable.sym
22CLEANFILES = crypto_portable.sym 22CLEANFILES = crypto_portable.sym
23CLEANFILES += libcrypto_la_objects.mk
23 24
24crypto_portable.sym: crypto.sym Makefile 25crypto_portable.sym: crypto.sym Makefile
25 -echo "generating crypto_portable.sym ..." 26 -echo "generating crypto_portable.sym ..."
@@ -93,8 +94,20 @@ if HOST_WIN
93 -mv crypto_portable.sym.tmp crypto_portable.sym 94 -mv crypto_portable.sym.tmp crypto_portable.sym
94endif 95endif
95 96
97libcrypto_la_objects.mk: Makefile
98 @echo "libcrypto_la_objects= $(libcrypto_la_OBJECTS)" \
99 | sed 's/ */ $$\(abs_top_builddir\)\/crypto\//g' \
100 > libcrypto_la_objects.mk
101 @echo "libcompat_la_objects= $(libcompat_la_OBJECTS)" \
102 | sed 's/ */ $$\(abs_top_builddir\)\/crypto\//g' \
103 >> libcrypto_la_objects.mk
104 @echo "libcompatnoopt_la_objects= $(libcompatnoopt_la_OBJECTS)" \
105 | sed 's/ */ $$\(abs_top_builddir\)\/crypto\//g' \
106 >> libcrypto_la_objects.mk
107
96libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym 108libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym
97EXTRA_libcrypto_la_DEPENDENCIES = crypto_portable.sym 109EXTRA_libcrypto_la_DEPENDENCIES = crypto_portable.sym
110EXTRA_libcrypto_la_DEPENDENCIES += libcrypto_la_objects.mk
98libcrypto_la_LIBADD = libcompat.la 111libcrypto_la_LIBADD = libcompat.la
99if !HAVE_EXPLICIT_BZERO 112if !HAVE_EXPLICIT_BZERO
100libcrypto_la_LIBADD += libcompatnoopt.la 113libcrypto_la_LIBADD += libcompatnoopt.la
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/libtls.pc.in b/libtls.pc.in
index 82a6a71..0d4e625 100644
--- a/libtls.pc.in
+++ b/libtls.pc.in
@@ -9,8 +9,7 @@ Name: LibreSSL-libtls
9Description: Secure communications using the TLS socket protocol. 9Description: Secure communications using the TLS socket protocol.
10Version: @VERSION@ 10Version: @VERSION@
11Requires: 11Requires:
12Requires.private: libcrypto libssl
13Conflicts: 12Conflicts:
14Libs: -L${libdir} -ltls 13Libs: -L${libdir} -ltls
15Libs.private: @LIBS@ -lcrypto -lssl @PLATFORM_LDADD@ 14Libs.private: @LIBS@ @PLATFORM_LDADD@
16Cflags: -I${includedir} 15Cflags: -I${includedir}
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/ssl/Makefile.am b/ssl/Makefile.am
index dded59f..4c4e594 100644
--- a/ssl/Makefile.am
+++ b/ssl/Makefile.am
@@ -6,6 +6,15 @@ EXTRA_DIST = VERSION
6EXTRA_DIST += CMakeLists.txt 6EXTRA_DIST += CMakeLists.txt
7EXTRA_DIST += ssl.sym 7EXTRA_DIST += ssl.sym
8 8
9CLEANFILES = libssl_la_objects.mk
10
11EXTRA_libssl_la_DEPENDENCIES = libssl_la_objects.mk
12
13libssl_la_objects.mk: Makefile
14 @echo "libssl_la_objects= $(libssl_la_OBJECTS)" \
15 | sed 's/ */ $$\(abs_top_builddir\)\/ssl\//g' \
16 > libssl_la_objects.mk
17
9libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined -export-symbols $(top_srcdir)/ssl/ssl.sym 18libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined -export-symbols $(top_srcdir)/ssl/ssl.sym
10libssl_la_LIBADD = $(abs_top_builddir)/crypto/libcrypto.la $(PLATFORM_LDADD) 19libssl_la_LIBADD = $(abs_top_builddir)/crypto/libcrypto.la $(PLATFORM_LDADD)
11 20
diff --git a/tls/Makefile.am b/tls/Makefile.am
index 942abf9..4cea3a2 100644
--- a/tls/Makefile.am
+++ b/tls/Makefile.am
@@ -1,5 +1,8 @@
1include $(top_srcdir)/Makefile.am.common 1include $(top_srcdir)/Makefile.am.common
2 2
3-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
4-include $(abs_top_builddir)/ssl/libssl_la_objects.mk
5
3lib_LTLIBRARIES = libtls.la 6lib_LTLIBRARIES = libtls.la
4 7
5EXTRA_DIST = VERSION 8EXTRA_DIST = VERSION
@@ -7,8 +10,10 @@ EXTRA_DIST += CMakeLists.txt
7EXTRA_DIST += tls.sym 10EXTRA_DIST += tls.sym
8 11
9libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym 12libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym
10libtls_la_LIBADD = $(abs_top_builddir)/ssl/libssl.la 13libtls_la_LIBADD = $(libcrypto_la_objects)
11libtls_la_LIBADD += $(abs_top_builddir)/crypto/libcrypto.la 14libtls_la_LIBADD += $(libcompat_la_objects)
15libtls_la_LIBADD += $(libcompatnoopt_la_objects)
16libtls_la_LIBADD += $(libssl_la_objects)
12libtls_la_LIBADD += $(PLATFORM_LDADD) 17libtls_la_LIBADD += $(PLATFORM_LDADD)
13 18
14libtls_la_CPPFLAGS = $(AM_CPPFLAGS) 19libtls_la_CPPFLAGS = $(AM_CPPFLAGS)
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