Skip to content

Commit 7e60b02

Browse files
authored
Merge branch 'master' into liboqs
2 parents 8a89470 + 461cf9e commit 7e60b02

63 files changed

Lines changed: 2602 additions & 1051 deletions

Some content is hidden

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

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
2828
You must delete them, or cmake will refuse to work.")
2929
endif()
3030

31-
project(wolfssl VERSION 5.6.4 LANGUAGES C ASM)
31+
project(wolfssl VERSION 5.6.6 LANGUAGES C ASM)
3232

3333
# Set WOLFSSL_ROOT if not already defined
3434
if ("${WOLFSSL_ROOT}" STREQUAL "")
@@ -43,7 +43,7 @@ endif()
4343

4444
# shared library versioning
4545
# increment if interfaces have been added, removed or changed
46-
set(LIBTOOL_CURRENT 41)
46+
set(LIBTOOL_CURRENT 42)
4747
# increment if source code has changed set to zero if current is incremented
4848
set(LIBTOOL_REVISION 0)
4949
# increment if interfaces have been added set to zero if interfaces have been

ChangeLog.md

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,99 @@
1+
# wolfSSL Release 5.6.6 (Dec 19, 2023)
2+
3+
Release 5.6.6 has been developed according to wolfSSL's development and QA
4+
process (see link below) and successfully passed the quality criteria.
5+
https://www.wolfssl.com/about/wolfssl-software-development-process-quality-assurance
6+
7+
NOTE: * --enable-heapmath is being deprecated and will be removed by 2024
8+
9+
REMINDER: When working with AES Block Cipher algorithms, `wc_AesInit()` should
10+
always be called first to initialize the `Aes` structure, before calling other
11+
Aes API functions. Recently we found several places in our documentation,
12+
comments, and codebase where this pattern was not observed. We have since
13+
fixed this omission in several PRs for this release.
14+
15+
## Vulnerabilities
16+
17+
* [Medium] CVE-2023-6935: After review of the previous RSA timing fix in wolfSSL 5.6.4, additional changes were found to be required. A complete resistant change is delivered in this release. This fix is for the Marvin attack, leading to being able to decrypt a saved TLS connection and potentially forge a signature after probing with a very large number of trial connections. This issue is around RSA decryption and affects the optional static RSA cipher suites on the server side, which are considered weak, not recommended to be used and are off by default in wolfSSL (even with `--enable-all`). Static RSA cipher suites were also removed from the TLS 1.3 protocol and are only present in TLS 1.2 and lower. All padding versions of RSA decrypt are affected since the code under review is outside of the padding processing. Information about the private keys is NOT compromised in affected code. It is recommended to disable static RSA cipher suites and update the version of wolfSSL used if using RSA private decryption alone outside of TLS. Thanks to Hubert Kario for the report. The fix for this issue is located in the following GitHub Pull Request: https://github.com/wolfSSL/wolfssl/pull/6955.
18+
19+
* [Low] CVE-2023-6936: A potential heap overflow read is possible in servers connecting over TLS 1.3 when the optional `WOLFSSL_CALLBACKS` has been defined. The out of bounds read can occur when a server receives a malicious malformed ClientHello. Users should either discontinue use of `WOLFSSL_CALLBACKS` on the server side or update versions of wolfSSL to 5.6.6. Thanks to the tlspuffin fuzzer team for the report which was designed and developed by; Lucca Hirschi (Inria, LORIA), Steve Kremer (Inria, LORIA), and Max Ammann (Trail of Bits). The fix for this issue is located in the following GitHub Pull Request: https://github.com/wolfSSL/wolfssl/pull/6949.
20+
21+
* [Low] A side channel vulnerability with AES T-Tables is possible in a very controlled environment where precision sub-cache-line inspection can happen, such as inside an Intel SGX enclave. This can lead to recovery of the AES key. To prevent this type of attack, wolfSSL added an AES bitsliced implementation which can be enabled with the “`--enable-aes-bitsliced`” configure option. Thanks to Florian Sieck, Zhiyuan Zhang, Sebastian Berndt, Chitchanok Chuengsatiansup, Thomas Eisenbarth, and Yuval Yarom for the report (Universities of Lübeck, Melbourne, Adelaide and Bochum). The fix for this issue is located in the following GitHub Pull Request: https://github.com/wolfSSL/wolfssl/pull/6854.
22+
23+
* [Low] CVE-2023-6937: wolfSSL prior to 5.6.6 did not check that messages in a single (D)TLS record do not span key boundaries. As a result, it was possible to combine (D)TLS messages using different keys into one (D)TLS record. The most extreme edge case is that, in (D)TLS 1.3, it was possible that an unencrypted (D)TLS 1.3 record from the server containing first a ServerHello message and then the rest of the first server flight would be accepted by a wolfSSL client. In (D)TLS 1.3 the handshake is encrypted after the ServerHello but a wolfSSL client would accept an unencrypted flight from the server. This does not compromise key negotiation and authentication so it is assigned a low severity rating. Thanks to Johannes Wilson for the report (Sectra Communications and Linköping University). The fix for this issue is located in the following GitHub Pull Request: https://github.com/wolfSSL/wolfssl/pull/7029.
24+
25+
## New Feature Additions
26+
27+
* Build option for disabling CRL date checks (`WOLFSSL_NO_CRL_DATE_CHECK`) (PR 6927)
28+
* Support for STM32WL55 and improvements to PKA ECC support (PR 6937)
29+
* Add option to skip cookie exchange on DTLS 1.3 session resumption (PR 6929)
30+
* Add implementation of SRTP KDF and SRTCP KDF (`--enable-srtp-kdf`) (PR 6888)
31+
* Add `wolfSSL_EXTENDED_KEY_USAGE_free()` (PR 6916)
32+
* Add AES bitsliced implementation that is cache attack safe (`--enable-aes-bitsliced`) (PR 6854)
33+
* Add memcached support and automated testing (PR 6430, 7022)
34+
* Add Hardware Encryption Acceleration for ESP32-C3, ESP32-C6, and ESP32-S2 (PR 6990)
35+
* Add (D)TLS 1.3 support for 0.5-RTT data (PR 7010)
36+
37+
## Enhancements and Optimizations
38+
39+
* Better built in testing of “`--sys-ca-certs`” configure option (PR 6910)
40+
* Updated CMakeLists.txt for Espressif wolfSSL component usage (PR 6877)
41+
* Disable TLS 1.1 by default (unless SSL 3.0 or TLS 1.0 is enabled) (PR 6946)
42+
* Add “`--enable-quic`” to “`--enable-all`” configure option (PR 6957)
43+
* Add support to SP C implementation for RSA exponent up to 64-bits (PR 6959)
44+
* Add result of “`HAVE___UINT128_T`” to options.h for CMake builds (PR 6965)
45+
* Add optimized assembly for AES-GCM on ARM64 using hardware crypto instructions (PR 6967)
46+
* Add built-in cipher suite tests for DTLS 1.3 PQC (PR 6952)
47+
* Add wolfCrypt test and unit test to ctest (PR 6977)
48+
* Move OpenSSL compatibility crypto APIs into `ssl_crypto.c` file (PR 6935)
49+
* Validate time generated from XGMTIME() (PR 6958)
50+
* Allow wolfCrypt benchmark to run with microsecond accuracy (PR 6868)
51+
* Add GitHub Actions testing with nginx 1.24.0 (PR 6982)
52+
* Allow encoding of CA:FALSE BasicConstraint during cert generation (PR 6953)
53+
* Add CMake option to enable DTLS-SRTP (PR 6991)
54+
* Add CMake options for enabling QUIC and cURL (PR 7049)
55+
* Improve RSA blinding to make code more constant time (PR 6955)
56+
* Refactor AES-NI implementation macros to allow dynamic fallback to C (PR 6981)
57+
* Default to native Windows threading API on MinGW (PR 7015)
58+
* Return better error codes from OCSP response check (PR 7028)
59+
* Updated Espressif ESP32 TLS client and server examples (PR 6844)
60+
* Add/clean up support for ESP-IDF v5.1 for a variety of ESP32 chips (PR 7035, 7037)
61+
* Add API to choose dynamic certs based on client ciphers/sigalgs (PR 6963)
62+
* Improve Arduino IDE 1.5 project file to match recursive style (PR 7007)
63+
* Simplify and improve apple-universal build script (PR 7025)
64+
65+
## Fixes
66+
67+
* Fix for async edge case with Intel QuickAssist/Cavium Nitrox (PR 6931)
68+
* Fix for building PKCS#7 with RSA disabled (PR 6902)
69+
* Fix for advancing output pointer in `wolfSSL_i2d_X509()` (PR 6891)
70+
* Fix for `EVP_EncodeBlock()` appending a newline (PR 6900)
71+
* Fix for `wolfSSL_RSA_verify_PKCS1_PSS()` with `RSA_PSS_SALTLEN_AUTO` (PR 6938)
72+
* Fixes for CODESonar reports around `isalpha()` and `isalnum()` calls (PR 6810)
73+
* Fix for SP ARM64 integer math to avoid compiler optimization issues (PR 6942)
74+
* Fix for SP Thumb2 inline assembly to add IAR build support (PR 6943, 6971)
75+
* Fix for SP Thumb2 to make functions not inlined (PR 6993)
76+
* Fix for SP Cortex-M assembly large build with IAR (PR 6954)
77+
* Fix for SP ARM64 assembly montgomery reduction by 4 (PR 6947)
78+
* Fix for SP ARM64 P-256 for not inlining functions for iOS compatibility (PR 6979)
79+
* Fix for `WOLFSSL_CALLBACKS` and potential memory error (PR 6949)
80+
* Fixes for wolfSSL’s Zephyr OS port (PR 6930)
81+
* Fix for build errors when building for NXP mmCAU (`FREESCALE_MMCAU`) (PR 6970)
82+
* Fix for TLS 1.3 `SendBuffered()` return code in non-blocking mode (PR 7001)
83+
* Fix for TLS `Hmac_UpdateFinal()` when padding byte is invalid (PR 6998)
84+
* Fix for ARMv8 AES-GCM streaming to check size of IV before storing (PR 6996)
85+
* Add missing calls to `wc_AesInit()` before `wc_AesSetKey()` (PR 7011)
86+
* Fix build errors with DTLS 1.3 enabled but TLS 1.2 disabled (PR 6976)
87+
* Fixes for building wolfSSL in Visual Studio (PR 7040)
88+
189
# wolfSSL Release 5.6.4 (Oct 30, 2023)
290

