Compare commits

...

21 Commits

Author SHA1 Message Date
Brent Cook
c4ebe2518c Update changelog 2016-09-23 05:40:01 -05:00
Geoff Beier
1d36474726 Set _PATH_SSL_CA_FILE to either CMAKE_INSTALL_PREFIX or OPENSSLDIR for the OCSP tests so that OCSP tests can be executed on a system without /etc/ssl/cert.pem 2016-08-02 11:02:48 -05:00
Brent Cook
48ecc2d05d update changelog for 2.4.2 2016-07-31 17:55:50 -05:00
Brent Cook
7f322bfe7e set link library dependencies with MSVC, fixes #221 2016-07-31 17:12:35 -05:00
Brent Cook
47d4f7109f properly enable strnlen checks for MSVC 2016-07-31 17:12:35 -05:00
Brent Cook
12348e6f64 create OPENBSD_6_0 branch 2016-07-29 07:51:02 -05:00
celan69
1b10e48a1f Fix typo in USE_BUILTIN_ARC4RANDOM check
Solaris 11 recently introduced a builtin arc4random in libc which fails the tests in "make check". Found USE_BUILTIN_ARC4RANDOM, but could not get it to work. Apparently, there is a typo in the configure logic rendering USE_BUILTIN_ARC4RANDOM ineffective.
2016-07-19 12:11:28 +02:00
Brent Cook
a9332ccecf avoid BSWAP assembly for ARM <= v6 2016-07-17 18:12:23 -05:00
Brent Cook
fa435db8df format 64-bit int portably (windows wants %l64d) 2016-07-17 17:37:16 -05:00
Brent Cook
618c32e4a1 don't build nc with MSVC 2016-07-11 03:14:23 -05:00
Brent Cook
b13529f791 Revert "remove DEFAULT_CA_FILE patch, since libtls handles this by default"
This reverts commit 30adf9c06e.
2016-07-09 12:40:22 -05:00
Brent Cook
30adf9c06e remove DEFAULT_CA_FILE patch, since libtls handles this by default 2016-07-07 07:27:39 -05:00
kinichiro
23083e7724 include OCSP test script 2016-07-05 20:33:16 +09:00
Brent Cook
aab671088d add OCSP test 2016-07-04 23:29:39 -05:00
Brent Cook
ccf66c469f update for netcat changes 2016-06-30 20:00:29 -05:00
Brent Cook
ec4c98718d refine netcat patch 2016-06-30 08:18:03 -05:00
Brent Cook
13b7ac8ada update netcat patch 2016-06-30 05:49:38 -05:00
Brent Cook
ddb22413ed update NetBSD recommendation 2016-06-07 07:10:21 -05:00
Brent Cook
2cbdc049bb Changelog for 2.4.1 2016-06-06 04:57:01 -05:00
Brent Cook
4a9e42808c Land #197, include platform linker flags in the .pc files 2016-06-03 05:14:04 -05:00
Martin Herkt
de4a123930 pc: add platform-specific libs to Libs.private
Fixes compilations including libressl static libraries in MinGW.

Signed-off-by: Ricardo Constantino (:RiCON) <wiiaboo@gmail.com>
2016-05-31 15:24:22 +01:00
18 changed files with 189 additions and 37 deletions

View File

@@ -49,6 +49,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "MINGW")
set(BUILD_NC false)
endif()
if(MSVC)
set(BUILD_NC false)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
if(CMAKE_C_COMPILER MATCHES "gcc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing")
@@ -140,7 +144,7 @@ if(HAVE_STRNDUP)
endif()
if(MSVC)
set(HAVE_STRNLEN)
set(HAVE_STRNLEN true)
add_definitions(-DHAVE_STRNLEN)
else()
check_function_exists(strnlen HAVE_STRNLEN)

View File

