diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | ChangeLog | 31 | ||||
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | Makefile.am.common | 4 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | apps/Makefile.am | 1 | ||||
-rw-r--r-- | apps/poll_win.c | 39 | ||||
-rw-r--r-- | configure.ac | 62 | ||||
-rw-r--r-- | crypto/Makefile.am | 14 | ||||
-rw-r--r-- | crypto/Makefile.am.elf-x86_64 | 30 | ||||
-rw-r--r-- | crypto/Makefile.am.macosx-x86_64 | 30 | ||||
-rwxr-xr-x | dist-win.sh | 3 | ||||
-rwxr-xr-x | dist.sh | 2 | ||||
-rwxr-xr-x | gen-coverage-report.sh | 2 | ||||
-rw-r--r-- | include/Makefile.am | 2 | ||||
-rwxr-xr-x | scripts/travis | 4 | ||||
-rw-r--r-- | ssl/Makefile.am | 1 | ||||
-rw-r--r-- | tests/Makefile.am | 282 | ||||
-rw-r--r-- | tests/Makefile.am.tpl | 15 | ||||
-rw-r--r-- | tls/Makefile.am | 4 | ||||
-rwxr-xr-x | update.sh | 94 |
21 files changed, 427 insertions, 202 deletions
@@ -92,7 +92,6 @@ INSTALL | |||
92 | /stamp-h2 | 92 | /stamp-h2 |
93 | 93 | ||
94 | include/openssl/Makefile.am | 94 | include/openssl/Makefile.am |
95 | tests/Makefile.am | ||
96 | 95 | ||
97 | crypto/VERSION | 96 | crypto/VERSION |
98 | ssl/VERSION | 97 | ssl/VERSION |
@@ -28,6 +28,37 @@ history is also available from Git. | |||
28 | 28 | ||
29 | LibreSSL Portable Release Notes: | 29 | LibreSSL Portable Release Notes: |
30 | 30 | ||
31 | This release primarily addresses a number of security issues in coordination | ||
32 | with the OpenSSL project. | ||
33 | |||
34 | 2.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 | |||
50 | 2.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 | |||
31 | 2.1.4 - Security and feature updates | 62 | 2.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 | |||
2 | ACLOCAL_AMFLAGS = -I m4 | 2 | ACLOCAL_AMFLAGS = -I m4 |
3 | 3 | ||
4 | pkgconfigdir = $(libdir)/pkgconfig | 4 | pkgconfigdir = $(libdir)/pkgconfig |
5 | pkgconfig_DATA = libcrypto.pc libssl.pc openssl.pc | 5 | pkgconfig_DATA = libcrypto.pc libssl.pc libtls.pc openssl.pc |
6 | |||
7 | if ENABLE_LIBTLS | ||
8 | pkgconfig_DATA += libtls.pc | ||
9 | endif | ||
10 | 6 | ||
11 | EXTRA_DIST = README README.windows VERSION config scripts | 7 | EXTRA_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 @@ | |||
1 | AM_CPPFLAGS = -I$(top_srcdir)/include | 1 | AM_CFLAGS = -I$(top_srcdir)/include |
2 | AM_CPPFLAGS += -DLIBRESSL_INTERNAL | 2 | AM_CPPFLAGS = -DLIBRESSL_INTERNAL |
@@ -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 | ||
3 | bin_PROGRAMS = openssl | 3 | bin_PROGRAMS = openssl |
4 | 4 | ||
5 | openssl_CFLAGS = $(USER_CFLAGS) | ||
6 | openssl_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) | 5 | openssl_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) |
7 | openssl_LDADD += $(top_builddir)/ssl/libssl.la | 6 | openssl_LDADD += $(top_builddir)/ssl/libssl.la |
8 | openssl_LDADD += $(top_builddir)/crypto/libcrypto.la | 7 | openssl_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) | |||
44 | static int | 44 | static int |
45 | is_socket(int fd) | 45 | is_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 | ||
10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
11 | 11 | ||
12 | AC_SUBST([USER_CFLAGS], "-O2 $CFLAGS") | 12 | AC_PROG_CC |
13 | CFLAGS="$CFLAGS -Wall -std=gnu99 -g" | 13 | AC_PROG_CC_STDC |
14 | AM_PROG_CC_C_O | ||
15 | AC_PROG_LIBTOOL | ||
16 | LT_INIT | ||
17 | |||
18 | CFLAGS="$CFLAGS -Wall -std=gnu99" | ||
14 | 19 | ||
15 | case $host_os in | 20 | case $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 | *) ;; |
55 | esac | 69 | esac |
56 | 70 | ||
71 | AM_CONDITIONAL([HOST_CYGWIN], [test x$HOST_OS = xcygwin]) | ||
57 | AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin]) | 72 | AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin]) |
58 | AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd]) | 73 | AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd]) |
59 | AM_CONDITIONAL([HOST_HPUX], [test x$HOST_OS = xhpux]) | 74 | AM_CONDITIONAL([HOST_HPUX], [test x$HOST_OS = xhpux]) |
@@ -68,11 +83,6 @@ AC_CHECK_FUNC([clock_gettime],, | |||
68 | AC_CHECK_FUNC([dl_iterate_phdr],, | 83 | AC_CHECK_FUNC([dl_iterate_phdr],, |
69 | [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])]) | 84 | [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])]) |
70 | 85 | ||
71 | AC_PROG_CC | ||
72 | AC_PROG_LIBTOOL | ||
73 | AC_PROG_CC_STDC | ||
74 | AM_PROG_CC_C_O | ||
75 | |||
76 | AC_MSG_CHECKING([if compiling with clang]) | 86 | AC_MSG_CHECKING([if compiling with clang]) |
77 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ | 87 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ |
78 | #ifndef __clang__ | 88 | #ifndef __clang__ |
@@ -85,6 +95,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ | |||
85 | AC_MSG_RESULT([$CLANG]) | 95 | AC_MSG_RESULT([$CLANG]) |
86 | AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments]) | 96 | AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments]) |
87 | 97 | ||
98 | CFLAGS="$CFLAGS $CLANG_FLAGS" | ||
99 | LDFLAGS="$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");]])], | |||
201 | CFLAGS="$save_cflags $AM_CFLAGS" | 214 | CFLAGS="$save_cflags $AM_CFLAGS" |
202 | AM_PROG_AS | 215 | AM_PROG_AS |
203 | 216 | ||
204 | CFLAGS="$CFLAGS $CLANG_CFLAGS" | ||
205 | LDFLAGS="$LDFLAGS $CLANG_FLAGS" | ||
206 | |||
207 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) | 217 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) |
208 | AC_CHECK_FUNCS([getentropy issetugid memmem poll reallocarray]) | 218 | AC_CHECK_FUNCS([getentropy issetugid memmem poll reallocarray]) |
209 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum]) | 219 | AC_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])) |
285 | AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) | 295 | AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) |
286 | 296 | ||
297 | AC_ARG_ENABLE([extratests], | ||
298 | AS_HELP_STRING([--enable-extratests], [Enable extra tests that may be unreliable on some platforms])) | ||
299 | AM_CONDITIONAL([ENABLE_EXTRATESTS], [test "x$enable_extratests" = xyes]) | ||
300 | |||
287 | old_cflags=$CFLAGS | 301 | old_cflags=$CFLAGS |
288 | CFLAGS="$old_cflags -I$srcdir/include" | 302 | CFLAGS="$CFLAGS -I$srcdir/include" |
303 | AC_MSG_CHECKING([if BSWAP4 builds without __STRICT_ALIGNMENT]) | ||
289 | AC_TRY_COMPILE([#include "$srcdir/crypto/modes/modes_lcl.h"], | 304 | AC_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) | ||
292 | CFLAGS="$old_cflags" | 310 | CFLAGS="$old_cflags" |
293 | 311 | ||
294 | case $host_cpu in | 312 | case $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 | ;; |
302 | esac | 320 | esac |
303 | 321 | ||
@@ -306,13 +324,6 @@ AM_CONDITIONAL([HOST_ASM_ELF_X86_64], | |||
306 | AM_CONDITIONAL([HOST_ASM_MACOSX_X86_64], | 324 | AM_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 | ||
309 | AC_ARG_ENABLE([libtls], | ||
310 | AS_HELP_STRING([--enable-libtls], [Enable building the libtls library])) | ||
311 | AM_CONDITIONAL([ENABLE_LIBTLS], [test "x$enable_libtls" = xyes]) | ||
312 | AM_COND_IF([ENABLE_LIBTLS], [AC_CONFIG_FILES([libtls.pc])]) | ||
313 | |||
314 | LT_INIT | ||
315 | |||
316 | AC_CONFIG_FILES([ | 327 | AC_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 @@ | |||
1 | include $(top_srcdir)/Makefile.am.common | 1 | include $(top_srcdir)/Makefile.am.common |
2 | 2 | ||
3 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/asn1 | 3 | AM_CFLAGS += -I$(top_srcdir)/crypto/asn1 |
4 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/evp | 4 | AM_CFLAGS += -I$(top_srcdir)/crypto/evp |
5 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/modes | 5 | AM_CFLAGS += -I$(top_srcdir)/crypto/modes |
6 | 6 | ||
7 | lib_LTLIBRARIES = libcrypto.la | 7 | lib_LTLIBRARIES = libcrypto.la |
8 | 8 | ||
@@ -10,13 +10,12 @@ EXTRA_DIST = VERSION | |||
10 | 10 | ||
11 | libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined | 11 | libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined |
12 | libcrypto_la_LIBADD = libcompat.la libcompatnoopt.la | 12 | libcrypto_la_LIBADD = libcompat.la libcompatnoopt.la |
13 | libcrypto_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) | 13 | libcrypto_la_CPPFLAGS = -DOPENSSL_NO_HW_PADLOCK |
14 | libcrypto_la_CFLAGS += -DOPENSSL_NO_HW_PADLOCK | ||
15 | if OPENSSL_NO_ASM | 14 | if OPENSSL_NO_ASM |
16 | libcrypto_la_CFLAGS += -DOPENSSL_NO_ASM | 15 | libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM |
17 | else | 16 | else |
18 | if HOST_WIN | 17 | if HOST_WIN |
19 | libcrypto_la_CFLAGS += -DOPENSSL_NO_ASM | 18 | libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM |
20 | endif | 19 | endif |
21 | endif | 20 | endif |
22 | 21 | ||
@@ -31,7 +30,6 @@ libcompatnoopt_la_SOURCES += compat/explicit_bzero.c | |||
31 | endif | 30 | endif |
32 | 31 | ||
33 | # other compatibility functions | 32 | # other compatibility functions |
34 | libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) | ||
35 | libcompat_la_SOURCES = | 33 | libcompat_la_SOURCES = |
36 | libcompat_la_LIBADD = $(PLATFORM_LDADD) | 34 | libcompat_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 | |||
22 | EXTRA_DIST += $(ASM_X86_64_ELF) | 22 | EXTRA_DIST += $(ASM_X86_64_ELF) |
23 | 23 | ||
24 | if HOST_ASM_ELF_X86_64 | 24 | if HOST_ASM_ELF_X86_64 |
25 | libcrypto_la_CFLAGS += -DAES_ASM | 25 | libcrypto_la_CPPFLAGS += -DAES_ASM |
26 | libcrypto_la_CFLAGS += -DBSAES_ASM | 26 | libcrypto_la_CPPFLAGS += -DBSAES_ASM |
27 | libcrypto_la_CFLAGS += -DVPAES_ASM | 27 | libcrypto_la_CPPFLAGS += -DVPAES_ASM |
28 | libcrypto_la_CFLAGS += -DOPENSSL_IA32_SSE2 | 28 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 |
29 | libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_MONT | 29 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
30 | libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_MONT5 | 30 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 |
31 | libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_GF2m | 31 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_GF2m |
32 | libcrypto_la_CFLAGS += -DMD5_ASM | 32 | libcrypto_la_CPPFLAGS += -DMD5_ASM |
33 | libcrypto_la_CFLAGS += -DGHASH_ASM | 33 | libcrypto_la_CPPFLAGS += -DGHASH_ASM |
34 | libcrypto_la_CFLAGS += -DRSA_ASM | 34 | libcrypto_la_CPPFLAGS += -DRSA_ASM |
35 | libcrypto_la_CFLAGS += -DSHA1_ASM | 35 | libcrypto_la_CPPFLAGS += -DSHA1_ASM |
36 | libcrypto_la_CFLAGS += -DSHA256_ASM | 36 | libcrypto_la_CPPFLAGS += -DSHA256_ASM |
37 | libcrypto_la_CFLAGS += -DSHA512_ASM | 37 | libcrypto_la_CPPFLAGS += -DSHA512_ASM |
38 | libcrypto_la_CFLAGS += -DWHIRLPOOL_ASM | 38 | libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM |
39 | libcrypto_la_CFLAGS += -DOPENSSL_CPUID_OBJ | 39 | libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ |
40 | libcrypto_la_SOURCES += $(ASM_X86_64_ELF) | 40 | libcrypto_la_SOURCES += $(ASM_X86_64_ELF) |
41 | endif | 41 | endif |
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 | |||
22 | EXTRA_DIST += $(ASM_X86_64_MACOSX) | 22 | EXTRA_DIST += $(ASM_X86_64_MACOSX) |
23 | 23 | ||
24 | if HOST_ASM_MACOSX_X86_64 | 24 | if HOST_ASM_MACOSX_X86_64 |
25 | libcrypto_la_CFLAGS += -DAES_ASM | 25 | libcrypto_la_CPPFLAGS += -DAES_ASM |
26 | libcrypto_la_CFLAGS += -DBSAES_ASM | 26 | libcrypto_la_CPPFLAGS += -DBSAES_ASM |
27 | libcrypto_la_CFLAGS += -DVPAES_ASM | 27 | libcrypto_la_CPPFLAGS += -DVPAES_ASM |
28 | libcrypto_la_CFLAGS += -DOPENSSL_IA32_SSE2 | 28 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 |
29 | libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_MONT | 29 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
30 | libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_MONT5 | 30 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 |
31 | libcrypto_la_CFLAGS += -DOPENSSL_BN_ASM_GF2m | 31 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_GF2m |
32 | libcrypto_la_CFLAGS += -DMD5_ASM | 32 | libcrypto_la_CPPFLAGS += -DMD5_ASM |
33 | libcrypto_la_CFLAGS += -DGHASH_ASM | 33 | libcrypto_la_CPPFLAGS += -DGHASH_ASM |
34 | libcrypto_la_CFLAGS += -DRSA_ASM | 34 | libcrypto_la_CPPFLAGS += -DRSA_ASM |
35 | libcrypto_la_CFLAGS += -DSHA1_ASM | 35 | libcrypto_la_CPPFLAGS += -DSHA1_ASM |
36 | libcrypto_la_CFLAGS += -DSHA256_ASM | 36 | libcrypto_la_CPPFLAGS += -DSHA256_ASM |
37 | libcrypto_la_CFLAGS += -DSHA512_ASM | 37 | libcrypto_la_CPPFLAGS += -DSHA512_ASM |
38 | libcrypto_la_CFLAGS += -DWHIRLPOOL_ASM | 38 | libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM |
39 | libcrypto_la_CFLAGS += -DOPENSSL_CPUID_OBJ | 39 | libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ |
40 | libcrypto_la_SOURCES += $(ASM_X86_64_MACOSX) | 40 | libcrypto_la_SOURCES += $(ASM_X86_64_MACOSX) |
41 | endif | 41 | endif |
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 | ||
9 | rm -fr $DIST | 9 | rm -fr $DIST |
10 | mkdir -p $DIST | 10 | mkdir -p $DIST |
11 | autoreconf -i | ||
11 | 12 | ||
12 | for ARCH in X86 X64; do | 13 | for 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 |
@@ -3,5 +3,5 @@ set -e | |||
3 | 3 | ||
4 | rm -f man/*.1 man/*.3 | 4 | rm -f man/*.1 man/*.3 |
5 | ./autogen.sh | 5 | ./autogen.sh |
6 | ./configure --enable-libtls | 6 | ./configure |
7 | make distcheck | 7 | make 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 | |||
20 | rm -fr $DESTDIR | 20 | rm -fr $DESTDIR |
21 | 21 | ||
22 | echo "Configuring to build with code coverage support" | 22 | echo "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 | ||
25 | echo "Running all code paths" | 25 | echo "Running all code paths" |
26 | make clean | 26 | make 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 | |||
28 | noinst_HEADERS += sys/types.h | 28 | noinst_HEADERS += sys/types.h |
29 | noinst_HEADERS += sys/uio.h | 29 | noinst_HEADERS += sys/uio.h |
30 | 30 | ||
31 | if ENABLE_LIBTLS | ||
32 | include_HEADERS = tls.h | 31 | include_HEADERS = tls.h |
33 | endif | ||
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 | ||
6 | if [ "x$ARCH" = "xnative" ]; then | 6 | if [ "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 |
33 | fi | 33 | fi |
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 | |||
5 | EXTRA_DIST = VERSION | 5 | EXTRA_DIST = VERSION |
6 | 6 | ||
7 | libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined | 7 | libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined |
8 | libssl_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) | ||
9 | libssl_la_LIBADD = ../crypto/libcrypto.la | 8 | libssl_la_LIBADD = ../crypto/libcrypto.la |
10 | 9 | ||
11 | libssl_la_SOURCES = bio_ssl.c | 10 | libssl_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 @@ | |||
1 | include $(top_srcdir)/Makefile.am.common | ||
2 | |||
3 | AM_CPPFLAGS += -I $(top_srcdir)/crypto/modes | ||
4 | AM_CPPFLAGS += -I $(top_srcdir)/crypto/asn1 | ||
5 | AM_CPPFLAGS += -I $(top_srcdir)/ssl | ||
6 | |||
7 | LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) | ||
8 | LDADD += $(top_builddir)/ssl/libssl.la | ||
9 | LDADD += $(top_builddir)/crypto/libcrypto.la | ||
10 | |||
11 | TESTS = | ||
12 | check_PROGRAMS = | ||
13 | EXTRA_DIST = | ||
14 | DISTCLEANFILES = pidwraptest.txt | ||
15 | |||
16 | # aeadtest | ||
17 | TESTS += aeadtest.sh | ||
18 | check_PROGRAMS += aeadtest | ||
19 | aeadtest_SOURCES = aeadtest.c | ||
20 | EXTRA_DIST += aeadtest.sh | ||
21 | EXTRA_DIST += aeadtests.txt | ||
22 | |||
23 | # aes_wrap | ||
24 | TESTS += aes_wrap | ||
25 | check_PROGRAMS += aes_wrap | ||
26 | aes_wrap_SOURCES = aes_wrap.c | ||
27 | |||
28 | # arc4randomforktest | ||
29 | # Windows/mingw does not have fork, but Cygwin does. | ||
30 | if !HOST_WIN | ||
31 | TESTS += arc4randomforktest.sh | ||
32 | check_PROGRAMS += arc4randomforktest | ||
33 | arc4randomforktest_SOURCES = arc4randomforktest.c | ||
34 | endif | ||
35 | EXTRA_DIST += arc4randomforktest.sh | ||
36 | |||
37 | # asn1test | ||
38 | TESTS += asn1test | ||
39 | check_PROGRAMS += asn1test | ||
40 | asn1test_SOURCES = asn1test.c | ||
41 | |||
42 | # base64test | ||
43 | TESTS += base64test | ||
44 | check_PROGRAMS += base64test | ||
45 | base64test_SOURCES = base64test.c | ||
46 | |||
47 | # bftest | ||
48 | TESTS += bftest | ||
49 | check_PROGRAMS += bftest | ||
50 | bftest_SOURCES = bftest.c | ||
51 | |||
52 | # biotest | ||
53 | # the BIO tests rely on resolver results that are OS and environment-specific | ||
54 | if ENABLE_EXTRATESTS | ||
55 | TESTS += biotest | ||
56 | check_PROGRAMS += biotest | ||
57 | biotest_SOURCES = biotest.c | ||
58 | endif | ||
59 | |||
60 | # bntest | ||
61 | TESTS += bntest | ||
62 | check_PROGRAMS += bntest | ||
63 | bntest_SOURCES = bntest.c | ||
64 | |||
65 | # bytestringtest | ||
66 | TESTS += bytestringtest | ||
67 | check_PROGRAMS += bytestringtest | ||
68 | bytestringtest_SOURCES = bytestringtest.c | ||
69 | |||
70 | # casttest | ||
71 | TESTS += casttest | ||
72 | check_PROGRAMS += casttest | ||
73 | casttest_SOURCES = casttest.c | ||
74 | |||
75 | # chachatest | ||
76 | TESTS += chachatest | ||
77 | check_PROGRAMS += chachatest | ||
78 | chachatest_SOURCES = chachatest.c | ||
79 | |||
80 | # cipherstest | ||
81 | TESTS += cipherstest | ||
82 | check_PROGRAMS += cipherstest | ||
83 | cipherstest_SOURCES = cipherstest.c | ||
84 | |||
85 | # cts128test | ||
86 | TESTS += cts128test | ||
87 | check_PROGRAMS += cts128test | ||
88 | cts128test_SOURCES = cts128test.c | ||
89 | |||
90 | # destest | ||
91 | TESTS += destest | ||
92 | check_PROGRAMS += destest | ||
93 | destest_SOURCES = destest.c | ||
94 | |||
95 | # dhtest | ||
96 | TESTS += dhtest | ||
97 | check_PROGRAMS += dhtest | ||
98 | dhtest_SOURCES = dhtest.c | ||
99 | |||
100 | # dsatest | ||
101 | TESTS += dsatest | ||
102 | check_PROGRAMS += dsatest | ||
103 | dsatest_SOURCES = dsatest.c | ||
104 | |||
105 | # ecdhtest | ||
106 | TESTS += ecdhtest | ||
107 | check_PROGRAMS += ecdhtest | ||
108 | ecdhtest_SOURCES = ecdhtest.c | ||
109 | |||
110 | # ecdsatest | ||
111 | TESTS += ecdsatest | ||
112 | check_PROGRAMS += ecdsatest | ||
113 | ecdsatest_SOURCES = ecdsatest.c | ||
114 | |||
115 | # ectest | ||
116 | TESTS += ectest | ||
117 | check_PROGRAMS += ectest | ||
118 | ectest_SOURCES = ectest.c | ||
119 | |||
120 | # enginetest | ||
121 | TESTS += enginetest | ||
122 | check_PROGRAMS += enginetest | ||
123 | enginetest_SOURCES = enginetest.c | ||
124 | |||
125 | # evptest | ||
126 | TESTS += evptest.sh | ||
127 | check_PROGRAMS += evptest | ||
128 | evptest_SOURCES = evptest.c | ||
129 | EXTRA_DIST += evptest.sh | ||
130 | EXTRA_DIST += evptests.txt | ||
131 | |||
132 | # explicit_bzero | ||
133 | # explicit_bzero relies on SA_ONSTACK, which is unavailable on Windows | ||
134 | if !HOST_WIN | ||
135 | if !HOST_CYGWIN | ||
136 | TESTS += explicit_bzero | ||
137 | check_PROGRAMS += explicit_bzero | ||
138 | explicit_bzero_SOURCES = explicit_bzero.c | ||
139 | if !HAVE_MEMMEM | ||
140 | explicit_bzero_SOURCES += memmem.c | ||
141 | endif | ||
142 | endif | ||
143 | endif | ||
144 | |||
145 | # exptest | ||
146 | TESTS += exptest | ||
147 | check_PROGRAMS += exptest | ||
148 | exptest_SOURCES = exptest.c | ||
149 | |||
150 | # gcm128test | ||
151 | TESTS += gcm128test | ||
152 | check_PROGRAMS += gcm128test | ||
153 | gcm128test_SOURCES = gcm128test.c | ||
154 | |||
155 | # gost2814789t | ||
156 | TESTS += gost2814789t | ||
157 | check_PROGRAMS += gost2814789t | ||
158 | gost2814789t_SOURCES = gost2814789t.c | ||
159 | |||
160 | # hmactest | ||
161 | TESTS += hmactest | ||
162 | check_PROGRAMS += hmactest | ||
163 | hmactest_SOURCES = hmactest.c | ||
164 | |||
165 | # ideatest | ||
166 | TESTS += ideatest | ||
167 | check_PROGRAMS += ideatest | ||
168 | ideatest_SOURCES = ideatest.c | ||
169 | |||
170 | # igetest | ||
171 | TESTS += igetest | ||
172 | check_PROGRAMS += igetest | ||
173 | igetest_SOURCES = igetest.c | ||
174 | |||
175 | # md4test | ||
176 | TESTS += md4test | ||
177 | check_PROGRAMS += md4test | ||
178 | md4test_SOURCES = md4test.c | ||
179 | |||
180 | # md5test | ||
181 | TESTS += md5test | ||
182 | check_PROGRAMS += md5test | ||
183 | md5test_SOURCES = md5test.c | ||
184 | |||
185 | # mdc2test | ||
186 | TESTS += mdc2test | ||
187 | check_PROGRAMS += mdc2test | ||
188 | mdc2test_SOURCES = mdc2test.c | ||
189 | |||
190 | # mont | ||
191 | TESTS += mont | ||
192 | check_PROGRAMS += mont | ||
193 | mont_SOURCES = mont.c | ||
194 | |||
195 | # pbkdf2 | ||
196 | TESTS += pbkdf2 | ||
197 | check_PROGRAMS += pbkdf2 | ||
198 | pbkdf2_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 | ||
203 | if ENABLE_EXTRATESTS | ||
204 | TESTS += pidwraptest | ||
205 | check_PROGRAMS += pidwraptest | ||
206 | pidwraptest_SOURCES = pidwraptest.c | ||
207 | endif | ||
208 | |||
209 | # pkcs7test | ||
210 | TESTS += pkcs7test | ||
211 | check_PROGRAMS += pkcs7test | ||
212 | pkcs7test_SOURCES = pkcs7test.c | ||
213 | |||
214 | # poly1305test | ||
215 | TESTS += poly1305test | ||
216 | check_PROGRAMS += poly1305test | ||
217 | poly1305test_SOURCES = poly1305test.c | ||
218 | |||
219 | # pq_test | ||
220 | TESTS += pq_test.sh | ||
221 | check_PROGRAMS += pq_test | ||
222 | pq_test_SOURCES = pq_test.c | ||
223 | EXTRA_DIST += pq_test.sh | ||
224 | EXTRA_DIST += pq_expected.txt | ||
225 | |||
226 | # randtest | ||
227 | TESTS += randtest | ||
228 | check_PROGRAMS += randtest | ||
229 | randtest_SOURCES = randtest.c | ||
230 | |||
231 | # rc2test | ||
232 | TESTS += rc2test | ||
233 | check_PROGRAMS += rc2test | ||
234 | rc2test_SOURCES = rc2test.c | ||
235 | |||
236 | # rc4test | ||
237 | TESTS += rc4test | ||
238 | check_PROGRAMS += rc4test | ||
239 | rc4test_SOURCES = rc4test.c | ||
240 | |||
241 | # rmdtest | ||
242 | TESTS += rmdtest | ||
243 | check_PROGRAMS += rmdtest | ||
244 | rmdtest_SOURCES = rmdtest.c | ||
245 | |||
246 | # sha1test | ||
247 | TESTS += sha1test | ||
248 | check_PROGRAMS += sha1test | ||
249 | sha1test_SOURCES = sha1test.c | ||
250 | |||
251 | # sha256test | ||
252 | TESTS += sha256test | ||
253 | check_PROGRAMS += sha256test | ||
254 | sha256test_SOURCES = sha256test.c | ||
255 | |||
256 | # sha512test | ||
257 | TESTS += sha512test | ||
258 | check_PROGRAMS += sha512test | ||
259 | sha512test_SOURCES = sha512test.c | ||
260 | |||
261 | # shatest | ||
262 | TESTS += shatest | ||
263 | check_PROGRAMS += shatest | ||
264 | shatest_SOURCES = shatest.c | ||
265 | |||
266 | # ssltest | ||
267 | TESTS += ssltest.sh | ||
268 | check_PROGRAMS += ssltest | ||
269 | ssltest_SOURCES = ssltest.c | ||
270 | EXTRA_DIST += ssltest.sh | ||
271 | EXTRA_DIST += testssl ca.pem server.pem | ||
272 | |||
273 | # timingsafe | ||
274 | TESTS += timingsafe | ||
275 | check_PROGRAMS += timingsafe | ||
276 | timingsafe_SOURCES = timingsafe.c | ||
277 | |||
278 | # utf8test | ||
279 | TESTS += utf8test | ||
280 | check_PROGRAMS += utf8test | ||
281 | utf8test_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 @@ | |||
1 | include $(top_srcdir)/Makefile.am.common | ||
2 | |||
3 | AM_CPPFLAGS += -I $(top_srcdir)/crypto/modes | ||
4 | AM_CPPFLAGS += -I $(top_srcdir)/crypto/asn1 | ||
5 | AM_CPPFLAGS += -I $(top_srcdir)/ssl | ||
6 | |||
7 | LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) | ||
8 | LDADD += $(top_builddir)/ssl/libssl.la | ||
9 | LDADD += $(top_builddir)/crypto/libcrypto.la | ||
10 | |||
11 | TESTS = | ||
12 | check_PROGRAMS = | ||
13 | EXTRA_DIST = | ||
14 | DISTCLEANFILES = 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 @@ | |||
1 | include $(top_srcdir)/Makefile.am.common | 1 | include $(top_srcdir)/Makefile.am.common |
2 | 2 | ||
3 | if ENABLE_LIBTLS | ||
4 | lib_LTLIBRARIES = libtls.la | 3 | lib_LTLIBRARIES = libtls.la |
5 | 4 | ||
6 | EXTRA_DIST = VERSION | 5 | EXTRA_DIST = VERSION |
7 | 6 | ||
8 | libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined | 7 | libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined |
9 | libtls_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) | ||
10 | libtls_la_LIBADD = ../crypto/libcrypto.la ../ssl/libssl.la $(PLATFORM_LDADD) | 8 | libtls_la_LIBADD = ../crypto/libcrypto.la ../ssl/libssl.la $(PLATFORM_LDADD) |
11 | 9 | ||
12 | libtls_la_SOURCES = tls.c | 10 | libtls_la_SOURCES = tls.c |
@@ -20,5 +18,3 @@ noinst_HEADERS = tls_internal.h | |||
20 | if !HAVE_STRSEP | 18 | if !HAVE_STRSEP |
21 | libtls_la_SOURCES += strsep.c | 19 | libtls_la_SOURCES += strsep.c |
22 | endif | 20 | endif |
23 | |||
24 | endif | ||
@@ -18,15 +18,15 @@ fi | |||
18 | git pull --rebase) | 18 | git pull --rebase) |
19 | 19 | ||
20 | # setup source paths | 20 | # setup source paths |
21 | dir=`pwd` | 21 | CWD=`pwd` |
22 | libc_src=$dir/openbsd/src/lib/libc | 22 | libc_src=$CWD/openbsd/src/lib/libc |
23 | libc_regress=$dir/openbsd/src/regress/lib/libc | 23 | libc_regress=$CWD/openbsd/src/regress/lib/libc |
24 | libcrypto_src=$dir/openbsd/src/lib/libcrypto | 24 | libcrypto_src=$CWD/openbsd/src/lib/libcrypto |
25 | libcrypto_regress=$dir/openbsd/src/regress/lib/libcrypto | 25 | libcrypto_regress=$CWD/openbsd/src/regress/lib/libcrypto |
26 | libssl_src=$dir/openbsd/src/lib/libssl | 26 | libssl_src=$CWD/openbsd/src/lib/libssl |
27 | libssl_regress=$dir/openbsd/src/regress/lib/libssl | 27 | libssl_regress=$CWD/openbsd/src/regress/lib/libssl |
28 | libtls_src=$dir/openbsd/src/lib/libtls | 28 | libtls_src=$CWD/openbsd/src/lib/libtls |
29 | openssl_app_src=$dir/openbsd/src/usr.bin/openssl | 29 | openssl_app_src=$CWD/openbsd/src/usr.bin/openssl |
30 | 30 | ||
31 | # load library versions | 31 | # load library versions |
32 | source $libcrypto_src/crypto/shlib_version | 32 | source $libcrypto_src/crypto/shlib_version |
@@ -197,13 +197,14 @@ echo "copying tests" | |||
197 | for i in `find $libcrypto_regress -name '*.c'`; do | 197 | for i in `find $libcrypto_regress -name '*.c'`; do |
198 | $CP "$i" tests | 198 | $CP "$i" tests |
199 | done | 199 | done |
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 |
202 | rm 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 | ||
219 | test_drivers=( | ||
220 | aeadtest | ||
221 | evptest | ||
222 | pq_test | ||
223 | ssltest | ||
224 | arc4randomforktest | ||
225 | pidwraptest | ||
226 | ) | ||
227 | tests_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 | ||
259 | chmod 755 tests/testssl | 218 | chmod 755 tests/testssl |
260 | for 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 | ||
273 | done | ||
274 | echo "EXTRA_DIST += aeadtests.txt" >> tests/Makefile.am | ||
275 | echo "EXTRA_DIST += evptests.txt" >> tests/Makefile.am | ||
276 | echo "EXTRA_DIST += pq_expected.txt" >> tests/Makefile.am | ||
277 | echo "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 | ||
286 | echo "copying manpages" | ||
287 | # copy manpages | 228 | # copy manpages |
229 | echo "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 | ) |