391
Release 5.6.4 has been developed according to wolfSSL's development and QA process (see link below) and successfully passed the quality criteria.
492
https://www.wolfssl.com/about/wolfssl-software-development-process-quality-assurance
593

6-
794
NOTE: * --enable-heapmath is being deprecated and will be removed by 2024
895
* Old CyaSSL/CtaoCrypt shim layer was removed in this release (5.6.4)
996

10-
1197
## Vulnerabilities
1298

1399
* [Medium] A fix was added, but still under review for completeness, for a Bleichenbacher style attack, leading to being able to decrypt a saved TLS connection and potentially forge a signature after probing with a large number of trial connections. This issue is around RSA decryption and affects static RSA cipher suites on the server side, which are not recommended to be used and are off by default. Static RSA cipher suites were also removed from the TLS 1.3 protocol and only present in TLS 1.2 and lower. All padding versions of RSA decrypt are affected since the code under review is outside of the padding processing. Information about the private keys is NOT compromised in affected code. It's recommended to disable static RSA cipher suites and update the version of wolfSSL used if using RSA private decryption alone outside of TLS. The fix is located in this pull request (https://github.com/wolfSSL/wolfssl/pull/6896)
@@ -70,7 +156,6 @@ Release 5.6.3 of wolfSSL embedded TLS has 4 bug fixes:
70156
* Improvements to Encrypted Memory support (WC_PROTECT_ENCRYPTED_MEM) implementations for modular exponentiation in SP math-all (sp_int.c) and TFM (tfm.c).
71157
* Improvements to SendAlert for getting output buffer.
72158