@@ -28,6 +28,67 @@ history is also available from Git.
LibreSSL Portable Release Notes:
2.4.3 - Bug fixes and reliability improvements
* Reverted change that cleans up the EVP cipher context in
EVP_EncryptFinal() and EVP_DecryptFinal(). Some software relies on the
previous behaviour.
* Avoid unbounded memory growth in libssl, which can be triggered by a
TLS client repeatedly renegotiating and sending OCSP Status Request
TLS extensions.
* Avoid falling back to a weak digest for (EC)DH when using SNI with
libssl.
2.4.2 - Bug fixes and improvements
* Fixed loading default certificate locations with openssl s_client.
* Ensured OSCP only uses and compares GENERALIZEDTIME values as per
RFC6960. Also added fixes for OCSP to work with intermediate
certificates provided in responses.
* Improved behavior of arc4random on Windows to not appear to leak
memory in debug tools, reduced privileges of allocated memory.
* Fixed incorrect results from BN_mod_word() when the modulus is too
large, thanks to Brian Smith from BoringSSL.
* Correctly handle an EOF prior to completing the TLS handshake in
libtls.
* Improved libtls ceritificate loading and cipher string validation.
* Updated libtls cipher group suites into four categories:
"secure" (TLSv1.2+AEAD+PFS)
"compat" (HIGH:!aNULL)
"legacy" (HIGH:MEDIUM:!aNULL)
"insecure" (ALL:!aNULL:!eNULL)
This allows for flexibility and finer grained control, rather than
having two extremes.
* Limited support for 'backward compatible' SSLv2 handshake packets to
when TLS 1.0 is enabled, providing more restricted compatibility
with TLS 1.0 clients.
* openssl(1) and other documentation improvements.
* Removed flags for disabling constant-time operations.
This removes support for DSA_FLAG_NO_EXP_CONSTTIME,
DH_FLAG_NO_EXP_CONSTTIME, and RSA_FLAG_NO_CONSTTIME flags, making
all of these operations unconditionally constant-time.
2.4.1 - Security fix
* Correct a problem that prevents the DSA signing algorithm from
running in constant time even if the flag BN_FLG_CONSTTIME is set.
This issue was reported by Cesar Pereida (Aalto University), Billy
Brumley (Tampere University of Technology), and Yuval Yarom (The
University of Adelaide and NICTA). The fix was developed by Cesar
Pereida.
2.4.0 - Build improvements, new features
* Many improvements to the CMake build infrastructure, including

View File

@@ -1 +1 @@
master
OPENBSD_6_0

View File

@@ -30,7 +30,7 @@ At the time of this writing, LibreSSL is know to build and work on:
* Linux (kernel 3.17 or later recommended)
* FreeBSD (tested with 9.2 and later)
* NetBSD (tested with 6.1.5)
* NetBSD (7.0 or later recommended)
* HP-UX (11i)
* Solaris (11 and later preferred)
* Mac OS X (tested with 10.8 and later)

View File

@@ -752,6 +752,9 @@ if (BUILD_SHARED)
add_library(crypto-objects OBJECT ${CRYPTO_SRC})
add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>)
add_library(crypto-shared SHARED $<TARGET_OBJECTS:crypto-objects>)
if (MSVC)
target_link_libraries(crypto-shared crypto Ws2_32.lib)
endif()
set_target_properties(crypto-shared PROPERTIES OUTPUT_NAME crypto)
set_target_properties(crypto-shared PROPERTIES VERSION
${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})

View File

@@ -11,5 +11,5 @@ Version: @VERSION@
Requires:
Conflicts:
Libs: -L${libdir} -lcrypto
Libs.private: @LIBS@
Libs.private: @LIBS@ @PLATFORM_LDADD@
Cflags: -I${includedir}

View File

@@ -12,5 +12,5 @@ Requires:
Requires.private: libcrypto
Conflicts:
Libs: -L${libdir} -lssl
Libs.private: @LIBS@ -lcrypto
Libs.private: @LIBS@ -lcrypto @PLATFORM_LDADD@
Cflags: -I${includedir}

View File

@@ -12,5 +12,5 @@ Requires:
Requires.private: libcrypto libssl
Conflicts:
Libs: -L${libdir} -ltls
Libs.private: @LIBS@ -lcrypto -lssl
Libs.private: @LIBS@ -lcrypto -lssl @PLATFORM_LDADD@
Cflags: -I${includedir}

View File

@@ -59,7 +59,7 @@ AM_CONDITIONAL([HAVE_TIMINGSAFE_MEMCMP], [test "x$ac_cv_func_timingsafe_memcmp"
# Override arc4random_buf implementations with known issues
AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF],
[test "x$USE_BUILTIN_ARC4RANDOM" != yes \
[test "x$USE_BUILTIN_ARC4RANDOM" != xyes \
-a "x$ac_cv_func_arc4random_buf" = xyes])
# Check for getentropy fallback dependencies

21
patches/modes_lcl.h Normal file
View File

@@ -0,0 +1,21 @@
--- openbsd/src/lib/libssl/src/crypto/modes/modes_lcl.h Sat Dec 6 17:15:50 2014
+++ crypto/modes/modes_lcl.h Sun Jul 17 17:45:27 2016
@@ -43,14 +43,16 @@
asm ("bswapl %0" \
: "+r"(ret)); ret; })
# elif (defined(__arm__) || defined(__arm)) && !defined(__STRICT_ALIGNMENT)
-# define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \
+# if (__ARM_ARCH >= 6)
+# define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \
asm ("rev %0,%0; rev %1,%1" \
: "+r"(hi),"+r"(lo)); \
(u64)hi<<32|lo; })
-# define BSWAP4(x) ({ u32 ret; \
+# define BSWAP4(x) ({ u32 ret; \
asm ("rev %0,%1" \
: "=r"(ret) : "r"((u32)(x))); \
ret; })
+# endif
# endif
#endif
#endif

