23907 Commits

Author SHA1 Message Date
David Garske
3674980387
Merge pull request #8173 from kojo1/man
add API doc: wc_ecc_set_curve
2024-11-15 09:42:12 -08:00
David Garske
55d2012139
Merge pull request #8189 from gojimmypi/pr-espressif-setup
remove trailing exit code
2024-11-15 08:37:20 -08:00
David Garske
5f06a7f732
Merge pull request #8188 from douzzer/20241114-wc_mp_sign_t
20241114-wc_mp_sign_t
2024-11-15 08:36:42 -08:00
David Garske
3b8373226a
Merge pull request #8191 from bandi13/fixTest
Fix missing cast
2024-11-15 08:35:55 -08:00
Andras Fekete
d99a1c6a13 Fix another compilation issue
In file included from ./wolfssl/error-ssl.h:27,
                 from ./wolfssl/ssl.h:35,
                 from ./wolfssl/internal.h:28,
                 from src/ssl.c:36:
./src/x509_str.c: In function 'int X509StoreLoadCertBuffer(WOLFSSL_X509_STORE*, byte*, word32, int)':
./wolfssl/wolfcrypt/error-crypt.h:336:37: error: 'CONST_NUM_ERR_WOLFSSL_SUCCESS' was not declared in this scope; did you mean 'CONST_NUM_ERR_WOLFSSL_UNKNOWN'?
  336 |     #define WC_NO_ERR_TRACE(label) (CONST_NUM_ERR_ ## label)
      |                                     ^~~~~~~~~~~~~~
./src/x509_str.c:1456:15: note: in expansion of macro 'WC_NO_ERR_TRACE'
 1456 |     int ret = WC_NO_ERR_TRACE(WOLFSSL_SUCCESS);
      |               ^~~~~~~~~~~~~~~
2024-11-15 10:12:13 -05:00
Andras Fekete
ca8b465dbf Fix missing cast
Introduced in PR#8176.
2024-11-15 09:17:41 -05:00
gojimmypi
4cce3db0d5 remove trailing exit code 2024-11-15 06:05:04 +01:00
David Garske
e22d17c09f
Merge pull request #8185 from SparkiDev/kyber_fixes_4
Kyber: Fix wolfSSL_get_curve_name()
2024-11-14 17:57:24 -08:00
David Garske
fcfd3be160
Merge pull request #8186 from SparkiDev/tfm_mask_cast
TFM: explicit cast of -1 to fp_digit
2024-11-14 17:57:00 -08:00
David Garske
c06b5fadc1
Merge pull request #8180 from JacobBarthelmeh/staticmemory
wc_UnloadStaticMemory should be used to free mutex
2024-11-14 17:54:56 -08:00
David Garske
21bfcaf666
Merge pull request #8136 from anhu/csr_version
Fix for setting wrong version in CSRs.
2024-11-14 17:52:58 -08:00
David Garske
54bdb39454
Merge pull request #8176 from SparkiDev/x509_coverage
X509: improve testing coverage
2024-11-14 17:49:33 -08:00
David Garske
8b1e9211b1
Merge pull request #8149 from SparkiDev/asn_getshortint
Make GetShortInt available with WOLFSSL_ASN_EXTRA
2024-11-14 17:47:11 -08:00
David Garske
8fe7d1076d
Merge pull request #8184 from douzzer/20241113-WC_THREADSHARED
20241113-WC_THREADSHARED
2024-11-14 17:46:19 -08:00
Daniel Pouzzner
469c410393 src/sniffer.c: remove build-time assert on HAVE_THREAD_LS || SINGLE_THREADED, as it breaks existing build tests. fix more later. 2024-11-14 18:22:42 -06:00
Daniel Pouzzner
154c5f0b56 rename mp_sign_t to wc_mp_sign_t and mp_size_t to wc_mp_size_t. 2024-11-14 18:14:45 -06:00
Daniel Pouzzner
4ad0dce84e src/sniffer.c: revert refactor pending proper fixes. 2024-11-14 18:00:52 -06:00
Daniel Pouzzner
dd9f6378cb rename WOLFSSL_GLOBAL to WC_THREADSHARED, and refactor mutex handling in src/sniffer.c for consistency and correctness, also adding gating on !SINGLE_THREADED for efficiency;
add wc_static_assert in wolfcrypt/test/test.h to assure that WC_TEST_RET_ENC() can correctly handle all error codes.
2024-11-14 16:35:04 -06:00
Sean Parkinson
9d8a3cc352 TFM: explicit cast of -1 to fp_digit
When -1 is needed as an fp_digit, as a mask. cast to fp_digit.
2024-11-15 08:25:44 +10:00
Sean Parkinson
b98af853f2 Kyber: Fix wolfSSL_get_curve_name()
Fix protection around Kyber hybrid strings when compiling for original
with wolfSSL implementation.
2024-11-15 08:17:02 +10:00
Daniel Pouzzner
6af54d3de2
Merge pull request #8183 from SparkiDev/kyber_fixes_3
Kyber: fixes to configure and wolfSSL_get_curve_name
2024-11-14 12:47:09 -06:00
Sean Parkinson
886f5b0a5b Kyber: fixes to configure and wolfSSL_get_curve_name
Remote original-only option for kyber in configure.ac.
Default is ML-KEM only.
original is Kyber only.
ml-lem is ML-KEM.
to have both: all,original,ml-kem.