73-
74159
# wolfSSL Release 5.6.2 (Jun 09, 2023)
75160

76161
Release 5.6.2 has been developed according to wolfSSL's development and QA process (see link below) and successfully passed the quality criteria.

IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/main.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
#include <wolfcrypt/test/test.h>
3737
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
3838

39+
/* set to 0 for one benchmark,
40+
** set to 1 for continuous benchmark loop */
41+
#define TEST_LOOP 0
42+
3943
/*
4044
** the wolfssl component can be installed in either:
4145
**
@@ -190,7 +194,10 @@ void app_main(void)
190194
#if defined(NO_ESP32_CRYPT)
191195
ESP_LOGI(TAG, "NO_ESP32_CRYPT defined! HW acceleration DISABLED.");
192196
#else
193-
#if defined(CONFIG_IDF_TARGET_ESP32C3)
197+
#if defined(CONFIG_IDF_TARGET_ESP32C2)
198+
ESP_LOGI(TAG, "ESP32_CRYPT is enabled for ESP32-C2.");
199+
200+
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
194201
ESP_LOGI(TAG, "ESP32_CRYPT is enabled for ESP32-C3.");
195202

196203
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
@@ -239,8 +246,11 @@ void app_main(void)
239246

240247
loops++;
241248
}
242-
while (ret == 0);
243-
ESP_LOGI(TAG, "loops = %d", loops);
249+
while (TEST_LOOP && (ret == 0));
250+
251+
#if defined TEST_LOOP && (TEST_LOOP == 1)
252+
ESP_LOGI(TAG, "Test loops completed: %d", loops);
253+
#endif
244254

245255
/* note wolfCrypt_Cleanup() should always be called when finished.
246256
** This is called at the end of wolf_test_task();
@@ -266,8 +276,12 @@ void app_main(void)
266276
- (uxTaskGetStackHighWaterMark(NULL)));
267277
#endif
268278

279+
#ifdef WOLFSSL_ESPIDF_EXIT_MESSAGE
280+
ESP_LOGI(TAG, WOLFSSL_ESPIDF_EXIT_MESSAGE);
281+
#else
269282
ESP_LOGI(TAG, "\n\nDone!\n\n"
270283
"If running from idf.py monitor, press twice: Ctrl+]");
284+
#endif
271285

272286
/* done */
273287
while (1) {

IDE/Renesas/e2studio/RA6M4/test/.cproject

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/fsp/inc/api}&quot;"/>
9595
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/fsp/inc/instances}&quot;"/>
9696
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/fsp/src/rm_freertos_port}&quot;"/>
97-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/aws/FreeRTOS/FreeRTOS/Source/include}&quot;"/>
97+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/aws/amazon-freertos/freertos_kernel/include}&quot;"/>
9898
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/arm/CMSIS_5/CMSIS/Core/Include}&quot;"/>
9999
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra_gen}&quot;"/>
100100
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra_cfg/fsp_cfg/bsp}&quot;"/>
@@ -103,7 +103,7 @@
103103
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/inc/api}&quot;"/>
104104
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/inc/instances}&quot;"/>
105105
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/private/inc}&quot;"/>
106-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/aws/FreeRTOS/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include}&quot;"/>
106+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/aws/amazon-freertos/libraries/freertos_plus/standard/freertos_plus_tcp/include}&quot;"/>
107107
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/wolfSSL_RA6M4/ra/fsp/src/rm_freertos_plus_tcp}&quot;"/>
108108
</option>
109109
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.1484044149" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">