View File

@@ -1,17 +1,6 @@
--- apps/nc/netcat.c.orig Mon May 30 11:05:31 2016
+++ apps/nc/netcat.c Mon May 30 11:05:44 2016
@@ -57,6 +57,10 @@
#include <tls.h>
#include "atomicio.h"
+#ifndef IPV6_TCLASS
+#define IPV6_TCLASS -1
+#endif
+
#define PORT_MAX 65535
#define UNIX_DG_TMP_SOCKET_SIZE 19
@@ -65,7 +69,9 @@
--- apps/nc/netcat.c.orig Thu Jun 30 19:56:49 2016
+++ apps/nc/netcat.c Thu Jun 30 19:59:09 2016
@@ -65,7 +65,9 @@
#define POLL_NETIN 2
#define POLL_STDOUT 3
#define BUFSIZE 16384
@@ -21,7 +10,7 @@
#define TLS_LEGACY (1 << 1)
#define TLS_NOVERIFY (1 << 2)
@@ -92,9 +98,13 @@
@@ -92,9 +94,13 @@
int Dflag; /* sodebug */
int Iflag; /* TCP receive buffer size */
int Oflag; /* TCP send buffer size */
@@ -35,7 +24,7 @@
int usetls; /* use TLS */
char *Cflag; /* Public cert file */
@@ -150,7 +160,7 @@
@@ -152,7 +158,7 @@
struct servent *sv;
socklen_t len;
struct sockaddr_storage cliaddr;
@@ -44,7 +33,7 @@
const char *errstr, *proxyhost = "", *proxyport = NULL;
struct addrinfo proxyhints;
char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE];
@@ -251,12 +261,14 @@
@@ -262,12 +268,14 @@
case 'u':
uflag = 1;
break;
@@ -59,7 +48,7 @@
case 'v':
vflag = 1;
break;
@@ -289,9 +301,11 @@
@@ -300,9 +308,11 @@
errx(1, "TCP send window %s: %s",
errstr, optarg);
break;
@@ -71,7 +60,7 @@
case 'T':
errstr = NULL;
errno = 0;
@@ -315,9 +329,11 @@
@@ -326,9 +336,11 @@
argc -= optind;
argv += optind;
@@ -83,7 +72,7 @@
if (family == AF_UNIX) {
if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1)
@@ -469,7 +485,10 @@
@@ -480,7 +492,10 @@
errx(1, "-H and -T noverify may not be used"
"together");
tls_config_insecure_noverifycert(tls_cfg);
@@ -95,19 +84,19 @@
}
if (lflag) {
struct tls *tls_cctx = NULL;
@@ -817,7 +836,10 @@
@@ -832,7 +847,10 @@
remote_connect(const char *host, const char *port, struct addrinfo hints)
{
struct addrinfo *res, *res0;
- int s, error, on = 1;
+ int s, error;
- int s, error, on = 1, save_errno;
+ int s, error, save_errno;
+#ifdef SO_BINDANY
+ int on = 1;
+#endif
if ((error = getaddrinfo(host, port, &hints, &res)))
errx(1, "getaddrinfo: %s", gai_strerror(error));
@@ -832,8 +854,10 @@
@@ -847,8 +865,10 @@
if (sflag || pflag) {
struct addrinfo ahints, *ares;
@@ -118,19 +107,19 @@
memset(&ahints, 0, sizeof(struct addrinfo));
ahints.ai_family = res0->ai_family;
ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
@@ -902,7 +926,10 @@
@@ -919,7 +939,10 @@
local_listen(char *host, char *port, struct addrinfo hints)
{
struct addrinfo *res, *res0;
- int s, ret, x = 1;
+ int s;
- int s, ret, x = 1, save_errno;
+ int s, save_errno;
+#ifdef SO_REUSEPORT
+ int ret, x = 1;
+#endif
int error;
/* Allow nodename to be null. */
@@ -924,9 +951,11 @@
@@ -941,9 +964,11 @@
res0->ai_protocol)) < 0)
continue;
@@ -142,7 +131,7 @@
set_common_sockopts(s, res0->ai_family);
@@ -1366,11 +1395,13 @@
@@ -1401,11 +1426,13 @@
{
int x = 1;
@@ -156,7 +145,26 @@
if (Dflag) {
if (setsockopt(s, SOL_SOCKET, SO_DEBUG,
&x, sizeof(x)) == -1)
@@ -1553,14 +1584,22 @@
@@ -1442,13 +1469,17 @@
}
if (minttl != -1) {
+#ifdef IP_MINTTL
if (af == AF_INET && setsockopt(s, IPPROTO_IP,
IP_MINTTL, &minttl, sizeof(minttl)))
err(1, "set IP min TTL");
+#endif
- else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6,
+#ifdef IPV6_MINHOPCOUNT
+ if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6,
IPV6_MINHOPCOUNT, &minttl, sizeof(minttl)))
err(1, "set IPv6 min hop count");
+#endif
}
}
@@ -1605,14 +1636,22 @@
\t-P proxyuser\tUsername for proxy authentication\n\
\t-p port\t Specify local port for remote connects\n\
\t-R CAfile CA bundle\n\

