aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--ChangeLog31
-rw-r--r--Makefile.am6
-rw-r--r--Makefile.am.common4
-rw-r--r--VERSION2
-rw-r--r--apps/Makefile.am1
-rw-r--r--apps/poll_win.c39
-rw-r--r--configure.ac62
-rw-r--r--crypto/Makefile.am14
-rw-r--r--crypto/Makefile.am.elf-x86_6430
-rw-r--r--crypto/Makefile.am.macosx-x86_6430
-rwxr-xr-xdist-win.sh3
-rwxr-xr-xdist.sh2
-rwxr-xr-xgen-coverage-report.sh2
-rw-r--r--include/Makefile.am2
-rwxr-xr-xscripts/travis4
-rw-r--r--ssl/Makefile.am1
-rw-r--r--tests/Makefile.am282
-rw-r--r--tests/Makefile.am.tpl15
-rw-r--r--tls/Makefile.am4
-rwxr-xr-xupdate.sh94
21 files changed, 427 insertions, 202 deletions
diff --git a/.gitignore b/.gitignore
index 6c70806..471ca3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,7 +92,6 @@ INSTALL
92/stamp-h2 92/stamp-h2
93 93
94include/openssl/Makefile.am 94include/openssl/Makefile.am
95tests/Makefile.am
96 95
97crypto/VERSION 96crypto/VERSION
98ssl/VERSION 97ssl/VERSION
diff --git a/ChangeLog b/ChangeLog
index 9c21037..7c1bb29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,37 @@ history is also available from Git.
28 28
29LibreSSL Portable Release Notes: 29LibreSSL Portable Release Notes:
30 30
31This release primarily addresses a number of security issues in coordination
32with the OpenSSL project.
33
342.1.6 - Security update
35
36 * Fixes for the following issues are integrated into LibreSSL 2.1.6:
37 - CVE-2015-0209 - Use After Free following d2i_ECPrivatekey error
38 - CVE-2015-0286 - Segmentation fault in ASN1_TYPE_cmp
39 - CVE-2015-0287 - ASN.1 structure reuse memory corruption
40 - CVE-2015-0288 - X509_to_X509_REQ NULL pointer deref
41 - CVE-2015-0289 - PKCS7 NULL pointer dereferences
42
43 * The fix for CVE-2015-0207 - Segmentation fault in DTLSv1_listen
44 is integrated for safety, but LibreSSL is not vulnerable.
45
46 * Libtls is now built by default. The --enable-libtls
47 configuration option is no longer required.
48 The libtls API is now stable for the 2.1.x series.
49
502.1.5 - Bug fixes and a security update
51 * Fix incorrect comparison function in openssl(1) certhash command.
52 Thanks to Christian Neukirchen / Void Linux.
53
54 * Windows port improvements and bug fixes.
55 - Removed a dependency on libgcc in 32-bit dynamic libraries.
56 - Correct a hang in openssl(1) reading from stdin on an connection.
57 - Initialize winsock in openssl(1) earlier, allow 'openssl ocsp' and
58 any other network-related commands to function properly.
59
60 * Reject all server DH keys smaller than 1024 bits.
61
312.1.4 - Security and feature updates 622.1.4 - Security and feature updates
32 * Improvements to libtls: 63 * Improvements to libtls:
33 - a new API for loading CA chains directly from memory instead of a 64 - a new API for loading CA chains directly from memory instead of a
diff --git a/Makefile.am b/Makefile.am
index 45aa9cc..d3011ec 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,10 +2,6 @@ SUBDIRS = crypto ssl tls include apps tests man
2ACLOCAL_AMFLAGS = -I m4 2ACLOCAL_AMFLAGS = -I m4
3 3
4pkgconfigdir = $(libdir)/pkgconfig 4pkgconfigdir = $(libdir)/pkgconfig
5pkgconfig_DATA = libcrypto.pc libssl.pc openssl.pc 5pkgconfig_DATA = libcrypto.pc libssl.pc libtls.pc openssl.pc
6
7if ENABLE_LIBTLS
8pkgconfig_DATA += libtls.pc
9endif
10 6
11EXTRA_DIST = README README.windows VERSION config scripts 7EXTRA_DIST = README README.windows VERSION config scripts
diff --git a/Makefile.am.common b/Makefile.am.common
index af20a0f..7a25d09 100644
--- a/Makefile.am.common
+++ b/Makefile.am.common
@@ -1,2 +1,2 @@
1AM_CPPFLAGS = -I$(top_srcdir)/include 1AM_CFLAGS = -I$(top_srcdir)/include
2AM_CPPFLAGS += -DLIBRESSL_INTERNAL 2AM_CPPFLAGS = -DLIBRESSL_INTERNAL
diff --git a/VERSION b/VERSION
index 7d2ed7c..ccbccc3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
2.1.4 2.2.0
diff --git a/apps/Makefile.am b/apps/Makefile.am
index 30978c1..3604349 100644
--- a/apps/Makefile.am
+++ b/apps/Makefile.am
@@ -2,7 +2,6 @@ include $(top_srcdir)/Makefile.am.common
2 2
3bin_PROGRAMS = openssl 3bin_PROGRAMS = openssl
4 4
5openssl_CFLAGS = $(USER_CFLAGS)
6openssl_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) 5openssl_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
7openssl_LDADD += $(top_builddir)/ssl/libssl.la 6openssl_LDADD += $(top_builddir)/ssl/libssl.la
8openssl_LDADD += $(top_builddir)/crypto/libcrypto.la 7openssl_LDADD += $(top_builddir)/crypto/libcrypto.la
diff --git a/apps/poll_win.c b/apps/poll_win.c
index bf30ccf..ce47b01 100644
--- a/apps/poll_win.c
+++ b/apps/poll_win.c
@@ -44,6 +44,8 @@ conn_has_oob_data(int fd)
44static int 44static int
45is_socket(int fd) 45is_socket(int fd)
46{ 46{
47 if (fd < 3)
48 return 0;
47 WSANETWORKEVENTS events; 49 WSANETWORKEVENTS events;
48 return (WSAEnumNetworkEvents((SOCKET)fd, NULL, &events) == 0); 50 return (WSAEnumNetworkEvents((SOCKET)fd, NULL, &events) == 0);
49} 51}
@@ -160,10 +162,6 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
160 nfds_t i; 162 nfds_t i;
161 int timespent_ms, looptime_ms; 163 int timespent_ms, looptime_ms;
162 164
163#define FD_IS_SOCKET (1 << 0)
164 int fd_state[FD_SETSIZE];
165 int num_fds;
166
167 /* 165 /*
168 * select machinery 166 * select machinery
169 */ 167 */
@@ -190,14 +188,12 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
190 FD_ZERO(&rfds); 188 FD_ZERO(&rfds);
191 FD_ZERO(&wfds); 189 FD_ZERO(&wfds);
192 FD_ZERO(&efds); 190 FD_ZERO(&efds);
193 num_fds = 0;
194 num_sockets = 0; 191 num_sockets = 0;
195 num_handles = 0; 192 num_handles = 0;
196 193
197 for (i = 0; i < nfds; i++) { 194 for (i = 0; i < nfds; i++) {
198 if ((int)pfds[i].fd < 0) { 195 if ((int)pfds[i].fd < 0)
199 continue; 196 continue;
200 }
201 197
202 if (is_socket(pfds[i].fd)) { 198 if (is_socket(pfds[i].fd)) {
203 if (num_sockets >= FD_SETSIZE) { 199 if (num_sockets >= FD_SETSIZE) {
@@ -205,8 +201,6 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
205 return -1; 201 return -1;
206 } 202 }
207 203
208 fd_state[num_fds] = FD_IS_SOCKET;
209
210 FD_SET(pfds[i].fd, &efds); 204 FD_SET(pfds[i].fd, &efds);
211 205
212 if (pfds[i].events & 206 if (pfds[i].events &
@@ -229,8 +223,6 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
229 handles[num_handles++] = 223 handles[num_handles++] =
230 (HANDLE)_get_osfhandle(pfds[i].fd); 224 (HANDLE)_get_osfhandle(pfds[i].fd);
231 } 225 }
232
233 num_fds++;
234 } 226 }
235 227
236 /* 228 /*
@@ -254,21 +246,22 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
254 * than simply triggering if there is space available. 246 * than simply triggering if there is space available.
255 */ 247 */
256 timespent_ms = 0; 248 timespent_ms = 0;
257 wait_rc = 0; 249 wait_rc = WAIT_FAILED;
258 250
259 if (timeout_ms < 0) { 251 if (timeout_ms < 0)
260 timeout_ms = INFINITE; 252 timeout_ms = INFINITE;
261 }
262 looptime_ms = timeout_ms > 100 ? 100 : timeout_ms; 253 looptime_ms = timeout_ms > 100 ? 100 : timeout_ms;
263 254
264 do { 255 do {
265 struct timeval tv = {0, looptime_ms * 1000}; 256 struct timeval tv = {0, looptime_ms * 1000};
257 int handle_signaled = 0;
266 258
267 /* 259 /*
268 * Check if any file handles have signaled 260 * Check if any file handles have signaled
269 */ 261 */
270 if (num_handles) { 262 if (num_handles) {
271 wait_rc = WaitForMultipleObjects(num_handles, handles, FALSE, 0); 263 wait_rc = WaitForMultipleObjects(num_handles, handles,
264 FALSE, 0);
272 if (wait_rc == WAIT_FAILED) { 265 if (wait_rc == WAIT_FAILED) {
273 /* 266 /*
274 * The documentation for WaitForMultipleObjects 267 * The documentation for WaitForMultipleObjects
@@ -285,18 +278,20 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
285 /* 278 /*
286 * If we signaled on a file handle, don't wait on the sockets. 279 * If we signaled on a file handle, don't wait on the sockets.
287 */ 280 */
288 if (wait_rc >= WAIT_OBJECT_0) 281 if (wait_rc >= WAIT_OBJECT_0 &&
282 (wait_rc <= WAIT_OBJECT_0 + num_handles - 1)) {
289 tv.tv_usec = 0; 283 tv.tv_usec = 0;
284 handle_signaled = 1;
285 }
290 286
291 /* 287 /*
292 * Check if any sockets have signaled 288 * Check if any sockets have signaled
293 */ 289 */
294 rc = select(0, &rfds, &wfds, &efds, &tv); 290 rc = select(0, &rfds, &wfds, &efds, &tv);
295 if (rc == SOCKET_ERROR) { 291 if (!handle_signaled && rc == SOCKET_ERROR)
296 return wsa_select_errno(WSAGetLastError()); 292 return wsa_select_errno(WSAGetLastError());
297 }
298 293
299 if (wait_rc >= WAIT_OBJECT_0 || (num_sockets && rc > 0)) 294 if (handle_signaled || (num_sockets && rc > 0))
300 break; 295 break;
301 296
302 timespent_ms += looptime_ms; 297 timespent_ms += looptime_ms;
@@ -305,14 +300,14 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
305 300
306 rc = 0; 301 rc = 0;
307 num_handles = 0; 302 num_handles = 0;
308 num_fds = 0;
309 for (i = 0; i < nfds; i++) { 303 for (i = 0; i < nfds; i++) {
310 pfds[i].revents = 0; 304 pfds[i].revents = 0;
311 305
312 if ((int)pfds[i].fd < 0) 306 if ((int)pfds[i].fd < 0)
313 continue; 307 continue;
314 308
315 if (fd_state[num_fds] & FD_IS_SOCKET) { 309 if (is_socket(pfds[i].fd)) {
310
316 pfds[i].revents = compute_select_revents(pfds[i].fd, 311 pfds[i].revents = compute_select_revents(pfds[i].fd,
317 pfds[i].events, &rfds, &wfds, &efds); 312 pfds[i].events, &rfds, &wfds, &efds);
318 313
@@ -323,8 +318,6 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
323 num_handles++; 318 num_handles++;
324 } 319 }
325 320
326 num_fds++;
327
328 if (pfds[i].revents) 321 if (pfds[i].revents)
329 rc++; 322 rc++;
330 } 323 }
diff --git a/configure.ac b/configure.ac
index bd370d6..b246808 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,10 +9,18 @@ AC_CONFIG_MACRO_DIR([m4])
9 9
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 11
12AC_SUBST([USER_CFLAGS], "-O2 $CFLAGS") 12AC_PROG_CC
13CFLAGS="$CFLAGS -Wall -std=gnu99 -g" 13AC_PROG_CC_STDC
14AM_PROG_CC_C_O
15AC_PROG_LIBTOOL
16LT_INIT
17
18CFLAGS="$CFLAGS -Wall -std=gnu99"
14 19
15case $host_os in 20case $host_os in
21 *cygwin*)
22 HOST_OS=cygwin
23 ;;
16 *darwin*) 24 *darwin*)
17 HOST_OS=darwin 25 HOST_OS=darwin
18 HOST_ABI=macosx 26 HOST_ABI=macosx
@@ -24,13 +32,14 @@ case $host_os in
24 ;; 32 ;;
25 *hpux*) 33 *hpux*)
26 HOST_OS=hpux; 34 HOST_OS=hpux;
27 CFLAGS="$CFLAGS -mlp64 -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT" 35 CFLAGS="$CFLAGS -mlp64"
36 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT"
28 AC_SUBST([PLATFORM_LDADD], ['-lpthread']) 37 AC_SUBST([PLATFORM_LDADD], ['-lpthread'])
29 ;; 38 ;;
30 *linux*) 39 *linux*)
31 HOST_OS=linux 40 HOST_OS=linux
32 HOST_ABI=elf 41 HOST_ABI=elf
33 CFLAGS="$CFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE" 42 CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
34 ;; 43 ;;
35 *netbsd*) 44 *netbsd*)
36 HOST_OS=netbsd 45 HOST_OS=netbsd
@@ -42,18 +51,24 @@ case $host_os in
42 ;; 51 ;;
43 *mingw*) 52 *mingw*)
44 HOST_OS=win 53 HOST_OS=win
45 CFLAGS="$CFLAGS -D_GNU_SOURCE -D_POSIX -D_POSIX_SOURCE -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600 -DOPENSSL_NO_SPEED -DNO_SYSLOG -D__USE_MINGW_ANSI_STDIO" 54 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_POSIX -D_POSIX_SOURCE -D__USE_MINGW_ANSI_STDIO"
55 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS"
56 CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
57 CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG"
58 CFLAGS="$CFLAGS -static-libgcc"
59 LDFLAGS="$LDFLAGS -static-libgcc"
46 AC_SUBST([PLATFORM_LDADD], ['-lws2_32']) 60 AC_SUBST([PLATFORM_LDADD], ['-lws2_32'])
47 ;; 61 ;;
48 *solaris*) 62 *solaris*)
49 HOST_OS=solaris 63 HOST_OS=solaris
50 HOST_ABI=elf 64 HOST_ABI=elf
51 CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP" 65 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP"
52 AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket']) 66 AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket'])
53 ;; 67 ;;
54 *) ;; 68 *) ;;
55esac 69esac
56 70
71AM_CONDITIONAL([HOST_CYGWIN], [test x$HOST_OS = xcygwin])
57AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin]) 72AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin])
58AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd]) 73AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd])
59AM_CONDITIONAL([HOST_HPUX], [test x$HOST_OS = xhpux]) 74AM_CONDITIONAL([HOST_HPUX], [test x$HOST_OS = xhpux])
@@ -68,11 +83,6 @@ AC_CHECK_FUNC([clock_gettime],,
68AC_CHECK_FUNC([dl_iterate_phdr],, 83AC_CHECK_FUNC([dl_iterate_phdr],,
69 [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])]) 84 [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])])
70 85
71AC_PROG_CC
72AC_PROG_LIBTOOL
73AC_PROG_CC_STDC
74AM_PROG_CC_C_O
75
76AC_MSG_CHECKING([if compiling with clang]) 86AC_MSG_CHECKING([if compiling with clang])
77AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ 87AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
78#ifndef __clang__ 88#ifndef __clang__
@@ -85,6 +95,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
85AC_MSG_RESULT([$CLANG]) 95AC_MSG_RESULT([$CLANG])
86AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments]) 96AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments])
87 97
98CFLAGS="$CFLAGS $CLANG_FLAGS"
99LDFLAGS="$LDFLAGS $CLANG_FLAGS"
100
88# We want to check for compiler flag support. Prior to clang v5.1, there was no 101# We want to check for compiler flag support. Prior to clang v5.1, there was no
89# way to make clang's "argument unused" warning fatal. So we invoke the 102# way to make clang's "argument unused" warning fatal. So we invoke the
90# compiler through a wrapper script that greps for this message. 103# compiler through a wrapper script that greps for this message.
@@ -201,9 +214,6 @@ __asm__(".section .note.GNU-stack,\"\",@progbits");]])],
201CFLAGS="$save_cflags $AM_CFLAGS" 214CFLAGS="$save_cflags $AM_CFLAGS"
202AM_PROG_AS 215AM_PROG_AS
203 216
204CFLAGS="$CFLAGS $CLANG_CFLAGS"
205LDFLAGS="$LDFLAGS $CLANG_FLAGS"
206
207AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) 217AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval])
208AC_CHECK_FUNCS([getentropy issetugid memmem poll reallocarray]) 218AC_CHECK_FUNCS([getentropy issetugid memmem poll reallocarray])
209AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum]) 219AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum])
@@ -284,20 +294,28 @@ AC_ARG_ENABLE([asm],
284 AS_HELP_STRING([--disable-asm], [Disable assembly])) 294 AS_HELP_STRING([--disable-asm], [Disable assembly]))
285AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) 295AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"])
286 296
297AC_ARG_ENABLE([extratests],
298 AS_HELP_STRING([--enable-extratests], [Enable extra tests that may be unreliable on some platforms]))
299AM_CONDITIONAL([ENABLE_EXTRATESTS], [test "x$enable_extratests" = xyes])
300
287old_cflags=$CFLAGS 301old_cflags=$CFLAGS
288CFLAGS="$old_cflags -I$srcdir/include" 302CFLAGS="$CFLAGS -I$srcdir/include"
303AC_MSG_CHECKING([if BSWAP4 builds without __STRICT_ALIGNMENT])
289AC_TRY_COMPILE([#include "$srcdir/crypto/modes/modes_lcl.h"], 304AC_TRY_COMPILE([#include "$srcdir/crypto/modes/modes_lcl.h"],
290 [int a = 0; BSWAP4(a);], 305 [int a = 0; BSWAP4(a);],
291 BSWAP4=yes, BSWAP4=no) 306 AC_MSG_RESULT([yes])
307 BSWAP4=yes,
308 AC_MSG_RESULT([no])
309 BSWAP4=no)
292CFLAGS="$old_cflags" 310CFLAGS="$old_cflags"
293 311
294case $host_cpu in 312case $host_cpu in
295 *sparc*) 313 *sparc*)
296 CFLAGS="$CFLAGS -D__STRICT_ALIGNMENT" 314 CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"
297 ;; 315 ;;
298 *arm*) 316 *arm*)
299 AS_IF([test "x$BSWAP4" = "xyes"],, 317 AS_IF([test "x$BSWAP4" = "xyes"],,
300 CFLAGS="$old_cflags -D__STRICT_ALIGNMENT") 318 CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT")
301 ;; 319 ;;
302esac 320esac
303 321
@@ -306,13 +324,6 @@ AM_CONDITIONAL([HOST_ASM_ELF_X86_64],
306AM_CONDITIONAL([HOST_ASM_MACOSX_X86_64], 324AM_CONDITIONAL([HOST_ASM_MACOSX_X86_64],
307 [test "x$HOST_ABI" = "xmacosx" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"]) 325 [test "x$HOST_ABI" = "xmacosx" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"])
308 326
309AC_ARG_ENABLE([libtls],
310 AS_HELP_STRING([--enable-libtls], [Enable building the libtls library]))
311AM_CONDITIONAL([ENABLE_LIBTLS], [test "x$enable_libtls" = xyes])
312AM_COND_IF([ENABLE_LIBTLS], [AC_CONFIG_FILES([libtls.pc])])
313
314LT_INIT
315
316AC_CONFIG_FILES([ 327AC_CONFIG_FILES([
317 Makefile 328 Makefile
318 include/Makefile 329 include/Makefile
@@ -325,6 +336,7 @@ AC_CONFIG_FILES([
325 man/Makefile 336 man/Makefile
326 libcrypto.pc 337 libcrypto.pc
327 libssl.pc 338 libssl.pc
339 libtls.pc
328 openssl.pc 340 openssl.pc
329]) 341])
330 342
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index 5861a55..e350cda 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -1,8 +1,8 @@
1include $(top_srcdir)/Makefile.am.common 1include $(top_srcdir)/Makefile.am.common
2 2
3AM_CPPFLAGS += -I$(top_srcdir)/crypto/asn1 3AM_CFLAGS += -I$(top_srcdir)/crypto/asn1
4AM_CPPFLAGS += -I$(top_srcdir)/crypto/evp 4AM_CFLAGS += -I$(top_srcdir)/crypto/evp
5AM_CPPFLAGS += -I$(top_srcdir)/crypto/modes 5AM_CFLAGS += -I$(top_srcdir)/crypto/modes
6 6
7lib_LTLIBRARIES = libcrypto.la 7lib_LTLIBRARIES = libcrypto.la
8 8
@@ -10,13 +10,12 @@ EXTRA_DIST = VERSION
10 10
11libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined 11libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined
12libcrypto_la_LIBADD = libcompat.la libcompatnoopt.la 12libcrypto_la_LIBADD = libcompat.la libcompatnoopt.la
13libcrypto_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) 13libcrypto_la_CPPFLAGS = -DOPENSSL_NO_HW_PADLOCK
14libcrypto_la_CFLAGS += -DOPENSSL_NO_HW_PADLOCK
15if OPENSSL_NO_ASM 14if OPENSSL_NO_ASM
16libcrypto_la_CFLAGS += -DOPENSSL_NO_ASM 15libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM
17else 16else
18if HOST_WIN 17if HOST_WIN
19libcrypto_la_CFLAGS += -DOPENSSL_NO_ASM 18libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM
20endif 19endif
21endif 20endif
22 21
@@ -31,7 +30,6 @@ libcompatnoopt_la_SOURCES += compat/explicit_bzero.c
31endif 30endif
32 31
33# other compatibility functions 32# other compatibility functions
34libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS)
35libcompat_la_SOURCES = 33libcompat_la_SOURCES =
36libcompat_la_LIBADD = $(PLATFORM_LDADD) 34libcompat_la_LIBADD = $(PLATFORM_LDADD)
37 35
diff --git a/crypto/Makefile.am.elf-x86_64 b/crypto/Makefile.am.elf-x86_64
index 6257c40..44e08a1 100644
--- a/crypto/Makefile.am.elf-x86_64
+++ b/crypto/Makefile.am.elf-x86_64
@@ -22,20 +22,20 @@ ASM_X86_64_ELF += cpuid-elf-x86_64.S
22EXTRA_DIST += $(ASM_X86_64_ELF) 22EXTRA_DIST += $(ASM_X86_64_ELF)
23 23
24if HOST_ASM_ELF_X86_64 24if HOST_ASM_ELF_X86_64
25libcrypto_la_CFLAGS += -DAES_ASM 25libcrypto_la_CPPFLAGS += -DAES_ASM
26libcrypto_la_CFLAGS += -DBSAES_ASM 26libcrypto_la_CPPFLAGS += -DBSAES_ASM
27libcrypto_la_CFLAGS += -DVPAES_ASM 27libcrypto_la_CPPFLAGS += -DVPAES_ASM
28libcrypto_la_CFLAGS += -DOPENSSL_IA32_SSE2 28libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2
29libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_MONT 29libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
30libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_MONT5 30libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5
31libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_GF2m 31libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_GF2m
32libcrypto_la_CFLAGS += -DMD5_ASM 32libcrypto_la_CPPFLAGS += -DMD5_ASM
33libcrypto_la_CFLAGS += -DGHASH_ASM 33libcrypto_la_CPPFLAGS += -DGHASH_ASM
34libcrypto_la_CFLAGS += -DRSA_ASM 34libcrypto_la_CPPFLAGS += -DRSA_ASM
35libcrypto_la_CFLAGS += -DSHA1_ASM 35libcrypto_la_CPPFLAGS += -DSHA1_ASM
36libcrypto_la_CFLAGS += -DSHA256_ASM 36libcrypto_la_CPPFLAGS += -DSHA256_ASM
37libcrypto_la_CFLAGS += -DSHA512_ASM 37libcrypto_la_CPPFLAGS += -DSHA512_ASM
38libcrypto_la_CFLAGS += -DWHIRLPOOL_ASM 38libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM
39libcrypto_la_CFLAGS += -DOPENSSL_CPUID_OBJ 39libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ
40libcrypto_la_SOURCES += $(ASM_X86_64_ELF) 40libcrypto_la_SOURCES += $(ASM_X86_64_ELF)
41endif 41endif
diff --git a/crypto/Makefile.am.macosx-x86_64 b/crypto/Makefile.am.macosx-x86_64
index e361aae..bc2aaad 100644
--- a/crypto/Makefile.am.macosx-x86_64
+++ b/crypto/Makefile.am.macosx-x86_64
@@ -22,20 +22,20 @@ ASM_X86_64_MACOSX += cpuid-macosx-x86_64.S
22EXTRA_DIST += $(ASM_X86_64_MACOSX) 22EXTRA_DIST += $(ASM_X86_64_MACOSX)
23 23
24if HOST_ASM_MACOSX_X86_64 24if HOST_ASM_MACOSX_X86_64
25libcrypto_la_CFLAGS += -DAES_ASM 25libcrypto_la_CPPFLAGS += -DAES_ASM
26libcrypto_la_CFLAGS += -DBSAES_ASM 26libcrypto_la_CPPFLAGS += -DBSAES_ASM
27libcrypto_la_CFLAGS += -DVPAES_ASM 27libcrypto_la_CPPFLAGS += -DVPAES_ASM
28libcrypto_la_CFLAGS += -DOPENSSL_IA32_SSE2 28libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2
29libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_MONT 29libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
30libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_MONT5 30libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5
31libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_GF2m 31libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_GF2m
32libcrypto_la_CFLAGS += -DMD5_ASM 32libcrypto_la_CPPFLAGS += -DMD5_ASM
33libcrypto_la_CFLAGS += -DGHASH_ASM 33libcrypto_la_CPPFLAGS += -DGHASH_ASM
34libcrypto_la_CFLAGS += -DRSA_ASM 34libcrypto_la_CPPFLAGS += -DRSA_ASM
35libcrypto_la_CFLAGS += -DSHA1_ASM 35libcrypto_la_CPPFLAGS += -DSHA1_ASM
36libcrypto_la_CFLAGS += -DSHA256_ASM 36libcrypto_la_CPPFLAGS += -DSHA256_ASM
37libcrypto_la_CFLAGS += -DSHA512_ASM 37libcrypto_la_CPPFLAGS += -DSHA512_ASM
38libcrypto_la_CFLAGS += -DWHIRLPOOL_ASM 38libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM
39libcrypto_la_CFLAGS += -DOPENSSL_CPUID_OBJ 39libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ
40libcrypto_la_SOURCES += $(ASM_X86_64_MACOSX) 40libcrypto_la_SOURCES += $(ASM_X86_64_MACOSX)
41endif 41endif
diff --git a/dist-win.sh b/dist-win.sh
index d600b97..cfb6414 100755
--- a/dist-win.sh
+++ b/dist-win.sh
@@ -8,6 +8,7 @@ DIST=libressl-$VERSION-windows
8 8
9rm -fr $DIST 9rm -fr $DIST
10mkdir -p $DIST 10mkdir -p $DIST
11autoreconf -i
11 12
12for ARCH in X86 X64; do 13for ARCH in X86 X64; do
13 14
@@ -21,7 +22,7 @@ for ARCH in X86 X64; do
21 22
22 echo Building for $HOST 23 echo Building for $HOST
23 24
24 CC=$HOST-gcc ./configure --host=$HOST --enable-libtls 25 CC=$HOST-gcc ./configure --host=$HOST
25 make clean 26 make clean
26 PATH=$PATH:/usr/$HOST/sys-root/mingw/bin \ 27 PATH=$PATH:/usr/$HOST/sys-root/mingw/bin \
27 make -j 4 check 28 make -j 4 check
diff --git a/dist.sh b/dist.sh
index 27bd40a..ff740b7 100755
--- a/dist.sh
+++ b/dist.sh
@@ -3,5 +3,5 @@ set -e
3 3
4rm -f man/*.1 man/*.3 4rm -f man/*.1 man/*.3
5./autogen.sh 5./autogen.sh
6./configure --enable-libtls 6./configure
7make distcheck 7make distcheck
diff --git a/gen-coverage-report.sh b/gen-coverage-report.sh
index f99bd8e..1a199cf 100755
--- a/gen-coverage-report.sh
+++ b/gen-coverage-report.sh
@@ -20,7 +20,7 @@ find -name '*.gcda' -o -name '*.gcno' -delete
20rm -fr $DESTDIR 20rm -fr $DESTDIR
21 21
22echo "Configuring to build with code coverage support" 22echo "Configuring to build with code coverage support"
23./configure --enable-libtls CFLAGS='-O0 -fprofile-arcs -ftest-coverage' 23./configure CFLAGS='-O0 -fprofile-arcs -ftest-coverage'
24 24
25echo "Running all code paths" 25echo "Running all code paths"
26make clean 26make clean
diff --git a/include/Makefile.am b/include/Makefile.am
index 31cc0ab..7e1ece2 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -28,6 +28,4 @@ noinst_HEADERS += sys/times.h
28noinst_HEADERS += sys/types.h 28noinst_HEADERS += sys/types.h
29noinst_HEADERS += sys/uio.h 29noinst_HEADERS += sys/uio.h
30 30
31if ENABLE_LIBTLS
32include_HEADERS = tls.h 31include_HEADERS = tls.h
33endif
diff --git a/scripts/travis b/scripts/travis
index c52be79..091f37d 100755
--- a/scripts/travis
+++ b/scripts/travis
@@ -4,7 +4,7 @@ set -e
4./autogen.sh 4./autogen.sh
5 5
6if [ "x$ARCH" = "xnative" ]; then 6if [ "x$ARCH" = "xnative" ]; then
7 ./configure --enable-libtls 7 ./configure
8 if [ `uname` = "Darwin" ]; then 8 if [ `uname` = "Darwin" ]; then
9 # OS X runs out of resources if we run 'make -j check' 9 # OS X runs out of resources if we run 'make -j check'
10 make check 10 make check
@@ -28,6 +28,6 @@ else
28 export PATH=$PATH:/opt/$ARCH/bin 28 export PATH=$PATH:/opt/$ARCH/bin
29 fi 29 fi
30 30
31 ./configure --host=$CPU-w64-mingw32 --enable-libtls 31 ./configure --host=$CPU-w64-mingw32
32 make -j 32 make -j
33fi 33fi
diff --git a/ssl/Makefile.am b/ssl/Makefile.am
index 7d66795..db60775 100644
--- a/ssl/Makefile.am
+++ b/ssl/Makefile.am
@@ -5,7 +5,6 @@ lib_LTLIBRARIES = libssl.la
5EXTRA_DIST = VERSION 5EXTRA_DIST = VERSION
6 6
7libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined 7libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined
8libssl_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS)
9libssl_la_LIBADD = ../crypto/libcrypto.la 8libssl_la_LIBADD = ../crypto/libcrypto.la
10 9
11libssl_la_SOURCES = bio_ssl.c 10libssl_la_SOURCES = bio_ssl.c
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..2ed7a44
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,282 @@
1include $(top_srcdir)/Makefile.am.common
2
3AM_CPPFLAGS += -I $(top_srcdir)/crypto/modes
4AM_CPPFLAGS += -I $(top_srcdir)/crypto/asn1
5AM_CPPFLAGS += -I $(top_srcdir)/ssl
6
7LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
8LDADD += $(top_builddir)/ssl/libssl.la
9LDADD += $(top_builddir)/crypto/libcrypto.la
10
11TESTS =
12check_PROGRAMS =
13EXTRA_DIST =
14DISTCLEANFILES = pidwraptest.txt
15
16# aeadtest
17TESTS += aeadtest.sh
18check_PROGRAMS += aeadtest
19aeadtest_SOURCES = aeadtest.c
20EXTRA_DIST += aeadtest.sh
21EXTRA_DIST += aeadtests.txt
22
23# aes_wrap
24TESTS += aes_wrap
25check_PROGRAMS += aes_wrap
26aes_wrap_SOURCES = aes_wrap.c
27
28# arc4randomforktest
29# Windows/mingw does not have fork, but Cygwin does.
30if !HOST_WIN
31TESTS += arc4randomforktest.sh
32check_PROGRAMS += arc4randomforktest
33arc4randomforktest_SOURCES = arc4randomforktest.c
34endif
35EXTRA_DIST += arc4randomforktest.sh
36
37# asn1test
38TESTS += asn1test
39check_PROGRAMS += asn1test
40asn1test_SOURCES = asn1test.c
41
42# base64test
43TESTS += base64test
44check_PROGRAMS += base64test
45base64test_SOURCES = base64test.c
46
47# bftest
48TESTS += bftest
49check_PROGRAMS += bftest
50bftest_SOURCES = bftest.c
51
52# biotest
53# the BIO tests rely on resolver results that are OS and environment-specific
54if ENABLE_EXTRATESTS
55TESTS += biotest
56check_PROGRAMS += biotest
57biotest_SOURCES = biotest.c
58endif
59
60# bntest
61TESTS += bntest
62check_PROGRAMS += bntest
63bntest_SOURCES = bntest.c
64
65# bytestringtest
66TESTS += bytestringtest
67check_PROGRAMS += bytestringtest
68bytestringtest_SOURCES = bytestringtest.c
69
70# casttest
71TESTS += casttest
72check_PROGRAMS += casttest
73casttest_SOURCES = casttest.c
74
75# chachatest
76TESTS += chachatest
77check_PROGRAMS += chachatest
78chachatest_SOURCES = chachatest.c
79
80# cipherstest
81TESTS += cipherstest
82check_PROGRAMS += cipherstest
83cipherstest_SOURCES = cipherstest.c
84
85# cts128test
86TESTS += cts128test
87check_PROGRAMS += cts128test
88cts128test_SOURCES = cts128test.c
89
90# destest
91TESTS += destest
92check_PROGRAMS += destest
93destest_SOURCES = destest.c
94
95# dhtest
96TESTS += dhtest
97check_PROGRAMS += dhtest
98dhtest_SOURCES = dhtest.c
99
100# dsatest
101TESTS += dsatest
102check_PROGRAMS += dsatest
103dsatest_SOURCES = dsatest.c
104
105# ecdhtest
106TESTS += ecdhtest
107check_PROGRAMS += ecdhtest
108ecdhtest_SOURCES = ecdhtest.c
109
110# ecdsatest
111TESTS += ecdsatest
112check_PROGRAMS += ecdsatest
113ecdsatest_SOURCES = ecdsatest.c
114
115# ectest
116TESTS += ectest
117check_PROGRAMS += ectest
118ectest_SOURCES = ectest.c
119
120# enginetest
121TESTS += enginetest
122check_PROGRAMS += enginetest
123enginetest_SOURCES = enginetest.c
124
125# evptest
126TESTS += evptest.sh
127check_PROGRAMS += evptest
128evptest_SOURCES = evptest.c
129EXTRA_DIST += evptest.sh
130EXTRA_DIST += evptests.txt
131
132# explicit_bzero
133# explicit_bzero relies on SA_ONSTACK, which is unavailable on Windows
134if !HOST_WIN
135if !HOST_CYGWIN
136TESTS += explicit_bzero
137check_PROGRAMS += explicit_bzero
138explicit_bzero_SOURCES = explicit_bzero.c
139if !HAVE_MEMMEM
140explicit_bzero_SOURCES += memmem.c
141endif
142endif
143endif
144
145# exptest
146TESTS += exptest
147check_PROGRAMS += exptest
148exptest_SOURCES = exptest.c
149
150# gcm128test
151TESTS += gcm128test
152check_PROGRAMS += gcm128test
153gcm128test_SOURCES = gcm128test.c
154
155# gost2814789t
156TESTS += gost2814789t
157check_PROGRAMS += gost2814789t
158gost2814789t_SOURCES = gost2814789t.c
159
160# hmactest
161TESTS += hmactest
162check_PROGRAMS += hmactest
163hmactest_SOURCES = hmactest.c
164
165# ideatest
166TESTS += ideatest
167check_PROGRAMS += ideatest
168ideatest_SOURCES = ideatest.c
169
170# igetest
171TESTS += igetest
172check_PROGRAMS += igetest
173igetest_SOURCES = igetest.c
174
175# md4test
176TESTS += md4test
177check_PROGRAMS += md4test
178md4test_SOURCES = md4test.c
179
180# md5test
181TESTS += md5test
182check_PROGRAMS += md5test
183md5test_SOURCES = md5test.c
184
185# mdc2test
186TESTS += mdc2test
187check_PROGRAMS += mdc2test
188mdc2test_SOURCES = mdc2test.c
189
190# mont
191TESTS += mont
192check_PROGRAMS += mont
193mont_SOURCES = mont.c
194
195# pbkdf2
196TESTS += pbkdf2
197check_PROGRAMS += pbkdf2
198pbkdf2_SOURCES = pbkdf2.c
199
200# pidwraptest
201# pidwraptest relies on an OS-specific way to give out pids and is generally
202# awkward on systems with slow fork
203if ENABLE_EXTRATESTS
204TESTS += pidwraptest
205check_PROGRAMS += pidwraptest
206pidwraptest_SOURCES = pidwraptest.c
207endif
208
209# pkcs7test
210TESTS += pkcs7test
211check_PROGRAMS += pkcs7test
212pkcs7test_SOURCES = pkcs7test.c
213
214# poly1305test
215TESTS += poly1305test
216check_PROGRAMS += poly1305test
217poly1305test_SOURCES = poly1305test.c
218
219# pq_test
220TESTS += pq_test.sh
221check_PROGRAMS += pq_test
222pq_test_SOURCES = pq_test.c
223EXTRA_DIST += pq_test.sh
224EXTRA_DIST += pq_expected.txt
225
226# randtest
227TESTS += randtest
228check_PROGRAMS += randtest
229randtest_SOURCES = randtest.c
230
231# rc2test
232TESTS += rc2test
233check_PROGRAMS += rc2test
234rc2test_SOURCES = rc2test.c
235
236# rc4test
237TESTS += rc4test
238check_PROGRAMS += rc4test
239rc4test_SOURCES = rc4test.c
240
241# rmdtest
242TESTS += rmdtest
243check_PROGRAMS += rmdtest
244rmdtest_SOURCES = rmdtest.c
245
246# sha1test
247TESTS += sha1test
248check_PROGRAMS += sha1test
249sha1test_SOURCES = sha1test.c
250
251# sha256test
252TESTS += sha256test
253check_PROGRAMS += sha256test
254sha256test_SOURCES = sha256test.c
255
256# sha512test
257TESTS += sha512test
258check_PROGRAMS += sha512test
259sha512test_SOURCES = sha512test.c
260
261# shatest
262TESTS += shatest
263check_PROGRAMS += shatest
264shatest_SOURCES = shatest.c
265
266# ssltest
267TESTS += ssltest.sh
268check_PROGRAMS += ssltest
269ssltest_SOURCES = ssltest.c
270EXTRA_DIST += ssltest.sh
271EXTRA_DIST += testssl ca.pem server.pem
272
273# timingsafe
274TESTS += timingsafe
275check_PROGRAMS += timingsafe
276timingsafe_SOURCES = timingsafe.c
277
278# utf8test
279TESTS += utf8test
280check_PROGRAMS += utf8test
281utf8test_SOURCES = utf8test.c
282
diff --git a/tests/Makefile.am.tpl b/tests/Makefile.am.tpl
deleted file mode 100644
index 26334af..0000000
--- a/tests/Makefile.am.tpl
+++ /dev/null
@@ -1,15 +0,0 @@
1include $(top_srcdir)/Makefile.am.common
2
3AM_CPPFLAGS += -I $(top_srcdir)/crypto/modes
4AM_CPPFLAGS += -I $(top_srcdir)/crypto/asn1
5AM_CPPFLAGS += -I $(top_srcdir)/ssl
6
7LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
8LDADD += $(top_builddir)/ssl/libssl.la
9LDADD += $(top_builddir)/crypto/libcrypto.la
10
11TESTS =
12check_PROGRAMS =
13EXTRA_DIST =
14DISTCLEANFILES = pidwraptest.txt
15
diff --git a/tls/Makefile.am b/tls/Makefile.am
index f0919a5..e8c4713 100644
--- a/tls/Makefile.am
+++ b/tls/Makefile.am
@@ -1,12 +1,10 @@
1include $(top_srcdir)/Makefile.am.common 1include $(top_srcdir)/Makefile.am.common
2 2
3if ENABLE_LIBTLS
4lib_LTLIBRARIES = libtls.la 3lib_LTLIBRARIES = libtls.la
5 4
6EXTRA_DIST = VERSION 5EXTRA_DIST = VERSION
7 6
8libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined 7libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined
9libtls_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS)
10libtls_la_LIBADD = ../crypto/libcrypto.la ../ssl/libssl.la $(PLATFORM_LDADD) 8libtls_la_LIBADD = ../crypto/libcrypto.la ../ssl/libssl.la $(PLATFORM_LDADD)
11 9
12libtls_la_SOURCES = tls.c 10libtls_la_SOURCES = tls.c
@@ -20,5 +18,3 @@ noinst_HEADERS = tls_internal.h
20if !HAVE_STRSEP 18if !HAVE_STRSEP
21libtls_la_SOURCES += strsep.c 19libtls_la_SOURCES += strsep.c
22endif 20endif
23
24endif
diff --git a/update.sh b/update.sh
index 29012ad..317b823 100755
--- a/update.sh
+++ b/update.sh
@@ -18,15 +18,15 @@ fi
18 git pull --rebase) 18 git pull --rebase)
19 19
20# setup source paths 20# setup source paths
21dir=`pwd` 21CWD=`pwd`
22libc_src=$dir/openbsd/src/lib/libc 22libc_src=$CWD/openbsd/src/lib/libc
23libc_regress=$dir/openbsd/src/regress/lib/libc 23libc_regress=$CWD/openbsd/src/regress/lib/libc
24libcrypto_src=$dir/openbsd/src/lib/libcrypto 24libcrypto_src=$CWD/openbsd/src/lib/libcrypto
25libcrypto_regress=$dir/openbsd/src/regress/lib/libcrypto 25libcrypto_regress=$CWD/openbsd/src/regress/lib/libcrypto
26libssl_src=$dir/openbsd/src/lib/libssl 26libssl_src=$CWD/openbsd/src/lib/libssl
27libssl_regress=$dir/openbsd/src/regress/lib/libssl 27libssl_regress=$CWD/openbsd/src/regress/lib/libssl
28libtls_src=$dir/openbsd/src/lib/libtls 28libtls_src=$CWD/openbsd/src/lib/libtls
29openssl_app_src=$dir/openbsd/src/usr.bin/openssl 29openssl_app_src=$CWD/openbsd/src/usr.bin/openssl
30 30
31# load library versions 31# load library versions
32source $libcrypto_src/crypto/shlib_version 32source $libcrypto_src/crypto/shlib_version
@@ -197,13 +197,14 @@ echo "copying tests"
197for i in `find $libcrypto_regress -name '*.c'`; do 197for i in `find $libcrypto_regress -name '*.c'`; do
198 $CP "$i" tests 198 $CP "$i" tests
199done 199done
200 200$CP $libcrypto_regress/evp/evptests.txt tests
201# the BIO tests rely on resolver results that are OS and environment-specific 201$CP $libcrypto_regress/aead/aeadtests.txt tests
202rm tests/biotest.c 202$CP $libcrypto_regress/pqueue/expected.txt tests/pq_expected.txt
203 203
204# copy libc tests 204# copy libc tests
205$CP $libc_regress/arc4random-fork/arc4random-fork.c tests/arc4randomforktest.c 205$CP $libc_regress/arc4random-fork/arc4random-fork.c tests/arc4randomforktest.c
206$CP $libc_regress/explicit_bzero/explicit_bzero.c tests 206$CP $libc_regress/explicit_bzero/explicit_bzero.c tests
207$CP $libc_src/string/memmem.c tests
207$CP $libc_regress/timingsafe/timingsafe.c tests 208$CP $libc_regress/timingsafe/timingsafe.c tests
208 209
209# copy libssl tests 210# copy libssl tests
@@ -214,68 +215,9 @@ done
214$CP $libssl_regress/certs/ca.pem tests 215$CP $libssl_regress/certs/ca.pem tests
215$CP $libssl_regress/certs/server.pem tests 216$CP $libssl_regress/certs/server.pem tests
216 217
217# setup test drivers
218# do not directly run all test programs
219test_drivers=(
220 aeadtest
221 evptest
222 pq_test
223 ssltest
224 arc4randomforktest
225 pidwraptest
226)
227tests_posix_only=(
228 arc4randomforktest
229 explicit_bzero
230 pidwraptest
231)
232$CP $libc_src/string/memmem.c tests/
233(cd tests
234 $CP Makefile.am.tpl Makefile.am
235
236 for i in `ls -1 *.c|sort|grep -v memmem.c`; do
237 TEST=`echo $i|sed -e "s/\.c//"`
238 if [[ ${tests_posix_only[*]} =~ "$TEST" ]]; then
239 echo "if !HOST_WIN" >> Makefile.am
240 fi
241 if ! [[ ${test_drivers[*]} =~ "$TEST" ]]; then
242 echo "TESTS += $TEST" >> Makefile.am
243 fi
244 echo "check_PROGRAMS += $TEST" >> Makefile.am
245 echo "${TEST}_SOURCES = $i" >> Makefile.am
246 if [[ ${TEST} = "explicit_bzero" ]]; then
247 echo "if !HAVE_MEMMEM" >> Makefile.am
248 echo "explicit_bzero_SOURCES += memmem.c" >> Makefile.am
249 echo "endif" >> Makefile.am
250 fi
251 if [[ ${tests_posix_only[*]} =~ "$TEST" ]]; then
252 echo "endif" >> Makefile.am
253 fi
254 done
255)
256$CP $libcrypto_regress/evp/evptests.txt tests
257$CP $libcrypto_regress/aead/aeadtests.txt tests
258$CP $libcrypto_regress/pqueue/expected.txt tests/pq_expected.txt
259chmod 755 tests/testssl 218chmod 755 tests/testssl
260for i in "${test_drivers[@]}"; do
261 if [ -e tests/${i}.sh ]; then
262 if [[ ${tests_posix_only[*]} =~ "$i" ]]; then
263 echo "if !HOST_WIN" >> tests/Makefile.am
264 fi
265 if ! [[ ${tests_disabled[*]} =~ "$i" ]]; then
266 echo "TESTS += ${i}.sh" >> tests/Makefile.am
267 fi
268 if [[ ${tests_posix_only[*]} =~ "$i" ]]; then
269 echo "endif" >> tests/Makefile.am
270 fi
271 echo "EXTRA_DIST += ${i}.sh" >> tests/Makefile.am
272 fi
273done
274echo "EXTRA_DIST += aeadtests.txt" >> tests/Makefile.am
275echo "EXTRA_DIST += evptests.txt" >> tests/Makefile.am
276echo "EXTRA_DIST += pq_expected.txt" >> tests/Makefile.am
277echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am
278 219
220# add headers
279(cd include/openssl 221(cd include/openssl
280 $CP Makefile.am.tpl Makefile.am 222 $CP Makefile.am.tpl Makefile.am
281 for i in `ls -1 *.h|sort`; do 223 for i in `ls -1 *.h|sort`; do
@@ -283,8 +225,8 @@ echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am
283 done 225 done
284) 226)
285 227
286echo "copying manpages"
287# copy manpages 228# copy manpages
229echo "copying manpages"
288(cd man 230(cd man
289 $CP Makefile.am.tpl Makefile.am 231 $CP Makefile.am.tpl Makefile.am
290 232
@@ -302,9 +244,7 @@ echo "copying manpages"
302 $CP $openssl_app_src/openssl.1 . 244 $CP $openssl_app_src/openssl.1 .
303 echo "dist_man_MANS += openssl.1" >> Makefile.am 245 echo "dist_man_MANS += openssl.1" >> Makefile.am
304 $CP $libtls_src/tls_init.3 . 246 $CP $libtls_src/tls_init.3 .
305 echo "if ENABLE_LIBTLS" >> Makefile.am
306 echo "dist_man_MANS += tls_init.3" >> Makefile.am 247 echo "dist_man_MANS += tls_init.3" >> Makefile.am
307 echo "endif" >> Makefile.am
308 248
309 # convert remaining POD manpages 249 # convert remaining POD manpages
310 for i in `ls -1 $libssl_src/src/doc/crypto/*.pod | sort`; do 250 for i in `ls -1 $libssl_src/src/doc/crypto/*.pod | sort`; do
@@ -326,23 +266,19 @@ echo "copying manpages"
326 echo " ln -f \$(DESTDIR)\$(mandir)/man3/$1 \\" >> Makefile.am 266 echo " ln -f \$(DESTDIR)\$(mandir)/man3/$1 \\" >> Makefile.am
327 echo " \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am 267 echo " \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
328 done 268 done
329 echo "if ENABLE_LIBTLS" >> Makefile.am
330 for i in $TLS_MLINKS; do 269 for i in $TLS_MLINKS; do
331 IFS=","; set $i; unset IFS 270 IFS=","; set $i; unset IFS
332 echo " ln -f \$(DESTDIR)\$(mandir)/man3/$1 \\" >> Makefile.am 271 echo " ln -f \$(DESTDIR)\$(mandir)/man3/$1 \\" >> Makefile.am
333 echo " \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am 272 echo " \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
334 done 273 done
335 echo "endif" >> Makefile.am
336 echo "" >> Makefile.am 274 echo "" >> Makefile.am
337 echo "uninstall-local:" >> Makefile.am 275 echo "uninstall-local:" >> Makefile.am
338 for i in $SSL_MLINKS; do 276 for i in $SSL_MLINKS; do
339 IFS=","; set $i; unset IFS 277 IFS=","; set $i; unset IFS
340 echo " -rm -f \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am 278 echo " -rm -f \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
341 done 279 done
342 echo "if ENABLE_LIBTLS" >> Makefile.am
343 for i in $TLS_MLINKS; do 280 for i in $TLS_MLINKS; do
344 IFS=","; set $i; unset IFS 281 IFS=","; set $i; unset IFS
345 echo " rm -f \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am 282 echo " rm -f \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
346 done 283 done
347 echo "endif" >> Makefile.am
348) 284)