IDE/STM32Cube/default_conf.ftl

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,28 @@ extern ${variable.value} ${variable.name};
213213
/* ------------------------------------------------------------------------- */
214214
/* Math Configuration */
215215
/* ------------------------------------------------------------------------- */
216-
/* 1=Fast (stack)
217-
* 2=Normal (heap)
218-
* 3=Single Precision C (only common curves/key sizes)
219-
* 4=Single Precision ASM Cortex-M3+
220-
* 5=Single Precision ASM Cortex-M0 (Generic Thumb)
221-
* 6=Single Precision C all small
222-
* 7=Single Precision C all big
216+
/* 1=Fast (stack) (tfm.c)
217+
* 2=Normal (heap) (integer.c)
218+
* 3-5=Single Precision: only common curves/key sizes:
219+
* (ECC 256/384/521 and RSA/DH 2048/3072/4096)
220+
* 3=Single Precision C (sp_c32.c)
221+
* 4=Single Precision ASM Cortex-M3+ (sp_cortexm.c)
222+
* 5=Single Precision ASM Cortex-M0 (sp_armthumb.c)
223+
* 6=Wolf multi-precision C small (sp_int.c)
224+
* 7=Wolf multi-precision C big (sp_int.c)
223225
*/
226+
224227
#if defined(WOLF_CONF_MATH) && WOLF_CONF_MATH == 1
225228
/* fast (stack) math - tfm.c */
226229
#define USE_FAST_MATH
227230
#define TFM_TIMING_RESISTANT
228231