19
patches/ssl_txt.c.patch Normal file
View File

@@ -0,0 +1,19 @@
--- ssl/ssl_txt.orig Sun Jul 17 17:26:59 2016
+++ ssl/ssl_txt.c Sun Jul 17 17:35:44 2016
@@ -82,6 +82,7 @@
* OTHERWISE.
*/
+#include <inttypes.h>
#include <stdio.h>
#include <openssl/buffer.h>
@@ -163,7 +164,7 @@
}
if (x->time != 0) {
- if (BIO_printf(bp, "\n Start Time: %lld", (long long)x->time) <= 0)
+ if (BIO_printf(bp, "\n Start Time: %"PRId64, (int64_t)x->time) <= 0)
goto err;
}
if (x->timeout != 0L) {

View File

@@ -52,6 +52,9 @@ if (BUILD_SHARED)
add_library(ssl-objects OBJECT ${SSL_SRC})
add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>)
add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>)
if (MSVC)
target_link_libraries(ssl-shared crypto-shared Ws2_32.lib)
endif()
set_target_properties(ssl-shared PROPERTIES OUTPUT_NAME ssl)
set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION}
SOVERSION ${SSL_MAJOR_VERSION})

View File

@@ -194,6 +194,19 @@ add_executable(mont mont.c)
target_link_libraries(mont ${OPENSSL_LIBS})
add_test(mont mont)
# ocsp_test
if(ENABLE_EXTRATESTS)
if(NOT "${OPENSSLDIR}" STREQUAL "")
add_definitions(-D_PATH_SSL_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
else()
add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
endif()
add_executable(ocsp_test ocsp_test.c)
target_link_libraries(ocsp_test ${OPENSSL_LIBS})
add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh)
set_tests_properties(ocsptest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}")
endif()
# optionstest
add_executable(optionstest optionstest.c)
target_link_libraries(optionstest ${OPENSSL_LIBS})

View File

@@ -208,6 +208,14 @@ TESTS += mont
check_PROGRAMS += mont
mont_SOURCES = mont.c
# ocsp_test
if ENABLE_EXTRATESTS
TESTS += ocsptest.sh
check_PROGRAMS += ocsp_test
ocsp_test_SOURCES = ocsp_test.c
endif
EXTRA_DIST += ocsptest.sh
# optionstest
TESTS += optionstest
check_PROGRAMS += optionstest

8
tests/ocsptest.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -e
TEST=./ocsp_test
if [ -e ./ocsp_test.exe ]; then
TEST=./ocsp_test.exe
fi
$TEST www.amazon.com 443
$TEST cloudflare.com 443

View File

@@ -31,6 +31,9 @@ if (BUILD_SHARED)
add_library(tls-objects OBJECT ${TLS_SRC})
add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>)
add_library(tls-shared SHARED $<TARGET_OBJECTS:tls-objects>)
if (MSVC)
target_link_libraries(tls-shared ssl-shared crypto-shared Ws2_32.lib)
endif()
set_target_properties(tls-shared PROPERTIES OUTPUT_NAME tls)
set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION}
SOVERSION ${TLS_MAJOR_VERSION})

View File

@@ -13,6 +13,7 @@ if [ ! -d openbsd ]; then
fi
fi
(cd openbsd
git fetch
git checkout $openbsd_branch
git pull --rebase)