Use WOLFSSL_NO_ML_KEM* instead of WOLFSSL_WC_ML_KEM_* which requires the
inclusion of kyber headers.
2024-11-14 16:25:41 +10:00
David Garske
c8f56f035f
Merge pull request #8169 from douzzer/20241108-WOLFSSL_CLEANUP_THREADSAFE
20241108-WOLFSSL_CLEANUP_THREADSAFE
2024-11-13 12:45:33 -08:00
Daniel Pouzzner
0ebd86d668 add second wolfCrypt error code span, and add DEADLOCK_AVERTED_E. 2024-11-13 13:01:00 -06:00
JacobBarthelmeh
f74e73e8ce wc_UnloadStaticMemory should be used to free mutex 2024-11-13 11:51:53 -07:00
Daniel Pouzzner
524f0f5799 peer review on "WOLFSSL_CLEANUP_THREADSAFE":
* add WOLFSSL_ATOMIC_INITIALIZER() to wc_port.h;
* rename feature macro to WOLFSSL_CLEANUP_THREADSAFE_BY_ATOMIC_OPS for clarity;
* remove spin lock logic in wolfSSL_Init() and instead return DEADLOCK_AVERTED_E on contended initialization;
* unless WOLFSSL_CLEANUP_THREADSAFE_BY_ATOMIC_OPS is user-defined to 0, automatically enable it when appropriate.
2024-11-12 23:57:35 -06:00
Daniel Pouzzner
b8aeaf4fa8 src/ssl.c: implement WOLFSSL_CLEANUP_THREADSAFE in wolfSSL_Init() / wolfSSL_Cleanup(). 2024-11-12 17:37:45 -06:00
Sean Parkinson
86ad96ca29 X509: improve testing coverage 2024-11-13 09:10:22 +10:00
Anthony Hu
b1ccbbc7fa Addressing review comments from dgarske 2024-11-12 16:36:12 -05:00
Daniel Pouzzner
878cf3afaa
Merge pull request #8155 from JacobBarthelmeh/x509_req
fix for memory leak due to missed WOLFSSL_GENERAL_NAME capability cha…
2024-11-11 23:03:52 -06:00
Daniel Pouzzner
c5f1acf960
Merge pull request #8172 from SparkiDev/kyber_bench_fix
Kyber benchmark: allow ML-KEM and Kyber
2024-11-11 23:00:51 -06:00
JacobBarthelmeh
ce935fddad cast return of XMALLOC 2024-11-11 09:57:33 -07:00
JacobBarthelmeh
4996aed166
Merge pull request #8117 from rizlik/static_mem_fix_types
memory: fix types in wc_LoadStaticMemory_ex()
2024-11-11 09:48:25 -07:00
Takashi Kojo
718b3d46b2 add API doc: wc_ecc_set_curve 2024-11-11 16:38:38 +09:00
Sean Parkinson
cadafffb71 Kyber benchmark: allow ML-KEM and Kyber
Fix benchmark to use ML-KEM/Kyber depending on how code is built.
2024-11-11 10:34:32 +10:00
Daniel Pouzzner
c08bbf0333
Merge pull request #8168 from bandi13/fixCMakeTests
Use only one or the other
2024-11-09 00:43:15 -06:00
Daniel Pouzzner
9361603d8b
Merge pull request #8071 from JacobBarthelmeh/static
display heap pointer with debug enabled
2024-11-09 00:20:32 -06:00
Daniel Pouzzner
165b4afbeb
Merge pull request #8143 from SparkiDev/kyber_plus_mlkem
Kyber/ML-KEM: make both available
2024-11-09 00:09:51 -06:00
Daniel Pouzzner
23f46a1c3e
Merge pull request #8140 from dgarske/wildcard
Fix for building sources (wildcard *.c). Add macro guard on new files.
2024-11-08 23:36:00 -06:00
Andras Fekete
a295aef0b2 Use only one or the other 2024-11-08 14:34:16 -05:00
David Garske
c868c3ecff
Merge pull request #8164 from douzzer/20241105-c89-expansion-etc
20241105-c89-expansion-etc
2024-11-08 10:15:00 -08:00
Daniel Pouzzner
469b9efc9e wolfssl/test.h: revert heap shim refactor -- api.c relies on these being native heap allocations. 2024-11-08 01:03:44 -06:00
Daniel Pouzzner
aa18bbca55 assorted cleanups and refactors for C89 conformance, codespell and check-source-text, and consistent heap shim usage.
.github/workflows/codespell.yml: remove */README_jp.txt from "skip" list.