232+
#if !defined(NO_RSA) || !defined(NO_DH)
233+
/* Maximum math bits (Max DH/RSA key bits * 2) */
234+
#undef FP_MAX_BITS
235+
#define FP_MAX_BITS 4096
236+
#endif
237+
229238
/* Optimizations (TFM_ARM, TFM_ASM or none) */
230239
//#define TFM_NO_ASM
231240
//#define TFM_ASM
@@ -240,19 +249,26 @@ extern ${variable.value} ${variable.name};
240249
#endif
241250
#if defined(WOLF_CONF_RSA) && WOLF_CONF_RSA == 1
242251
#define WOLFSSL_HAVE_SP_RSA
252+
//#define WOLFSSL_SP_NO_2048
253+
//#define WOLFSSL_SP_NO_3072
254+
//#define WOLFSSL_SP_4096
243255
#endif
244256
#if defined(WOLF_CONF_DH) && WOLF_CONF_DH == 1
245257
#define WOLFSSL_HAVE_SP_DH
246258
#endif
247259
#if defined(WOLF_CONF_ECC) && WOLF_CONF_ECC == 1
248260
#define WOLFSSL_HAVE_SP_ECC
261+
//#define WOLFSSL_SP_NO_256
262+
//#define WOLFSSL_SP_384
263+
//#define WOLFSSL_SP_521
249264
#endif
250265
#if WOLF_CONF_MATH == 6 || WOLF_CONF_MATH == 7
251266
#define WOLFSSL_SP_MATH_ALL /* use sp_int.c multi precision math */
267+
//#define WOLFSSL_SP_ARM_THUMB /* enable ARM Thumb ASM speedups */
252268
#else
253269
#define WOLFSSL_SP_MATH /* disable non-standard curves / key sizes */
254270
#endif
255-
#define SP_WORD_SIZE 32
271+
#define SP_WORD_SIZE 32 /* force 32-bit mode */
256272

257273
/* Enable to put all math on stack (no heap) */
258274
//#define WOLFSSL_SP_NO_MALLOC
@@ -331,12 +347,6 @@ extern ${variable.value} ${variable.name};
331347
/* RSA */
332348
#undef NO_RSA
333349
#if defined(WOLF_CONF_RSA) && WOLF_CONF_RSA == 1
334-
#ifdef USE_FAST_MATH
335-
/* Maximum math bits (Max RSA key bits * 2) */
336-
#undef FP_MAX_BITS
337-
#define FP_MAX_BITS 4096
338-
#endif
339-
340350
/* half as much memory but twice as slow */
341351
#undef RSA_LOW_MEM
342352
//#define RSA_LOW_MEM
@@ -390,8 +400,8 @@ extern ${variable.value} ${variable.name};
390400
//#define HAVE_COMP_KEY
391401

392402
#ifdef USE_FAST_MATH
393-
#ifdef NO_RSA
394-
/* Custom fastmath size if not using RSA */
403+
#if defined(NO_RSA) && defined(NO_DH)
404+
/* Custom fastmath size if not using RSA/DH */
395405
/* MAX = ROUND32(ECC BITS) * 2 */
396406
#define FP_MAX_BITS (256 * 2)
397407
#else

IDE/WIN10/wolfssl-fips.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 5,6,4,0
55-
PRODUCTVERSION 5,6,4,0
54+
FILEVERSION 5,6,6,0
55+
PRODUCTVERSION 5,6,6,0
5656
FILEFLAGSMASK 0x3fL
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
6969
BEGIN
7070
VALUE "CompanyName", "wolfSSL Inc."
7171
VALUE "FileDescription", "The wolfSSL FIPS embedded SSL library is a lightweight, portable, C-language-based SSL/TLS library targeted at IoT, embedded, and RTOS environments primarily because of its size, speed, and feature set."
72-
VALUE "FileVersion", "5.6.4.0"
72+
VALUE "FileVersion", "5.6.6.0"
7373
VALUE "InternalName", "wolfssl-fips"
74-
VALUE "LegalCopyright", "Copyright (C) 2022"
74+
VALUE "LegalCopyright", "Copyright (C) 2023"
7575
VALUE "OriginalFilename", "wolfssl-fips.dll"
7676
VALUE "ProductName", "wolfSSL FIPS"
77-
VALUE "ProductVersion", "5.6.4.0"
77+
VALUE "ProductVersion", "5.6.6.0"
7878
END
7979
END
8080
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)