Skip to content

Commit bb06c73

Browse files
authored
update to version 3.9.2 (#31)
1 parent 59fac1e commit bb06c73

File tree

535 files changed

+15483
-29810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

535 files changed

+15483
-29810
lines changed

CMakeLists.txt

Lines changed: 71 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
6262
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
6363
endif()
6464

65-
# Enable asserts regardless of build type
66-
add_definitions(-UNDEBUG)
65+
# Do not disable assertions based on CMAKE_BUILD_TYPE
66+
foreach(_build_type "Release" "MinSizeRel" "RelWithDebInfo")
67+
foreach(_lang C CXX)
68+
string(TOUPPER "CMAKE_${_lang}_FLAGS_${_build_type}" _var)
69+
string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " ${_var} "${${_var}}")
70+
endforeach()
71+
endforeach()
6772

6873
set(BUILD_NC true)
6974

@@ -84,16 +89,16 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
8489
set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
8590
endif()
8691

87-
if(WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "MINGW"))
92+
if(WIN32)
8893
set(BUILD_NC false)
89-
add_definitions(-D_GNU_SOURCE)
90-
add_definitions(-D_POSIX)
91-
add_definitions(-D_POSIX_SOURCE)
92-
add_definitions(-D__USE_MINGW_ANSI_STDIO)
94+
if(MINGW)
95+
add_definitions(-D_GNU_SOURCE)
96+
add_definitions(-D_POSIX)
97+
add_definitions(-D_POSIX_SOURCE)
98+
add_definitions(-D__USE_MINGW_ANSI_STDIO)
99+
endif()
93100
endif()
94101

95-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
96-
97102
if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
98103
if(CMAKE_C_COMPILER MATCHES "gcc")
99104
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fno-strict-aliasing")
@@ -129,7 +134,7 @@ if(WIN32)
129134
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
130135
add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS)
131136
add_definitions(-D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS)
132-
add_definitions(-DCPPFLAGS -DNO_SYSLOG -DNO_CRYPT)
137+
add_definitions(-DNO_SYSLOG)
133138
add_definitions(-DWIN32_LEAN_AND_MEAN)
134139
if(NOT CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
135140
add_definitions(-D_WIN32_WINNT=0x0600)
@@ -140,6 +145,15 @@ endif()
140145
if(MSVC)
141146
add_definitions(-Dinline=__inline)
142147
message(STATUS "Using [${CMAKE_C_COMPILER_ID}] compiler")
148+
149+
include(TestBigEndian)
150+
TEST_BIG_ENDIAN(HAVE_BIG_ENDIAN)
151+
if(HAVE_BIG_ENDIAN)
152+
add_definitions(-DHAVE_BIG_ENDIAN)
153+
else()
154+
add_definitions(-DHAVE_LITTLE_ENDIAN)
155+
endif()
156+
143157
if(CMAKE_C_COMPILER_ID MATCHES "MSVC" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
144158
set(MSVC_DISABLED_WARNINGS_LIST
145159
"C4018" # 'expression' : signed/unsigned mismatch
@@ -182,6 +196,8 @@ if(MSVC)
182196
${MSVC_DISABLED_WARNINGS_LIST})
183197
string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
184198
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 ${MSVC_DISABLED_WARNINGS_STR}")
199+
else()
200+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
185201
endif()
186202

187203
check_function_exists(asprintf HAVE_ASPRINTF)
@@ -234,6 +250,11 @@ if(HAVE_STRSEP)
234250
add_definitions(-DHAVE_STRSEP)
235251
endif()
236252

253+
check_function_exists(strtonum HAVE_STRTONUM)
254+
if(HAVE_STRTONUM)
255+
add_definitions(-DHAVE_STRTONUM)
256+
endif()
257+
237258
check_function_exists(timegm HAVE_TIMEGM)
238259
if(HAVE_TIMEGM)
239260
add_definitions(-DHAVE_TIMEGM)
@@ -295,8 +316,8 @@ if(HAVE_TIMINGSAFE_BCMP)
295316
endif()
296317

297318
check_function_exists(timingsafe_memcmp HAVE_TIMINGSAFE_MEMCMP)
298-
if(HAVE_MEMCMP)
299-
add_definitions(-DHAVE_MEMCMP)
319+
if(HAVE_TIMINGSAFE_MEMCMP)
320+
add_definitions(-DHAVE_TIMINGSAFE_MEMCMP)
300321
endif()
301322

302323
check_function_exists(memmem HAVE_MEMMEM)
@@ -333,49 +354,53 @@ if(APPLE AND (NOT CMAKE_OSX_ARCHITECTURES STREQUAL ""))
333354
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}")
334355
endif()
335356

336-
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(aarch64|arm64|ARM64)")
357+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64|arm64|ARM64)")
337358
set(HOST_AARCH64 true)
338-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
359+
if(WIN32)
360+
set(ENABLE_ASM false)
361+
endif()
362+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
339363
set(HOST_ARM true)
340-
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386")
364+
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
341365
set(HOST_X86_64 true)
342-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86_64|amd64|AMD64)")
366+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64|AMD64)")
343367
set(HOST_X86_64 true)
344-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|[xX]86)")
368+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|[xX]86)")
345369
set(ENABLE_ASM false)
346370
set(HOST_I386 true)
347-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips64")
371+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "mips64")
348372
set(HOST_MIPS64 true)
349-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
373+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "mips")
350374
set(HOST_MIPS true)
351-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "powerpc")
375+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
352376
set(HOST_POWERPC true)
353-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "ppc64")
377+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
354378
set(HOST_PPC64 true)
355-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "riscv64")
379+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
356380
set(HOST_RISCV64 true)
357-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "sparc64")
381+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc64")
358382
set(HOST_SPARC64 true)
359383
else()
360384
set(ENABLE_ASM false)
361385
endif()
362386