IDE/Renesas/cs+/Projects/t4_demo/README_jp.txt: convert from SHIFT_JIS to UTF-8.

cmake/options.h.in: use "#cmakedefine HAVE_PTHREAD 1" to avoid conflict with config.h.

configure.ac: add --enable-c89, and remove !ENABLED_OPENSSLEXTRA dependency from AM_CONDITIONAL([BUILD_CRYPTONLY],...).

wolfcrypt/src/asn.c: refactor SetOthername() for efficiency, and add PRAGMA_GCC to suppress false positive -Wstringop-overflow associated with -fstack-protector.

wolfssl/wolfcrypt/rsa.h: add WC_ prefixes to RSA_PKCS1_PADDING_SIZE and RSA_PKCS1_OAEP_PADDING_SIZE, and define unprefixed compat aliases only if !OPENSSL_COEXIST.

wolfssl/wolfcrypt/types.h:

  #ifdef WOLF_C89, #define WC_BITFIELD unsigned;
  enhance WOLF_ENUM_DUMMY_LAST_ELEMENT() to include the line number, to construct unique labels given a per-filename argument, to accommodate anonymous enums.

examples/asn1/asn1.c:
examples/client/client.c:
examples/pem/pem.c:
examples/server/server.c:
wolfcrypt/src/sp_dsp32.c:
wolfcrypt/src/wc_port.c:
wolfssl/test.h:

  use XMALLOC/XREALLOC/XFREE consistently, not malloc/realloc/free.

wolfcrypt/benchmark/benchmark.c:
wolfcrypt/src/memory.c:
wolfcrypt/test/test.c:
wolfssl/wolfcrypt/mem_track.h:
wolfssl/wolfcrypt/settings.h:
wolfssl/wolfcrypt/types.h:

  annotate intentional native heap access with "/* native heap */".

wolfcrypt/src/asn.c:
wolfssl/callbacks.h:
wolfssl/openssl/ec.h:
wolfssl/openssl/ssl.h:
wolfssl/wolfcrypt/hpke.h:
wolfssl/wolfcrypt/types.h:

  fix enum trailing commas.

wolfssl/openssl/ec.h:
wolfssl/openssl/evp.h:
wolfssl/openssl/rsa.h:
wolfssl/openssl/ssl.h:

  use WC_BITFIELD in bitfield elements, not byte or word16, to allow for pedantic C89 conformant builds.

wolfssl/openssl/ec.h:
wolfssl/openssl/evp.h:
wolfssl/openssl/pem.h:
wolfssl/openssl/ssl.h:
wolfssl/wolfcrypt/logging.h:
avoid variadic macros wherever possible, and where unavoidable, #ifdef WOLF_NO_VARIADIC_MACROS, define them with empty arg lists, rather than ..., to support Watcom compiler.

wolfssl/wolfcrypt/settings.h: if defined(__WATCOMC__), define WOLF_NO_VARIADIC_MACROS.
2024-11-07 22:36:24 -06:00
David Garske
b648d35449
Merge pull request #8138 from JacobBarthelmeh/wolfclu_config
wolfCLU added support for PKCS7
2024-11-07 12:44:06 -08:00
David Garske
364cd107ff
Merge pull request #8151 from SparkiDev/test_fixes_3
Testing fixes
2024-11-07 12:43:12 -08:00
David Garske
79d9aab5bd
Merge pull request #8159 from philljj/spelling_cleanup
spelling: tiny cleanup.
2024-11-07 12:00:04 -08:00
David Garske
1061518876
Merge pull request #8153 from LinuxJedi/Pi-pico
Add support for Raspberry Pi Pico
2024-11-07 11:59:34 -08:00
Andrew Hutchings
1d2c78e3be Add support for Raspberry Pi Pico
This adds improved support for the Raspberry Pi Pico range of
microcontrollers.

Benchmark now compiles, and added support for the RNG functions of the
Pico SDK. This gives a ~2x RNG performance improvement on the RP2040 and
over 3x improvement on the RP2350.

The accelerated SHA256 in the RP2350 unfortunately cannot be used with
wolfSSL.
2024-11-07 17:26:51 +00:00
jordan
b4e8e57b59 spelling: tiny cleanup. 2024-11-07 07:40:02 -06:00
JacobBarthelmeh
a896c16ebd fix for memory leak due to missed WOLFSSL_GENERAL_NAME capability changes 2024-11-06 17:10:54 -07:00