363387
if(ENABLE_ASM)
364-
if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF")
365-
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86_64|amd64)")
388+
if(CMAKE_C_COMPILER_ABI STREQUAL "ELF")
389+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)")
366390
set(HOST_ASM_ELF_X86_64 true)
367-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
391+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND
392+
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
368393
set(HOST_ASM_ELF_ARMV4 true)
369-
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386")
394+
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
370395
set(HOST_ASM_ELF_X86_64 true)
371396
endif()
372397
add_definitions(-DHAVE_GNU_STACK)
373-
elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
398+
elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
374399
set(HOST_ASM_MACOSX_X86_64 true)
375-
elseif(MSVC AND ("${CMAKE_GENERATOR}" MATCHES "Win64" OR "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "x64"))
400+
elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Win64" OR CMAKE_GENERATOR_PLATFORM STREQUAL "x64"))
376401
set(HOST_ASM_MASM_X86_64 true)
377402
ENABLE_LANGUAGE(ASM_MASM)
378-
elseif(MINGW AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
403+
elseif(MINGW AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
379404
set(HOST_ASM_MINGW64_X86_64 true)
380405
endif()
381406
endif()
@@ -407,11 +432,23 @@ set(LIBTLS_LIBS tls ${PLATFORM_LIBS})
407432

408433
# libraries for regression test
409434
if(BUILD_SHARED_LIBS)
410-
set(OPENSSL_TEST_LIBS ssl-static crypto-static ${PLATFORM_LIBS})
411-
set(LIBTLS_TEST_LIBS tls-static ${PLATFORM_LIBS})
435+
set(OPENSSL_TEST_LIBS ssl-static crypto-static ${PLATFORM_LIBS} compat_obj)
436+
set(LIBTLS_TEST_LIBS tls-static ${OPENSSL_TEST_LIBS} tls_compat_obj)
412437
else()
413-
set(OPENSSL_TEST_LIBS ssl crypto ${PLATFORM_LIBS})
414-
set(LIBTLS_TEST_LIBS tls ${PLATFORM_LIBS})
438+
set(OPENSSL_TEST_LIBS ssl crypto ${PLATFORM_LIBS} compat_obj)
439+
set(LIBTLS_TEST_LIBS tls ${PLATFORM_LIBS} compat_obj tls_compat_obj)
440+
endif()
441+
442+
if(OPENSSLDIR STREQUAL "")
443+
if(WIN32)
444+
set(OPENSSLDIR "C:/Windows/libressl/ssl")
445+
else()
446+
set(OPENSSLDIR "${CMAKE_INSTALL_PREFIX}/etc/ssl")
447+
endif()
448+
449+
set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/etc/ssl")
450+
else()
451+
set(CONF_DIR "${OPENSSLDIR}")
415452
endif()
416453

417454
add_subdirectory(include)
@@ -495,12 +532,6 @@ if(ENABLE_LIBRESSL_INSTALL)
495532
endif()
496533
endif(ENABLE_LIBRESSL_INSTALL)
497534

498-
if(NOT "${OPENSSLDIR}" STREQUAL "")
499-
set(CONF_DIR "${OPENSSLDIR}")
500-
else()
501-
set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/etc/ssl")
502-
endif()
503-
504535
if(ENABLE_LIBRESSL_INSTALL)
505536
install(FILES cert.pem openssl.cnf x509v3.cnf DESTINATION ${CONF_DIR})
506537
install(DIRECTORY DESTINATION ${CONF_DIR}/certs)

ChangeLog

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,101 @@ history is also available from Git.
2828

2929
LibreSSL Portable Release Notes:
3030

31+
3.9.2 - Stable release
32+
33+
* Bugfixes
34+
- OpenBSD 7.5 errata 003. A missing bounds check could lead to a crash
35+
due to dereferencing a zero-sized allocation.
36+
37+
3.9.1 - Stable release
38+
39+
* Portable changes
40+
- Updated tests with expiring certificates
41+
- CET-related build fixes for Windows and macOS targets
42+
- update libtls linker script to include libssl and libcrypto again
43+
3144
3.9.0 - In development
3245

3346
* Portable changes
47+
- libcrypto no longer exports compat symbols in cmake builds.
48+
- Most compatibility symbols are prefixed with libressl_ to avoid
49+
symbol clashes in static links.
50+
- Fixed various warnings on Windows.
51+
- Removed assert pop-ups with Windows debug builds.
52+
- Fixed crashes and hangs in Windows ARM64 builds.
53+
- Improved control-flow enforcement (CET) support.
3454
* Internal improvements
55+
- Converted uses of OBJ_bsearch_() to standard bsearch().
56+
- Greatly simplified by_file_ctrl().
57+
- Simplified and cleaned up the OBJ_ API.
58+
- Cleaned up the EVP_Cipher{Init,Update,Final}() implementations.
59+
- Removed unused function pointers from X.509 stores and contexts.
60+
- A lot of cleanup and reorganization in EVP.
61+
- Removed all remaining ENGINE tentacles.
62+
- Simplified internals of X509_TRUST handling.
63+
- Made deletion from a lhash doall callback safe.
64+
- Rewrote BIO_dump*(3) internals to be less bad.
3565
* Documentation improvements
66+
- ENGINE documentation was updated to reflect reality.
67+
- Made EVP API documentation more accurate and less incoherent.
68+
- Call out some shortcomings of the EC_KEY_set_* API explicitly.
3669
* Testing and proactive security
70+
- Bug fixes and simplifications in the Wycheproof tests.
71+
* Compatibility changes
72+
- Added ChaCha20 and chacha20 aliases for ChaCha.
73+
- SSL_library_init() now has the same effect as OPENSSL_init_ssl().
74+
- EVP_add_{cipher,digest}() were removed. From the OBJ_NAME API,
75+
only OBJ_NAME_do_all*() remain. In particular, it is no longer
76+
possible to add aliases for ciphers and digests.
77+
- The thread unsafe global tables are no longer supported. It is no
78+
longer possible to add aliases for ciphers and digests, custom ASN.1
79+
strings table entries, ASN.1 methods, PKEY methods, digest methods,
80+
CRL methods, purpose and trust identifiers, or X.509 extensions.
81+
- Removed the _cb() and _fp() versions of BIO_dump{,_indent}().
82+
- BIO_set() was removed.
83+
- BIO_{sn,v,vsn}printf() were removed.
84+
- Turn the long dysfunctional openssl(1) s_client -pause into a noop.
85+
- openssl(1) x509 now supports -new -force_pubkey, -multivalue-rdn,
86+
-set_issuer, -set_subject, and -utf8.
87+
- Support ECDSA with SHA-3 signature algorithms.
88+
- Support HMAC with truncated SHA-2 and SHA-3 as PBE PRF.
89+
- GOST and STREEBOG support was removed.
90+
- CRYPTO_THREADID, _LHASH, _STACK, X509_PURPOSE are now opaque,
91+
X509_CERT_AUX and X509_TRUST were removed from the public API.
92+
- ASN1_STRING_TABLE_get() and X509_PURPOSE_get0*() now return const
93+
pointers.
94+
- EVP_{CIPHER,MD}_CTX_init()'s signatures and semantics now match
95+
OpenSSL's behavior.
96+
- sk_find_ex() and OBJ_bsearch_() were removed.
97+
- CRYPTO_malloc() was fixed to use size_t argument. CRYPTO_malloc()
98+
and CRYPTO_free() now accept file and line arguments.
99+
- A lot of decrepit CRYPTO memory API was removed.
37100
* Bug fixes
38-
- Fixed aliasing issues in BN_mod_exp_simple() and BN_mod_exp_recp()
101+
- Fixed aliasing issues in BN_mod_exp_simple() and BN_mod_exp_recp().
102+
- Fixed numerous misuses of X509_ALGOR_set0() resulting in leaks and
103+
potentially incorrect encodings.
104+
- Fixed potential double free in X509v3_asid_add_id_or_range().
105+
- Stopped using ASN1_time_parse() outside of libcrypto.
106+
- Prepared OPENSSL_gmtime() and OPENSSL_timegm() as public API
107+
wrappers of internal functions compatible with BoringSSL API.
108+
- Removed print_bin() to avoid overwriting the stack with 5 bytes
109+
of ' ' when ECPK parameters are printed with large indentation.
110+
- Avoid a NULL dereference after memory allocation failure during TLS
111+
version downgrade.
112+
- Fixed various bugs in CMAC internals.
113+
- Fixed 4-byte overreads in GHASH assembly on amd64 and i386.
114+
- Fixed various NULL dereferences in PKCS #12 code due to mishandling
115+
of OPTIONAL content in PKCS #7 ContentInfo.
116+
- Aligned SSL_shutdown() behavior in TLSv1.3 with the legacy stack.
117+
- Fixed the new X.509 verifier to find trust anchors in the trusted
118+
stack.
119+
120+
3.8.3 - Stable release
121+
122+
* Portable changes
123+
- Removed assert pop-ups with Windows debug builds.
124+
- Fixed crashes and hangs in Windows ARM64 builds.
125+
- Improved control-flow enforcement (CET) support.
39126

40127
3.8.2 - Stable release
41128

0 commit comments

Comments
 (0)