Compare commits

...

2727 Commits

Author SHA1 Message Date
3b3c175af0 Merge pull request #6521 from ejohnstown/readme
Update Readme
2023-06-18 21:16:56 -07:00
c322e1f7f8 update readme 2023-06-18 20:24:28 -07:00
d967aae501 Merge pull request #6518 from ejohnstown/release-5.6.3
Release 5.6.3
2023-06-16 12:08:23 -07:00
42e934b251 Update read-me and change-log for the release. 2023-06-16 09:47:35 -07:00
4741a0b696 Merge pull request #6508 from JacobBarthelmeh/fuzzing
sanity check on send fatal alert return
2023-06-15 20:13:49 -07:00
78b78428e7 Merge pull request #6512 from SparkiDev/math_enc_mem_exptmod
Math, Encrypted Memory: mod exp fix
2023-06-15 19:52:41 -07:00
beef8b0014 outputBuffer - use idx field
dtls13.c:
Change end of outputBuffer data calculations to use function
GetOutputBuffer().
  Use idx when calculating unused byte count of outputBuffer.

internal.c:
Change end of outputBuffer data calculations to use function
GetOutputBuffer().
  Use GetOutputBuffer() to calculate end of data in outputBuffer.
  GrowOutputBuffer():
Calculate new size to allocate to include already written data in
case of static buffer.
    Copy all data including already written count (idx).
  CheckAvailableSize():
    Don't subtract idx from length when checking MTU size.
Do subtract idx from bufferSize to determine count of unused bytes
in outputBuffer.
2023-06-16 10:29:52 +10:00
7153dd70a6 Math, Encrypted Memory: mod exp fix
The modular exponentiation implementations in sp_int.c and tfm.c are not
safe when using Encrypted Memory.
Cannot have two pieces of memory where one changes and the other doesn't
based on private value.
Use extra variable to hold the two new values and assign them both back
at the same time in a safe manner.

Alternative implementations used when WC_PROTECT_ENCRYPTED_MEM is
defined.
2023-06-16 07:28:47 +10:00
5b81dc47d2 adjust location used for writing to output buffer 2023-06-14 21:01:12 -07:00
0a860c793f adjust test case to handle error of peer closing down 2023-06-14 12:21:52 -07:00
9e0c13bbdb sanity check on send fatal alert return 2023-06-14 11:08:56 -07:00
82cc988226 Merge pull request #6495 from JacobBarthelmeh/build
update check for stdatomic header file
2023-06-14 14:00:04 +10:00
cdb3d6df40 Merge pull request #6502 from JacobBarthelmeh/release
prepare for 5.6.3
2023-06-14 13:59:41 +10:00
72536e0e10 prepare for 5.6.3 2023-06-13 14:47:06 -06:00
58c1c0c31b Merge pull request #6499 from douzzer/20230612-windows-fixes
20230612-windows-fixes
2023-06-13 12:32:01 -05:00
03a6eed037 wolfcrypt/src/{aes.c,blake2b.c,siphash.c}: fix W64LIT() arguments to not have improper 'U' suffix;
wolfssl/wolfcrypt/types.h: add 'U' suffix to W64LIT() macro defs, and add SW64LIT() macro defs (not yet used anywhere);

wolfcrypt/src/asn.c: add !WOLFSSL_ECC_CURVE_STATIC gate around DataToHexStringAlloc() to resolve -Wunused;

wolfcrypt/src/ecc.c: guard against zero-valued "len" arg to wc_ecc_get_curve_id_from_oid();

wolfcrypt/src/wc_port.c: fix several argument implicit sign changes in USE_WINDOWS_API paths;

wolfssl/wolfcrypt/ecc.h: remove const attribute from inline buffers in WOLFSSL_ECC_CURVE_STATIC struct ecc_set_type.
2023-06-12 23:15:08 -05:00
47036d0166 update check for stdatomic header file 2023-06-12 13:48:24 -06:00
9ffa9faecd Merge pull request #6491 from ejohnstown/fix-imp-conv
Implicit Type Conversion Fix
2023-06-09 13:19:18 -06:00
7b0283fa04 Implicit Type Conversion Fix
1. Typecast the return of strlen() to int for the variable used.
2023-06-09 11:13:44 -07:00
a56070cd70 Merge pull request #6490 from JacobBarthelmeh/release
Prepare for release 5.6.2
2023-06-09 11:00:10 -07:00
353a2926b6 add check for stdatomic.h 2023-06-09 09:52:01 -07:00
032ac405db prepare for release 5.6.2 2023-06-09 05:51:18 -07:00
c59cc92379 Merge pull request #6488 from douzzer/20230608-linuxkm-__is_constexpr
20230608-linuxkm-__is_constexpr
2023-06-08 14:48:19 -06:00
e35cb5bc3d linuxkm/linuxkm_wc_port.h: override definition of __is_constexpr() from /usr/src/linux/include/linux/const.h with warning-free __builtin_constant_p(). 2023-06-08 14:43:05 -05:00
3f1dd32f4e Merge pull request #6487 from JacobBarthelmeh/fuzzing
sanity check on socket return value for timeout with DTLS13
2023-06-08 10:41:41 -07:00
0d591f1111 Merge pull request #6485 from SparkiDev/coverity_api_c_fixes
Coverity fixes: api.c
2023-06-08 09:25:08 -06:00
897a865090 Merge pull request #6477 from JacobBarthelmeh/stm32
add sanity check on hash size with STM32 port
2023-06-08 22:21:19 +10:00
e5bb09f281 Coverity fixes: api.c
Fixes from coverity scan in the file api.c.
2023-06-08 22:18:05 +10:00
938a48d9b1 sanity check on socket return value for timeout with DTLS13 2023-06-08 02:37:21 -06:00
66d222adfc Merge pull request #6484 from JacobBarthelmeh/cov
coverity scan fixes
2023-06-08 10:06:18 +10:00
4a4a769512 check on allocation of new node before dereferencing 2023-06-07 15:20:23 -06:00
84979900a7 avoid use after free in error case 2023-06-07 15:13:13 -06:00
14990ad92d set return bio to null after free on error 2023-06-07 15:05:52 -06:00
fb5413cea0 account for null terminator with SEP serail number 2023-06-07 14:59:07 -06:00
ebc62f8d17 clear extension string and avoid potential double free 2023-06-07 14:41:47 -06:00
d796aa12fc free up memory with othername object on error 2023-06-07 13:29:41 -06:00
c399fba4ce set ext pointer to null after free'ing it 2023-06-07 13:23:43 -06:00
327645ff2a add additional STM32 ECC sanity check to sign 2023-06-07 10:26:40 -07:00
2a0b244393 add sanity check on hash size with STM32 port 2023-06-07 10:26:40 -07:00
c040b4a339 Merge pull request #6478 from SparkiDev/kyber_fixes_1
Kyber: allow compilation with limited sizes with liboqs
2023-06-07 11:24:08 -06:00
8583cc65fa Merge pull request #6471 from SparkiDev/tests_api_expect_3
Test api.c: change more tests to use Expect instead of Assert
2023-06-07 11:22:23 -06:00
1445a6a832 Merge pull request #6482 from SparkiDev/regression_fixes_7
Regression testing fixes
2023-06-07 11:18:36 -06:00
2b054e223b Merge pull request #6483 from SparkiDev/cppcheck_fixes_10
cppcheck: fixes from scan
2023-06-07 11:13:53 -06:00
0752a9e4f4 Merge pull request #6481 from miyazakh/fix_androidb_2
fix un-initialized var
2023-06-07 09:39:00 -06:00
ed01b14356 cppcheck: fixes from scan
wolfssl_sce_unit_test.c:
  sce_crypt_Sha_AesCbcGcm_multitest(): duplicate condition
ssl_asn1.c:
  wolfSSL_i2t_ASN1_OBJECT(): done is not needed
  MonthStr(): fix bounds check on i
woolfcrypt_test.c, test_main.c, wolfssl_tsip_unit_test.c, devices.c,
aes.c, des3.c:
  Variable not used.
asn.c:
DecodeSubjKeyId(): sz is unsigned - check for less than zero does
nothing
kcapi_rsa.c:
  KcapiRsa_Decrypt(): fix ret check by using else
  KcapiRsa_Encrypt(): make same change for consistency
kcapi_hash.c:
  KcapiHashFinal(): move ret into #ifdef where it is needed
stm32.c:
wc_Stm32_Hash_GetDigest(): i redeclared with different type - use ii
instead
bio.c, conf.c:
  XFREE checks for NULL

Reduce scope of varialbes.
Condition same.
2023-06-07 17:27:51 +10:00
d67ce722ff Merge pull request #6476 from kareem-wolfssl/dtlsBlankCert
Send blank certificate message in DTLS when no client cert is loaded.
2023-06-06 22:43:01 -07:00
b07c5d7ce8 Regression testing fixes
Fix: ./configure --disable-shared  --enable-smallstack --enable-all
CFLAGS=-DNO_ASN_TIME

Don't compile mp_test when compiling for SP Math All and RSA
verification only - very few functions available.

ssl.c:
wolfSSL_Rehandshake(): wolfSSL_UseSessionTicket only available when
not NO_WOLFSSL_CLIENT
api.c:
  test_wolfSSL_ticket_keys(): meant to be tested on server
2023-06-07 14:26:45 +10:00
e542e51d9f Test api.c: change more tests to use Expect instead of Assert
bio.c:
  wolfSSL_BIO_push(): handles NULL for top and append.

crl.c:
InitCRL_Entry(): set toBeSigned to NULL after freeing when allocation
fails.
  AddCRL(): free CRL entry properly on error.
wolfSSL_X509_STORE_add_crl(): check for NULL after
wolfSSL_X509_crl_new call.

ssl.c:
wolfSSL_CertManagerGetCerts(): free the certificate if it didn't get
pushed onto stack
  wolfSSL_RAND_Init(): returns success if global already initialized.

ssl_asn1.c: wolfSSL_ASN1_TYPE_set now avaiable when OPENSSL_EXTRA
defined for function wolfssl_dns_entry_othername_to_gn().

x509.c:
Added support for creating a valid General Name of type GEN_OTHERNAME.
Extracted some code out into wolfssl_x509_alt_names_to_gn().
  wolfSSL_X509_set_ext(): free data correctly on errors
wolfSSL_X509_PUBKEY_set(): free str if DSA parameters cannot be
retrieved; wolfSSL_OBJ_nid2obj() called separately to handle when
returning NULL.
wolfSSL_X509_NAME_copy(): check for failure when
wolfSSL_X509_NAME_add_entry() is called.

x509_str.c:
wolfSSL_X509_STORE_CTX_new(): check for error from calling
wolfSSL_X509_STORE_CTX_init().
wolfSSL_X509_STORE_get0_objects(): don't double free x509; free memory
correctly on error
2023-06-07 14:10:42 +10:00
5624df95b5 fix uninit var 2023-06-07 07:43:02 +09:00
ee289fdf89 Merge pull request #6429 from embhorn/zd16184
Allow wolfSSL_RAND_Init to pass if already initialized
2023-06-06 16:23:42 -06:00
8390ab5847 Merge pull request #6480 from lealem47/xcode
XCODE project: install all headers
2023-06-06 16:19:21 -06:00
cac42db53c Merge pull request #6468 from philljj/zd16236
Fix fastmath and heapmath invmod to be consistent with sp-math.
2023-06-07 07:47:41 +10:00
f42d57df87 Merge pull request #6472 from kaleb-himes/ZD16185-Doc-Update-Request
Update error return(s) for wc_RsaPSS_Verify
2023-06-06 15:16:40 -06:00
9bb2ae4884 XCODE project: install all headers 2023-06-06 13:34:22 -06:00
3b48bc97ed Merge pull request #6381 from SparkiDev/type_conversion_fixes_1
Fix type conversion warnings by gcc
2023-06-06 11:25:31 -05:00
9ca9c2ba6f Kyber: allow compilation with limited sizes with liboqs 2023-06-06 14:26:06 +10:00
3230d27700 Merge pull request #6436 from lealem47/sanitizer
Miscellaneous fixes for sanitizer
2023-06-06 11:55:52 +10:00
32976d379f Fix formatting 2023-06-05 16:47:11 -06:00
c0e2752000 Merge pull request #6475 from rizlik/fix_dtls_nogroups_nocerts
fix: add guards to compile w !HAVE_SUPPORTED_CURVES && NO_CERTS
2023-06-06 07:55:08 +10:00
ebac138e77 Send blank certificate message in DTLS when no client cert is loaded. 2023-06-05 10:49:42 -07:00
e53453a7ed fix: add guards to compile w !HAVE_SUPPORTED_CURVES && NO_CERTS
This configuration can be used to build a static PSK only build
2023-06-05 16:13:11 +00:00
6d85d09b0b Update error return(s) for wc_RsaPSS_Verify 2023-06-05 09:22:08 -06:00
ccd404e13d Merge pull request #6470 from douzzer/20230603-unittest-maybe-uninited
20230603-unittest-maybe-uninited
2023-06-05 08:11:52 +10:00
6c4cc2a931 tests/api.c: fix a likely-spurious maybe-uninitialized from gcc-11 -m32 (all-sp-m32) in test_wolfSSL_PEM_PrivateKey(). 2023-06-03 10:41:15 -05:00
db28d38ea3 Fix fastmath and heapmath invmod to be consistent with sp-math. 2023-06-02 22:11:44 -05:00
37aada0313 Merge pull request #6465 from lealem47/zd162152
Read and assign err return val from _sp_mulmod_tmp
2023-06-02 11:45:27 -06:00
3ee31dca6b Merge pull request #6464 from douzzer/20230602-analyzer-guided-fixes
20230602-analyzer-guided-fixes
2023-06-02 11:31:26 -06:00
eaf27b1945 Read and assign err return val from _sp_mulmod_tmp 2023-06-02 10:09:12 -06:00
291be53524 tests/api.c: fixes for clang-diagnostic-embedded-directive (also warned by gcc), clang-analyzer-core.UndefinedBinaryOperatorResult, and clang-analyzer-deadcode.DeadStores. 2023-06-02 11:06:16 -05:00
bb78e1c7d8 Merge pull request #6462 from douzzer/20230601-fix-fips-XASM_LINK
20230601-fix-fips-XASM_LINK
2023-06-01 14:00:01 -06:00
35e59a3569 Merge pull request #6456 from SparkiDev/tests_api_expect_2
Test api.c: change more tests to use Expect instead of Assert
2023-06-01 10:29:52 -06:00
a435302415 wolfssl/wolfcrypt/types.h: conditionalize XASM_LINK() definition on !FIPS_VERSION_LT(5,3) and !WOLFSSL_NO_ASM. 2023-06-01 11:12:27 -05:00
806c75d28b Merge pull request #6450 from miyazakh/fix_jenkins_android
fix to cast diff type, int and uint
2023-06-01 08:33:02 -06:00
7259351a3f Test api.c: change more tests to use Expect instead of Assert
Added a new version of 'nofail' handshaking that doesn't use threads.
More tests can be run in single threaded.

Changed tests over to use test_wolfSSL_client_server_nofail() or
test_wolfSSL_client_server_nofail_memio() to simplfy test cases.

Changed tests to use Expect.

CRL:
BufferLoadCRL wasn't freeing allocated data when currentEntry
couldn't be allocated.

ssl.c:
DecodeToX509(): Needs to call FreeDecodedCert even if
ParseCertRelative fails.
wolfSSL_PEM_read_PUBKEY(): Need to check result of
wolfSSL_d2i_PUBKEY is NULL rather than the passed in WOLFSSL_EVP_PKEY.

X509:
wolfSSL_X509_set_ext(): Must free allocated WOLFSSL_X509_EXTENSION
if not pushed on to stack regardless of stack being NULL.
wolfSSL_X509V3_EXT_i2d(): Don't free asn1str on error as it is the
data passed in.
wolfSSL_i2d_X509_NAME_canon(): free names and cano_data when call to
wolfSSL_ASN1_STRING_canon() fails.

PKCS7:
    wc_PKCS7_InitWithCert(): Check memory allocation of cert for NULL.
2023-06-01 14:22:00 +10:00
b62e0b7ceb Fix type conversion warnings by gcc 2023-06-01 14:21:41 +10:00
5ffee2dbe1 Merge pull request #6459 from douzzer/20230531-analyzer-guided-fixes
20230531-analyzer-guided-fixes
2023-06-01 10:55:48 +10:00
c45efd79af api.c: fix 3 missed EXPECT_RESULT() == WOLFSSL_SUCCESSes to use the succincter EXPECT_SUCCESS(). 2023-05-31 18:26:27 -05:00
42a5d0320b Merge pull request #6445 from jpbland1/dsa_ex
add ex functions to use other digest algorithms with DSA
2023-05-31 14:50:05 -06:00
59a7c0d7e4 move definitions of XASM_LINK() from wolfcrypt/src/aes.c, wolfcrypt/src/asm.c, and wolfcrypt/src/cpuid.c, to wolfssl/wolfcrypt/types.h, and use __asm__() instead of asm() if __GNUC__, for compatibility with -std=c99. 2023-05-31 15:48:52 -05:00
64c9026c77 wolfssl/wolfcrypt/types.h: add PRAGMA_DIAG_PUSH, PRAGMA(), and PRAGMA_DIAG_POP(), using the gcc or clang variants as applicable, to facilitate pragmas to be used on both gcc and clang;
tests/unit.h: fix ExpectPtr() to inhibit pedantic warnings on both gcc and clang;

wolfssl/test.h: in myVerify(), explicitly check for nullness when printing issuer/subject, to avoid cppcheck null-deref warning;

tests/api.c: fixes for:

* myriad "embedding a directive within macro arguments is not portable"
* an "ISO C forbids conversion of object pointer to function pointer type"
* some "stringop-overflow"s
* a clang-analyzer-core.uninitialized.Assign
* a clang-analyzer-core.CallAndMessage "2nd function call argument is an uninitialized value"
* a nullPointerRedundantCheck
* several clang-diagnostic-declaration-after-statement
* a spurious gcc sanitizer maybe-uninitialized in test_wolfSSL_CheckOCSPResponse()
2023-05-31 15:19:15 -05:00
109a17f3bd wolfcrypt/src/memory.c: restore required linuxkm #define WOLFSSL_NEED_LINUX_CURRENT 2023-05-31 15:17:01 -05:00
80311975ce Merge pull request #6452 from anhu/no_rsa_sigalgs
For NO_RSA, don't advertise support for RSA.
2023-05-31 13:41:56 -06:00
554e6472b5 addressed review comments 2023-05-31 06:54:14 +09:00
5604033902 Merge pull request #6453 from kaleb-himes/OE52_OE54_CHECKIN
Checkin STARCORE project OE52_OE54_ACVP effort
2023-05-30 14:43:25 -06:00
ca2ca4f739 Merge pull request #6454 from philljj/spelling_cleanup
Used codespell and fixed obvious typos in src and wolfssl.
2023-05-30 14:42:04 -06:00
769c488d18 Merge pull request #6444 from night1rider/wolfssl-Onboarding
added test case for wolfSSL_configure_args
2023-05-30 13:03:05 -06:00
1bdd1cb157 Used codespell and fixed obvious typos in src and wolfssl. 2023-05-30 11:36:43 -05:00
f51d4c4c30 Checkin STARCORE project OE52_OE54_ACVP effort 2023-05-30 10:36:01 -06:00
ea6155c924 For NO_RSA, don't advertise support for RSA. 2023-05-30 12:34:23 -04:00
dbca65f028 Merge pull request #6447 from SparkiDev/tests_api_expect
Tests api.c: rework for malloc failure testing
2023-05-30 09:19:54 -06:00
63a5fe3229 fix to cast diff type, int and uint 2023-05-30 17:32:42 +09:00
541ea51ad5 Tests api.c: rework for malloc failure testing
Modified number of tests to not crash on failure and cleanup allocations
on failure.
Added memory fail count option to set which memory allocation to start
failing on.
Fix issues found from testing.

bio.c:
BIO_new() move ref count up so that calls to wolfSSL_BIO_free()
work.
internal.c:
ImportCipherSpecState wasn't checking SetKeySide for failure. Crash
when pointer is NULL and accessed directly.
ocsp.c:
wolfSSL_OCSP_response_get1_basic() doesn't need to free vs->source
as it is freed in WOLFSSL_OCSP_RESPONSE_free().
ssl.c:
ProcessBuffer() Don't strip PKCS#8 header if failed to create DER.
Crasged as directly accessing 'der' which was NULL.
ssl_asn.c:
wolfssl_asn1_integer_require_len was checking wrong variable to see
if allocation failed.
x509,c:
wolfSSL_X509_ALGOR_set0 needs to set aobj only when no failure
possible.
wolfSSL_X509_chain_up_ref needs to call cleanup to ensure everything
is freed.
2023-05-30 12:01:21 +10:00
37c03e3f11 Merge pull request #6442 from embedded-specialties/int-sequence
ASN.1 Integer sequence
2023-05-30 09:37:55 +10:00
4f8419c641 Merge pull request #6441 from SparkiDev/cryptocb_pkcs11_rsa_get_size
CryptoCb, PKCS#11: add RSA key size lookup
2023-05-29 16:09:33 -07:00
d340587035 Added valid ASN.1 integer value to test_asn1 2023-05-28 21:18:45 -04:00
8fb4e7813b Added braces to support older compilers 2023-05-28 18:59:16 -04:00
c0116d6026 added test case for wolfSSL_configure_args and added fix
new fix

removing redundant () in code
2023-05-26 16:45:13 -06:00
5a49b8c436 Merge pull request #6449 from anhu/syn_err
Fix a syntax error.
2023-05-26 15:55:36 -06:00
87bbcbb96a Fix a syntax error.
Tested with:
    ./configure --enable-debug --enable-all CFLAGS=-DDEBUG_WOLFSSL_VERBOSE
2023-05-26 16:12:14 -04:00
569a498015 Merge pull request #6443 from SparkiDev/wolfssl_x509_name_entry_leak_2
X509 NAME Entry: fix get object to not leak
2023-05-25 16:15:12 -06:00
566fa1179f add ex functions to use other digest algorithms 2023-05-25 12:50:23 -04:00
a05f4f4dd9 Merge pull request #6432 from SparkiDev/wolfssl_x509_name_entry_leak
X509 NAME ENTRY create: ensure existing object is not lost
2023-05-25 09:28:45 -06:00
6b2fe61d95 Merge pull request #6439 from lealem47/asio_cmake
CMake: add option to enable asio
2023-05-25 09:26:06 -06:00
cff8e8e6f7 X509 NAME Entry: fix get object to not leak
wolfSSL_X509_NAME_ENTRY_get_object
 - object field was being reused if it existed but lost on error
 - store object only on success, ie object is not NULL
 - moved function into x509.c
2023-05-25 09:26:22 +10:00
e3be76b238 Merge pull request #6435 from SparkiDev/sp_int_count_bits_cleanup
SP int: cleanup sp_count_bits
2023-05-24 15:11:12 -07:00
2c59bec72c Fixed typo in comment 2023-05-24 17:37:51 -04:00
8bd3850e58 Added ASN.1 Integer sequencing 2023-05-24 17:28:53 -04:00
98522fa39d Only clear last ASN_PEM_NO_HEADER error 2023-05-24 14:17:46 -06:00
1218cfb7f2 Merge pull request #6087 from rizlik/embed_recv_from_fix_peer
dtls: improve different peer recvfrom and better error reporting on ipv6
2023-05-24 13:54:40 -06:00
34c12789c9 CMake: add option to enable asio 2023-05-24 12:46:11 -06:00
188a99bd5a Merge pull request #6438 from anhu/ext_cache
Without HAVE_EXT_CACHE session dup is not compiled in
2023-05-24 11:15:00 -06:00
87a7af05dd Without HAVE_EXT_CACHE session dup is not compiled in 2023-05-24 12:14:02 -04:00
e954110cc5 CryptoCb, PKCS#11: add RSA key size lookup
wc_RsaEncryptSize(): assumed a key size of 2048 when using hardware key.
Added callback to do lookup and implemented for PKCS#11.
If lookup not supported then assumes 2048 bits.
2023-05-24 11:42:52 +10:00
5613109fae Miscellaneous fixes for sanitizer 2023-05-23 13:51:46 -06:00
9d01411857 Merge pull request #6433 from SparkiDev/memusage_7
Memory usage: reduce stack usage
2023-05-22 16:35:04 -07:00
622375b47e SP int: clenaup sp_count_bits
More explicitly handle used == 0 for static code analyser.
Make sp_count_bits clearer.
2023-05-23 09:20:22 +10:00
5a59807733 Merge pull request #6431 from douzzer/20230521-wolfsentry-mt-usage-fixes
20230521-wolfsentry-mt-usage-fixes
2023-05-22 10:05:52 -07:00
5182fe3f7d wolfio: cleaning: use WOLFSSL_IP6 define instead of AF_INET6 2023-05-22 15:33:06 +00:00
f21c34b08d tests: EmbedRecvFrom/EmbedSendTo error if ipv6 w/o ipv6 compiled in 2023-05-22 15:33:06 +00:00
640f9cf967 wolfio: EmbedRecvFrom: check ipv6 peer on non-ipv6 version 2023-05-22 15:33:05 +00:00
b4542ed270 tests: add dtls ignoring different peer test 2023-05-22 15:32:57 +00:00
73f502e189 wolfio: dtls: retry instead of returning WANT_READ on different peer
If EmbedReceiveFrom() returns WANT_READ, a blocking socket will not know how to
deal with the error. Retry the recvfrom instead adjusting the timeout.
2023-05-22 15:31:58 +00:00
5f293bf736 tests: add test_wolfssl_client_server_no_fail(_ex) to set client cb 2023-05-22 15:31:58 +00:00
cff580b4f0 tests: api: error out on read error in test_server_nofail 2023-05-22 15:31:58 +00:00
98a717e1d5 Memory usage: reduce stack usage
AES C impl: don't align to 32 bytes, align to 16 as buffer is 16 bytes
long.
SP int: Don't call _sp_mulmod but call sp_mul and _sp_div to do mod
operation. For RSA, fewer calls for mod operation means less stack used
at deepest point.
2023-05-22 16:57:07 +10:00
403acadf1a X509 NAME ENTRY create: ensure existing object is not lost
wolfSSL_X509_NAME_ENTRY_create_by_txt and
wolfSSL_X509_NAME_ENTRY_create_by_NID:
 - object field was being reused if it existed but lost on error
 - extracted common code
 - store object only on success, ie object is not NULL
2023-05-22 10:52:51 +10:00
d8e4c78960 Merge pull request #6426 from jpbland1/invariant-mp-size
add check to sp_invmod_mont_ct to make sure the
2023-05-22 08:14:39 +10:00
3e14b34bdc wolfssl/test.h: in wolfsentry_setup(), add lock-unlock wrap before wolfsentry_route_get_main_table() (enforced by wolfSentry 1.3+, and was always required for thread safety). 2023-05-21 10:51:24 -05:00
3e95ad9549 Allow wolfSSL_RAND_Init to pass if already initialized 2023-05-19 17:08:44 -05:00
a06bd777c0 Merge pull request #6423 from cconlon/pkcs7NoStream
Fix PKCS#7 build with NO_PKCS7_STREAM
2023-05-19 10:32:49 -06:00
235dc95b27 Merge pull request #6420 from julek-wolfssl/atomic-use-macro
Implement atomic operations interface
2023-05-19 10:29:04 -06:00
8b9e13865a Merge pull request #6383 from philljj/zd16072
Fix session ticket leak in wolfSSL_Cleanup
2023-05-19 09:14:07 -07:00
8f4524efa0 Merge pull request #6298 from rizlik/dtls13-null-cipher
dtls13: support Authentication and Integrity-Only Cipher Suites
2023-05-19 10:13:44 -06:00
10b6105505 Merge pull request #6424 from SparkiDev/coverity_2
Coverity scan fixes
2023-05-19 09:13:26 -07:00
7e3aafb60c Fix for FIPS ECC integrity check with crypto callback set (#6425)
Skip ECC private key check when the TPM is used to generate the key, since it doesn't release the private part. this option needs to be used with a FIPS approved TPM for the end result to be FIPS approved
2023-05-19 09:12:44 -07:00
344c3338a9 add check to sp_invmod_mont_ct to make sure the
result integer can hold the range of the modulus
2023-05-19 10:49:42 -04:00
f3b66a3e26 Merge pull request #6427 from SparkiDev/scan-build_fixes_1
scan-build fixes
2023-05-19 10:46:00 -04:00
35185e1a59 tests: add dtls13 null cipher test 2023-05-19 08:10:26 +00:00
45503972f8 scan-build fixes
sp_mulmod
 - scan-build getting confused with size of result
 - don't check result size as checked already
 - split out implementation of sp_mulmod from check

StoreEccKey
 - ensure pubKey is not NULL even though all uses will not be

GetCertKey
 - ensure source is not NULL
 - cert->source may be NULL in incorrect usages of APIs
2023-05-19 12:17:41 +10:00
2c34210efb Coverity scan fixes
DecodeRsaPssParams() assumed params is never NULL. Should never be
called with NULL but check saves a NULL dereference.

PrintObjectIdText() didn't check return of call to GetObjectId. 'oid'
will retain -1 value on error and work as normal on error return.
Cleaner to check for ASN_PARSE_E and handle - other error,
ASN_UNKNOWN_OID_E, is OK for printing.
2023-05-19 09:15:16 +10:00
6ef580ca59 fix PKCS#7 build when using NO_PKCS7_STREAM 2023-05-18 14:50:03 -06:00
a595f10549 Merge pull request #6421 from ejohnstown/bp-conf-desc-fix
Configure Typo
2023-05-18 14:07:58 -06:00
f9dcab956e Configure Typo
1. The description text for the brainpool enable option in configure was
   using a shell variable that ended up in the output. Switched to the
   description pattern used in other options.
2023-05-18 10:51:04 -07:00
466636214f Add MSVC atomics 2023-05-18 12:06:54 +02:00
31ed2a2bbb dtls13: support Authentication and Integrity-Only Cipher Suites
See RFC 9150. To enable the feature use HAVE_NULL_CIPHER compilation flag.
2023-05-18 10:03:03 +00:00
5f1ce09dce Merge pull request #6412 from JacobBarthelmeh/tls13
add tls extension sanity check
2023-05-18 09:33:49 +10:00
0530ee774f Merge pull request #6418 from douzzer/20230517-linuxkm-benchmarks
20230517-linuxkm-benchmarks
2023-05-17 15:00:49 -07:00
90b858492f CMake: improve build scripts (#6331)
* make wolfssl compile with Mingw-w64

* cmake: CMAKE_SYSTEM_PROCESSOR is AMD64 on Windows

* cmake: use target_compile_definitions instead of add_definitions

* cmake: change default value of WOLFSSL_BUILD_OUT_OF_TREE_DEFAULT to ON

* cmake: link crypt32.lib on Windows

* cmake: export wolfssl

* move Config.cmake.in to cmake directory

* revert changes to .gitignore

* add Config.cmake.in to include.am
2023-05-17 15:26:46 -06:00
9d05a4f2ed Don't orphan ticBuff pointer in wolfSSL_DupSessionEx 2023-05-17 16:25:27 -04:00
2bb3ade4ac Merge pull request #6416 from embhorn/gh6413
Fix valgrind issue with memcpy
2023-05-17 13:46:49 -06:00
a5106ecda0 Merge pull request #6417 from kareem-wolfssl/docUpdates
Update AES and Chacha documentation.
2023-05-17 13:43:15 -06:00
fffff657de cleanups: line length, WOLFSSL_SMALL_STACK_STATIC, and SAVE_VECTOR_REGISTERS() failure trap in benchmark.c, proper path to benchmark.c in linuxkm/module_hooks.c, and proper casting in aes.c. also harmonized semantics and prototype of bench_ripemd(). 2023-05-17 13:00:46 -05:00
dd9edfee24 Implement atomic operations interface 2023-05-17 16:33:11 +02:00
37b716192b wolfcrypt/benchmark/benchmark.c: fix typo in bench_stats_start(). 2023-05-17 02:27:04 -05:00
4f4842fce6 linuxkm/linuxkm_memory.c: refactor SAVE/RESTORE_VECTOR_REGISTERS() to be per-process rather than per-CPU, and add migrate_disable/enable() to kernel_fpu_begin/end() because preempt_disable() is just a barrier on _PREEMPT_VOLUNTARY kernels;
linuxkm/linuxkm_wc_port.h: activate SAVE/RESTORE_VECTOR_REGISTERS() whenever defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS) for benchmark.c support, independent of vector crypto features;

fix and optimize various alignment issues with stack and heap allocations;

fix macro definitions for XMALLOC/XREALLOC/XFREE to correctly use kvmalloc and friends when defined(HAVE_KVMALLOC), and to use wolfSSL_Malloc() and friends when defined(WOLFSSL_TRACK_MEMORY);

purge stale LINUXKM_SIMD_IRQ code.
2023-05-17 01:44:36 -05:00
fc589d664e wolfssl/wolfcrypt/mem_track.h: refactor for linuxkm compatibility, mainly by supporting NO_STDIO_FILESYSTEM. 2023-05-17 01:13:36 -05:00
cc1ec8ace5 wolfssl/wolfcrypt/types.h: add missing do-while-0 nonstatments to WC_FREE_VAR() and WC_FREE_ARRAY() for pedantic semicolon swallowing. 2023-05-17 01:11:01 -05:00
a18dc7f10a wolfcrypt/src/aes.c: in wc_AesSetKeyLocal(), add an alignment check in the haveAESNI path for WOLFSSL_LINUXKM, because the failure mode is module crash. 2023-05-17 01:07:47 -05:00
40b598289f src/ssl_asn1.c: in wolfssl_asn1_time_to_tm(), initialize localTm with memset, not the zero initializer, for C++ compatibility. 2023-05-17 01:06:17 -05:00
85e0bf337b fix for benign sign clash in wc_RNG_GenerateBlock(). 2023-05-17 01:05:33 -05:00
5aceae1d1c src/internal.c: fix for typo (identicalInnerCondition) in DoClientHello(). 2023-05-17 01:05:14 -05:00
3ad7e39dc4 refactor benchmark.c for linux kernel compatibility -- WOLFSSL_SMALL_STACK and WOLFSSL_NO_FLOAT_FMT codepaths, SAVE/RESTORE_VECTOR_REGISTERS, refactor of several stack array initializations that broke in the kernel, and replacement of an fputs() call with printf(). 2023-05-17 01:04:40 -05:00
42cce9d8e5 add --enable-linuxkm-benchmarks; add check for async.{c,h} when --enable-asynccrypt; update failure message for the opensslextra AC_CHECK_HEADER() test. 2023-05-17 01:03:26 -05:00
6cb2c84f12 Update AES documentation to clarify block size requirement. Fix parameter ordering in wc_ChaCha20Poly1305_Decrypt documentation. 2023-05-16 14:31:51 -07:00
0a5a5a65a2 Fix valgrind issue with memcpy 2023-05-16 14:38:51 -05:00
5194a296e0 Merge pull request #6414 from embhorn/zd16166
Documentation for wolfSSL_CertManagerFreeCRL
2023-05-16 10:08:51 -06:00
53ef26bf3a Merge pull request #6392 from rizlik/dtls13-fix-ch-epoch
DTLS v1.3: fix epoch 0 check on plaintext message
2023-05-16 10:07:14 -06:00
ae37fee134 Merge pull request #6411 from lealem47/6397
Fixes for wolfcrypt test without ECC SECP
2023-05-16 09:59:55 -06:00
494febb3fb Documentation for wolfSSL_CertManagerFreeCRL 2023-05-16 09:44:00 -05:00
00f1eddee4 add tls extension sanity check 2023-05-15 15:49:44 -07:00
1c3fa38821 Fix for conflicting types for HAL timer 2023-05-15 14:12:53 -06:00
3f795f2f47 Fixes for wolfcrypt test without ECC SECP 2023-05-15 14:12:24 -06:00
c2a7397425 Merge pull request #6406 from JacobBarthelmeh/fuzzing
check for socket errors on SendAlert
2023-05-15 09:16:20 -07:00
c17cff7265 Merge pull request #6403 from kareem-wolfssl/gh6387
Fix wolfssl_asn1_time_to_tm setting unexpected fields in tm struct.
2023-05-12 16:37:17 -06:00
a474179cdf Merge pull request #6301 from miyazakh/ra_cryptonly
Add Renesas SCE RSA Crypt Only support
2023-05-12 16:32:15 -06:00
f1ad37919d Add test case for ASN1_TIME_to_tm fix. 2023-05-12 14:30:55 -07:00
1b6ab01d0b Merge pull request #6407 from dgarske/stm32_cleanup
Remove STM AES always true check
2023-05-12 13:54:24 -06:00
9cca571c1d Merge pull request #6399 from bigbrett/zd16083-ocsp-double-free
fix double free in InitOCSPRequest
2023-05-12 13:50:54 -06:00
bebf4f6e8b Merge pull request #6405 from julek-wolfssl/zephyr-misc
Small fixes to build wolfSSL on zephyr without warnings
2023-05-12 12:33:01 -07:00
79a5c49e47 Skip Async_DevCtxInit when using init rsa/ecc label/id api's (#6393)
* Skip Async_DevCtxInit when using init rsa/ecc label/id api's

---------

Co-authored-by: Lealem Amedie <lealem47@github.com>
2023-05-12 11:54:03 -07:00
ea40176bee check for socket errors on SendAlert 2023-05-12 09:52:01 -07:00
56cd8c3dc1 Merge pull request #6401 from anhu/doc_ptr_fix
Doc Fix: TI no longer maintains the documentation; we do.
2023-05-12 09:20:37 -06:00
62db14e676 Small fixes to build wolfSSL without warnings 2023-05-12 13:24:21 +02:00
a68b0d8ecf Merge pull request #6402 from lealem47/no_ecc_secp
Don't test SECP vectors when disabled in test.c
2023-05-11 17:25:42 -07:00
6930179b8e Fix wolfssl_asn1_time_to_tm setting unexpected fields in tm struct. 2023-05-11 15:15:46 -07:00
9a2dc120c4 Don't test SECP vectors when disabled in test.c 2023-05-11 14:21:39 -06:00
ced8198737 Doc Fix: TI no longer maintains the documentation; we do. 2023-05-11 15:23:35 -04:00
46dce4b33f set pointer to null after freeing in InitOcspRequest() to prevent a subsequent double-free in FreeOcspRequest() 2023-05-11 12:59:25 -06:00
dbb5ee3b1e Merge pull request #6389 from JacobBarthelmeh/devid
always call crypto cb when compiled in
2023-05-11 11:48:30 -07:00
6a48539309 Merge pull request #6398 from douzzer/20230511-analyzer-carps
20230511-analyzer-carps
2023-05-11 11:47:23 -07:00
dfbd61cad9 Remove always true check. 2023-05-11 11:38:12 -07:00
3c06638115 wolfcrypt/src/aes.c: fixes for bugprone-macro-parentheses;
wolfcrypt/src/ecc.c: fix for nullPointerRedundantCheck ("possible null pointer dereference").
2023-05-11 11:51:27 -05:00
07c41c5498 add macro guard on test case 2023-05-10 15:51:39 -07:00
bab35c4de2 add WOLF_CRYPTO_CB_FIND macro to guard find device ID callback 2023-05-10 15:28:19 -07:00
870f7cc95b Merge pull request #6394 from douzzer/20230509-THIS_MODULE-mem-and-more-Wconversion
20230509-THIS_MODULE-mem-and-more-Wconversion
2023-05-10 10:19:25 -07:00
04e831fa63 Merge pull request #6309 from SparkiDev/aes_cache_touch_lines
AES: touch each cache line when getting offset from table
2023-05-10 09:56:27 -06:00
c953716367 Merge pull request #6391 from rizlik/dtls13-label-fix
dtls13: fix: use correct label to derive resumption key
2023-05-10 08:06:27 -06:00
c26a5f7514 Merge pull request #6390 from lealem47/no_asn_time
Fix for compiling with NO_ASN_TIME + doc fix
2023-05-10 08:02:45 -06:00
5773252e33 test: add check that CH with epoch != 0 are ignored 2023-05-10 13:54:25 +00:00
6c8811a737 dtls13: fix: check plaintext record header epoch is 0
In DTLS v1.3 the normal (plaintext) record header can be used only with
unprotected message (epoch == 0). Protected messages use the unified header.

Check this invariant using `IsAtLeastTLSv1_3` instead of `ssl->options.tls1_3`
because the latter is false before version negotiation.

In DTLSv1.2 the DTLS normal header is used for all the epoch, this check doesn't
interfere because:
1. the first CH's epoch must be zero in all DTLS versions
2. In case of downgrade after version negotiation `IsAtLeastTLSv1_3` is false
2023-05-10 13:54:25 +00:00
a2776ad35e addressed review comments 2023-05-10 13:55:34 +09:00
f2c97d5d35 fixes for various wolfcrypt -Wconversions visible only on compilers that promote byte and word16 to signed int, then warn of a sign conflict when an intrinsically safe result is assigned back to the original type. 2023-05-09 23:55:08 -05:00
ec9beaab41 linuxkm: add coverage for Linux 6.4+ module memory layout refactor; also, refactor WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS to make it settable independent of WOLFSSL_AESNI etc. 2023-05-09 23:53:49 -05:00
158c0362e7 Merge pull request #6372 from rizlik/send_alert_fix
tls13: correctly propagatae SendAlert err message
2023-05-10 10:25:15 +10:00
03f5ce03ff Remove inaccurate STM32 documentation 2023-05-09 13:28:20 -06:00
86064f9a04 Fix for compiling with NO_ASN_TIME 2023-05-09 13:26:19 -06:00
71ca447b6b resolve CB_ONLY cases 2023-05-09 09:08:32 -07:00
e9303a5e77 dtls13: fix: use dtls label to derive ExportKey/Resumption secrets 2023-05-09 10:04:29 +00:00
cdeba4e1b0 Merge pull request #6364 from anhu/compat_unknown_oid
Allow for unknown OIDs in extensions in wolfSSL_X509_set_ext()
2023-05-08 14:51:35 -06:00
11512c7e89 Merge pull request #6388 from philljj/zd16114
Fix memory leak in TLSX_KeyShare_Setup
2023-05-08 14:47:00 -06:00
03a566791e fix for recursive issue in test case 2023-05-08 12:51:22 -07:00
730db6a841 Address Jacob's comment 2023-05-08 14:47:22 -04:00
71cbc019d7 always call crypto cb when compiled in 2023-05-08 09:49:50 -07:00
8c792b836c Fix memory leak in TLSX_KeyShare_Setup 2023-05-08 10:46:33 -05:00
62a4329f8e Merge pull request #6379 from SparkiDev/sp_int_gcd_fix
SP int; fix sp_gcd error checking
2023-05-07 12:11:29 -07:00
979b92deb8 Fix session ticket leak in wolfSSL_Cleanup 2023-05-04 22:21:55 -05:00
ae844b4a0f Merge pull request #6378 from SparkiDev/minor_fixes_2
Minor fixes
2023-05-04 20:20:33 -05:00
d342e341d8 SP int; fix sp_gcd error checking
r can be as large as the smaller of a and b.
Fix sign check.
Add comments as to what GCD does.
2023-05-05 09:11:47 +10:00
55a91c2b55 Minor fixes
configure.ac: Don't use == in test.
client.c: Merge string to one line.
asn.c/asn_public.h:
  fix conversion warnings/errors.
  wc_Asn1_Print no longer public and doesn't need to check for NULL.
  wc_Asn1_PrintAll check all pointer parameters for NULL.
2023-05-05 08:43:50 +10:00
c3e4da9f66 Merge pull request #6376 from lealem47/freeRTOS_thread
Define WOLFSSL_THREAD for FREERTOS case
2023-05-04 14:53:24 -07:00
0af4e8d10a Define WOLFSSL_THREAD for FREERTOS case 2023-05-04 14:26:12 -06:00
6e572cc91d Merge pull request #6352 from SparkiDev/asn1_print
ASN.1 print utility: asn1
2023-05-04 10:55:47 -07:00
75390937bc tls13: correctly propagatae SendAlert err message 2023-05-04 16:30:50 +00:00
4cdf32e497 Merge pull request #6333 from SparkiDev/memusage_6
Memory usage improvements
2023-05-04 09:14:24 -07:00
82e502d8a2 WOLFSSL_SP_INT_NEGATIVE declaration for all Espressif chipsets (#6374)
* WOLFSSL_SP_INT_NEGATIVE declaration for all Espressif chipsets
* correct naming for WOLFSSL_SHA384 on ESP32-C3
2023-05-04 08:04:25 -07:00
9b404fcc5b AES touch cache lines
Change implementation to get from each line of a table once for each 4
variables.
Only enable WOLFSSL_AES_TOUCH_LINES, by default, when RISC-V.
2023-05-04 16:34:42 +10:00
d2afe9e5e0 Memory usage improvements
ECC: make private key field 'k' able to be smaller when ALT_ECC_SIZE is
defined.
WOLFSSL_SMALL_STACK_CACHE: allocate temps using new macros.
2023-05-04 10:26:57 +10:00
9cdee20a7d ASN.1 print: implementation to parse and print added
New API to parse and print DER/BER data from a buffer.
Add an example to parse DER, Base64 and PEM files and print out ASN.1 items.
2023-05-04 09:57:44 +10:00
6369b1e9ec Merge pull request #6371 from dgarske/lowres
Fixes and improvements for building with low footprint
2023-05-03 19:33:53 -04:00
714ec82e91 Merge pull request #6369 from rizlik/dh-async-fix
async fixes: dh and tests
2023-05-03 07:50:23 -07:00
f05543c9e5 Merge pull request #6370 from SparkiDev/sp_int_copy_change
SP int: _sp_copy don't check a == b, change calls to _sp_copy
2023-05-03 08:30:55 -06:00
4b90afa37b Provide way to disable ASN but have wc_RsaPublicKeyDecodeRaw, which doesn't need ASN.1 parsing. 2023-05-02 18:10:25 -07:00
61dfbf5ef2 Fixes and improvements for building with low footprint. Fix for ASN template with RSA verify only (was missing mp_leading_bit). Fix to allow disabling DRBG with crypto callbacks enabled. Updated the wolfTPM user_settings.h template with low resource option. 2023-05-02 16:51:41 -07:00
1a8f09d013 Merge pull request #6320 from JacobBarthelmeh/curl
smaller sized build with curl
2023-05-03 07:46:29 +10:00
c3a8476b95 SP int: _sp_copy don't check a == b, change calls to _sp_copy
Simplify code to make it easier for software analysers.
Reduce work done by using _sp_copy instead of sp_copy where possible.
2023-05-03 07:44:28 +10:00
11a77f7078 Merge pull request #6363 from dgarske/threadlocal
Add option to support disabling thread local storage
2023-05-02 15:12:13 -06:00
58b996353b Merge pull request #6266 from dgarske/zd15938_async_ecc
Fix for async ECC shared secret state
2023-05-02 12:01:31 -06:00
0ebe5819d0 Allow for unknown OIDs in extensions in wolfSSL_X509_set_ext()
...and add some testing to show we properly inserted the extensions.
2023-05-02 12:43:14 -04:00
a5a2316aa4 async: fix overwrite of keylen params between calls
The `kse->pubKeyLen` parameter is used as an input parameter to `DhGenKeyPair`
to provide the size of the `pubKey` buffer (the same size as the prime p). After
that, `kse->pubKeyLen` is used to check that the public key generated is of the
same length as the prime p. If this is not the case, the public key is
padded. If the key generation is asynchronous, then `TLSX_KeyShare_GenDhKey` may
be invoked twice. The second time, the `kse->pubKeyLen` value, updated
asynchronously by the async code, is overwritten with the prime size at the
beginning of the function. When this happens, a wrong public key value is used,
and the shared secret computed is incorrect.

Similar reasoning can be applied to `kse->keyLen`
2023-05-02 16:34:15 +00:00
3e4b95eb4b test: fix test AEAD limit server set fds as nonblock 2023-05-02 16:34:01 +00:00
bdd45350c5 Merge pull request #6361 from bandi13/minorContainerUpdates
Minor container updates
2023-05-01 17:05:36 -06:00
ceeda82906 Add option to support disabling thread local --disable-threadlocal. Useful for cross-compile situation where thread local storage is not desired. ZD 16062 2023-05-01 15:51:22 -07:00
06d5897233 Merge pull request #6362 from dgarske/stm32_hash
Improved fix for STM32 hashing on U5
2023-05-01 16:30:57 -06:00
72ffa743a0 Fix for async ECC shared secret. ZD 15938 2023-05-01 15:30:03 -07:00
ef955c620f refactor evp.c to group all MD digest functions togther 2023-05-01 13:23:48 -07:00
7576380635 Improved fix for STM32 hashing on U5 2023-05-01 13:13:00 -07:00
c84abaf5b6 Merge pull request #6357 from kareem-wolfssl/gh6348
Fix wc_PeekErrorNodeLineData not unlocking error queue on error.
2023-05-01 13:59:35 -06:00
45c8796f7c Merge pull request #6355 from bandi13/minorBugfix
Should only move the index by the amount we wrote
2023-05-01 13:56:22 -06:00
931f665a9a Missing 'tcpdump' utility 2023-05-01 15:30:12 -04:00
00fa00f875 Changes to make it possible to use a different base container 2023-05-01 15:28:39 -04:00
73b3f9c01a Merge pull request #6356 from lealem47/init_values
Fix uninitialized variable compiler warning
2023-05-01 09:18:48 -06:00
f6cdcfcf9f Fix wc_PeekErrorNodeLineData not unlocking error queue on error. 2023-04-28 16:35:49 -07:00
99b4ee50ba Fix uninitialized variable compiler warning 2023-04-28 13:58:29 -06:00
1522155892 Should only move the index by the amount we wrote 2023-04-28 14:08:15 -04:00
52a20fc2b5 Merge pull request #6328 from julek-wolfssl/zd/16000
Allow cert callback to override skipAddCA
2023-04-28 10:25:13 -07:00
13f4e178e5 Zephyr misc fixes for TLS (#6353)
* zephyr wolfssl_tls_sock: fix project name

* zephyr tls_sock.c: don't include options.h when using user settings

* zephyr: define XSTAT_TYPE for use with XSTAT
2023-04-28 10:00:24 -07:00
6b2aca1418 Merge pull request #6347 from SparkiDev/sp_int_armv6_clz
SP int ARMv6: clz not available, correct #if
2023-04-28 09:43:58 -06:00
36ac816cd1 Merge pull request #6342 from TakayukiMatsuo/unittest 2023-04-28 10:06:04 +02:00
f8559b745e Merge pull request #6351 from douzzer/20230427-linuxkm-simd-fixes
20230427-linuxkm-simd-fixes
2023-04-28 11:20:20 +10:00
e4bf1a7c0b Merge pull request #6350 from kareem-wolfssl/zd15670
Fix PowerPC inline assembly on old GNU toolchain.
2023-04-28 11:19:42 +10:00
448f1ec9e7 linuxkm: in {save,restore}_vector_registers_x86(), check if vector register file has already been saved and invalidated, and if so, inhibit the kernel_fpu_{begin,end}() wrap and instead just use preempt_{disable,enable}() wraps. 2023-04-27 17:48:32 -05:00
8a89303b49 wolfcrypt/test/test.c: add TEST_FAIL() macro (counterpart to incumbent TEST_PASS()), by default same as incumbent functionality, but #ifdef TEST_ALWAYS_RUN_TO_END, print errors as they occur but continue to end. 2023-04-27 17:46:56 -05:00
3f60fa8c3b configure.ac: escape backslashes when generating preprocessor directives for .build_params; delete backslashes and process parenthesized arguments correctly when generating options.h. 2023-04-27 17:38:29 -05:00
dcd1428b7d Merge pull request #6304 from TakayukiMatsuo/jpupdate
Update Japanese comments
2023-04-28 07:06:38 +09:00
1172354664 Fix PowerPC inline assembly on old GNU as. It does not like an empty clobbered register line, so simply omit the line. 2023-04-27 14:54:51 -07:00
7b52913451 Merge pull request #6345 from kareem-wolfssl/zd16035
Fix getting key size in stm32_ecc_sign_hash_ex.
2023-04-27 13:32:47 -06:00
bbad64649b Merge pull request #6340 from SparkiDev/minor_fixes_1
Minor fixes
2023-04-27 10:02:06 -06:00
59472312a5 Fix example code in wolfSSL_get_chain_X509 2023-04-27 17:51:10 +09:00
bf2c66a1cb Allow cert callback to override skipAddCA 2023-04-27 10:07:04 +02:00
4c47934562 Fix issues in test_wolfSSL_dtls_fragments 2023-04-27 17:00:29 +09:00
d901433999 SP int ARMv6: clz not available, correct #if
Checking for architecture less than 7 to use clz instruction when clz is
only guaranteed to be available in 7 or more. Reverse logic.
2023-04-27 09:41:31 +10:00
ca4a17ebf6 Merge pull request #6339 from SparkiDev/asn_orig_ocsp_fix
ASN original, OCSP: fix maximum size calc to GetDateInfo
2023-04-26 16:36:55 -06:00
e7e2713bba Fix getting key size in stm32_ecc_sign_hash_ex. 2023-04-26 15:00:59 -07:00
ccb9bdd903 set dev ID with signature check (#6318)
* set dev ID with signature check

* refactor devId use and add API to set devId in WOLFSSL_CERT_MANAGER structure

* add api.c call to set devid with WOLFSSL_CERT_MANAGER

* resolving devID CRL issue and CM pointer

* add device find callback

* add simple test case
2023-04-26 11:19:00 -07:00
3556b7adb7 Merge pull request #6338 from JacobBarthelmeh/certs
revert WOLFSSL_NO_ASN_STRICT macro guard
2023-04-26 11:16:04 -07:00
b42d3566ab Merge pull request #6336 from lealem47/useAfterFree
Remove XMEMSET after XFREE in sniffer.c
2023-04-26 10:50:00 -07:00
32c6a66a4e Merge pull request #6341 from douzzer/20230425-analyzer-coddling
20230425-analyzer-coddling
2023-04-26 11:22:23 -06:00
4526df6d78 Merge pull request #6199 from JacobBarthelmeh/PKCS7
add messageDigest attribute if adding any custom signed attributes
2023-04-26 09:23:22 -06:00
ead8d9784b Update Japanese comments 2023-04-26 18:20:51 +09:00
5538d65a79 wolfcrypt/src/asn.c: add to DecodeCertInternal() a workaround for an apparent clang-tidy bug, gated on WOLFSSL_CLANG_TIDY, and add a missing cast to mollify -Wconversion;
wolfssl/wolfcrypt/sp_int.h: refactor MP_INT_SIZEOF() using sizeof(sp_int_minimal) and addition, rather than sizeof(sp_int) and subtraction, for clarity and analyzer mollification.
2023-04-26 00:05:37 -05:00
5b0c017a94 ASN original, OCSP: fix maximum size calc to GetDateInfo
GetDateInfo called with a local index (reset to 0) but size is of
original buffer. Subtract the index into original buffer from size to
get size available for parsing.
2023-04-26 11:18:29 +10:00
a5a4c71121 Minor fixes
EncryptContent() - id not initialized
sp_int.c: cast count to int to ensure same type comparison with i.
2023-04-26 11:05:07 +10:00
c4233e7aec Merge pull request #6288 from JacobBarthelmeh/Testing
avoid callback buffer overwrite with sha512_224 and remove min from w…
2023-04-26 08:36:20 +10:00
7fb9540176 Merge pull request #6337 from JacobBarthelmeh/fuzzing
add sanity check on PKCS7 index value
2023-04-26 08:33:25 +10:00
5c97dfbb4c Merge pull request #6334 from SparkiDev/openssl_ec_set_priv_key_check
OpenSSL EC API: fix setting private key
2023-04-25 16:32:53 -06:00
2641c493b3 Merge pull request #6335 from JacobBarthelmeh/RT1170
add guard for random with CAAM + MQX
2023-04-26 08:32:20 +10:00
71f71074f8 revert WOLFSSL_NO_ASN_STRICT macro guard 2023-04-25 13:32:19 -07:00
bbe9c694a6 more specific naming for attribute types 2023-04-25 13:56:29 -06:00
d701a0a06e add sanity check on PKCS7 index value 2023-04-25 08:30:33 -07:00
84ea15039f Remove XMEMSET after XFREE in sniffer.c 2023-04-25 09:16:39 -06:00
57de292d19 add guard for random with CAAM + MQX 2023-04-24 16:29:22 -07:00
3e5c8af571 Merge pull request #6322 from lealem47/remove_shellscript
Fix for CMake with USER_SETTINGS on Windows
2023-04-24 17:01:57 -06:00
a991ce1a6b Merge pull request #6327 from SparkiDev/memusage_5
Memory usage improvements
2023-04-24 16:42:56 -06:00
a10526d5f9 Async sniffer: don't retry if seeing non-pending error (#6220)
* Async sniffer: don't retry if seeing non-pending error

* Print error messages when decrypting from queue

* Zeroize the SessionTable in ssl_FreeSniffer()

---------

Co-authored-by: Lealem Amedie <lealem47@github.com>
2023-04-24 13:51:55 -07:00
9b7ca65608 Merge pull request #6330 from douzzer/20230421-configure-fixes
20230421-configure-fixes
2023-04-24 09:35:48 -07:00
e1d1bef085 Merge pull request #6321 from SparkiDev/sp_int_missing_brace
SP int: missing brace
2023-04-24 10:00:39 -06:00
cfeb8b9aee Merge pull request #6332 from SparkiDev/bn_to_asn1_fix
BN_to_ASN1_INTEGER: fix handling of padding
2023-04-24 09:58:12 -06:00
673d72a2dc OpenSSL EC API: fix setting private key
wolfSSL_EC_KEY_set_private_key() should fail on obvious bad private key
values.
2023-04-24 17:59:32 +10:00
2d06718857 Memory usage improvements
TLS 1.3 Server: don't cache the messages for Ed25519/Ed448 when doing
TLS 1.3.

ASN DecodeCertInternal: Call GetCertName for issuer and subject after
freeing the dataASN.
2023-04-24 11:12:00 +10:00
6634ec198e BN_to_ASN1_INTEGER: fix handling of padding
Incorrect calculation of when padding byte needed and consequently
adding byte manually when properly handled by SetASNInt().
2023-04-24 09:30:38 +10:00
865581704e Merge pull request #6312 from philljj/zd15961
Fix out-of-bounds write in fp_mod_2d.
2023-04-24 08:03:02 +10:00
800f4df7a3 fix typos in configure.ac (from shellcheck --severity=warning). 2023-04-21 16:05:43 -05:00
32ff165d8b remove buggy+bug-prone WOLFSSL_NO_XOR_OPS setup in settings.h. 2023-04-21 16:05:20 -05:00
60d059fc9e Merge pull request #6305 from SparkiDev/sp_radix_size_stack_fix
SP int: sp_radix_size when radix 10 fix temp size
2023-04-21 09:59:56 -06:00
e194c90b3e Merge pull request #6326 from SparkiDev/ecc_key_max_bits_fix
ECC: max bits for a key must handle order as well
2023-04-21 09:47:42 -06:00
12cec5ec61 Merge pull request #6325 from SparkiDev/memusage_fix_4
Memory Usage fixes
2023-04-21 09:37:11 -06:00
1106e5ff0e TLS v1.3: Support a stateful ticket and test HAVE_EXT_CACHE (#5960)
* Add TLSv1.3 stateful support
Fix internal and external session cache

* session cache fixes

* Refactor

- implement wolfSSL_CTX_flush_sessions
- use wolfSSL_CTX_flush_sessions to make test_wolfSSL_CTX_add_session_ext deterministic
- add dtls to test_wolfSSL_CTX_add_session_ext
- DoClientTicket_ex does not modify ssl object
- only call session remove callback on:
  - timeout
  - session is being overwritten/removed from the cache

* Session fixes

- restore bogus ID on session duplicate
- don't evict on overwrite
- use memmove instead on memcpy as `ssl->session == session` is possible
- ignore ClientSession parameter in AddSessionToCache on NO_SESSION_CACHE_REF
- use sessionID when altSessionID not present

* Session fixes

- DoClientTicketFinalize: always copy in the ID as teh altSessionID
- don't overwrite ex_data when overwriting cacheSession and cacheSession owns it

* Callback wants to retain a copy

* wolfSSL_GetSessionClient: ssl->ctx->get_sess_cb does not apply here

* test_wolfSSL_CTX_add_session_ext 

gate expected results on WOLFSSL_DTLS_NO_HVR_ON_RESUME

* TlsSessionIdIsValid: copy return can't be ignored

* Silence unused parameter

* test_wolfSSL_CTX_add_session_ext: handle async case

* Gate wolfSSL_SSL_CTX_remove_session on NO_SESSION_CACHE

* ssl.c: style fixes

* Add twcase_get_sessionCb_cleanup to free external cache

* Remove hard tab

* Correct build error in wolfSSL_CTX_flush_sessions

* Jenkins fixes:

- altSessionID only available with WOLFSSL_TICKET_HAVE_ID
- slim out psk_sess_free_cb_ctx

* Stateful dtls case has 2 accesses. Stateless just one.

* Add version numbering to hostap logs

* Import internal.h for test_wolfSSL_SESSION_get_ex_new_index

* wolfSSL_SetSession: don't check SslSessionCacheOff for session setting

* wolfSSL_SetSession: fully set expired session for OpenSSL compatibility

* wolfSSL_SetSession: check if setting same object

* AddSession: always populate the session object to allow re-use

* Add logging to wolfSSL_NewSession and wolfSSL_FreeSession

* Always setup session object

* Check if session has been setup before setting it

* Print errors in async test

* Make SetupSession available outside NO_SESSION_CACHE

* Review comments

* Fix ticBuf leak and TlsSessionIdIsValid logic

* Fix unmatched curly brackets

* TlsSessionIdIsValid: always need to check copy var

* TlsResumptionIsValid: set resume to FALSE default

* wolfSSL_SetSession: remove now variable since only used in one place

* Move internalCacheLookupOff into HAVE_EXT_CACHE block

---------

Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2023-04-21 06:46:08 -07:00
9230d9cfe3 Merge pull request #6185 from lealem47/time_check
Adding NO_ASN_TIME_CHECK build option
2023-04-21 11:55:52 +10:00
0cc50521b6 ECC: max bits for a key must handle order as well
The order may be 1 bit larger than prime for some curves.
Handle this in calculation of maximum size of curve.

SP int _sp_mont_red(): ensure m->used is never 0 when doing default
implementaion.
2023-04-21 11:23:47 +10:00
d414ae9492 Memory Usage fixes
Ed25519CheckPubKey/Ed448CheckPubKey: get the public key from certificate
in a new function, wc_CertGetPubKey, that uses less memory.
Set the ENCRYPT_BASE_BITS to minimal values when Curve448/Curve25519 are
the largest public key algorithms.
2023-04-21 09:59:38 +10:00
0bae919a9c SP int: ensure declaration of sp_ints are with valid values
Move declaration of sp_ints until after checks of valid parameters.
In particular, whether used field of input/s are valid.
Pull implementations of algorithms out into separate functions as a
pattern to fix.
2023-04-21 08:48:38 +10:00
8994aab0ed SP int: sp_radix_size when radix 10 fix temp size
SP int should be able to calculate size of encoded number for a radix of
10 when mp_int has all digits used.
sp_radix_size declared a temporary mp_int of 1 greater than input. Don't
need it 1 greater. Stack declaration of maximum plus one caused address
sanitizer error.
Changed temporary mp_int to be same size as input mp_int.
2023-04-21 08:46:46 +10:00
42be04f323 Remove duplicate line 2023-04-20 16:45:53 -06:00
a963adc33d Add more comments for alternatives and security risk 2023-04-20 14:36:22 -06:00
b0c6a3ec75 Adding NO_ASN_TIME_CHECK build option 2023-04-20 14:16:00 -06:00
d099fe34b5 Merge pull request #6324 from SparkiDev/sp_int_thumb_asm_r7
SP int: ARM Thumb ASM don't use r7 on debug
2023-04-20 10:51:19 -06:00
ebff7f46b7 Merge pull request #6323 from SparkiDev/sp_c_to_bin_mp_fix
SP C: fix handling of oversized arrays
2023-04-20 09:24:06 -06:00
c761f587f6 Merge pull request #6278 from julek-wolfssl/fix-zephyr
Zephyr port update
2023-04-20 06:48:02 -07:00
4fd629d4e7 fix white spaces and overlong lines 2023-04-20 16:07:51 +09:00
1d94521abe SP int: ARM Thumb ASM don't use r7 on debug
When DEBUG is defined, use versions of assembly code that don't use
register r7.
2023-04-20 15:13:54 +10:00
574d8c3f63 Merge pull request #6319 from douzzer/20230418-more-Wconversion-fixes
20230418-more-Wconversion-fixes
2023-04-20 13:19:07 +10:00
32e2775d34 SP C: fix handling of oversized arrays
For mul and sqr implementation efficiency the fixed array has extra
digits beyond what is needed. When encoding, only put in the useful
digits.
2023-04-20 12:42:51 +10:00
da9cda7eae wolfcrypt/src/pkcs12.c: fix non-portable casts;
wolfcrypt/src/sp_int.c: use unsigned int, not word32, for sign variables, to match type in header file.
2023-04-19 21:22:34 -05:00
fa914a0054 Let hashbang decide which shell to run with instead of default shell 2023-04-19 18:13:57 -06:00
cc8b789545 Remove shellscript dependency from CMake with WOLFSSL_USER_SETTINGS 2023-04-19 17:20:33 -06:00
4ec23571c6 SP int: missing brace
Missing a brace in sp_exptmod_ex().
2023-04-20 08:27:44 +10:00
2a00b67056 revert change in wc_ShaFinal() capturing InitSha() retval, introduced in 510038022f, to (void)ed result. 2023-04-19 17:25:33 -05:00
dc8f348bdf smaller sized build with curl 2023-04-19 15:12:15 -07:00
8f610bb156 fix for retval overwrite (warned by clang-analyzer-deadcode.DeadStores) in sha.c:wc_ShaFinal();
fix for benign clang-analyzer-deadcode.DeadStores in aes.c:wc_AesFeedbackEncrypt();

fix for cppcheck:selfAssignment in chacha.c:wc_Chacha_wordtobyte().
2023-04-19 15:53:48 -05:00
f396989d20 more -Wconversion fixes, now covering everything inside the 140-3 boundary with default build options, everything in wolfcrypt with default build options, all modes of AES, builds with/without intelasm, all permutations of c89/c99 32/64 bit, and much of the crypto-all-cryptonly boundary;
also a gating fix for asn.c:SetShortInt().
2023-04-19 15:26:05 -05:00
3865f943c3 Merge pull request #6203 from julek-wolfssl/xor-optim
Try to XOR as many words as possible in xorbuf APIs
2023-04-19 11:59:33 -06:00
0e64972c86 Merge pull request #6316 from SparkiDev/memusage_fix_3
ASN.1 template: CheckCertSignature memory usage fix
2023-04-19 10:37:11 -06:00
0186fb7114 Merge pull request #6313 from anhu/empty_stack
Should not be an error to call wolfSSL_X509_REQ_add_extensions with...
2023-04-19 10:32:06 -06:00
c9d91c5e79 Zephyr port update
- Add CONFIG_PTHREAD_IPC when using threads
- Add logging config suggestions
- test.c: fix undefined `ret` error
- Increase stack size for samples
- Ignore ASN_BEFORE_DATE_E in examples
- wc_port.h: add missing posix thread includes
- wc_port.h: move definitions to relevant section
- benchmark.c: fix missing `arc` and `argv` errors
- benchmark.c: fflush does not work on stdout in Zephyr
- Update z_fs_open implementation to support flags
2023-04-19 18:18:00 +02:00
81c9062973 sakke.c: use xorbuf 2023-04-19 17:06:25 +02:00
bed99401a0 hpke.c: use xorbufout in wc_HpkeContextComputeNonce 2023-04-19 17:06:25 +02:00
3c57228197 aes.c: Use xorbufout when possible 2023-04-19 17:06:25 +02:00
6079b92e26 xorbuf: fix alignment when possible 2023-04-19 17:06:25 +02:00
82e8eb2f70 rsa.c: Use xorbuf when possible 2023-04-19 17:06:25 +02:00
e7ae64d9b5 pkcs12.c: Ignore param when heap not used 2023-04-19 17:05:03 +02:00
7a0d6487b7 Simplify ctMaskCopy 2023-04-19 17:05:03 +02:00
b91f3063ea Use xorbuf in 3des for FREESCALE_MMCAU 2023-04-19 17:05:03 +02:00
aeb4338085 Use xorbufout in chacha 2023-04-19 17:05:03 +02:00
8fe321d5be Try to XOR as many words as possible in xorbuf APIs 2023-04-19 17:05:03 +02:00
81ab16b105 Merge pull request #6314 from TakayukiMatsuo/vla2 2023-04-19 08:11:40 -06:00
510038022f Various Espressif HW crypto, SHA2, AES, MP updates. (#6287)
* various Espressif HW crypto, SHA2, AES, MP updates.

* code review updates & cleanup

* clean trailing whitespace

* cleanup per code review

* removed additional unused WOLFSSL_USE_ESP32C3_CRYPT_HASH_HW

* Code review updates; pack & order WC_ESP32SHA

* clean up TAG text for Espressif ESP_LOG()
2023-04-19 06:10:22 -07:00
436c647acc Memory Usage: reduce maximum in use
CheckCertSignature
Free the dataASN before calling ConfirmSignature.
dataASN not needed at this point and ConfirmSignature uses lots of
memory.

DecodeCertInternal:
Free the dataASN before calling DecodeCertExtensions,
dataASN not needed at this point and DecodeCertExtensions uses more
memory.

ecc_verify_hash:
v doesn't need to be a new allocated variable - reuse w.
v is the modular reduction of x-ordinate to prime calculated at end.
2023-04-19 16:44:34 +10:00
70322f620d Merge pull request #6303 from douzzer/20230414-yet-more-c89
20230414-yet-more-c89
2023-04-18 16:00:12 -07:00
3a2bcf080b Merge pull request #6276 from anhu/zephyr_stm32
Add in instructions for compiling with zephyr on STM32.
2023-04-18 14:50:53 -07:00
243665fe37 Merge pull request #6315 from anhu/stm32_gpdma
Instructions for GPDMA configuration
2023-04-18 14:50:25 -07:00
c67de7f914 Merge pull request #6308 from SparkiDev/sp_mod_err_check
SP int: sp_mod check sp_div error before adding and replacing error
2023-04-18 15:44:50 -06:00
8b79248eab Merge pull request #6307 from SparkiDev/decode_ecdsa_sig_inited
ECC, ASN.1: DecodeECC_DSA_Sig didn't handle r and s being initialized
2023-04-18 15:43:42 -06:00
a525fa19f4 Merge pull request #6306 from SparkiDev/wc_ecc_is_point_check_args
ECC: wc_ecc_is_point - validate parameters
2023-04-18 15:37:22 -06:00
d59724a0f3 Instructions for GPDMA configuration 2023-04-18 16:52:57 -04:00
b3b26dd266 Add in instructions for compiling with zephyr on STM32. 2023-04-18 16:19:32 -04:00
fe3099b08e wolfssl/wolfcrypt/settings.h: add #ifdef _MSC_VER clause to define ssize_t, #ifndef HAVE_SSIZE_T. 2023-04-18 14:43:41 -05:00
cc747f0094 Add WOLFSSL_SP_NO_DYN_STACK macro to avoid compilation error in CC-RX compiler 2023-04-19 04:39:49 +09:00
f1a674eec9 wolfcrypt/src/wc_port.c: in wc_FileLoad(), use ssize_t for fileSz, not long int, for portability. 2023-04-18 14:30:38 -05:00
b87c2fc621 fix null pointer deref (found by cppcheck:nullPointerRedundantCheck) in src/x509.c:wolfSSL_X509_EXTENSION_create_by_OBJ(). 2023-04-18 14:29:13 -05:00
4180a650c8 fix clang-analyzer-deadcode.DeadStores in wolfcrypt/src/asn.c:SetOthername(). 2023-04-18 14:27:52 -05:00
a4aef0e55d refinements from peer review for #6303. 2023-04-18 12:23:24 -05:00
193919a276 add wc_strcasecmp() and wc_strncasecmp() to wc_port.c, and set up (USE_WOLF_STR[N]CASECMP) in types.h for targets lacking native implementations (including WOLF_C89);
define USE_WOLF_STRSEP if defined(WOLF_C89).
2023-04-18 12:23:24 -05:00
4b9302cdb3 another batch of -Wconversion fixes. 2023-04-18 12:23:24 -05:00
42bea705d9 fix several more C89 "comma at end of enumerator list" spots in 64-bit-only headers, missed in earlier passes; in tests/unit.h, add a WOLF_C89 definition of AssertPtr() without pragmas, to avoid a -Wdeclaration-after-statement. 2023-04-18 12:23:24 -05:00
730890b8cc wolfssl/wolfcrypt/sp_int.h: fix a missed bugprone-macro-parentheses in the C89 path. 2023-04-18 12:23:24 -05:00
d91f0f82d8 wolfssl/wolfcrypt/misc.h: add missing argument names in NO_INLINE path. 2023-04-18 12:23:24 -05:00
3d16ec8dc1 wolfssl/wolfcrypt/asn_public.h: fix version threshold for wc_RsaPrivateKeyValidate() prototype. 2023-04-18 12:23:24 -05:00
98b718f91b wolfcrypt polish: init, checks, corrections (#6249)
* wolfcrypt polish: init, checks, corrections
2023-04-18 09:41:42 -07:00
b0e90b6ffe Should not be an error to call wolfSSL_X509_REQ_add_extensions with empty stack. 2023-04-18 12:27:54 -04:00
f7d7e4f30a Merge pull request #6285 from gojimmypi/Espressif_VisualGDB
platform-specific VisualGDB test & benchmark projects
2023-04-18 11:52:29 -04:00
8254112c9b Fix out-of-bounds write in fp_mod_2d. 2023-04-18 10:51:38 -05:00
ca71907142 add function to control default pkcs7 signer attributes 2023-04-18 08:35:02 -07:00
ad13717644 add messageDigest attribute if adding any custom signed attributes 2023-04-18 08:35:02 -07:00
ff13a7cdc8 Merge pull request #6250 from julek-wolfssl/fix-wolfSSL_DES_ede3_cbc_encrypt
Write next IV in wolfSSL_DES_ede3_cbc_encrypt
2023-04-18 09:33:10 -06:00
a5c220d034 AES: touch each cache line when getting offset from table 2023-04-18 12:46:56 +10:00
59c113d358 SP int: sp_mod check sp_div error before adding and replacing error
Fix to not overwrite error when sp_div fails in sp_mod.
2023-04-18 09:38:13 +10:00
eddcf0c0ee ECC, ASN.1: DecodeECC_DSA_Sig didn't handle r and s being initialized
New creation of mp_ints r and s to be minimal size must not be
re-initialized.
Changes to ASN.1 code to handle r and s being initialized and to not
initialize again.
2023-04-18 09:37:23 +10:00
04ae676629 ECC: wc_ecc_is_point - validate parameters
Public API wc_ecc_is_point() needs to validate the parameters.
Ensure that the x and y are in range [0, p-1] and z is one (affine
ordinates).

Made the API a wrapper around existing calculation code.
When x-ordinate is a large negative, then it will spend large amounts of
time adding the prime to a large negative intermediate value.
2023-04-18 09:35:22 +10:00
42b73ee326 Merge pull request #6277 from anhu/upnsid
Support UPN and SID.
2023-04-17 17:03:55 -06:00
120d1f0d1a Support in the compatibility layer for UPN and SID. 2023-04-17 14:42:27 -04:00
91a2c9f18e Merge pull request #6310 from julek-wolfssl/hostap-certs-update-2023
hostap/hwsim: use a custom commit to update the expired certs
2023-04-17 11:36:59 -07:00
aa47a38a9e hostap/hwsim: use a custom commit to update the expired certs
- use 'theirs' merge strategy
2023-04-17 18:43:47 +02:00
5938a40def Merge pull request #6297 from JacobBarthelmeh/math
clean up NO_BIG_INT build, removing WOLFSSL_SP_MATH macro and heapmath compile
2023-04-17 07:44:20 -07:00
ec78d1a4b8 Merge pull request #6293 from tim-weller-wolfssl/mynewt-updates
Update wolfCrypt porting layer for Mynewt OS to remove build warning.
2023-04-17 08:07:39 -06:00
50e15dbb36 Merge pull request #6283 from cconlon/tls13resume12
In SendTls13ClientHello() only send Session ID for sessions being resumed (< TLS 1.3)
2023-04-17 12:21:11 +10:00
6b12831dfb Merge pull request #6302 from douzzer/20230413-more-wolfcrypt-c89
20230413-more-wolfcrypt-c89
2023-04-14 14:08:03 -07:00
cb9a121bd7 fix configure, compatibility layer needed big int. for BN use 2023-04-14 14:52:05 -06:00
1bed740710 address peer review: make C89-compatible refactors in sakke_pairing() and sakke_modexp_loop(); add explanatory comment for WOLF_ENUM_DUMMY_LAST_ELEMENT() in types.h. 2023-04-14 15:07:05 -05:00
39b81ce338 Merge pull request #6282 from dgarske/fix_heapmath
Fix for including integer.h when heap math is not used
2023-04-14 14:28:38 -05:00
ac85cfa3d5 fix "comma at end of enumerator list" warnings in wolfcrypt for C89 compatibility, mostly by just snipping out unneeded comma, but several using WOLF_ENUM_DUMMY_LAST_ELEMENT() to preserve gated enum values as-is. 2023-04-14 13:48:03 -05:00
2bcf6bd3ca wolfssl/wolfcrypt/types.h: add WOLF_ENUM_DUMMY_LAST_ELEMENT() macro, and disable HAVE_ANONYMOUS_INLINE_AGGREGATES ifdef WOLF_C89. 2023-04-14 13:47:47 -05:00
d5588af0a2 wolfcrypt/src/sakke.c: fixes for C89 "initializer element is not computable at load time". 2023-04-14 13:29:26 -05:00
105714460c wolfcrypt/src/fe_448.c: fix declaration-after-statement in fe448_mul_8(). 2023-04-14 13:29:26 -05:00
edf95dbcbd add WOLF_C89 clauses to the W64LIT() definitions in wolfssl/wolfcrypt/types.h, and wrap several long long numeric literals with W64LIT() in wolfcrypt/src/{aes.c,blake2b.c,siphash.c};
add WOLF_C89 handling to SP_ULONG_BITS and SP_ULLONG_BITS setup in wolfssl/wolfcrypt/sp_int.h.
2023-04-14 13:29:26 -05:00
bc3d070629 Merge pull request #6290 from embhorn/zd15969
Allow Micrium to use STM32_RNG
2023-04-14 10:59:50 -07:00
deae28b9a3 Fix for building with heap math and including integer.h only. Fixes https://github.com/wolfSSL/wolfssl/issues/6280
```
./configure --enable-heapmath CFLAGS="-DWOLFSSL_PUBLIC_MP" && make && sudo make install
cd ../wolfssl-examples/ecc
make clean && make
```
2023-04-14 10:37:40 -07:00
36a9b9944c fix guard on ECC export 2023-04-13 16:12:08 -07:00
00aa061d77 Merge pull request #6300 from douzzer/20230413-fixes
20230413-fixes
2023-04-13 15:41:51 -06:00
35f6099d7c Add SCE RSA Crypt Only feature
- RSA SSA 1024/2048 Sign/verify
  - RSA ES 1024/2048 Enc/Dec
  - Unit test for these RSA operation
2023-04-14 06:41:24 +09:00
04ee247389 do not default to heapmath if no other math libraries found, add NO_BIG_INT as a math option in settings.h 2023-04-13 14:38:35 -07:00
6040a6b5da Merge pull request #6299 from JacobBarthelmeh/build
fix for wpas build with x509 small
2023-04-13 13:54:50 -07:00
358af4ef05 fix for cppcheck/zerodivcond in wolfcrypt/src/pkcs7.c:wc_PKCS7_DecodeAuthEnvelopedData();
fixes for clang-tidy/bugprone-macro-parentheses in wolfssl/wolfcrypt/sp_int.{c,h} and wolfcrypt/src/ecc.c;

fix for clang-analyzer-deadcode.DeadStores in olfcrypt/src/asn.c.
2023-04-13 14:51:29 -05:00
2307b36a65 Merge pull request #6296 from JacobBarthelmeh/RT1170
fix for creating options.h with cmake and WOLFSSL_USER_SETTINGS
2023-04-13 11:24:53 -07:00
9a0934161d fix for wpas build with x509 small 2023-04-13 10:38:12 -07:00
419a1f0a01 Merge pull request #6294 from douzzer/20230412-WC_ASN_NAME_MAX-bump-for-MULTI_ATTRIB
20230412-WC_ASN_NAME_MAX-bump-for-MULTI_ATTRIB
2023-04-12 16:21:33 -07:00
441b78e5a2 Merge pull request #6284 from douzzer/20230410-Wconversion-fixes
20230410-Wconversion-fixes
2023-04-12 17:07:24 -06:00
d4b92cb65c Merge pull request #6295 from dgarske/stm32_20230412
Fixes for STM32 U5/H5/H7 hash and PKA sign build error
2023-04-12 16:36:43 -06:00
26a0142f51 add nomath option for builds without a math library 2023-04-12 15:33:59 -07:00
c41030663e wolfcrypt/src/pkcs7.c: correct fix for clang-analyzer-core.DivideZero in wc_PKCS7_DecodeAuthEnvelopedData(). 2023-04-12 16:37:20 -05:00
b7ff375ac6 Fix PKA build error with SP sign. Fix U5/H5/H7 hashing, which require a workaround to write an extra 32-bit to flush FIFO before save/restore. 2023-04-12 13:45:29 -07:00
e1ca478356 Added STM32G0 benchmarks. 2023-04-12 13:45:28 -07:00
2c26b068b2 Merge pull request #6239 from dgarske/stm32h5
Support for STM32H5
2023-04-12 14:33:25 -06:00
97ffdfa9b8 wolfssl/wolfcrypt/asn.h: if defined(WOLFSSL_MULTI_ATTRIB), bump predefined WC_ASN_NAME_MAX, to fix rsa_certgen_test() with config --enable-testcert --enable-asn=original CPPFLAGS='-DWOLFSSL_CERT_GEN -DWOLFSSL_MULTI_ATTRIB'. 2023-04-12 13:48:03 -05:00
72fc023d38 Update wolfCrypt porting layer for Mynewt OS to provide declarations needed to remove build warning for time API used for XTIME 2023-04-12 12:30:42 -05:00
4b59588cf3 more fixes for implicit casts, mostly asn=original. 2023-04-12 02:17:18 -05:00
fe2acb53af wolfcrypt/src/ecc.c:fix overstringent arg check in wc_ecc_gen_k(). 2023-04-12 01:37:09 -05:00
7155c5748e fix overlong lines. 2023-04-12 01:37:09 -05:00
99ffd7726f wolfcrypt/src/pkcs7.c:wc_PKCS7_DecodeAuthEnvelopedData(): fix clang-analyzer-core.DivideZero (expBlockSz not properly set before use as a denominator in a mod op). 2023-04-12 01:37:09 -05:00
bd8f97f315 Revert "Resolve issue with C89 compliance with "commas at the end of enumerator lists"."
This reverts commit 68acfd51dca1e0e11e2e7bd0e6ab956b8def6473.
2023-04-12 01:37:09 -05:00
41818bf6f8 Revert "Fix enum KeyWrap_Sum impossible combinations (note: ugly code)."
This reverts commit 2bac48a290e5243337f661c70eb582e55ceb2c39.
2023-04-12 01:37:09 -05:00
ed11669f3c more fixes for implicit casts, including asn=template. 2023-04-12 01:37:09 -05:00
ee50d95b0b Fix enum KeyWrap_Sum impossible combinations (note: ugly code). 2023-04-12 01:37:09 -05:00
72c6429276 Better fixes for pedantic to resolve (error: comparison of unsigned expression >= 0 is always true). Also overlong lines. 2023-04-12 01:37:09 -05:00
f3eee4bc99 Resolve issue with C89 compliance with "commas at the end of enumerator lists".
Tested with `./configure --disable-asm --enable-32bit --enable-asn --enable-cryptonly CFLAGS="-Wall -ansi -pedantic-errors -Wshadow -g" && make`
2023-04-12 01:37:09 -05:00
6418e3cbfe Fixes for implicit casts.
Tested with `./configure --disable-asm --enable-32bit --enable-asn=original --enable-cryptonly CFLAGS="-Wconversion -pedantic" && make`. Some progress with ASN template, but not complete.
2023-04-12 01:37:09 -05:00
1889549828 fix for creating options.h with cmake and WOLFSSL_USER_SETTINGS 2023-04-11 13:30:04 -07:00
9465d32aea Allow Micrium to use STM32_RNG 2023-04-11 15:12:58 -05:00
edad8d1da8 avoid callback buffer overwrite with sha512_224 and remove min from wolfcaam_cmac 2023-04-11 09:06:39 -07:00
6a89464176 Merge pull request #6231 from billphipps/15785-CorrectFreeDuringEarlyConnectFail
Track SetDigest usage to avoid invalid free under error conditions.
2023-04-11 09:49:51 -06:00
9f257af989 platform-specific VisualGDB test & benchmark projects 2023-04-11 09:41:53 +02:00
18e0c28487 Only send session ID in resumed ClientHello from SendTls13ClientHello() if ssl->options.resuming 2023-04-10 15:43:31 -06:00
0013be9027 15451 correct padding for pkcs7 (#6260)
* Update to ensure full blocks for crypto in En/DecodeAuthEnvelopedData.

* Corrected spacing and comments

* Set plain to NULL after free on non-error path.
2023-04-10 14:08:52 -07:00
f2ae066797 Merge pull request #6281 from JacobBarthelmeh/ECC
- fix ECC performance regression
2023-04-10 14:08:43 -07:00
8bb0b2ef3f fix for ECC sign with nonblocking only 2023-04-10 12:53:40 -07:00
6b862a1440 Merge pull request #6272 from gojimmypi/wolfcrypt-mpi-fix
mp_setneg(Z), not mpi
2023-04-10 11:58:04 -07:00
2430f2377f Corrected spacing and comments 2023-04-10 17:15:22 +00:00
582d8a70f5 fix ECC performance regression 2023-04-09 00:08:01 -06:00
12e285434b Merge pull request #6275 from douzzer/20230406-XREWIND-fixes-contd
20230406-XREWIND-fixes-contd
2023-04-06 15:22:48 -06:00
7c15131db5 wolfcrypt/src/asn.c: in wc_PemCertToDer_ex() and wc_PemPubKeyToDer_ex(), work around false positive -Wmaybe-uninitialized from scan-build. 2023-04-06 15:15:26 -05:00
012f0e0779 Merge pull request #6262 from SparkiDev/mp_int_mem_usage
SP int: improve use of stack
2023-04-06 14:06:08 -06:00
3468750bae wolfcrypt/src/asn.c:
* refactor error-checking cascade in wc_PemCertToDer_ex() as in wc_PemPubKeyToDer_ex(),
 * refactor staticBuffer gating/dynamics in wc_PemPubKeyToDer_ex() as in wc_PemCertToDer_ex(),
 * and use IO_FAILED_E, not BUFFER_E, for I/O errors on the file handles, in both routines;

fix smallstack null pointer dereferences in src/pk.c:wolfSSL_RSA_GenAdd() and src/ssl.c:set_curves_list().
2023-04-06 14:31:53 -05:00
bd02b9c29c Merge pull request #6254 from miyazakh/fix_favouriteDrink 2023-04-06 09:39:23 -06:00
67624628c2 Merge pull request #6274 from douzzer/20230405-fixes
20230405-fixes
2023-04-06 14:27:37 +10:00
dcc8b5d7d5 eliminate XREWIND() macro, add XSEEK_SET definitions, and refactor all XREWIND()s to XFSEEK()s, to fix clang-tidy-17 bugprone-unsafe-functions warning on rewind();
add BENCH_DEVID_COLUMN_HEADER in wolfcrypt/benchmark/benchmark.c:bench_stats_sym_finish() to resolve clang-diagnostic-embedded-directive.
2023-04-05 20:28:51 -05:00
8065139050 SP int: improve use of stack
Minimize use of stack.
Make very large stack allocations dynamic memory allocations unless
WOLFSSL_SP_NO_MALLOC.

ProcessBufferTryDecode() split up into a function for each type.
ProcessBufferTryDecodeRsa() decodes the data and gets key size rather
than having or allocating an RsaKey.
Added wc_RsaPrivateKeyValidate() that only validates the encoding is an
RSA key and returns the key size in bytes.

For SP int, only create sp_ints of required size in RSA and ECC
implementation. For WOLFSSL_SMALL_STACK, memory is allocated to have
just enough bytes and size is set to maximum supported. Otherwise,
relies on dynamic stack variables.
For ECC, MAX_ECC_BITS_USE used when dynamic stack variables not
supported. Significantly reduces memory usage when RSA/DH is also built.

Add macros to sp_int.h, tfm.h and integer.h to support declaring,
allocating, initializing and freeing mp_ints.
For integer.h, mp_int is always static as size is no more than 32 bytes.
For tfm.h, WOLFSSL_SMALL_STACK has a full mp_int allocated, otherwise
the full mp_int is put on the stack.
For sp_int.h  with new macros, dynamically allocate sp_int to minimal
size when WOLFSSL_SMALL_STACK, or when dynamic stack variables, declare
them to be of minimal size or otherwise declare with a fixed max.
Added mp_bitsused(), for all implementations, to get the number of bits
available based on used. Included for RSA to get the size of the
modulus.

SP int now always uses dynamic stack variables if possible rather than
for builds with WOLFSSL_SP_SMALL.
Moved code out into separate functions so that stack allocations don't
happen when not going down code path.
2023-04-06 10:04:39 +10:00
8c0a20fc32 Merge pull request #6212 from embhorn/gh6211
RIOT-OS does support writev
2023-04-05 15:26:07 -06:00
caf2749c8a Merge pull request #6269 from julek-wolfssl/fix-test_wolfSSL_CTX_add_session
Fix intermittent failures in test_wolfSSL_CTX_add_session
2023-04-05 15:19:36 -06:00
1bef3ec745 Merge pull request #6233 from embhorn/gh6209
Support HAVE_SESSION_TICKET without realloc
2023-04-05 15:17:58 -06:00
3c90eb25c8 Merge pull request #6271 from anhu/XSTAT
Allow user to override XSTAT
2023-04-05 14:44:09 -06:00
9c368d0a0e Merge pull request #6273 from anhu/wolfSSL_get_chain_cert
Documentation fixup for wolfSSL_get_chain_cert();
2023-04-05 14:33:29 -06:00
599cf9356f Merge branch 'wolfSSL:master' into 15785-CorrectFreeDuringEarlyConnectFail 2023-04-05 15:24:30 -04:00
3e58e47856 Documentation fixup for wolfSSL_get_chain_cert(); 2023-04-05 15:12:43 -04:00
cf173e7b7d Merge pull request #6270 from julek-wolfssl/fix-test_wolfSSL_dtls_stateless_HashWOLFSSL
Ignore staticBuffer in test_wolfSSL_dtls_stateless_HashWOLFSSL
2023-04-05 12:53:11 -05:00
d9bf93b49f Support HAVE_SESSION_TICKET without realloc 2023-04-05 11:33:06 -05:00
3b934b858e Merge pull request #6268 from SparkiDev/asn1_test_0_len
ASN.1 testing: restore 0 length BIO failure tests
2023-04-05 11:14:50 -04:00
bb32b6a927 mp_setneg(Z), not mpi 2023-04-05 17:10:37 +02:00
6a52c727f6 Merge pull request #6267 from SparkiDev/openssl_cryptonly
OpenSSL API and cryptonly: fix to compile
2023-04-05 09:08:32 -06:00
c9e467b734 Allow user to override XSTAT 2023-04-05 10:39:16 -04:00
171c217ae5 Add in-place support for DES_ede3_cbc_encrypt 2023-04-05 15:50:51 +02:00
c5f03e43cf Ignore staticBuffer in test_wolfSSL_dtls_stateless_HashWOLFSSL 2023-04-05 14:23:19 +02:00
a51daf1bfa Fix intermittent failures in test_wolfSSL_CTX_add_session 2023-04-05 13:57:10 +02:00
9eac521521 ASN.1 testing: restore 0 length BIO failure tests
Create a fixed buffer BIO of length 1 and then write one byte into it so
that there is 0 length to write into.
Test cases removed as setting fixed buffer BIO to length 0 allocated 0
length buffer that is sometimes returning NULL.
2023-04-05 10:29:46 +10:00
10c1009bbd Merge pull request #6127 from JacobBarthelmeh/qnx
IMX6Q CAAM Port
2023-04-05 08:44:00 +10:00
9eb3c4d31a fix unitest failure 2023-04-05 07:25:25 +09:00
b30c8b1fca OpenSSL API and cryptonly: fix to compile
OBJ_nid2sn not available when compiling for cryptonly - don't compile in
call to it in test.h.
2023-04-05 08:02:20 +10:00
b8e61a241b Merge pull request #6257 from kareem-wolfssl/micriumFixes
Micrium settings fixes
2023-04-04 11:09:49 -06:00
539c562ecd Merge pull request #6263 from julek-wolfssl/fix-docs-wolfSSL_set_dtls_fd_connected
Add missing semicolon
2023-04-04 10:49:02 -06:00
cb422bfaf7 Merge pull request #6242 from julek-wolfssl/harden-tls
Implement TLS recommendations from RFC 9325
2023-04-04 10:13:27 -06:00
027c8ed926 Add missing semicolon 2023-04-04 16:59:28 +02:00
a4a6a05f06 Merge pull request #6251 from PrinceOfPuppers/master
updated zephyr includes
2023-04-03 16:25:32 -07:00
e4f75afe5f update README 2023-04-03 16:41:09 -06:00
f9f1347e8d third optimization pass with aes-ctr 2023-04-03 16:41:09 -06:00
14b0f422c8 optimization pass through 2 2023-04-03 16:41:08 -06:00
5882b8f68a cleanup user_settings example file 2023-04-03 16:41:08 -06:00
30adcd58d8 IMX6Q CAAM Port 2023-04-03 16:41:08 -06:00
b1e4d4922e Merge pull request #6259 from SparkiDev/cppcheck_fixes_9
cppcheck fixes
2023-04-03 15:35:35 -07:00
b6ab7a9d56 Merge pull request #6261 from douzzer/20230331-fixes
20230331-fixes
2023-04-03 14:56:16 -07:00
c08878ac94 configure.ac: include both -I. and -I$srcdir for "circular dependency" test, so that ${build_pwd}/wolfssl/options.h is found in out-of-tree builds; streamline scripting that dynamically sets $TRIM;
linuxkm/module_exports.c.template: include wolfssl/wolfcrypt/wolfmath.h, to bring in wc_GetMathInfo() prototype;

src/ssl.c: move "Global pointer to constant BN on" to src/ssl_bn.c; and in wolfSSL_Cleanup(), call the new wolfSSL_BN_free_one() rather than using ad hoc cleanup logic;

src/ssl_bn.c: add bn_one and wolfSSL_BN_free_one();

src/ssl_asn1.c: fix bugprone-macro-parentheses in bufLenOrNull(); refactor wolfSSL_ASN1_TIME_diff() to avoid floating point math; use intermediate tm_year variable in wolfssl_asn1_time_to_tm() to avoid target-specific type conflicts on tm->tm_year; use "FALL_THROUGH", not "/* fall-through */", in wolfSSL_ASN1_TYPE_set (clang-diagnostic-implicit-fallthrough);

wolfcrypt/src/ecc.c: fix identicalInnerCondition in ecc_mul2add();

wolfcrypt/src/integer.c: refactor OPT_CAST()s in mp_grow() to unconditional casts as elsewhere, to mollify a confused cppcheck-all-intmath;

tests/api.c: reformat some overlong lines.
2023-04-03 15:49:39 -05:00
505ab746c6 Tabs -> spaces 2023-04-03 18:24:01 +02:00
8851065848 cppcheck fixes
Fix checking of negative with unsigned variables.
Check digestSz for 0 in wc_SSH_KDF() so that no possibility of dividing
by zero.
Change XMEMCPY to XMEMSET in renesas_sce_util.c.
Fix test.c to free prvTmp and pubTmp on read error.
Remove unused variables.
XFREE checks for NULL so don't check before call.
Move variable declarations to reduce scope.
2023-04-03 16:59:58 +10:00
a64fba93cb Micrium: Add missing XATOI/XSTRTOK definitions, update XMEMMOVE function. 2023-03-31 17:33:33 -07:00
2ad0659fa4 Merge pull request #6255 from julek-wolfssl/fix-ssl_asn1
Add missing guards
2023-03-31 13:54:25 -07:00
c56e58db5b Remove TODO+bad tests 2023-03-31 15:51:28 -04:00
18f4b45129 Fix object size 2023-03-31 15:44:25 -04:00
80a0fb548a Zero buffer size test should be implemented another way 2023-03-31 15:44:13 -04:00
753ad4c4c1 Merge pull request #6253 from JacobBarthelmeh/CAAM
resolve warning about uninitialized variable
2023-03-31 10:50:28 -07:00
35611cad96 Merge pull request #6252 from julek-wolfssl/async-test-action
Initial async test with gh action
2023-03-31 11:33:32 -06:00
c8e1731cb7 Fix dependency issues 2023-03-31 13:21:13 -04:00
74e6f0d337 Merge pull request #6243 from julek-wolfssl/reuse-wolfssl-builds
actions: Build wolfSSL in seperate job
2023-03-31 09:26:43 -06:00
7138b66b5e Compiler error 2023-03-31 11:22:58 -04:00
9f41ed8c72 Add missing guards 2023-03-31 16:11:58 +02:00
8f8153220b Remove trailing whitespace 2023-03-31 13:29:42 +02:00
f1a93f524d Tabs -> spaces 2023-03-31 11:51:49 +02:00
ffcc66bb53 Add explicit casts 2023-03-31 11:48:18 +02:00
4ddc975aca Expand asyn-check script 2023-03-31 11:25:46 +02:00
27f5f3a3e8 fix overwriting serialnum by favouriteDrink 2023-03-31 15:56:31 +09:00
00e3dcfab5 Merge pull request #6226 from SparkiDev/asn1_move
Move ASN.1 APIs out to separate file: ssl_asn1.c
2023-03-30 18:22:13 -07:00
8489095057 Move ASN.1 APIs out to separate file: ssl_asn1.c
Implementations of ASN.1 APIs reworked.

Added tests.

Added wolfssl_bn_set_neg for ASN.1 code.
Added wolfssl_sk_new_type() and wolfssl_sk_pop_type() to generically
handle creating and popping a stack of elements of a type.

No longer freeing pathlen field of ASN1 OBJECT in
wolfSSL_X509_EXTENSION_free(). This is happening in
wolfSSL_ASN1_OBJECT_free().
Stop wolfSSL_i2d_X509_NAME_canon from double freeing ASN.1 STRING's data
field.

Fixed up GetFormattedTime() to be better code.
Added ASN_CLASS_MASK to mask off the class part of an ASN.1 tag.
NO_ASN_TIME means no implementation to get the current time. Disable
features that won'r work without time.
2023-03-31 09:36:01 +10:00
6bed0c5757 Merge pull request #6123 from dgarske/math_info
Add introspection for math build and math cleanups
2023-03-31 09:15:48 +10:00
7fae945ee6 Merge pull request #6214 from miyazakh/altname_next_reset 2023-03-30 16:58:09 -06:00
22a5a5c45e Add introspection for math build and math cleanups:
* Add introspection for math build.
* Raise build error if more than one multi-precision math library used.
* Fix ESP32 to support using any multi-precision math option.
* Refactor math headers to use `wolfmath.h`
* Refactor of the opaque math variable type `MATH_INT_T` used by crypto hardware (QuickAssist, SE050, ESP32 and STM32).
* Cleanups for building with `WOLFCRYPT_ONLY` and `NO_BIG_INT`.
* Stop forcing use of fast math by default for platforms in settings.h. Note: For users that still want to use fast math (tfm.c) they will need to add USE_FAST_MATH to their build settings.

Applies To:
```
WOLFSSL_ESPWROOM32
WOLFSSL_ESPWROOM32SE
MICROCHIP_PIC32
WOLFSSL_PICOTCP_DEMO
WOLFSSL_UTASKER
WOLFSSL_NRF5x
FREERTOS_TCP
WOLFSSL_TIRTOS
EBSNET
FREESCALE_COMMON
FREESCALE_KSDK_BM
WOLFSSL_DEOS
MICRIUM
WOLFSSL_SGX
```
2023-03-30 14:42:55 -07:00
c7a76365f0 Fixes to support larger H5 save/restore and larger digest result (for SHA2-512). 2023-03-30 14:42:20 -07:00
d99514a41c Added benchmarks for STM32H563ZI. 2023-03-30 14:42:20 -07:00
0201662094 Support for STM32H5 2023-03-30 14:42:20 -07:00
f7d3ce7843 resolve warning about uninitialized variable 2023-03-30 11:44:08 -06:00
27794c4b7e Initial async test with gh action 2023-03-30 19:33:54 +02:00
de2f878781 Write next IV in wolfSSL_DES_ede3_cbc_encrypt 2023-03-30 18:47:53 +02:00
9120712438 Address code review 2023-03-30 15:35:52 +02:00
4338ed9b7b Add missing define 2023-03-30 14:56:31 +02:00
0210dcd98d Merge pull request #6240 from kaleb-himes/wolfEntropy-work
Fix a typo in PP macro and add a ceiling to guard against implementation bugs
2023-03-30 12:33:01 +10:00
9b1aed0c82 updated zephyr includes 2023-03-29 22:22:31 -04:00
a8ca958855 Merge pull request #6248 from JacobBarthelmeh/fips
visibility is dependent on macros that could be set in user_settings.h
2023-03-29 16:32:29 -07:00
5d1a914ebd Merge pull request #6247 from JacobBarthelmeh/config
check if colrm is available for options.h creation
2023-03-29 15:19:14 -07:00
951b5bc77c visibility is dependent on macros that could be set in user_settings.h 2023-03-29 16:14:54 -06:00
e1730c760c check if colrm is available for options.h creation 2023-03-29 14:11:56 -07:00
68d6ce647d Merge pull request #6227 from julek-wolfssl/hwsim-retry
Retry hwsim tests 3 times on fail
2023-03-29 12:34:19 -07:00
8b34ad7c4d Merge pull request #6245 from lealem47/asyncRelease
Fixes for the async release
2023-03-29 12:33:57 -07:00
8e730534d5 Free in drbg test when appropriate 2023-03-29 10:26:59 -06:00
3841b559ec Merge pull request #6246 from SparkiDev/siphash_asm_fix
siphash: fix assembly so that no register is left behind
2023-03-29 09:23:38 -07:00
047db19956 Disable SHA512/224 & SHA512/256 on QAT 2023-03-29 10:17:06 -06:00
65f97482f3 Missed free's in api.c 2023-03-29 10:16:29 -06:00
6a71c7d71a Merge pull request #6228 from SparkiDev/sp_math_dh_test_param
SP math: 2048-bit DH parameters
2023-03-29 08:25:54 -07:00
689b0f803a Merge pull request #6237 from SparkiDev/benchmark_base10
Benchmark: fix reporting of base10
2023-03-29 08:25:29 -07:00
4a75d78682 Add flags to disable certain checks 2023-03-29 14:22:31 +02:00
43ca374cad actions: Fix openwrt patch 2023-03-29 11:32:32 +02:00
ca11b4e560 siphash: fix assembly so that no register is left behind
Change all assembly so that no register is used explicitly - all
variables.
2023-03-29 09:38:04 +10:00
35111b29c1 Merge pull request #6244 from bandi13/consolidateVMdeps
Fix dependencies
2023-03-28 13:30:08 -07:00
6824166cf9 Add QAT flags to logic checking for dependencies 2023-03-28 12:44:22 -06:00
ba47562d18 Merge pull request #6238 from bandi13/fixRenewcerts.sh
Remove expectation for an argument to be passed
2023-03-28 11:24:51 -06:00
415d6151ff Use unique name in openwrt action 2023-03-28 18:10:01 +02:00
103f6e7520 Fix dependencies 2023-03-28 11:56:29 -04:00
f5b0c406c0 use unique artifact names 2023-03-28 17:17:18 +02:00
f1aa43dc48 Merge pull request #6230 from bandi13/zd15855
Fix for variable server startup time
2023-03-28 09:13:52 -06:00
ba2b7af84a Merge pull request #6241 from lealem47/strncmp
Fixes for sniffer with enable all
2023-03-28 09:13:11 -06:00
1766a69152 actions: Build wolfSSL in seperate job 2023-03-28 17:00:51 +02:00
0a2201700d Put the .rnd file in a local folder 2023-03-28 10:43:17 -04:00
1cf2d9ece3 Create files that the script depends on 2023-03-28 10:16:24 -04:00
610c45afb6 Don't need to store state anymore 2023-03-28 10:15:58 -04:00
60501236cf Add counter 2023-03-28 14:15:57 +02:00
e73ae077dc Retry hwsim tests 3 times on fail 2023-03-28 14:15:57 +02:00
7116f1e005 Add comment. 2023-03-28 14:14:40 +02:00
f0ad01f552 Send secure renegotiation extension by default
- Add test for terminating the connection
- Add ProcessReplyEx(ssl, 1) to wolfSSL_accept
2023-03-28 12:43:53 +02:00
69199a30f9 SP math: 2048-bit DH parameters
Add 2048-bit DH parameters for testing when SP math with SP.
2023-03-28 09:24:56 +10:00
591089664d Fixes for sniffer with enable all 2023-03-27 16:37:14 -06:00
59107aeaa8 Fix a typo in PP macro and add a ceiling to guard against implementation bugs 2023-03-27 16:02:34 -06:00
1f6071df33 PR suggestions 2023-03-27 13:59:01 -04:00
496a15037b Merge pull request #6166 from TakayukiMatsuo/tsip117 2023-03-27 11:49:18 -06:00
cadd2d9ab6 Remove expectation for an argument to be passed
Added in a failing return value to flush out tests/scripts that may be calling this script multiple times with various arguments
2023-03-27 13:30:12 -04:00
85e82746c3 Merge pull request #6210 from rizlik/realloc_on_espressif
wolfcrypt/settings.h: use default realloc on EspressIf
2023-03-27 09:28:42 -07:00
28fd14621a Add harden config to testing 2023-03-27 17:20:16 +02:00
c0b0c14a15 Allow user to choose between 112 and 128 bits of security 2023-03-27 15:42:19 +02:00
3b759580b2 Require 128 bits of security for public keys 2023-03-27 10:27:57 +02:00
5f2208e71d Benchmark: fix reporting of base10 2023-03-27 16:29:47 +10:00
979707380c Merge pull request #6232 from JacobBarthelmeh/release
prepare for release 5.6.0
2023-03-24 10:14:19 -07:00
40cbb32b23 Ciphersuite check
https://www.rfc-editor.org/rfc/rfc9325#section-4.1
2023-03-24 16:44:33 +01:00
e465089798 No old TLS check 2023-03-24 16:44:01 +01:00
94cf845c05 Truncated hmac check 2023-03-24 16:43:34 +01:00
7791b8ff4d Add config option 2023-03-24 16:42:56 +01:00
877e026da4 prepare for release 5.6.0 2023-03-23 21:44:18 -07:00
9f6388d272 Track SetDigest usage to avoid invalid free under error conditions. 2023-03-23 15:46:38 -04:00
d57d6d2b78 Fix for variable server startup time 2023-03-23 15:03:26 -04:00
e0e590f126 Merge pull request #6223 from lealem47/misc_fixes
Async build typos and miscellaneous fixes
2023-03-23 23:55:20 +07:00
aeffe6cfa7 Merge pull request #6222 from JacobBarthelmeh/alerts
don't try to send an alert to a disconnected peer
2023-03-23 09:49:15 -07:00
3ef7db8e1b Merge pull request #6229 from JacobBarthelmeh/Testing
fix for check on ecc public key size with FIPS and compressed keys
2023-03-23 08:25:31 -07:00
e9214e07cf Merge pull request #6219 from RSmatRA/RSmatRA/zeroing-input-buffer
Do not ForceZero the part of the buffer that has not been used.
2023-03-23 21:13:37 +07:00
a121a5c270 Merge pull request #6225 from SparkiDev/memzero_check_fixes_1
MemZero check fixes
2023-03-23 21:04:39 +07:00
25577ab96c fix for check on ecc public key size with FIPS and compressed keys 2023-03-23 06:58:03 -07:00
d1e4349661 MemZero check fixes
ForceZero the client and server secret regardless of whether TLS 1.3 as
it may change but have been copied in.
ForceZero the input buffer in wolfSSL_Clear() when encryption was on.

Changed wc_PRF_TLS to only check the parts of data used.
Changed where scatch is added for checking in wc_AesCtrEncrypt.
Change wc_MakeRsaKey to memset p, q, tmp1, tmp2 and tmp3 to all zeros so
that MemZero check works. Memset not needed otherwise.
Changes for new compiler - thinks uninitialized.
2023-03-23 12:27:38 +10:00
6ad786abe4 Merge pull request #6224 from SparkiDev/quic_aes_gcm_stream
AES-GCM streaming: EVP needs to set IV with wc_AesGcmInit
2023-03-23 08:25:31 +07:00
a31ca24bb0 Fix for async build with enable all 2023-03-22 17:30:38 -06:00
c83e899b78 Fix for overlong string warning 2023-03-22 17:29:53 -06:00
a5e7a20c93 Fix for logic gating strerror_r() 2023-03-22 17:29:13 -06:00
1fa75a5503 AES-GCM streaming: EVP needs to set IV with wc_AesGcmInit
Store IV if it is small enough to fit in aes->reg - was a copy of the
aes->reg in the first place.
2023-03-23 09:28:22 +10:00
df4081ea5a Merge pull request #6215 from JacobBarthelmeh/static_analysis
fixes for static analysis reports
2023-03-23 08:37:08 +10:00
7734588669 don't try to send an alert to a disconnected peer 2023-03-22 14:20:07 -07:00
835e8a18c7 Merge pull request #6216 from JacobBarthelmeh/fuzzing
adjust sanity check for index into URI
2023-03-22 12:52:04 -07:00
c11f5d0ee5 fixes for static analysis reports 2023-03-22 12:34:37 -07:00
7c122cda6d Merge pull request #6197 from JacobBarthelmeh/Testing
adjust location of Options typdef
2023-03-22 12:31:00 -07:00
edca6b9d03 adjust location of Options typedef 2023-03-22 09:27:26 -07:00
7e8d027a17 Merge pull request #6217 from douzzer/20230321-fixes
20230321-fixes
2023-03-22 10:23:07 -06:00
e618bb9686 Do not ForceZero the part of the buffer that has not been used. 2023-03-22 14:48:18 +01:00
49cd3ff872 wolfssl/internal.h: fixes for -Wpedantic "redefinition of typedef" around typedef ... TLSX and Options;
src/internal.c: fix for -Wdeclaration-after-statement and clang-diagnostic-unreachable-code-break;

tests/api.c: fix for -Wunused-variable and clang-analyzer-deadcode.DeadStores;

olfcrypt/src/pkcs12.c: fixes for cppcheck uselessAssignmentPtrArg and arrayIndexThenCheck, and clang-tidy clang-analyzer-deadcode.DeadStores and clang-analyzer-core.NonNullParamChecker;

wolfssl/src/tls.c: fix for clang-analyzer-deadcode.DeadStores;

wolfcrypt/src/tfm.c: fix for clang-diagnostic-newline-eof;

src/tls13.c: fix for clang-analyzer-core.NonNullParamChecker.
2023-03-21 22:52:56 -05:00
180a20d535 adjust sanity check for index into URI 2023-03-21 20:19:08 -07:00
147395476f Merge pull request #6213 from SparkiDev/regression_fixes_6
Regression testing fixes
2023-03-21 20:17:30 -06:00
51040b1f07 reset alt name list to head 2023-03-22 10:31:58 +09:00
9ec742b11f Regression testing fixes
HAVE_ECH only used by TLS 1.3 add protection around all code.
ssl->options.onlyPskDheKe only available when HAVE_SUPPORTED_CURVES.
CleanupClientTickets() defined when HAVE_SUPPORTED_CURVES.
TLSX_KeyShare_DeriveSecret only defined when HAVE_SUPPORTED_CURVES.
DecodeResponseData - initialize variable single.
New OpenSSL compatibility BN code requires mp_read_radix - turn on in
integer.c, sp_int.c when OPENSSL_EXTRA defined.
rsa.c:_CheckProbablePrime - make sure tmp1 and tmp2 are initialized
before error handling jumps to freeing them.

test_remove_hs_message uses 1024-bit DH key which is not supported when
using SP math with SP.
2023-03-22 08:57:20 +10:00
1eeb54e981 Merge pull request #6208 from JacobBarthelmeh/fuzzing
handle failing RNG init when creating PKEY
2023-03-22 08:55:38 +10:00
2af55903c5 Merge pull request #6187 from SparkiDev/tls13_server_id
Server ID - long id, TLS 1.3 - cache client session for tickets
2023-03-21 16:48:05 -06:00
265a6c824f Merge pull request #6164 from wolfSSL/gojimmypi-patch-zephyr-link
Update README link
2023-03-21 09:10:52 -06:00
17e20b8c36 Server ID - long id, TLS 1.3 - cache client session for tickets
Long server IDs were being truncated. Hash long IDs instead.
TLS 1.3 session ticket on client side no longer added session to client
cache. Explicit call added.
2023-03-21 15:29:07 +10:00
74f549a0b4 Merge pull request #6206 from SparkiDev/aesgcm_armv6_asm
AES ARMASM <ARMV7: fix load order
2023-03-20 21:21:01 -07:00
7d2a9136b6 Add support for TSIP v1.17 2023-03-21 11:28:07 +09:00
4eeb792a05 AES ARMASM <ARMV7: fix load order
Loading from memory based on register that is overwritten in ldrd.
When ldrd split out for older processors, register overwritten before
second load.
Switch order of loads in this case.
2023-03-21 10:53:47 +10:00
09dd9a0ca3 Merge pull request #6207 from rizlik/move_alerts_from_get_record_header
Move alerts from get record header
2023-03-21 08:20:22 +10:00
cc4f6221e1 RIOT-OS does support writev 2023-03-20 16:07:29 -05:00
5c7be2fa98 Merge pull request #6202 from philljj/zd15807
Fix out-of-bounds read in CRL parsing
2023-03-20 14:19:01 -06:00
e281ef9ea9 wolfcrypt/settings.h: use default realloc on EspressIf 2023-03-20 17:26:46 +00:00
72e53ca1a4 handle failing RNG init when creating PKEY 2023-03-20 07:17:25 -07:00
84d8245e58 internal: move SendAlerts outside of GetRecordHeader
This will give a chance to DTLS logic to ignore an error.
2023-03-20 10:50:00 +00:00
aabd665e73 SendAlert: propagate return error in non-fatal SendAlert 2023-03-20 10:50:00 +00:00
c3b51af6cd Merge pull request #6204 from JacobBarthelmeh/name
Fix for value of givenName and name
2023-03-20 10:59:47 +10:00
2fe473cf9f Fix out-of-bounds read in CRL parsing 2023-03-17 22:33:35 -05:00
327692b09f Merge pull request #6200 from kareem-wolfssl/zd15324_2
Fix IAR warnings.
2023-03-17 15:04:35 -06:00
9e331aa6d5 Merge pull request #6195 from embhorn/zd15836
Fix type conv error in logging
2023-03-17 14:46:54 -06:00
9c3cfab328 Merge pull request #6196 from bandi13/zd15783
OCSP_CERT_UNKNOWN
2023-03-17 14:33:57 -06:00
0e431c3eaa add given name test case 2023-03-17 13:07:15 -07:00
a917f380bb fix values for givenName and name 2023-03-17 12:56:27 -07:00
011385d4d4 Revert logging return code fixes, already fixed in another PR. 2023-03-17 12:39:04 -07:00
06d970c999 Merge pull request #6181 from kareem-wolfssl/zd15767
Fix not ignoring date errors when VERIFY_SKIP_DATE is set
2023-03-17 10:53:41 -06:00
042ceff08e Merge pull request #6160 from lealem47/indefPKCS12
Adding support for indefinite length PKCS12
2023-03-17 10:45:46 -06:00
5b08b016af Add client-absolute-urn.pem to renewcerts.sh 2023-03-16 16:14:08 -07:00
5126dc87e6 Fix IAR warnings. 2023-03-16 15:46:41 -07:00
459058a645 Merge pull request #6194 from JacobBarthelmeh/string
cast on input of XISALNUM
2023-03-17 08:39:21 +10:00
21c5ecc371 Merge pull request #6179 from tim-weller-wolfssl/zd14527-pemtoder-return-size
zd14527 - Update `PubKey` and `Key` PEM-to-DER APIs to support return of needed DER size
2023-03-17 08:37:51 +10:00
db166e5e5a Merge pull request #6198 from kaleb-himes/140-3-iOS-early-stage
Add a base-line user_settings.h for use with FIPS 140-3 in xCode example app
2023-03-16 15:20:15 -07:00
cc51b2d52e Add additional fix for absolute URN issue from PR #5964 and add test. 2023-03-16 14:56:44 -07:00
4c12c334cf Allow alternative absolute URI syntax in certificate general name. 2023-03-16 14:25:42 -07:00
28f39f6b3d Fix unit test failure when building OPENSSL_EXTRA without HAVE_EXT_CACHE. 2023-03-16 14:25:42 -07:00
2bb8eeae85 Fix not ignoring date errors when VERIFY_SKIP_DATE is set 2023-03-16 14:25:41 -07:00
e1d1f0790e Fixup uninitialized warnings detected by xCode 2023-03-16 15:18:00 -06:00
75149f71d2 Implement peer suggestions 2023-03-16 12:59:49 -06:00
8ec339d11c Merge pull request #6175 from tim-weller-wolfssl/zd15722-mem-leak
zd15722 - Prevent out-of-bound read in ASN parsing logic by erroring out.
2023-03-16 07:29:26 -06:00
5659bd6036 Prevent out-of-bound read in ASN parsing logic by erroring out. 2023-03-16 06:11:34 -05:00
7f6811a731 Merge pull request #6146 from kareem-wolfssl/zd15324
Fixes various warnings
2023-03-15 16:59:00 -06:00
fb6f2d1790 cast on input of XISALNUM 2023-03-15 15:43:28 -07:00
aaad3980a0 Various warning fixes. ESP32S3 include and build fixes. Added optional slot support for STSAFE shared secret using WOLFSSL_STSAFE_TAKES_SLOT. 2023-03-15 13:34:02 -07:00
ea06d064b0 Add a base-line user_settings.h for use with FIPS 140-3 in xCode example app 2023-03-15 14:08:32 -06:00
0486db8a2e Merge pull request #6188 from SparkiDev/aes_gcm_streaming_long_nonce
AES-GCM streaming: fix IV caching
2023-03-15 11:39:37 -06:00
8ba35a5f16 Merge pull request #6180 from julek-wolfssl/openvpn-test
Add libnl-genl-3-200 as dependency to openvpn test
2023-03-15 10:11:20 -06:00
69024d121f Revert change 2023-03-15 10:16:34 -04:00
682354628b Better return value 2023-03-15 09:58:39 -04:00
7c918255b9 Fix type conv error in logging 2023-03-15 07:46:22 -05:00
1967375ea5 Pass up the error 2023-03-14 18:11:00 -04:00
c6e7ea685e Add in CERT_UNKNOWN detection 2023-03-14 18:09:45 -04:00
3b5310d186 AES-GCM streaming: fix IV caching
AES-GCM stremaing was caching IV even when larger than buffer copying
into.
Instead, require calls to wc_AesGcmSetIV() or wc_AesGcmSetExtIV() to
cache IV.
wc_AesGcmInit() now uses passed in IV or retrieves from cache.
2023-03-15 07:52:06 +10:00
a268222167 Merge pull request #6169 from rizlik/wssl-alerts
Wssl alerts
2023-03-15 07:48:57 +10:00
0355187f51 Merge pull request #6184 from bandi13/fixCRLTest
Fix possible timing issue with other tests copying the certs folder
2023-03-14 09:29:03 -06:00
caad42291b Merge pull request #6193 from JacobBarthelmeh/tls13 2023-03-14 14:54:00 +01:00
94d983f94a tests: add WOLFSSL_EXTRA_ALERTS tests 2023-03-14 13:27:40 +00:00
c61d079905 Merge pull request #6186 from SparkiDev/asn_template_leading_zero
ASN template: compile option to allow leading zeros
2023-03-14 06:37:06 -06:00
52105a10c9 Add means to get size of DER buffer size needed for PEM-to-DER conversion to Key and PubKey APis 2023-03-14 06:33:12 -05:00
898fed9a8b tests: memio: allow NULL client and/or server ctx 2023-03-14 09:27:19 +00:00
4227f763a8 ssl: send alert on bad psk 2023-03-14 09:27:19 +00:00
7b53baea62 refactor: more centralized extra alerts
on handshake messages' errors:

- don't send alerts on WANT_READ, WANT_WRITE and WC_PENDING_E "errors"
- use return error code to decide which alert description
  to send
- use alert description handshake_failure in the general case
- if a fatal alert was already sent, do not send any new alerts. This allow
  a more specific alert description in case the exact description can't be
  derived from the return code
2023-03-14 09:27:18 +00:00
f666a7d4b7 internal.c: fix fall_through compilation issues
src/internal.c: In function 'SendCertificateVerify':
./wolfssl/wolfcrypt/types.h:345:40: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]
  345 |                 #define FALL_THROUGH ; __attribute__ ((fallthrough))

In file included from ./wolfssl/internal.h:27,
                 from src/internal.c:92:
src/internal.c: In function 'SendCertificateVerify':
./wolfssl/wolfcrypt/types.h:345:40: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]
  345 |                 #define FALL_THROUGH ; __attribute__ ((fallthrough))
2023-03-14 09:27:18 +00:00
1d0b04bfb3 ASN template: compile option to allow leading zeros
DER/BER encoding requires positive numbers to not have leading zeros.

Sometimes customer's have examples that break the rules.
In those cases define: WOLFSSL_ASN_INT_LEAD_0_ANY
Define used in original ASN.1 implementation.
2023-03-14 09:23:15 +10:00
19a1ec8c98 Merge pull request #6192 from kaleb-himes/aes-free-dox
Document use of wc_AesFree()
2023-03-13 16:03:13 -06:00
d7cd7bc256 adjust guards around PreSharedKey structure for non tls13 builds 2023-03-13 14:47:25 -07:00
9c1adbd83b Fix typo's in the code sample(s) 2023-03-13 14:56:46 -06:00
5bbdda6895 Document use of wc_AesFree() 2023-03-13 11:50:28 -06:00
e8828574ea Merge pull request #6190 from bandi13/ghActions
Let tests run to completion
2023-03-13 09:24:09 -06:00
694b527e67 Merge pull request #5910 from julek-wolfssl/dtls13-stateless
DTLS 1.3 stateless server ClientHello parsing
2023-03-13 09:22:58 -06:00
c56c4ef7ce Hacky workaround to be able to put/remove files in certs folder 2023-03-13 10:37:21 -04:00
f3e785b4c7 Let tests run to completion 2023-03-13 09:48:37 -04:00
bcd6bce040 Merge pull request #6183 from ejohnstown/rng-tweak
RNG Tweak
2023-03-10 15:16:54 -07:00
f2a955d5eb Merge pull request #6182 from julek-wolfssl/hostap-testing
Add initial testing for wpa_supplicant
2023-03-10 15:44:07 -05:00
1c9fa5c5ae Set some freed data to NULL 2023-03-10 13:40:25 -07:00
e2a1ab9e49 Fix possible timing issue with other tests copying the certs folder 2023-03-10 15:35:03 -05:00
907a29ab9e RNG Tweak
1. Remove a redundant test. The duplicate data test is not required and
   is checking for something that potentially can happen normally,
   albeit rarely.
2023-03-10 11:08:35 -08:00
a47cf08273 Add initial testing for wpa_supplicant 2023-03-10 17:12:56 +01:00
90f1c26211 Merge pull request #6162 from gojimmypi/Espressif_fix_6148
compiler appeasement initialization
2023-03-09 20:08:24 -08:00
9628eb0159 Add libnl-genl-3-200 as dependency to openvpn test
Looks like github actions removed libnl-genl-3-200 from the default image. Need to install manually.
2023-03-09 21:47:10 +01:00
4c7aa5c8dd Address code review 2023-03-09 19:00:25 +01:00
2a15363033 Merge pull request #6176 from bandi13/addWolfCLUDocker
Add in wolfCLU Dockerfile
2023-03-09 10:39:56 -07:00
4fe3cc60b0 Merge pull request #6177 from cconlon/asnTimeString
Fix GetAsnTimeString() to correctly increment internal data pointer
2023-03-09 09:36:59 -07:00
a640418832 Merge pull request #6170 from julek-wolfssl/openvpn-test
Add fsanitize testing for openvpn
2023-03-09 09:25:43 -07:00
30106d82ea replace fp_init_copy to appease some compilers 2023-03-08 20:37:19 -08:00
d03347d79c fix GetAsnTimeString() to correctly increment data_ptr, fixes PKCS#7 signedData signingTime attribute 2023-03-08 16:39:49 -07:00
ebf7fa585a First attempt 2023-03-08 15:27:16 -05:00
13867dab12 Fix leak and address more feedback 2023-03-08 13:14:16 -07:00
e04a01dc4c Add fsanitize testing for openvpn 2023-03-08 11:23:41 +01:00
6e58ca3bc4 Merge pull request #6171 from JacobBarthelmeh/Testing
build checks on mp_read_radix
2023-03-08 10:36:19 +10:00
07a1725635 remove redundent check on mp_read_radix available 2023-03-07 16:08:37 -07:00
842b22858b Merge pull request #6168 from anhu/WOLFSSL_RELAXED_ASN_PARSING
Relaxed parsing of explicit ECC public key
2023-03-08 08:20:04 +10:00
eb0bf7cd03 build checks on mp_read_radix 2023-03-07 13:55:10 -07:00
f1757b1bae WOLFSSL_NO_ASN_STRICT 2023-03-07 07:24:25 -05:00
335722c586 Async fixes 2023-03-07 12:04:54 +01:00
f5f67f43d7 Reset DTLS sequence number 2023-03-07 12:04:54 +01:00
a432502a98 Refactor sequence number reset for DTLS into one function 2023-03-07 12:04:54 +01:00
db1f199a11 Add comment about keyshare negotiation 2023-03-07 12:04:54 +01:00
cbedae2f55 This path in TLSX_KeyShare_Choose should not be taken normally 2023-03-07 12:04:54 +01:00
06749144d5 Add RFC link to help understand constraints 2023-03-07 12:04:54 +01:00
f2032e8744 Clear decrypted ticket that failed checks in DoClientTicket_ex 2023-03-07 12:04:54 +01:00
b0d7656ad2 Rebase fixes 2023-03-07 12:04:54 +01:00
885cca67fe Check for shared ctx in all configs 2023-03-07 12:04:54 +01:00
61c2059cd9 Differentiate between empty and missing extension 2023-03-07 12:04:54 +01:00
5f39c594aa TLS 1.3: hold decrypted ticket to check which ciphersuite matches
DTLS 1.3: Move stateless ticket decoding to FindPskSuiteFromExt
2023-03-07 12:04:54 +01:00
8c08dbb6ce Adding checks for SigAlgs, KeyShare, and Supported Groups 2023-03-07 12:04:54 +01:00
2bbdf6979a Reuse ReadVector16 2023-03-07 12:04:54 +01:00
de6ed96feb CopyExtensions -> CopySupportedGroup 2023-03-07 12:04:54 +01:00
5f65752414 Refactor alerts into one location
Remove previous stateless code. Now all DTLS 1.3 stateless handling is done in dtls.c
2023-03-07 12:04:54 +01:00
51a384eba5 Read cookie extension into separate field 2023-03-07 12:04:54 +01:00
5b0903a82d Missing casts 2023-03-07 12:04:54 +01:00
b5e7761e58 For DTLS 1.3 use PSK for ticket
Resumption info is also necessary when WOLFSSL_DTLS_NO_HVR_ON_RESUME is not defined.
2023-03-07 12:04:54 +01:00
0264df1546 Definition was defined out in some configs 2023-03-07 12:04:54 +01:00
969c610ef7 Fix unused variable 2023-03-07 12:04:54 +01:00
57dccc4cf4 Calculate cookie in SendStatelessReplyDtls13()
Not touching ssl->hsHashes while in stateless mode
2023-03-07 12:04:54 +01:00
c15043b191 Refactor SendStatelessReply 1.3 branch into new function 2023-03-07 12:04:54 +01:00
2f31cdef69 Re-create hs header for hash 2023-03-07 12:04:54 +01:00
aa9dcca624 Rebase and Jenkins fixes 2023-03-07 12:02:54 +01:00
a999909969 Use PSK callback to get the ciphersuite to use
- Allocate additional byte in TLSX_PreSharedKey_New for null terminator
2023-03-07 12:02:54 +01:00
6160f93f94 Fix Jenkins errors 2023-03-07 12:02:54 +01:00
7dfa96a729 Define usePSK when ext is present 2023-03-07 12:02:54 +01:00
984d709db0 dtls 1.3: Stateless ClientHello parsing 2023-03-07 12:02:54 +01:00
109063e427 Relaxed parsing of explicit ECC public key 2023-03-06 20:11:36 -05:00
9bc3b867e0 Merge pull request #6157 from miyazakh/add_favouriteDrinkNID 2023-03-06 16:45:14 -07:00
fa8b253657 Merge pull request #6167 from douzzer/20230306-fix-header-loop-test
20230306-fix-header-loop-test
2023-03-07 08:47:41 +10:00
3c107da2a9 wolfssl/openssl/bn.h: fix bugprone-macro-parentheses. 2023-03-06 15:23:14 -06:00
0a90b2d354 configure.ac: further fix for header loop check -- construct header list while in $srcdir, so that -I${srcdir} works as expected. see earlier commits 7baddb04f8 a7d9ea7550 b3a1ac80dc . 2023-03-06 15:21:23 -06:00
d9429185d8 Addressing some review feedback 2023-03-06 10:42:23 -07:00
86e1b0d8ab Merge pull request #6165 from SparkiDev/bn_move
BN compatibility API: move implementation out to separate API
2023-03-06 09:27:24 -08:00
9f66a58afd Merge pull request #6159 from philljj/zd15693
Fix ASN1_STRING leak in create_by_NID and create_by_txt
2023-03-06 09:25:37 -08:00
e4c2386b61 BN compatibility API: move implementation out to separate API
BN APIs from ssl.c have been moved out to ssl_bn.c that is included in
ssl.c.
Added defines for BN_rand() and BN_pseudo_rand() to indicate which bits
are to be set.
'internal' field now always maps to the ;mpi' field that is a MP
integer.
SetIndividualInternal/External renamed to wolfssl_bn_get/set_value.
Fixed BN APIs to work as closely to OpenSSL as possible.
Added tests.
Moved wolfssl_make_rng out to ssl.c as BN APIs are using it now.
SP int and TFM now check trials are in a valid range for
mp_prime_is_prime_ex().
2023-03-06 14:32:10 +10:00
9363b96947 Update README link
fix link that's currently 404
2023-03-05 15:26:48 -08:00
487d46fd28 Merge pull request #6161 from douzzer/20230303-fix-c89-etc
20230303-fix-c89-etc
2023-03-05 14:24:33 -08:00
b3a1ac80dc configure.ac: don't check for opensslextra circular header dependencies if ENABLED_LINUXKM (handcrafted linuxkm/Makefile and linuxkm/Kbuild set up paths to correctly find dependencies like linux/mutex.h). 2023-03-04 12:12:08 -06:00
05b0796361 add favourite drink pilot attibute type to get it from the encoding 2023-03-04 14:20:48 +09:00
ab71f6fd4c extend C89 build to whole codebase including examples:
configure.ac: remove implied --disable-examples when --disable-inline;

tests/api.c: always include wolfcrypt/src/misc.c;

wolfcrypt/src/misc.c: use WC_MISC_STATIC to designate staticness of the misc functions;

wolfssl/wolfcrypt/misc.h: define WC_MISC_STATIC to empty or static depending on #ifdef NO_INLINE or not (respectively);

wolfssl/wolfcrypt/types.h: #ifdef NO_INLINE, #define WC_INLINE WC_MAYBE_UNUSED, and move the definitions of WARN_UNUSED_RESULT and WC_MAYBE_UNUSED above the definition of WC_INLINE for clarity;

wolfssl/wolfcrypt/mem_track.h: always declare TrackMalloc() et al static (no functional change, because the state and callback bindings were and remain unconditionally static, but previously #ifdef NO_INLINE the functions were globals, leading to multiple definitions.
2023-03-03 22:30:08 -06:00
e76d12f932 src/ssl.c: fix a couple suppressions to use C comment syntax, for C89 goodness. 2023-03-03 22:01:52 -06:00
aecb37c032 linuxkm/module_hooks.c: wc_SetSeed_Cb(wc_GenerateSeed) in wolfssl_init() #ifdef WC_RNG_SEED, regardless of whether wolfcrypt_test() will be called. 2023-03-03 22:00:24 -06:00
a7d9ea7550 configure.ac: fix openssl header circular dependency detector to work on out-of-tree builds. 2023-03-03 21:56:42 -06:00
bb9c1bb253 Adding support for indefinite length PKCS12 2023-03-03 15:58:17 -07:00
35b68fb23d Merge pull request #5597 from Tathorack/add-renesas-rx64-rx72-sha-support
Add RX64/RX71 SHA hardware support
2023-03-03 13:14:32 -08:00
4d81a06557 Update comment format and other minor changes 2023-03-03 13:57:44 -06:00
d955ec8d54 Merge pull request #6156 from jpbland1/revert-zephyr-relocation
move the zephyr folder back to it's correct location
2023-03-03 11:19:35 -08:00
9a597a098b Merge pull request #6158 from miyazakh/initial_dec
fix init var in for-loop
2023-03-03 08:40:55 -08:00
51dbb44799 Fix ASN1_STRING leak in create_by_NID and create_by_txt 2023-03-03 08:22:35 -06:00
0693b66c44 fix init var in for-loop 2023-03-03 17:51:34 +09:00
b146830fe8 move the zephyr folder back to it's correct location 2023-03-02 23:40:12 -05:00
4ebc896231 Merge pull request #6095 from SparkiDev/aes_gcm_win_asm
Aes gcm win asm
2023-03-02 15:02:55 -08:00
a8723f71cb Merge pull request #6154 from kaleb-himes/wolfmikey-w-fips-140-3
Allow building of sakke as external non-FIPS algorithm with wolfmikey product
2023-03-03 08:18:40 +10:00
03948fd3ae Merge pull request #6140 from JacobBarthelmeh/seco
Fix AES-ECB with SECO
2023-03-02 13:43:15 -08:00
41a9b1148f Merge pull request #6152 from philljj/spelling_cleanup
Used codespell and fixed obvious typos in src and wolfssl.
2023-03-02 11:39:45 -08:00
871754b97c Merge pull request #6153 from bandi13/fixZD15705
Fix memory leak
2023-03-02 11:39:03 -08:00
7ca4b1bc66 Allow building of sakke as external non-FIPS algorithm with wolfmikey product 2023-03-02 11:30:56 -07:00
7baddb04f8 Check for circular dependencies in compatibility headers (#6091)
* Check for circular dependencies in compatibility headers

* Run header check only when ENABLED_OPENSSLEXTRA

* Add missing include

* Pedantic compilers don't like empty translation units

* Fix macro guards
2023-03-02 08:51:13 -08:00
406d8753be Fix memory leak 2023-03-02 11:15:32 -05:00
409ed6232a Used codespell and fixed obvious typos in src and wolfssl. 2023-03-02 09:52:07 -06:00
9a54cea78b Fix AES-ECB with SECO 2023-03-02 07:55:05 -07:00
3f7109c18b Merge pull request #6147 from dgarske/cpp17
Fixes for building with C++17
2023-03-02 07:46:35 -07:00
126805183c Merge pull request #6150 from douzzer/20230301-fix-async-and-mips-and-kcapi
20230301-fix-async-and-mips-and-kcapi
2023-03-02 13:10:26 +10:00
98c1b152a0 wolfssl/openssl/sha.h: fix undersized WOLFSSL_SHA384_CTX to have same size as WOLFSSL_SHA512_CTX (fixes failed assert in fips-140-3-dev-kcapi-opensslextra-build). 2023-03-01 17:55:02 -06:00
24a1c171ea wolfssl/wolfcrypt/settings.h: define WOLFSSL_SP_INT_DIGIT_ALIGN when target is MIPS, to fix a crash in sp_read_unsigned_bin(). 2023-03-01 17:52:46 -06:00
51339edf47 wolfcrypt/src/asn.c: fix WOLFSSL_ASYNC_CRYPT codepath in SignCert() -- fall through to non-async certSignCtx_lcl for algs without async support. 2023-03-01 17:51:25 -06:00
6a7674a146 wolfcrypt/test/test.c: improve strerror_r() flavor sensing (simpler gate randomly provoked cppcheck-all-async-quic). 2023-03-01 17:50:00 -06:00
63b049814b Merge pull request #6136 from SparkiDev/armv7_aes_no_reloc_text
ARMv7a AES asm: don't have relocatable text
2023-03-01 14:36:41 -08:00
5de15fedee Merge pull request #6132 from bandi13/moreContainerSupport
More container support
2023-03-01 13:57:04 -08:00
17ad27c350 Fixes for building with C++17. Adds new USE_CPLUSPLUS_BYTE build option to use std::byte as byte to avoid redefinition issues when customer application sets default namespace to "std" or wants to use "byte".
Tested using `./configure CC="g++ -std=c++17" --enable-all && make check`.
2023-03-01 12:49:47 -08:00
7d049aa90a Merge pull request #6141 from SparkiDev/cert_name_enc_fix
Cert name encoding fix
2023-02-28 17:36:22 -08:00
3aa1ef5907 ARMv7a AES asm: don't have relocatable text
For FIPS hash, don't have relocatable text in ARMv7's AES assembly code.
2023-03-01 11:32:00 +10:00
91d77393b9 Merge pull request #6110 from SparkiDev/sp_small_stack
SP: WOLFSSL_SP_SMALL_STACK
2023-02-28 17:17:58 -08:00
aa8d3df8dd Merge pull request #6137 from SparkiDev/rsa_enc_no_pad
RSA padding - no pad length check fix
2023-02-28 17:17:05 -08:00
d1b8386d36 Cert name encoding fix
Only include extra name entries once when encoding.
Fix certDefaultName to not have \0 on strings of extra names.
2023-03-01 10:01:54 +10:00
2a33f24dc9 RSA padding - no pad length check fix
Perform correct length check of input bytes based on bits in key in
wc_RsaPad_ex when no padding to be done.
2023-03-01 09:42:39 +10:00
cc8493668b SP: WOLFSSL_SP_SMALL_STACK
Defined when WOLFSSL_SMALL_STACK and !WOLFSSL_SP_NO_MALLOC or on
configuration line as an option to --enable-sp: smallstack.
2023-03-01 09:35:05 +10:00
47aad3fedb Merge pull request #6138 from dgarske/pkcs7_async
Fix for PKCS7 with asynchronous crypto enabled
2023-02-28 17:24:56 -06:00
2420d5d3b6 Merge pull request #6144 from kareem-wolfssl/zd15741Gh6142
Fix for PIC32 crypto HW and unused `TLSX_SetResponse`
2023-02-28 15:10:37 -08:00
be6fb0c26f Merge pull request #6145 from bandi13/x509_sign_test_fix
Fix `test_wolfSSL_X509_sign` expected size
2023-02-28 15:10:21 -08:00
aff4d4a7d3 The size of the packet could vary by up to 5 bytes 2023-02-28 17:04:40 -05:00
08a3e2cb6e Avoid building TLSX_SetResponse unless it is being used. Initialize PIC32 UPDPTR register in all cases. 2023-02-28 14:37:45 -07:00
58236632ca Fix for PKCS7 with asynchronous crypto enabled. The addition of the devId field will attempt to leverage crypto callbacks and async hardware, so convert WC_PENDING_E to blocking. 2023-02-28 13:22:39 -08:00
b133f6bbf7 20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 13:02:37 -08:00
41ce9afef4 Better dependency list
Need 32bit compilation support as well as ARM/AARCH64
2023-02-28 11:19:09 -05:00
7b96cd2220 Switch out gcc-multilib for more modern multiarch 2023-02-28 09:29:23 -05:00
397537e691 AES-GCM: MSVC use generated assembly instead of inline
AES-GCM for MSVC was using inline assembly.
Add MSVC version of AES-GCM assembly and use it instead.
Removed inline assembly.
2023-02-28 14:56:29 +10:00
79eaf10041 Merge pull request #6139 from bandi13/fixOpenVpn
Attempt to fix build error
2023-02-27 17:56:26 -08:00
c7b4bb1b27 Merge pull request #6128 from tim-weller-wolfssl/zd15454-benchmark-windows-update
Update wolfCrypt benchmark windows build files to support x64 Platform
2023-02-28 08:28:20 +10:00
2cbf5435c6 Attempt to fix build error 2023-02-27 17:07:13 -05:00
950e0d100a Merge pull request #6133 from philljj/zd15662
Fix malloc of zero size in fast_s_mp_sqr and fast_s_mp_mul_digs.
2023-02-27 10:47:29 -08:00
12ccd01127 Merge pull request #6131 from anhu/STM32_kyber
Changes that make kyber work on STM32
2023-02-27 08:14:02 -08:00
49ae7d4845 Make old compilers happy. 2023-02-24 17:13:47 -05:00
041d9c4510 Merge pull request #6130 from gojimmypi/Espressif_OpenSSL_interim
fix WOLFSSL_SHA_CTX for OpenSSL w/Espressif HW hash
2023-02-24 14:58:08 -07:00
f3f2f6ccb9 Merge pull request #6126 from tmael/rpm_fix
Fix RPM build
2023-02-24 13:35:52 -08:00
fd3d8c407d Update wolfCrypt benchmark Windows / Visual Studio build files to include x64 Configuration/Platform combinations (e.g. Debug-x64) and fixed compilation errors in benchmark.c related to conditional-compilation. 2023-02-24 11:53:01 -06:00
469226f214 Merge pull request #6107 from anhu/ecc_pub
Fixes for encoding/decoding ecc public keys.
2023-02-24 08:36:15 -08:00
22b1857bee Fix malloc of zero size in fast_s_mp_sqr and fast_s_mp_mul_digs. 2023-02-24 10:18:36 -06:00
392ddd1b4a Remove conflicts 2023-02-24 10:38:35 -05:00
b1f421d0a6 Improve the "adder" for compatibility layer SHA context when hardware acceleration is used. 2023-02-24 07:28:15 -08:00
aef44ff029 fix WOLFSSL_SHA_CTX for OpenSSL w/Espressif HW hash 2023-02-24 07:20:55 -08:00
d98dd53f55 Add one more utility 2023-02-24 09:48:15 -05:00
62748ba451 One more liboqs flag 2023-02-24 09:47:47 -05:00
559db5f314 Build liboqs for distribution
This makes it possible to use the library on same architecture but different processor type.
2023-02-24 09:47:47 -05:00
2b96f4bd16 Add in liboqs 2023-02-24 09:47:47 -05:00
87b7988643 Add cross compilers 2023-02-24 09:47:24 -05:00
1fcff5b30d Changes that make kyber work on STM32
(wolfcrypttest and benchmark)
2023-02-24 04:08:07 -05:00
b2a6203ec0 Merge pull request #6129 from SparkiDev/ed25519_doc_fix
Ed25519 doxygen update
2023-02-23 19:53:41 -08:00
695aa2e6a0 Ed25519 doxygen update
Fix return comments to match code.
2023-02-24 08:54:16 +10:00
c2daca1393 Fixes for encoding/decoding ecc public keys. 2023-02-23 13:56:48 -05:00
d85ee5c87f Merge pull request #6124 from embhorn/zd15573
Fix NID conflict NID_givenName and NID_md5WithRSAEncryption
2023-02-23 18:15:28 +00:00
69ceedbcff Merge pull request #5938 from JacobBarthelmeh/RT1170
Port to RT1170 and expand CAAM driver
2023-02-22 20:11:58 -08:00
ffa392cdb5 Merge pull request #6125 from embhorn/gh6007
Include sys/time.h for WOLFSSL_RIOT_OS
2023-02-22 16:06:10 -08:00
434e869b1d Merge pull request #6109 from nunojpg/master
Fix out of bound memset to 0
2023-02-22 15:43:09 -08:00
a8b8092ff8 Merge pull request #6122 from anhu/WOLFSSL_HAVE_KYBER
HAVE_KYBER --> WOLFSSL_HAVE_KYBER
2023-02-22 14:55:29 -08:00
121ee7a6df fix spelling, refactor openssl extra struct, remove magic number, use static mutex 2023-02-22 14:31:16 -08:00
2e7713f4c2 Merge pull request #6120 from embhorn/zd15698
Fix NULL dereference in TLSX_CSR_Parse
2023-02-22 13:43:43 -08:00
3d71d3c388 Include sys/time.h for WOLFSSL_RIOT_OS 2023-02-22 15:36:50 -06:00
b32036258d Fix NID conflict NID_givenName and NID_md5WithRSAEncryption 2023-02-22 15:02:52 -06:00
bd3ae97603 HAVE_KYBER --> WOLFSSL_HAVE_KYBER 2023-02-22 15:05:47 -05:00
b801a96f8c Port to RT1170 and expand CAAM driver 2023-02-22 08:26:25 -08:00
0a928208f2 Fix NULL dereference in TLSX_CSR_Parse 2023-02-22 08:19:11 -06:00
b81759173a Merge pull request #5840 from kareem-wolfssl/dynSessCache2
Add dynamic session cache which allocates sessions from the heap.
2023-02-22 15:14:38 +10:00
74bad76707 Merge pull request #6117 from SparkiDev/priv_key_id_fix
Private Key ID: change to always set priv key type and size
2023-02-21 19:23:51 -08:00
05365f6052 Merge pull request #6116 from dgarske/various2
Cleanup function logging
2023-02-22 12:27:26 +10:00
bfcc615e44 Fix rpm build 2023-02-21 15:02:10 -08:00
39cfd8e566 Private Key ID: change to always set priv key type and size
When a certificate is loaded then the private key type and size is set
based on the public key.
Always set, even if previously set.
Use case is setting an RSA certificate against ctx and then setting EC
certificate against ssl.
2023-02-22 08:07:27 +10:00
fa41754b83 RX64/RX71 SHA hardware support updates
Made the following updates based on review feedback
Fixed mixed variable declaration and simplified cases by typedefing
wolfssl_RX64_HW_Hash to wc_Sha, wc_Sha224, & wc_Sha256
Added files to include.am so they are built when using make
Add WOLFSSL_RENESAS_RX64_HASH to settings.h and set WOLFSSL_NO_HASH_RAW
in settings.h based on value of WOLFSSL_RENESAS_RX64_HASH
Add and handle return value for rx64_hw_Open
Fix some minor formatting and comments
2023-02-21 15:46:25 -06:00
e47633ad83 Add RX64/RX71 SHA hardware support
Adding support for SHA1, SHA224, and SHA256 hardware acceleration on
Renesas RX64 and RX71 microcontrollers.
This follows the a similar pattern as the Renesas TSIP support.

Speed comparison for hashing 64KB of data on a RX64M
| Hash Speed | SHA1 | SHA256 |
|:----------:|:----:|:------:|
| Hardware   | 4ms  | 4ms    |
| Software   | 11ms | 89ms   |

Update define for RX64/RX71 SHA hardware support

This will allow for different hardware acceleration modules to be
enabled individually.

Init & Close for the RX64/RX71 SHA subsystem for WolfCrypt

This ensures that the SHA subsystem is ready for use when WolfCrypt
needs access to it.

Shorten the max line length, clean up comments

This wraps code and comments at 80 characters and adds some  comments
2023-02-21 15:46:17 -06:00
fc6d693dae Update logging enter, exit, msg to match function names. Fix some typos and improper use of "enter". Fix internal uses of SSL_SUCCESS and SSL_FAILURE. Add WOLFSSL_DEBUG_NONBLOCK option to allow printing iterations without debug enabled. 2023-02-21 12:02:15 -08:00
da04e0fb4c Merge pull request #6115 from SKlimaRA/SKlimaRA/fix-decompress-dynamic
fixed heap corruption
2023-02-21 11:58:11 -07:00
a6114afb84 Merge pull request #6114 from dgarske/stm32_hash
Fix for STM32 hashing hardware
2023-02-21 18:37:03 +00:00
821120e31c Add SHA512/224 and SHA512/256 benchmarks (#6113) 2023-02-21 09:27:03 -08:00
208056b2da fixed heaap corruptions 2023-02-21 11:01:50 +01:00
e0abb0e306 Merge pull request #6097 from gojimmypi/New_SHA512_Tests
Add new SHA-512/224 and SHA-512/256 tests
2023-02-21 01:39:38 -06:00
6820fea5d3 Merge pull request #6111 from SparkiDev/sp_point_add_fix
SP: fix point_add_qz1
2023-02-20 17:05:21 -08:00
136267d29c Add new SHA-512/224 and SHA-512/256 tests 2023-02-20 16:55:38 -08:00
5ec62c8d48 Merge pull request #6096 from SparkiDev/armv7a_neon_config
ARMv7a neon configure.ac
2023-02-20 15:22:20 -08:00
39e72630ce Proper fix for STM32 hashing. FIFO is always 32 bytes. The original U5/H7 proper fix is to make sure the hash is "done" before saving state. 2023-02-20 15:14:44 -08:00
c055740e6a Merge pull request #6100 from julek-wolfssl/stunnel-github-action-test
Add OSP github action
2023-02-20 15:41:58 -05:00
261054896c Actions fix
Fix for `workflows must be defined at the top level of the .github/workflows/ directory` error.
2023-02-20 18:42:47 +01:00
8b7ea9e820 Refactor os-check.yml 2023-02-20 18:42:47 +01:00
04cc85b31e Separate out into different files 2023-02-20 18:29:41 +01:00
d3551acc2b Code review 2023-02-20 18:29:41 +01:00
36df1e1ae9 Add OSP github action 2023-02-20 18:29:41 +01:00
9a7cd7367a SP: fix point_add_qz1
Better detection of when add won't work and double needed.
Minor reorg of point operations.
2023-02-20 21:53:52 +10:00
4e6bad1225 Fix out of bound memset to 0
In case buf size sz is too small it will get updated to the larger required value
and can't be used anymore to clear the buffer.

As the buffer is untouched don't need to clear it anyway.

Signed-off-by: Nuno Gonçalves <nunojpg@gmail.com>
2023-02-18 10:40:21 +00:00
6cc5c1a428 Merge pull request #6102 from dgarske/non_const
Fix for "expression must have a constant value" in tls13.c
2023-02-17 21:07:27 -06:00
1bae1ef63e Merge pull request #6101 from kaleb-himes/invalid-pp-macro
Fix invalid PP macro logic, guard under same conditions as internal.h
2023-02-17 17:05:50 -08:00
588b694c7d Merge pull request #5709 from TakayukiMatsuo/ccv 2023-02-17 17:02:04 -07:00
8de2eba9ab Fix allocating new sessions using the dynamic session cache. 2023-02-17 15:25:12 -07:00
c476dd6e28 Merge pull request #6103 from SparkiDev/sp_ecdsa_sig_r0
SP ECC sign: reject random k when r is 0
2023-02-17 13:58:53 -08:00
8a6483f13a Merge pull request #6080 from tim-weller-wolfssl/zd15632-oob-in-cert-parsing
zd15632 - OSS-Fuzz #55810: Out-of-bounds read in certificate parsing
2023-02-17 12:08:11 -08:00
4edb7e26b9 Merge pull request #6104 from douzzer/20230216-readability-redundant-preprocessor
20230216-readability-redundant-preprocessor
2023-02-17 10:31:27 -08:00
24fd561bf8 Merge pull request #6099 from bandi13/ocsp-cleanup
Be more aggressive in killing processes
2023-02-17 09:28:14 -08:00
21645460cd src/tls13.c: fix a readability-redundant-preprocessor in CheckPreSharedKeys(). 2023-02-16 23:37:43 -06:00
26b7052b3f SP ECC sign: reject random k when r is 0
SP ECC signing code was generating signatures with r of 0.
This is not allowed by the algorithm description.
Retry sig gen when r is 0 like when s is 0.
2023-02-17 08:55:59 +10:00
d488693f15 Allow #define HAVE_LIBZ support in user_settings.h. 2023-02-16 14:20:57 -08:00
82d65481bb Fix for "expression must have a constant value" in tls13.c with GreenHills compiler. 2023-02-16 13:58:48 -08:00
b2caa5c5ae Fix invalid PP macro logic, guard under same conditions as internal.h 2023-02-16 14:40:43 -07:00
0b31d5577c Merge pull request #6098 from bandi13/moreDockerprograms
Some tests need these utilities
2023-02-16 13:28:02 -08:00
fdb0338473 Be more aggressive in killing processes 2023-02-16 09:55:52 -05:00
ff96150404 Some tests need these utilities 2023-02-16 09:51:46 -05:00
dea123f88e Minimal changes to avoid Out-of-Bounds write in ASN.1 parsing logic. Add unit tests for ParseCert() API passing badly formed ASN data (should error out gracefully). 2023-02-16 07:49:08 -06:00
0a6dedab03 Merge pull request #6094 from SparkiDev/aes_gcm_stream_bench
AES GCM benchmark: separate aes-gcm streaming runs
2023-02-15 21:10:48 -08:00
464c2d19dc Merge pull request #6006 from SparkiDev/tls13_only_psk_dhe_ke
TLS 1.3 PSK: add option to require only PSK with DHE
2023-02-15 21:10:27 -08:00
859b1ff398 Merge pull request #6093 from dgarske/fix_async
Fix issue with async and `WOLFSSL_CHECK_ALERT_ON_ERR`
2023-02-15 19:49:56 -06:00
aaed553311 Merge pull request #6092 from dgarske/various
Various cleanups (STM docs, include case, make dist small script)
2023-02-16 11:23:51 +10:00
1167ad623b Dynamic session cache: code review feedback 2023-02-15 17:38:14 -07:00
85314e6ba5 ARMv7a neon configure.ac
Support other CPUs that start with armv7a.
2023-02-16 10:36:38 +10:00
195ca1a20a AES GCM benchmark: separate aes-gcm streaming runs
Always to AES-GCM one-shot benchmark.
When WOLFSSL_AESGCM_STREAM, always perform AES-GCM streaming benchmark.
2023-02-16 09:37:00 +10:00
b624fc8377 TLS 1.3 PSK: add option to require only PSK with DHE
Can specify only PSK without DHE.
Add only PSK with DHE.
2023-02-16 09:21:29 +10:00
18bee3142d Fix to use the right cert/key in the API unit test if overridden. 2023-02-15 14:57:43 -08:00
e8a26c673a Fix for async with WOLFSSL_CHECK_ALERT_ON_ERR. 2023-02-15 14:57:34 -08:00
47801107da Fix to make sure API unit test always calls init/cleanup when not running all tests. 2023-02-15 14:24:22 -08:00
5481a059c4 Fix wincrypt.h include header case when used with case sensitive file system. 2023-02-15 11:44:34 -08:00
6ea3fe2f7a Merge pull request #6089 from kaleb-himes/stunnel-5_67_support_fix
Fix unused variable warning when configuring with --enable-apachehttpd
2023-02-15 08:39:30 -08:00
089ef86587 Merge pull request #6090 from douzzer/20230214-mollify-iso-c-pedantic
20230214-mollify-iso-c-pedantic
2023-02-15 17:04:07 +10:00
ca87a99646 src/ssl.c and src/x509.c: use the customary function pointers (WOLFSSL_CRYPTO_EX_*()), not void *, in the arg lists of wolfSSL_CTX_get_ex_new_index() and wolfSSL_X509_get_ex_new_index(), to avoid "ISO C forbids passing argument ... between function pointer and ‘void *’";
move typedefs for WOLFSSL_CRYPTO_EX_*() from wolfssl/openssl/compat_types.h to wolfssl/wolfcrypt/types.h, grouped with the other EX_DATA-related typedefs, as they are needed whenever defined(HAVE_EX_DATA) regardless of openssl compatness;

properly gate wolfSSL_CTX_get_ex_new_index() and wolfSSL_X509_get_ex_new_index() prototypes on defined(HAVE_EX_DATA).
2023-02-14 19:28:40 -06:00
7e582932f3 Improve documentation for STM32 PKA support. 2023-02-14 14:27:05 -08:00
100ec1e7e6 Fix ./scripts/makedistsmall.sh for Docker and RTOS. 2023-02-14 14:25:40 -08:00
dead56b3cb Merge pull request #6086 from julek-wolfssl/explicit-rwlock
Make rwlock an explicit enable option
2023-02-14 15:04:13 -07:00
2719943ffd Fix unused variable warning when configuring with --enable-apachehttpd 2023-02-14 14:25:57 -07:00
0cedc4e1ac stunnel 5.67 support (#6020)
* stunnel 5.67 support

- ssl->session->ticketAdd may be set when parsing a ticket before PSK
- PSK binders should be calculated based on ciphersuite associated with PSK
- Add option to prioritise PSK order instead of ciphersuite order
- Update ctx->method->version when using Set_CTX_max_proto_version API
- Simplify wolfSSL_parse_cipher_list
  - Keep copy of old list and then add in the previous ciphersuites depending on whether we are doing only TLS 1.3 ciphersuites or not
- Specify CRL revocation in alert
  - Match reason string to match OpenSSL
- Add support for external data callbacks for WOLFSSL_SESSION

* Upref the session for stunnel instead of duplicating it

* Add small stack option for wolfSSL_parse_cipher_list
2023-02-14 09:38:28 -08:00
c4fa013800 Fix for BIO_reset() (#5887)
* Fix for BIO_reset
* Introduced BIO_FLAGS_MEM_RDONLY
2023-02-14 08:54:25 -08:00
bcfd5fb66b Make rwlock an explicit enable option 2023-02-14 13:55:59 +01:00
2fe34facba Merge pull request #6084 from philljj/zd15607
Check keyLen matches cipher in wolfSSL_CMAC_Init.
2023-02-14 12:51:20 +10:00
6e21b8c907 Merge pull request #6085 from anhu/env_shell
Invoke shell for shell scripts.
2023-02-13 14:53:47 -08:00
ed79545a27 Espressif examples run with local wolfSSL (no setup!) (#6018)
* Espressif examples run with local wolfSSL (no setup!)
* include.am Espressif local no-setup component files
* cleanup Espressif Example CMakeLists.txt, use function
* multiple wolfSSL installs is now a fatal Espressif build error
* Examples no longer need setup
* CompileAll builds local examples, not IDF_PATH ones
* Espressif compileAllExamples both local & ESP-IDF components
* add wolfssl_test_idf test project
* move VisualGDB projects to subdirectories
* move VisualGDB wolfssl_server to subdirectory
* update include.am for moved VisualGDB project files
2023-02-13 14:37:56 -08:00
6877c98d82 Merge pull request #6081 from douzzer/20230211-wolfcrypttest-fixes
20230211-wolfcrypttest-fixes
2023-02-13 14:28:43 -08:00
eedc8fa0b3 Invoke shell for shell scripts. 2023-02-13 15:58:15 -05:00
a945017a88 wolfcrypt/test/test.c: around ecc_ctx_kdf_salt_test(): fix fips gating, fix length handling for "message", fix memory leaks;
in crypto_ecc_verify(), crypto_ecc_sign(), ecc_test_nonblock_dhe(), and ecc_test_nonblock_ecdsa(), add codepoint-specific retvals.
2023-02-13 14:21:50 -06:00
405b98aaa4 Merge pull request #6078 from SparkiDev/rsapss_openssl_compat
X509 RSA PSS: fixes for OpenSSL compat layer
2023-02-13 08:43:10 -08:00
295da3232a Merge pull request #6082 from SparkiDev/asn_dsa_mp_int_leak
ASN template, DSA: Clear the mp_int before re-reading data
2023-02-12 22:28:11 -06:00
0a8753d2b2 ASN template, DSA: Clear the mp_int before re-reading data
Make sure the mp_int is cleared so that any exisiting bigint is freed.
Tidy up api.c code.
2023-02-13 11:08:18 +10:00
909aa86d2d Check keyLen matches cipher in wolfSSL_CMAC_Init.
Fixes ZD15607.
2023-02-12 18:26:40 -06:00
5a77db3f20 Add dynamic session cache which allocates sessions from the heap. 2023-02-10 14:18:03 -07:00
55a7e24cfe Support pthread_rwlock (#5952)
* Support rwlock

* Fix typo, ENABLE_SESSION_CACHE_ROW_LOCK with TITAN_SESSION_CACHE

* Implement read lock

- Use read lock for the SessionCache
- Don't copy the

* TLS 1.3: Don't push ticket to cache if we don't retrieve from it

* Detect rwlock support with PTHREAD_RWLOCK_INITIALIZER

* Implement explicit rwlocks

- Mutex's still necessary for signals. Implement explicit rwlocks and we can migrate critical mutexs to rwlocks when necessary.

* Remove WOLFSSL_USE_RWLOCK guard around mutex condLock

* condLock not necessary after all

* Use configure.ac to check for pthread_rwlock_destroy support

* Can't include config.h in wc_port.h as that breaks make distcheck

* Check for pthread_rwlock_t to determine if rwlock is available

* Code review

---------

Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2023-02-10 10:42:38 -08:00
338d8db274 Ecc ctx state fix (#6077)
* set the client state correctly when wc_ecc_ctx_set_kdf_salt is called
* add test that covers wc_ecc_ctx_set_kdf_salt
* use shared key and smallstack to reduce test stack usage
2023-02-10 10:05:52 -08:00
5b8fda1ac6 Fix overflow in fp_to_unsigned_bin_len length check. (#6075)
* Fix overflow in fp_to_unsigned_bin_len length check.
* Add a second check when i == a->used - 1.
2023-02-10 08:46:37 -08:00
0c771a93dc Improve TLS1.2 client authentication to use TSIP 2023-02-10 16:16:25 +09:00
c2384674d8 Merge pull request #6079 from SparkiDev/aes-ecb-len-aesni
AES ECB/CTR/XTS: enable AES-NI usage
2023-02-09 21:17:50 -06:00
b359dd27e4 AES ECB/CTR/XTS: enable AES-NI usage
Perform multiple blocks of encryption/decryption in assembly call with
ECB.
This improves performance of ECB, CTR and XTS on Intel x64.
2023-02-10 11:14:06 +10:00
9750fc4485 X509 RSA PSS: fixes for OpenSSL compat layer
Add NIDs for RSA-PSS to OpenSSL compat layer.
Have wc_RsaPublicKeyDecode call wc_RsaPublicKeyDecode_ex where logic for
RSA-PSS handling is already done.
2023-02-10 10:25:49 +10:00
d336e22b85 Allow reading ENC EC PRIVATE KEY as well via wolfSSL_PEM_read_bio_ECPrivateKey (#6055)
* fix qt qsslkey unit test
2023-02-09 14:48:52 -08:00
7a6f7ff6b7 Merge pull request #6076 from dgarske/fix_async
Fix for possible uses of NULL with heap hint in pk.c
2023-02-10 08:26:44 +10:00
8929b31b84 Fix for possible uses of NULL in heap hint. The api.c has expected "bad" test cases where the key is passed in as NULL and the XFREE tries to use it. Tested with: ./configure --enable-asynccrypt --with-intelqa=../QAT1.8 --enable-all && make && sudo ./tests/unit.test 2023-02-09 10:18:37 -08:00
05f8abd524 Merge pull request #6064 from embhorn/gh6063
Add WOLFSSL_IP_ALT_NAME to --enable-curl; fix unused error in FindPsk
2023-02-09 08:38:38 -08:00
644d92f28c Merge pull request #6074 from douzzer/20230208-fixes
20230208-fixes
2023-02-09 16:18:35 +10:00
9dd23fca25 wolfcrypt/src/pwdbased.c: refactor copy in scryptSalsa() as a memcpy(), for efficiency and to work around a bug in clang-17; also fix scratch buffer x in scryptBlockMix() to have correct alignment. 2023-02-08 21:31:56 -06:00
63fdc4e843 src/ssl.c: fix PK object on stack in wolfSSL_i2d_PublicKey(). 2023-02-08 21:30:50 -06:00
ef0eda4091 cleaner fix for bugprone-signed-char-misuse first addressed in 38c057a084. 2023-02-08 21:28:34 -06:00
49a500c2af Merge pull request #6070 from bandi13/coverityFixes
Coverity fixes
2023-02-09 10:21:12 +10:00
008d2962d7 Merge pull request #6072 from bandi13/dsaNoInit
Fix for calling 'mp_clear(tmp)' without having called 'mp_init(tmp)'
2023-02-09 10:18:51 +10:00
e9aeb1a857 Add nuttx integration (#6043) 2023-02-08 16:04:53 -08:00
619a587a7b Merge pull request #6071 from bandi13/extraPackagesForDocker
Add in a few more utilities that we need
2023-02-08 14:53:20 -08:00
7f9b764eb5 Merge pull request #6054 from anhu/d2i_publickey_fix
Ensure that i2d APIs for public keys gives appropriate data.
2023-02-08 14:44:29 -08:00
1da392c297 Merge pull request #6069 from philljj/spelling_cleanup
Spelling cleanup: configure.ac, ssl.c, ssl.h
2023-02-08 14:40:03 -08:00
7a30617b26 Merge pull request #6073 from dgarske/shake_bench
Fix for benchmarking shake with custom block size
2023-02-09 08:06:24 +10:00
767c282c1d Addressing PR comments 2023-02-08 16:35:03 -05:00
6a24cdaa42 Merge pull request #6067 from SparkiDev/sp_int_fixup_5
SP int: tidy up ifdef
2023-02-08 13:50:50 -06:00
cefd55eb74 Fix for benchmarking shake with custom block size. Using ./benchmark -shake 1024 caused seg fault. 2023-02-08 11:25:53 -08:00
08c63d55dc Addressing PR comments 2023-02-08 13:18:13 -05:00
38f2f43705 Fix for calling 'mp_clear(tmp)' without having called 'mp_init(tmp)' 2023-02-08 13:08:12 -05:00
06d6f2d4b6 One more app for debugging 2023-02-08 11:25:11 -05:00
94c01d9f4e Add in a few more utilities that we need 2023-02-08 10:52:00 -05:00
7a6ed68f2d Ensure that i2d APIs for public keys gives appropriate data. 2023-02-08 09:54:28 -05:00
cc791a7a53 Spelling cleanup: configure.ac, ssl.c, ssl.h 2023-02-07 21:45:06 -06:00
3e82abd002 SP int: tidy up ifdef 2023-02-08 10:45:00 +10:00
62cfd8725a Disable latest OpenWrt test 2023-02-07 18:17:39 -05:00
1912aaf91b EC OpenSSL compat: validate point after setting
wolfSSL_EC_POINT_set_affine_coordinates_GFp wasn't checking the point is
valid for the curve. Added call to check point when setting.
Made check available for opensslextra.
Fixed test to have valid ordinates to set.
2023-02-07 18:17:39 -05:00
3e445b5ba0 SP int: sp_invmod_mont_ct check err before setting
Two places in sp_invmod_mont_ct were not checking err is set before
performing a new operation and setting err. Change to check error before
performing operation.
2023-02-07 18:17:39 -05:00
ee12a5f0c6 Merge pull request #6048 from SparkiDev/asn1_template_def
ASN: make template default for configure
2023-02-07 14:15:57 -08:00
299bee96d2 Merge pull request #6060 from SparkiDev/sp_int_fixes_4
SP int: fix sp_div_2 to use signed integer
2023-02-07 14:13:02 -08:00
9f5ffe6bd7 Merge pull request #6066 from SparkiDev/int_fast_mont_red_oob
integer.c: fast mod reduce fix
2023-02-07 14:12:13 -08:00
2539ba3f3d Add WOLFSSL_IP_ALT_NAME to --enable-curl; fix unused error in FindPsk 2023-02-07 15:51:09 -06:00
3ae8bac3b2 Merge pull request #6065 from SparkiDev/ec_point_cmp_jacobian
wolfSSL_EC_POINT_cmp: handle Jacobian ordinates
2023-02-07 10:04:37 -08:00
20ae076b80 integer.c: fast mod reduce fix
When using small stack, not enough memory uas being allocated in
fast_mp_montgomery_reduce().
Allocate the required space and memset all used memory.
2023-02-07 11:29:53 +10:00
92065b61b3 wolfSSL_EC_POINT_cmp: handle Jacobian ordinates
API support doesn't allow for a point to be in Jacobian ordinates.
wolfSSL_EC_POINT_add() has ordinates in Montgomery form.
When needed, compile with WOLFSSL_EC_POINT_CMP_JACOBIAN.
2023-02-07 11:02:50 +10:00
ca0731616f SP int: fix sp_div_2 to use signed integer
sp_div_2 no longer handled a->used of 0 and 1.
Rework to have have internal APIs that don't return errors and use them
where no error is expected.
2023-02-07 08:51:15 +10:00
bd155389e2 ASN: make template default for configure
When loading DH private key, create the public key if not found.
Failures fixed.
2023-02-07 08:49:46 +10:00
2448adf68b Merge pull request #6051 from philljj/zd15531
Fix wolfSSL_ASN1_INTEGER_to_BN for negative values
2023-02-06 12:46:21 -08:00
cc037447dd Merge pull request #6062 from bandi13/disableOpenWrtSnapshot
Disable latest OpenWrt test
2023-02-06 08:06:31 -08:00
dc08ecf287 Disable latest OpenWrt test 2023-02-06 11:03:41 -05:00
8a212ec351 Merge pull request #6042 from SparkiDev/ec_point_set
EC OpenSSL compat: validate point after setting
2023-02-06 07:14:19 -08:00
c9fefe660f EC OpenSSL compat: validate point after setting
wolfSSL_EC_POINT_set_affine_coordinates_GFp wasn't checking the point is
valid for the curve. Added call to check point when setting.
Made check available for opensslextra.
Fixed test to have valid ordinates to set.
2023-02-06 12:22:17 +10:00
a8c2a9aeab Merge pull request #6040 from SparkiDev/sp_invmod_mont_ct_err
SP int: sp_invmod_mont_ct check err before setting
2023-02-05 14:17:51 -08:00
3cdda2adf0 Merge pull request #6056 from ejohnstown/ssh-kdf-inlines
Build Fixes
2023-02-04 10:37:16 -08:00
a4ffe085a0 Merge pull request #6052 from rizlik/fix_ret_create
fix: propagate WOLFSSL_TICKET_RET_CREATE from DoDecryptTicket()
2023-02-03 17:32:26 -08:00
8e57ff08ab Build Fixes
./configure --enable-wolfssh --enable-cryptonly \
        --disable-asn --disable-rsa --disable-ecc
./configure --disable-asn --disable-rsa --disable-ecc --enable-psk
./configure --enable-cryptonly --disable-asn --disable-rsa --disable-ecc

1. Fails compiling the KDF file, can't find c32toa inline function.
2. In configure, move the check for ECC when ASN is disabled up to the
   other ASN checks. It also needs to be checked with cryptonly is
   disabled.
2023-02-03 16:09:27 -08:00
a9ffbae7af test: add test to check new ticket is created when resuming 2023-02-03 22:16:06 +00:00
646b363e49 Merge pull request #6053 from JacobBarthelmeh/freebsd
fix DTLS test case for when able to read peers close notify alert
2023-02-03 14:10:33 -08:00
c6018b837d Merge pull request #6050 from JacobBarthelmeh/time
fix warning if ltime is unsigned
2023-02-03 11:06:17 -08:00
f55f9bfd36 fix DTLS test case for when able to read peers close notify alert 2023-02-03 11:05:56 -08:00
29c884eafd Merge pull request #6045 from JacobBarthelmeh/PKCS7
add sequence around algo parameters with authenvelop
2023-02-03 10:29:19 -08:00
1027c0667a Merge pull request #6049 from SparkiDev/sp_int_used_size
SP int: make used and size fields unsigned
2023-02-03 09:38:40 -08:00
a2bf82397a fix: propagate WOLFSSL_TICKET_RET_CREATE from DoDecryptTicket() 2023-02-03 17:33:24 +00:00
f61dce8746 Fix wolfSSL_ASN1_INTEGER_to_BN for negative values
Added mp_setneg for ZD#15531.
2023-02-03 08:51:46 -06:00
d184a17644 fix warning if ltime is unsigned 2023-02-03 07:43:08 -07:00
3455e726f9 SP int: make used and size fields unsigned
used and size have no reason to be negative - change type.
Change code to match unsigned change. Mostly change variables to be
unsigned where possible.
integer.c: Only have mp_rand_prime available when needed and
mp_prime_is_prime_ex is available.
Fixes from regression testing.
2023-02-03 17:09:56 +10:00
ef266d7e0b Merge pull request #6047 from SparkiDev/refinc_ret_check
Ref counting: rework for static analysers
2023-02-02 18:46:34 -08:00
8ecf6f3381 Merge pull request #6046 from ejohnstown/srtp-marshal
SRTP Marshaling
2023-02-02 18:03:31 -08:00
f6da3a26ac Ref counting: rework for static analysers
When always reference counting APIs always return 0 don't check return
value for error.
Reference decrement set isZero to false on error.
2023-02-03 10:13:32 +10:00
ca999f932c SRTP Marshaling
1. Changed the loop over the SRTP setting bitfield when it is encoded
   for the TLS extension.
2023-02-02 14:51:12 -08:00
9e9315f480 add sequence around algo parameters with authenvelop 2023-02-02 10:54:38 -08:00
a4f55b01d6 Merge pull request #6041 from JacobBarthelmeh/seco
Fix to mask the argument for enc/dec flag used with GCM/CCM in CAAM+SECO build
2023-02-02 08:32:48 -08:00
447991a9c2 Merge pull request #5949 from JacobBarthelmeh/Testing
add pragram around sanity check for vcpkg build warning
2023-02-02 10:34:14 +10:00
55d43a46b8 SP int: sp_invmod_mont_ct check err before setting
Two places in sp_invmod_mont_ct were not checking err is set before
performing a new operation and setting err. Change to check error before
performing operation.
2023-02-02 08:45:45 +10:00
d76195c52a add fix GCM use with CAAM SECO 2023-02-01 14:42:39 -08:00
087e2dc22a Merge pull request #6037 from douzzer/20230131-fixes-evp-af-alg
20230131-fixes-evp-af-alg
2023-02-01 07:09:02 -08:00
a8a61fe6b7 evp.c: fix gating in wolfSSL_EVP_CIPHER_CTX_cleanup() to avoid switch-unreachable; also fix indentation. 2023-02-01 01:29:36 -06:00
38c057a084 fix resource leak (missing calls to wc_AesFree()) in wolfSSL_EVP_CIPHER_CTX_cleanup();
fix file descriptor leaks in AF_ALG code, and fix return codes (WC_AFALG_SOCK_E, not -1) in afalg_aes.c;

fixes for sanitizer-detected forbidden null pointer args in AfalgHashUpdate() and AfalgHashCopy();

fixes for resource leaks in api.c test_wolfSSL_AES_cbc_encrypt() (missing wc_AesFree()s);

fixes for resource leaks in test.c openssl_test() (missing wolfSSL_EVP_CIPHER_CTX_cleanup());

also some local fixes for bugprone-signed-char-misuse, readability-redundant-preprocessor, and clang-diagnostic-strict-prototypes, in src/pk.c and src/ssl.c.
2023-02-01 00:49:34 -06:00
462f76c1ff Merge pull request #6033 from dgarske/stm32_fixes
Fixes and cleanups for STM32
2023-01-31 12:13:13 -05:00
9defb9a356 Merge pull request #6035 from gojimmypi/PK_SSL_init_vars
Initialize `OPENSSL_ALL` local size / length / type vars
2023-01-31 09:09:18 -08:00
9b6e787071 Merge pull request #6034 from gojimmypi/Espressif_fix_6024
ESP32 SHA384 fixes
2023-01-31 09:08:54 -08:00
934d8e274f Merge pull request #5926 from SparkiDev/openssl_ec_api_rework
EC OpenSSL compat: rework EC API
2023-01-31 09:08:26 -08:00
b10adae48f Initialize OPENSSL_ALL local size / length / type vars 2023-01-30 17:30:56 -08:00
53d6e79f89 ESP32 SHA384 fixes 2023-01-30 16:58:57 -08:00
2d03a052e1 Fixes and cleanups for STM32:
* Fix for STM32 Hash peripherals (like on F437) with FIFO depth = 1.
* Cleanups for `XREALLOC` and new `WOLFSSL_NO_REALLOC` to force undef of `XREALLOC`.
* Change STM32 Cube to default to `NO_TLS_UART_TEST`.
2023-01-30 16:44:47 -08:00
7691cd4b45 EC OpenSSL compat: rework EC API
Reworked the implementations of the EC APIs including:
wolfSSL_EC_curve, wolfSSL_EC_METHOD, wolfSSL_EC_GROUP,
wolfSSL_EC_POINT, wolfSSL_EC_KEY, wolfSSL_ECDSA_SIG, wolfSSL_ECDSA and
wolfSSL_ECDH.

Added support for EC parameters to PEM decoding.

EccEnumToNID() moved out of wolfCrypt - it maps NIDs defined in
wolfssl/openssl/ec.h to those in wolfssl/wolfcrypt/ecc.h.
Moved wc_OBJ_sn2nid() out of wolfCrypt - implementation uses
EccEnumToNID().

Changed reference counding to use wolfSSL_Ref.

Added tests to api.c that increase coverage of EC APIs.
2023-01-31 10:19:57 +10:00
08538b69f3 Merge pull request #6016 from SparkiDev/sp_dh_agree_uinit
DH and SP: sp_DhExp_* called with uninitialized outLen
2023-01-30 15:56:46 -08:00
66532ed052 Merge pull request #6032 from anhu/braces
Closing and opening scope around case statement.
2023-01-30 15:08:02 -08:00
daa82e4653 Merge pull request #6030 from SparkiDev/sp_ecc_p256_arm64
SP Aarch64 ECC P256: mont reduce fix
2023-01-30 15:07:29 -08:00
7cdf5c7956 SP Aarch64 ECC P256: mont reduce fix
For Montgomery Reduction of P256: Don't set x10 and x11 to words of mu
<< 32. x11 is needed later and there are plenty of registers.
2023-01-30 11:14:12 -08:00
420f2f45c1 Merge pull request #6019 from SparkiDev/sp_arm64_cc
SP Aarch64: conditional changed in asm needs "cc"
2023-01-30 11:06:53 -08:00
242dcb0141 Closing and opening scope around case statement.
Related: ZD 15451
2023-01-30 13:45:03 -05:00
414c72adbc Fix workflow concurrency (#6031)
* First test of the consolidated workflows
Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-30 10:10:54 -08:00
d72ea6101f Merge pull request #6027 from SparkiDev/sp_int_div_small
SP int: div small static code analysis change
2023-01-30 10:34:05 -05:00
0e16d2919f Merge pull request #6022 from douzzer/20230127-fixes
20230127-fixes
2023-01-30 08:46:42 +10:00
08afe6a404 SP int: div small static code analysis change
_sp_div_small: Make it explicit as possible that we only want the bottom
digit of the product subtracted from the bottom word of t. Top digit is
unnecessary and more cycles used if calculated.
2023-01-30 08:40:45 +10:00
6e9d956a49 Merge pull request #6021 from kareem-wolfssl/zd15544
Fix for building with ASN template and `NO_ASN_TIME`
2023-01-27 18:19:19 -08:00
ef8afa98a4 Merge pull request #6017 from cconlon/se050_tls_fixes
Fix SE050 RSA public key loading and RSA/ECC SE050 TLS Compatibility
2023-01-27 15:29:21 -08:00
c70ca25282 Fix building NO_ASN_TIME with cert gen and OpenSSL Extra enabled. 2023-01-27 16:09:04 -07:00
d077c39f42 wolfcrypt/test/test.c: in aes_xts_128_test(), gate in-place test on !HAVE_FIPS || FIPS_VERSION_GE(5,3); in hpke_test(), gate tests on availability of relevant ECC curve, not just on relevant digest. 2023-01-27 16:49:46 -06:00
687bbeb712 wolfcrypt/src/port/arm/armv8-aes.c: harmonize arg validation in aarch64-armasm wc_AesCcm{En,De}crypt() with aes.c -- tolerate null in/out iff inSz==0. 2023-01-27 16:32:13 -06:00
f14c27f644 Fix SE050 RSA public key loading and RSA/ECC SE050 usage from TLS with WOLF_PRIVATE_KEY_ID 2023-01-27 14:28:47 -07:00
4542eb0df1 Fix NO_ASN_TIME support for ASN template, also fix expired certificate unit tests with NO_ASN_TIME defined. 2023-01-27 12:39:53 -07:00
f61938a882 SP Aarch64: conditional changed in asm needs "cc"
Add "cc" to asm that changes the conditional flags.
2023-01-27 16:33:06 +10:00
134d4cca67 DH and SP: sp_DhExp_* called with uninitialized outLen
Fix for GeneratePublicDh was not right in #6002.
sp_DhExp_* are called from multiple functions.
Sometimes outLen contains a value and sometimes not.
Check public key output size in GeneratePublicDh before calling SP.
2023-01-27 10:13:56 +10:00
06509021ff Merge pull request #6013 from douzzer/20230125-various-fixes
20230125-various-fixes
2023-01-26 15:10:18 -08:00
58c2fe1c40 Merge pull request #6011 from SparkiDev/xts_in_place_enc_fix
AES XTS: encrypt not handling in-place properly
2023-01-26 14:04:58 -08:00
5b36d5235c Always check to make sure 'sigCheckBuf' is within range 2023-01-26 16:23:39 -05:00
eaeff1e7c2 Avoid "use after free" error 2023-01-26 16:23:39 -05:00
3cfaa4c1ff Handle return value 2023-01-26 16:23:39 -05:00
f776371874 wolfcrypt/src/hpke.c: add PRIVATE_KEY_{UNLOCK,LOCK}() wrappers in wc_HpkeSealBase() and wc_HpkeOpenBase();
wolfcrypt/test/test.c: remove PRIVATE_KEY_{UNLOCK,LOCK}() wrappers from hpke_test_single(), and do a smallstack refactor.
2023-01-26 15:00:56 -06:00
84a5bb67f2 tests/api.c: in test_tls13_apis(), conditionalize expected return value of wolfSSL_CTX_set_max_early_data() on WOLFSSL_ERROR_CODE_OPENSSL (only affects !OPENSSL_EXTRA paths). 2023-01-26 14:56:50 -06:00
4b0e0b88fb configure.ac: restore CPPFLAGS and CFLAGS to list of iterated options rendered into options.h; delete stale .build_params when ENABLED_REPRODUCIBLE_BUILD. 2023-01-26 14:53:56 -06:00
8eacd3acc9 Merge pull request #6015 from dgarske/wolf_products
Add user_settings.h template for wolfTPM
2023-01-26 15:33:54 -05:00
10529e6199 Add user_settings.h template for wolfTPM 2023-01-26 10:40:59 -08:00
c3a5698799 configure.ac/Makefile.am:
add support for EXTRA_CPPFLAGS, EXTRA_CCASFLAGS, and EXTRA_LDFLAGS;

fix typo in setup for CFLAG_VISIBILITY;

lightly refactor handling of CPPFLAGS/AM_CPPFLAGS in handlers for --with-liboqs, --with-wnr, and --with-cavium;

refactor+enhance options.h generation to handle -U directives.
2023-01-25 23:45:21 -06:00
022d0e7c89 linuxkm/module_exports.c.template: include hpke.h if HAVE_HPKE. 2023-01-25 23:36:55 -06:00
78cc2c5c3e wolfcrypt/src/port/af_alg/afalg_aes.c: in wc_AesCbc{En,De}crypt(), handle WOLFSSL_AES_CBC_LENGTH_CHECKS as in wolfcrypt/aes.c; in wc_AesGcm{En,De}crypt(), truncate ivSz to WC_SYSTEM_AESGCM_IV if necessary. 2023-01-25 23:36:01 -06:00
8f2ae77513 wolfcrypt/test/test.c: add missing PRIVATE_KEY_UNLOCK()/PRIVATE_KEY_LOCK() in hpke_test_single(). 2023-01-25 23:32:55 -06:00
584411f21a Merge pull request #6012 from kareem-wolfssl/zd15524
Fix building FIPSv2 with WOLFSSL_ECDSA_SET_K defined.
2023-01-25 18:59:38 -08:00
8ecd906c23 Update open wrt test (#6010)
Adding in tests of various versions of OpenWrt. Also simplified the way to reproduce potential issues and added in breadcrumbs for debugging.

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-25 13:58:52 -08:00
c9125f9685 Fix building FIPSv2 with WOLFSSL_ECDSA_SET_K defined. 2023-01-25 14:49:05 -07:00
7e1aecfe4c Merge pull request #6001 from SparkiDev/dsa_sign_sig_size
DSA sign: use mp_to_unsigned_bin_len
2023-01-25 11:59:27 -08:00
becedd41c9 Merge pull request #6000 from SparkiDev/dsa_force_zero
DSA: Don't force zero MPs on memory allocation failure
2023-01-25 11:59:13 -08:00
214a6bd216 Merge pull request #6009 from douzzer/20230124-fix-HAVE_C___ATOMIC
20230124-fix-HAVE_C___ATOMIC
2023-01-25 15:34:30 +10:00
e9af0136b9 AES XTS: encrypt not handling in-place properly
Fix AES XTS in-place encrypt to work when ciphertext stealing.
2023-01-25 09:32:37 +10:00
b2c751a9ca wolfcrypt/src/asn.c: fix a maybe-uninitialized found by clang --enable-asn=template. 2023-01-24 14:00:22 -06:00
5e6005a1a3 m4/ax_atomic.m4: fix conflicting macro definition for HAVE_C___ATOMIC. 2023-01-24 12:08:35 -06:00
a21c3a3c89 Merge pull request #6005 from SparkiDev/ecc_fp_alloc_fail_oob_1
ECC FP_ECC: zeroize when value set
2023-01-24 07:57:53 -08:00
c9e1039a54 Merge pull request #6003 from SparkiDev/sp_math_ec_smul
EC scalar mult with SP Math: fix scalar length check
2023-01-24 07:54:02 -08:00
a5adfcd5ca ECC FP_ECC: zeroize when value set
accel_fp_mul was zeroizing an uninitialized MP - tk.
Add boolean, indicating to zeroize, that is set when a value is set.
2023-01-24 10:28:49 +10:00
e34027ec76 SP EC ASM: mod_mul_norm fix
Handle corner case of overflow in last 32-bit word.
2023-01-24 10:12:32 +10:00
4592f1a5b4 EC scalar mult with SP Math: fix scalar length check
The support curves in SP all have an order length the same as modulus
length. The scalar cannot be larger than the order and so fix the check.
2023-01-24 09:23:19 +10:00
4b8ab2550d Merge pull request #6004 from jpbland1/hpke-disable-harden
update hpke to not use rng with ecc when hardening is off
2023-01-23 15:09:30 -08:00
44ca98f5b3 add missing NULL checks and remove rng pointer when not needed 2023-01-23 16:03:58 -05:00
a24a1c8530 Merge pull request #5924 from SparkiDev/ref_cnt_update
Ref count: change to use wolfSSL_Ref
2023-01-23 08:33:37 -08:00
9c1d214a61 Merge pull request #6002 from SparkiDev/sp_dh_exp_check_outlen
SP DH Exp: check output length for minimum
2023-01-23 08:32:12 -08:00
a36276ca3a update hpke to not use rng with ecc when hardening is off 2023-01-23 11:27:23 -05:00
53dfcd00e2 Ref count: change to use wolfSSL_Ref
Data structures changed:
WOLFSSL_CERT_MANAGER, WOLFSSL_CTX, WOLFSSL_SESSION, WOLFSSL_X509,
WOLFSSL_X509, WOLFSSL_EVP_PKEY, WOLFSSL_BIO, WOLFSSL_X509_STORE
2023-01-23 16:29:12 +10:00
1c4e1f8871 SP DH Exp: check output length for minimum
For DH Exp function in SP, don't assume output length has the minimum
length.
2023-01-23 09:43:58 +10:00
90e24d8ba5 DSA sign: use mp_to_unsigned_bin_len
mp_to_unsigned_len checks length and front pads with zeros.

Return MP_VAL when length is too small in all implemenations.
Make TFM implementation check length.
Add test case.
2023-01-23 09:14:24 +10:00
ffe302025e DSA: Don't force zero MPs on memory allocation failure
When memory allocation fails, the MPs are not initialized and force zero
is using invalid values.
2023-01-23 08:33:09 +10:00
a40da56f11 Merge pull request #5996 from douzzer/20230120-fixes
20230120-fixes
2023-01-21 08:32:14 -08:00
aa776057ff fixes: shellcheck gripes on Docker/OpenWrt/runTests.sh; null pointer derefs and duplicate tests and assigns in src/tls.c and wolfcrypt/src/hpke.c found by cppcheck (nullPointerRedundantCheck, identicalInnerCondition, duplicateAssignExpression). 2023-01-21 00:51:57 -06:00
d711e4b9f8 Merge pull request #5995 from jpbland1/ech-no-recursion
stop ech from using a recursive function call
2023-01-20 23:47:22 -06:00
9d73c197e6 Move X509_V errors from enums to defines for HAProxy CLI (#5901)
* Move X509_V errors to openssl/ssl.h

* Have X509_V define errors in wolfssl/ssl.h

* Refactor X509_V errors

* Add wolfSSL_SESSION_set1_id_*

* Fix overlong line
2023-01-20 17:50:26 -08:00
b9a544920d Add open wrt test (#5985)
* First test

* Don't forget to run autogen.sh!

* Add tools needed by automake

* Try additional platforms

* Add in qemu for other platforms

* No real support for arm containers

* Fix indentation

* Simplify container build with a testing script

* Simpler names for actions

* No need to distribute OpenWRT test files

* Better list to put ignore files onto

* Create an 'ignore_files' list after all

* Add in some documentation of how OpenWRT tests work

* Fix up naming of OpenWrt

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-20 16:59:36 -08:00
6206ad320c Merge pull request #5992 from tim-weller-wolfssl/zd15423-accepts-large-ivs
Update AES-GCM stream decryption to allow long IVs (ZenDesk #15423)
2023-01-20 16:10:13 -08:00
d28bd08093 Merge pull request #5994 from bandi13/noAutoCancelActions
Don't auto-cancel GitHub Workflows
2023-01-20 16:09:56 -08:00
d14d29e32a stop ech from using a recursive function call
update bad return value for when retry_configs is returned, add locks around hkdf functions for private key use
2023-01-20 18:37:19 -05:00
7e87623973 Don't auto-cancel GitHub Workflows 2023-01-20 16:17:20 -05:00
cf9b865e33 Update AES-GCM stream decryption setup to allow long IV values (already allowed by encryption APIs) 2023-01-20 20:35:39 +00:00
8c3cad3e95 Merge pull request #5984 from embhorn/zd15493
Fix Cmake to exclude libm when DH is not enabled
2023-01-20 11:21:09 -08:00
8d89d4a168 Merge pull request #5927 from SparkiDev/sp_math_clz
SP math: use count leading zero instruction
2023-01-20 10:33:18 -08:00
c1e0115092 Merge pull request #5993 from anhu/quic_doc_switcharoo
Move the wolfSSL Configuration section higher in QUIC.md
2023-01-20 09:32:40 -08:00
9be01633d1 Move the wolfSSL Configuration section higher in QUIC.md because it is the first step. 2023-01-20 09:49:18 -05:00
9f7e82a081 Add WOLFSSL_DH_CONST option to Cmake 2023-01-20 08:42:48 -06:00
9adea94274 SP math: use count leading zero instruction
To speed up counting bits, use the instruction that counts leading zeros
in a word.

Fix _sp_div_3 to use registers with 0 in them for multiplication result.
2023-01-20 11:56:07 +10:00
cfe92aa330 Merge pull request #5983 from SparkiDev/sp_int_read_radix_neg
SP int negative: handle negative character properly with read radix
2023-01-19 17:51:07 -08:00
e72ec4e876 Merge pull request #5976 from SparkiDev/eccsi_hash_check
ECCSI: hash function must have output size as curve size
2023-01-19 17:50:44 -08:00
f0c9f5f9f0 Multi compiler test (#5991)
* First attempt with GCC only

* Make the test run on every push temporarily

Also clean up the description of the workflow

* Fix invalid job name

* Missing hunks added

* Try out matrix actions

* Fix missing 'runs-on'

* Only needs to run on Ubuntu

* Use local installations of gcc/clang instead of containers

* Explicitly list out compilers to test

* Clean up names and concurrency group

* Only need to run on PRs and important branches

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-19 14:56:16 -08:00
f6ecc6ce4c Merge pull request #5990 from philljj/gcmstream_kcapi_errmsg
Don't allow aesgcm-stream option with kcapi
2023-01-19 12:00:36 -08:00
02178b9013 Merge pull request #5988 from bandi13/parallelOSBuilds
Parallel os builds
2023-01-19 09:59:07 -08:00
fc19aed8c8 Merge pull request #5623 from dgarske/hpke
Adds support for TLS v1.3 Encrypted Client Hello (ECH) and HPKE (Hybrid Public Key Encryption)
2023-01-19 10:03:28 -07:00
04383bfb34 Don't allow aesgcm-stream option with kcapi 2023-01-19 10:54:48 -06:00
f0212fef3e Merge pull request #5986 from bandi13/fixNonStandarBaseImages
Fix when a base image leaves non-root user
2023-01-19 07:55:19 -08:00
2276fca0f4 Cancel runs on subsequent push to PR but not to branches 2023-01-19 10:12:08 -05:00
d955768744 Only run on important branches 2023-01-19 10:03:26 -05:00
ac8951c4e2 Fix typo 2023-01-19 09:54:20 -05:00
4d5dbe9b90 Give a better name to the workflow 2023-01-19 09:44:38 -05:00
b1f423be38 Kill off previous run if another commit happens 2023-01-19 09:41:18 -05:00
cb601bdf64 Combine ubuntu and macos tests to ensure the same thing is run 2023-01-19 09:33:26 -05:00
e1d9b37f84 Merge pull request #5932 from julek-wolfssl/zd15346
ssl->suites: use ssl->ctx->suites when possible
2023-01-18 15:20:21 -08:00
283ebd5afe Remove base job 2023-01-18 17:17:15 -05:00
bb88c8fbfa Add in 'runs-on' 2023-01-18 17:13:08 -05:00
caa7c9e8b5 One more missing keyword 2023-01-18 17:07:36 -05:00
0d73074718 Missing keyword 2023-01-18 17:00:47 -05:00
ffee4edcf5 Fix dependency command 2023-01-18 16:22:06 -05:00
6ac09b5c66 Fix spacing 2023-01-18 16:12:54 -05:00
cd0b3b4eb9 Separate out steps to individual jobs 2023-01-18 16:10:58 -05:00
6b6ad38e4f Adds support for TLS v1.3 Encrypted Client Hello (ECH) draft-ietf-tls-esni) and HPKE (Hybrid Public Key Encryption) RFC9180. 2023-01-18 11:37:27 -08:00
41c35b1249 Fix line length and whitespace issues. Fix macro argument missing parentheses. 2023-01-18 11:10:19 -08:00
50cb3a7b8c Address code review 2023-01-18 09:55:33 -08:00
0e662dea6e TLSX_SetSignatureAlgorithms: free sa when TLSX_Push fails 2023-01-18 09:55:33 -08:00
281bb32edf DtlsMsgCreateFragBucket: heap param might be unused 2023-01-18 09:55:33 -08:00
a58e83847e Don't allocate Suites object on renegotiation 2023-01-18 09:55:33 -08:00
2f63fdc6ce Allocate CTX->suites in InitSSL when not already allocated 2023-01-18 09:55:33 -08:00
1cb4615435 Add SCR reconnect test 2023-01-18 09:55:32 -08:00
5b8026899b Refactor SigAlgs to use a custom struct that can override ssl->suites 2023-01-18 09:55:32 -08:00
e431688ca6 ssl->suites: use ssl->ctx->suites when possible
- Allocate ssl->suites when necessary for the WOLFSSL object to have its own instance. Use AllocateSuites() to allocate the object.
- Move cipher negotiation options from Suites into Options

ZD15346
2023-01-18 09:55:32 -08:00
68520e3f0b Fix Cmake to exclude libm when DH is not enabled 2023-01-17 16:28:36 -06:00
11ea6a10e8 ECCSI: hash function must have output size as curve size 2023-01-18 03:54:17 +10:00
7120ae1961 Merge pull request #5978 from gojimmypi/Visual_Studio_Line_Endings
CRLF line endings, trailing spaces for C# Wrapper Projects  (no code change)
2023-01-17 10:38:38 -07:00
cdf2036454 SP int negative: handle negative character properly with read radix
SP int when compiled with negative was setting sign too early.
Get sign and set after absolute value read in.
2023-01-18 03:38:23 +10:00
ea80e9e0ea Add documentation for the CSharp wrapper. 2023-01-16 11:13:25 -08:00
e90ba67a4c Fix when a base image leaves non-root user 2023-01-16 13:32:10 -05:00
b15bc3d236 Merge pull request #5977 from dgarske/kcapi_opensslextra
Fixes for building KCAPI with opensslextra enabled
2023-01-17 02:13:50 +10:00
b01e42a96c Merge pull request #5970 from ejohnstown/dtls-seq
DTLS Handshake Sequence
2023-01-16 07:39:53 -08:00
08a988f557 Merge pull request #5973 from philljj/zd15445
EVP_EncryptUpdate should update outl on empty input
2023-01-15 13:45:19 -08:00
4c35a22e0a Cleanup input checks. 2023-01-14 23:04:29 -06:00
acf761ea07 Merge pull request #5979 from SparkiDev/sp_int_arm_asm_cc
SP int ARM: Fix div word asm to indicate flags changed
2023-01-14 11:13:23 -08:00
bf3673c0b2 Merge pull request #5974 from SparkiDev/aessiv_uninit_aes
AES SIV: Allocate memory for AES as late as possbile
2023-01-14 11:13:09 -08:00
e6ef66a777 SP int ARM: Fix div word asm to indicate flags changed
"cc" needs to be set in assembly code as a modified register for div
word for ARM64 and ARM32.
2023-01-15 02:05:34 +10:00
2d8c19ac42 Merge pull request #5972 from SparkiDev/sp_int_8bit_to_bin_len
SP int: fix 8-bit words and to binary length
2023-01-13 16:55:53 -08:00
fec4fe6095 Fixes for building KCAPI with opensslextra enabled. 2023-01-13 16:33:55 -08:00
91d2ff1fe9 no code change; CRLF line endings, trailing spaces 2023-01-13 16:29:19 -08:00
46ace19111 Merge pull request #5975 from bandi13/cleanupContainers
No need to leave container artifacts around
2023-01-13 15:03:43 -08:00
e6ed44322a Merge pull request #5967 from dgarske/bench_help
Fixes for benchmark help `-alg` list and block format
2023-01-14 05:55:04 +10:00
0a2ee6c530 AES SIV: Allocate memory for AES as late as possbile
AES will be initialized if memory allocation succeeded.
2023-01-14 05:41:24 +10:00
4f4819bd19 EVP_EncryptUpdate should update outl on empty input 2023-01-13 11:32:15 -06:00
658d647339 SP int: fix 8-bit words and to binary length 2023-01-14 03:10:50 +10:00
af379f0a0f DTLS Handshake Sequence
The DTLS server needs to save the message_seq number of the client
hello for use in both the hello verify request in the stateless start
and for the server hello. Move the stashing of the value earlier in
DoClientHello(). (Issue #5224)
2023-01-12 20:43:05 -08:00
5311a8e673 Merge pull request #5969 from SparkiDev/sp_int_to_bin_len
SP int: fail when buffer writing to is too small for number
2023-01-12 13:44:39 -08:00
3151a5b12a Merge pull request #5956 from gojimmypi/Espressif_S3_wolfcrypt_random
interim ESP32-S3 changes & diagnostics
2023-01-12 11:34:38 -08:00
48a136a932 Fix for MB vs MiB printing. The base2 option was printing type backwards (base2=1 = 1024 bytes and base2=0 or -base10 means 1000 bytes). 2023-01-12 11:09:20 -08:00
c22b89e935 SP int: fail when buffer writing to is too small for number 2023-01-13 02:12:03 +10:00
24f89337f6 Espressif examples default partition params: large app 2023-01-11 17:46:44 -08:00
5e1c7c3db2 Fix for benchmark help broken in PR #5871 2023-01-11 15:05:07 -08:00
50820b64fb update Espressif include.am, add sdkconfig.defaults 2023-01-11 12:26:19 -08:00
0c263a4098 tidy up ESP32S3 detection. known-good sdkconfig defaults 2023-01-09 19:59:15 -08:00
b2d8b1c2fd Merge pull request #5954 from JacobBarthelmeh/Compatibility-Layer
very basic support for public key types in cipher list string with '+'
2023-01-09 15:46:50 -08:00
369c565368 No need to leave container artifacts around 2023-01-06 15:06:30 -05:00
86aa3cc836 Merge pull request #5942 from bandi13/evpaesccm
Evpaesccm
2023-01-06 11:25:37 -08:00
9c2bbc2080 Merge pull request #5959 from douzzer/20230105-wolfsentry-fixes
20230105-wolfsentry-fixes
2023-01-06 11:04:16 -07:00
26f9047079 Merge pull request #5958 from tatowicz/siphash-fix
Add fix for siphash cache and tests
2023-01-06 11:02:38 -07:00
99a489dec3 improve test and handling of public key type cipher suite string 2023-01-06 09:53:51 -08:00
8436f82540 Adding in @ejohnstown's suggested patch for line lengths 2023-01-06 12:23:30 -05:00
d44130d807 src/ssl.c: revert 2c2740d0dc, as it duplicates optimizer functionality, and produces bugprone-sizeof-expression on clang-tidy and sizeofwithnumericparameter on cppcheck. 2023-01-05 18:40:51 -06:00
0b0b980784 fix an oversight in wolfSentry integration in examples/{client,server}. 2023-01-05 17:59:10 -06:00
a08c853799 Add fix for siphash cache and tests 2023-01-05 16:56:07 -06:00
10c324e9ad Merge pull request #5953 from anhu/wolfSSL_CertManagerLoadCABuffer_ex
Add wolfSSL_CertManagerLoadCABuffer_ex()
2023-01-05 15:20:58 -07:00
ab33788cdb treat ECDHE,RSA cipher suite list as mixed TLS 1.3 and pre TLS 1.3 2023-01-05 13:48:34 -08:00
636f4fc929 Merge pull request #5957 from douzzer/20230104-fixes
20230104-fixes
2023-01-05 13:58:21 -07:00
5de817b0c1 Add wolfSSL_CertManagerLoadCABuffer_ex()
Also add unit tests.
2023-01-05 15:34:13 -05:00
404930036c Merge pull request #5951 from tim-weller-wolfssl/zd14935-pointless-comparison
Avoid pointless-comparison warnings (Pa084) with IAR for ARM tools
2023-01-05 08:20:02 -08:00
43265669c6 fix warnings around clang-diagnostic-embedded-directive and readability-uppercase-literal-suffix; update wolfSentry integration for upcoming release 0.8.0. 2023-01-05 00:13:17 -06:00
124c04b01a A bit more consistent naming for structure variables 2023-01-04 21:04:58 -05:00
25ce553e8f Shorten some line lengths 2023-01-04 20:32:04 -05:00
51f3386d60 Shorten variable names 2023-01-04 20:29:14 -05:00
d5a7b56332 sp pragram around sanity check for vcpkg build warning 2023-01-04 16:19:27 -08:00
b04d6ed56b interim ESP32-S3 changes & diagnostics 2023-01-04 15:49:35 -08:00
2c2740d0dc Update comparison of WOLFSSL_BN_ULONG value to MP_MASK to include check for potential type size differences which can lead to pointless-comparison warnings with IAR tools 2023-01-04 17:35:46 -06:00
af2c5cf18b Remove the existence of WOLFSSL_AESCCM_STREAM 2023-01-04 14:17:36 -05:00
a3e085f204 very basic support for public key types in cipher list string with '+' 2023-01-04 10:49:18 -08:00
adb406e1ee Adding some developer utilities (#5941)
* Adding some developer utilities for Docker.
* Add support for `make test`
* Don't need to run the testsuite specifically
* Share .gitconfig and ssh keys with the container

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-04 08:48:24 -08:00
e42f6dbe4b Merge pull request #5939 from dgarske/20221228_cleanups
Fixes for some build configuration variations
2023-01-04 08:32:20 -07:00
0ec0c05eda Change variable names to protect the innocent 2023-01-04 10:23:42 -05:00
c21f5f3757 Fix unused variable error 2023-01-04 09:48:28 -05:00
8d59f61b9b Fix test_wolfSSL_dtls_stateless_resume test case 2023-01-04 13:04:45 +01:00
114471d6cf add pragram around sanity check for vcpkg build warning 2023-01-03 15:23:43 -08:00
914d3114de Addressing PR comments
TODO should not have been in the changes
indentation of #ifdef moved in line with the 'if' conditional
2023-01-03 14:55:07 -05:00
023db01aca * Fixed some build configuration variations.
* Fixed `PEM_BUFSIZE` macro redefined when building with coexist.
* Updated the `user_settings_all.h` and `user_settings_wolfboot_keytools.h` to include latest options.
* Improved API unit test error case checking where `TEST_RES_CHECK` is not used.
* Changed `TEST_SKIPPED` to unique value.
* Added CI tests for enable-all, small stack, and user setting templates.
2023-01-03 10:59:59 -08:00
4f8edb312b Add compilation to espressif (#5947)
* Refactor GitHub actions and add ESP tests.
* Add script for building all examples for ESP.
* Fixes for ESP-IDF v5.0
* Consolidating Espressif files into a single include.am
Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-03 09:50:38 -08:00
bdcf6928a2 Merge pull request #5945 from JacobBarthelmeh/copyright
update copyright to 2023
2023-01-03 09:29:39 -08:00
4edae51095 Fix StartTLS_Init (#5907)
* Fix StartTLS_Init (contribution by Yota Nagaya)
2023-01-03 09:28:23 -08:00
dc6ffc790d Need declaration of 'tmp' variable 2023-01-02 14:36:50 -05:00
ec9697999e Use minimum size for NONCE 2023-01-02 08:51:13 -05:00
9dcc48c8f7 update copyright to 2023 2022-12-30 17:12:11 -07:00
df3c11ad82 Don't define a new default NONCE size, instead use existing MAX 2022-12-30 16:02:30 -05:00
f734f5037d Add similar trick to GCM routines so our code is more uniform 2022-12-30 13:11:26 -05:00
a00abb0f88 Fix compilation issue when AESCCM is not enabled 2022-12-30 13:10:24 -05:00
c925223822 Merge pull request #5943 from JacobBarthelmeh/sessionExport 2022-12-30 09:58:47 -08:00
b43852363e Merge pull request #5944 from JacobBarthelmeh/Testing
fix for older selftest that returns bad padding instead of salt len e…
2022-12-30 08:37:02 -08:00
4a23edd5fb fix for older selftest that returns bad padding instead of salt len error 2022-12-30 06:31:09 -08:00
aab12fc14b check DTLS method for test case 2022-12-29 15:49:46 -07:00
1132579dd1 Add in zero length test 2022-12-29 17:02:43 -05:00
1192d41f0e First successful implementation of EVP_aes_*_ccm 2022-12-29 17:02:43 -05:00
27b5ac421e Use the actual size of the structure 2022-12-29 17:02:43 -05:00
251b89631e Merge pull request #5940 from anhu/bench_ext_kyber
don't call external implemenation of kyber from benchmark anymore.
2022-12-29 11:00:59 -08:00
0787ab1131 don't call external implemenation of kyber from benchmark anymore. 2022-12-29 11:48:54 -05:00
5e11fb19a4 Merge pull request #5937 from anhu/blinding_on
Change comment to reflect that RSA blind is enabled by default
2022-12-28 12:56:58 -08:00
5c0abfd7ad Merge pull request #5936 from embhorn/zd15400
Fix unguarded XFPRINTF calls
2022-12-28 12:47:19 -08:00
004705b38f Fix unguarded XFPRINTF calls 2022-12-28 12:23:40 -06:00
f9ccdd7ffc Change comment to reflect that RSA blind is enabled by default 2022-12-28 13:09:59 -05:00
aadce3af9c Merge pull request #5930 from miyazakh/subscript_has_char 2022-12-28 10:18:43 -07:00
9b513fd6bf Merge pull request #5934 from cconlon/jpdocfix
Remove incomplete doxygen in JP asn_public.h
2022-12-28 08:07:20 -07:00
67fe575896 Merge pull request #5933 from anhu/purge_dilithium_aes
Purge the AES variant of Dilithium
2022-12-27 16:44:52 -08:00
a2b6c5dd1e remove incomplete doxygen in JP asn_public.h 2022-12-27 14:46:38 -07:00
b3e99348cd Purge the AES variant of Dilithium 2022-12-27 14:37:47 -05:00
19033d82fe Merge pull request #5931 from douzzer/20221226-minor-fixes
20221226-minor-fixes
2022-12-27 08:40:17 -08:00
43f0830ad7 Merge pull request #5923 from JacobBarthelmeh/release
add quality of release statement
2022-12-27 08:39:41 -08:00
11e44e746b Merge pull request #5928 from dgarske/zd15388
Fixes SP math all build issue with small-stack and no hardening
2022-12-27 09:23:53 -07:00
cb1b20dc8e linuxkm/: accomodate refactoring in kernel 6.2+ of cpu_number to be an element of the pcpu_hot`structure. 2022-12-26 21:03:04 -06:00
425d0b72c3 wolfcrypt/benchmark/benchmark.c: fix bench_stats_sym_finish() in GENERATE_MACHINE_PARSEABLE_REPORT mode to properly render "bytes_total" column in bytes, not the unit selected by WOLFSSL_BENCHMARK_FIXED_UNITS_*. 2022-12-26 20:25:05 -06:00
9ac790a8ce Docker/run.sh: mollify shellcheck, and prevent splitting on whitespace passing args through to configure. 2022-12-26 20:18:43 -06:00
684646c8b9 fix shadows min and subscript by i486-netbsd-gcc 2022-12-25 07:20:04 +09:00
dee01cfe9b Fixes SP math all build issue with small-stack and no hardening. Fixes ZD15388 2022-12-23 13:22:40 -08:00
d686f0a5de Merge pull request #5925 from SparkiDev/sp_mod_3_perf
SP math: rework mod 3
2022-12-22 17:55:28 -08:00
18e04d184e Merge pull request #5895 from bandi13/addDocker
Add docker
2022-12-22 17:19:43 -08:00
60037ead70 Merge pull request #5871 from gojimmypi/BenchmarkEnhancements
Benchmark Enhancements and Code Cleanup
2022-12-22 17:18:47 -08:00
49d23cf60a Merge pull request #5913 from douzzer/20221219-no-sha-1-all-crypto
20221219-no-sha-1-all-crypto
2022-12-22 17:02:58 -08:00
1b18da7e87 Merge pull request #5920 from jpbland1/unrecognized-http-header
remove http header length check for CRL verification
2022-12-22 17:01:54 -08:00
5c89719c51 Merge pull request #5916 from julek-wolfssl/dtls-srtp-keying-material
DTLS-SRTP: use wolfSSL_export_keying_material instead of wc_PRF_TLS
2022-12-22 17:01:37 -08:00
135b9f0566 Merge pull request #5915 from julek-wolfssl/dtls-remove-realloc-dep
DtlsMsgCombineFragBuckets: Remove realloc dependency
2022-12-22 17:01:31 -08:00
62e3835b0e Merge pull request #5911 from julek-wolfssl/DtlsMsgPoolSend-sendSz
DtlsMsgPoolSend: Use correct sendSz
2022-12-22 17:01:19 -08:00
29c46ce867 Merge pull request #5902 from bandi13/ESP-IDF_fixes
Esp idf v5 fixes
2022-12-22 17:01:09 -08:00
162dca87c3 SP math: rework mod 3
Simplification when only calculating mod and modulus is 3.
2^(2*n) * x mod 3 = x mod 3.
Add all digits and calculate mod 3 of sum.
2022-12-23 09:21:13 +10:00
8e0f0d611f Merge pull request #5914 from kojo1/ja
add Doxygen cmac.h, quic.h
2022-12-22 15:20:26 -07:00
9ce79c4de8 Merge pull request #5921 from cconlon/libsuffix 2022-12-22 11:37:28 -08:00
50aeb2f79e add quality of release statement 2022-12-22 10:42:18 -07:00
a20426b2b0 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into BenchmarkEnhancements 2022-12-22 08:47:25 -08:00
709461e4aa Merge pull request #5922 from JacobBarthelmeh/Testing
add crl test file to dist
2022-12-21 16:30:33 -08:00
db03994899 add crl test file to dist 2022-12-21 15:05:30 -07:00
9a7ff8773b add --with-libsuffix support, append suffix to library artifact name 2022-12-21 13:31:07 -07:00
b36d585335 remove http header length check for CRL verification 2022-12-21 13:01:58 -05:00
4fbd4fd36a Merge pull request #5917 from JacobBarthelmeh/release
prepare for release 5.5.4
2022-12-20 16:15:51 -08:00
509ad07dbd Merge pull request #5918 from kareem-wolfssl/zd15369
Fix length being passed into GetFormattedTime.
2022-12-20 17:12:13 -07:00
eebe04b181 Fix length being passed into GetFormattedTime. 2022-12-20 15:42:02 -07:00
cca63a465d prepare for release 5.5.4 2022-12-20 14:19:59 -07:00
455e76873c peer review fixes re: minor fixes to accommodate --disable-sha in combination with --enable-all-crypto. 2022-12-20 10:43:33 -06:00
6a8be960ba DTLS-SRTP: use wolfSSL_export_keying_material instead of wc_PRF_TLS 2022-12-20 16:42:28 +01:00
2fe6555fcf DtlsMsgCombineFragBuckets: Remove realloc dependency 2022-12-20 13:53:03 +01:00
5ff8bec975 add Doxygen cmac.h, quic.h 2022-12-20 17:44:52 +09:00
91869f6028 minor fixes to accommodate --disable-sha in combination with --enable-all-crypto. 2022-12-20 00:42:05 -06:00
6f7d8d287d Merge pull request #5905 from JacobBarthelmeh/cert_update
end of year certificate update
2022-12-19 09:52:53 -08:00
bc15f67d8d Fixing indentation on preprocessor commands 2022-12-19 11:13:58 -05:00
11fcb790b1 Merge branch 'wolfSSL:master' into ESP-IDF_fixes 2022-12-19 11:11:55 -05:00
53b2be06d3 DtlsMsgPoolSend: Use correct sendSz
pool->sz is the size without the record header. The handshake header is present already.

Reproducible with
  ./udp_proxy -p 12345 -s 127.0.0.1:11111 -x 1:3 -S server
or
  ./udp_proxy -p 12345 -s 127.0.0.1:11111 -x 1:3 -S server
and
  ./examples/server/server -l ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305 -u -i
  ./examples/client/client -l ECDHE-RSA-AES256-GCM-SHA384 -u -R -p 12345 -i
2022-12-19 17:07:37 +01:00
64a7d511b8 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into BenchmarkEnhancements 2022-12-16 14:00:16 -08:00
3d1775320b Merge pull request #5900 from icing/tls12-no-tickets
WOLFSSL_OP_NO_TICKET fix for TLSv1.2
2022-12-16 14:42:50 -07:00
91f8b5e58e Merge pull request #5903 from douzzer/20221216-fix-benchmark
20221216-fix-benchmark
2022-12-16 14:35:12 -07:00
c6aaa1310e end of year certificate update 2022-12-16 13:32:37 -08:00
b90c07900b Merge pull request #5904 from anhu/FIPS_fix
ENABLED_FIPS doesn't hold the version; FIPS_VERSION does.
2022-12-16 14:16:47 -07:00
8d372b2c6f Start an FAQ in the README.md 2022-12-16 15:45:29 -05:00
c370529975 manual merge with upstream 2022-12-16 11:28:04 -08:00
24d7f85016 ENABLED_FIPS doesn't hold the version; FIPS_VERSION does.
Found with:

./configure --enable-engine=fips=v2
2022-12-16 14:06:43 -05:00
04b31518ba wolfcrypt/benchmark/benchmark.c: fix calculation of outer iteration constant in bench_aesecb_internal(); fix .c.h clash in argument name ("useDevId" vs "useDeviceID"). 2022-12-16 12:55:37 -06:00
d0f0d66b80 Add in changes to wolfssl_server 2022-12-16 11:55:53 -05:00
814ad9fc38 Better fixes 2022-12-16 11:55:28 -05:00
b9e69f1795 Fixes for wolfssl_client example 2022-12-16 10:23:09 -05:00
5c21e40bce Merge pull request #5899 from SparkiDev/regression_fixes_5
Fixes from regression testing.
2022-12-16 06:54:26 -08:00
07dcd5270e Merge pull request #5898 from cconlon/androidSystemCa
Add Android CA certs path for wolfSSL_CTX_load_system_CA_certs()
2022-12-16 06:12:24 -08:00
9d0b16097e Fix builds without session tickets. 2022-12-16 09:40:51 +01:00
dccabc60a5 Disabling TLSv1.2 session tickets when WOLFSSL_OP_NO_TICKET is being set.
There seems to have been a misunderstanding that WOLFSSL_OP_NO_TICKET would only disable tickets
for TLS version lower than 1.2. But it includes 1.2 as well.
2022-12-16 09:29:44 +01:00
45e3c721b3 Fixes from regression testing.
Fix random prime generation for big endian to set low bits after
shifting top word.
Allow SP_MATH to be built without RSA, DH and ECC - needed for PKCS#12.
Add DH 2048 bit parameters to cert_test.c for test.c when NO_ASN and
WOLFSSL_SP_MATH.
2022-12-16 14:43:29 +10:00
502fd843ec Merge pull request #5897 from gojimmypi/gojimmypi-initialize-resp_length
initialize resp_length = 0 in tls.c
2022-12-15 17:23:48 -08:00
f9bd8f76de add Android system CA certs path for to wolfSSL_CTX_load_system_CA_certs() usage 2022-12-15 16:39:48 -07:00
4434d898a1 Merge pull request #5894 from kaleb-himes/fix-leak
Fix a quick leak in the test apps
2022-12-16 08:04:50 +10:00
aa784397b0 Merge pull request #5896 from cconlon/atexitOSX
AC_CHECK_DECLS for atexit needs stdlib.h on OSX
2022-12-15 15:00:29 -07:00
b823da9bb9 Fix build issues with the latest ESP-IDF 2022-12-15 16:11:39 -05:00
e0c9586b79 initialize resp_length = 0 in tls.c 2022-12-15 12:51:33 -08:00
3ba8c918f2 Use standard naming 2022-12-15 15:30:22 -05:00
6a2673f5f7 Adding Docker files to distribution 2022-12-15 15:11:14 -05:00
995e3bd009 Allow for existing group 2022-12-15 14:30:13 -05:00
b23db16ff8 Refactor the double-free fix 2022-12-15 12:21:08 -07:00
668efea464 Merge pull request #5884 from icing/ssl-set-ssl-ctx
Fix wolfSSL_set_SSL_CTX() to be usable during handshake.
2022-12-15 10:59:54 -08:00
8c54bd0fb1 check for atexit needs stdlib.h on OSX, fixes configure sed error 2022-12-15 11:23:37 -07:00
908744dc0f Merge pull request #5646 from JacobBarthelmeh/caam
benchmark devid changes, CCM with SECO fix, set IV on AES import into SECO
2022-12-15 10:01:01 -08:00
c1cf8a8f34 Add in README.md 2022-12-15 12:54:21 -05:00
d9ca5f6d3a Merge pull request #5893 from kaleb-himes/mtu-with-static-mem
Add alt case for unsupported static memory API
2022-12-15 09:22:21 -08:00
9c135e59dc Script can run from an arbitrary folder 2022-12-15 12:22:05 -05:00
d46813953d Merge pull request #5892 from tatowicz/decodealtnames-fuzz-fix
Add Overflow check to DecodeAltNames input buffer access
2022-12-15 09:21:37 -08:00
64d39dbd74 Cleaner base image 2022-12-15 12:10:48 -05:00
c1ad3457f3 Run as non-root local user 2022-12-15 12:10:25 -05:00
be1b3ec007 Fix issue with multiple command arguments 2022-12-15 11:25:43 -05:00
46c47e4adc Fix a quick leak in the test apps
Fix a double-free scenario also
2022-12-15 09:13:45 -07:00
78fd5d7dbc Fix wolfSSL_set_SSL_CTX() to be usable during handshake.
This method requires some explanation. Its sibling is
  int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
which re-inits the WOLFSSL* with all settings in the new CTX.
That one is the right one to use *before* a handshake is started.

This method was added by OpenSSL to be used *during* the handshake, e.g.
when a server inspects the SNI in a ClientHello callback and
decides which set of certificates to use.

Since, at the time the SNI callback is run, some decisions on
Extensions or the ServerHello might already have been taken, this
method is very restricted in what it does:
 - changing the server certificate(s)
 - changing the server id for session handling
and everything else in WOLFSSL* needs to remain untouched.
2022-12-15 09:33:01 +01:00
d8c9a5aa17 return benchmark to auto-scale units by default 2022-12-14 20:45:44 -08:00
8831fbd22e fix csv math, units/sec, PQ cycle header 2022-12-14 20:27:15 -08:00
8924487f27 fix warning for builds using cmac and not devID 2022-12-14 15:38:08 -08:00
89c993eff3 fix AES-CCM enc/dec for SECO (passes nonce directly) 2022-12-14 15:20:03 -08:00
b79879d106 fix setting IV when importing AES key into SECO 2022-12-14 15:20:03 -08:00
9f77210b0b update benchmark for devID builds 2022-12-14 15:20:03 -08:00
ed17524793 Add alt case for unsupported static memory API 2022-12-14 16:02:35 -07:00
a3f3c76faa Merge pull request #5890 from anhu/fix_iv_size
Fix the wrong IV size.
2022-12-15 08:43:25 +10:00
3d8f25ab7d Merge pull request #5430 from dgarske/sniffer_multithread
Support for multi-threaded sniffer
2022-12-15 08:18:49 +10:00
3fd2292d11 Merge pull request #5889 from anhu/dtls13_pqtests
Kyber with DTLS 1.3 tests
2022-12-14 13:20:32 -08:00
370e0ce0f4 Add formatting fixes 2022-12-14 13:54:03 -06:00
c5ca20fe43 New files so add them to include.am 2022-12-14 13:28:20 -05:00
d55ef14cc7 First crack at creating a common Docker environment 2022-12-14 13:17:22 -05:00
8580ac0377 Add Overflow check to DecodeAltNames input buffer access 2022-12-14 12:08:19 -06:00
472a31a801 Fix the wrong IV size. 2022-12-14 13:04:38 -05:00
ad6d6be620 Kyber with DTLS 1.3 tests 2022-12-14 12:46:24 -05:00
6be0512728 Peer review cleanups. 2022-12-14 09:25:04 -08:00
b2d25ece98 Merge pull request #5885 from anhu/pq_session_ticket
Allow session tickets to properly resume when using PQ KEMs.
2022-12-13 16:32:07 -08:00
e33d59cd76 Review cleanups. 2022-12-13 10:55:22 -08:00
364835dc9e Allow session tickets to properly resume when using PQ KEMs.
Found with:

```
./configure --with-liboqs --enable-session-ticket
./examples/server/server -v 4 -r --pqc P521_KYBER_LEVEL5
./examples/client/client -v 4 -r --pqc P521_KYBER_LEVEL5
```
2022-12-13 11:36:00 -05:00
64ef6aedd6 Merge pull request #5882 from SparkiDev/sp_aarch64_be
SP: support aarch64 big endian
2022-12-12 22:06:38 -06:00
a7a6d5b297 Merge pull request #5874 from JacobBarthelmeh/tls13
adjust post auth support with TLS 1.3
2022-12-13 09:39:31 +10:00
bc3b723609 SP: support aarch64 big endian 2022-12-13 09:33:16 +10:00
d0c9ec6681 Merge pull request #5854 from JacobBarthelmeh/Certs
fix other name san parsing and add RID cert to test parsing
2022-12-12 14:44:07 -08:00
a1e883b43d Merge pull request #5875 from JacobBarthelmeh/Compatibility-Layer
fix for handling DEFAULT:... cipher suite list
2022-12-12 14:43:50 -08:00
334042d7f5 Merge pull request #5881 from anhu/warn_session_ticket
Warn that renegotiation in TLS 1.3 requires session ticket.
2022-12-12 13:51:28 -08:00
36413a2c11 Merge pull request #5879 from SparkiDev/api_test_timing
API test: Report time taken to perform test
2022-12-12 12:31:06 -08:00
f87859a00e Whitespace cleanups. Use const for test_tls_ext_duplicate. 2022-12-12 08:59:53 -08:00
78f495cdae Merge pull request #5877 from SparkiDev/x509v3_d2i_aia
X509v3 EXT d2i: fix freeing of aia
2022-12-12 08:59:15 -08:00
2a97862d26 Merge pull request #5878 from SparkiDev/benchmark_aesofb_fix
Benchmark AES-OFB: initialize and free AES object
2022-12-12 08:57:44 -08:00
b017795413 Remove changes around wolfSSL_set_session() as it breaks tests. 2022-12-12 11:44:27 -05:00
de22dbe61d Support for multi-threaded sniffer. Add support for atomic operations instead of mutex in wc_port.h. 2022-12-12 08:39:42 -08:00
fffd3adc30 Warn that renegotiation in TLS 1.3 requires session ticket. 2022-12-12 11:30:01 -05:00
b871829833 Merge pull request #5811 from lealem47/zd15184
Async Sniffer: Fix for decryption after second handshake
2022-12-12 08:21:35 -08:00
b4b1739783 API test: Report time taken to perform test
API test now displays timing taken to perform a test case to help
identify ones that are doing too much work.
2022-12-12 12:24:38 +10:00
50c5d61998 Merge pull request #5872 from SparkiDev/tls_ext_no_dup
TLS: detect duplicate known extensions
2022-12-11 16:53:38 -08:00
819d40a76f Benchmark AES-OFB: initialize and free AES object
Device ID is not initialized unless wc_AesInit() is called.
Call wc_AesFree() for possible hardware implementations.
2022-12-12 10:45:21 +10:00
7f3de91e25 X509v3 EXT d2i: fix freeing of aia
aia is a stack and must be pop freed rather than freed with XFREE.
Extract function that creates Authority Info Access stack.

Fix spelling issue raised by codespell.
2022-12-12 10:13:13 +10:00
9ab8867b42 TLS: detect duplicate known extensions
TLS specification requires that there not be more than one extension of
the same type in a given extension block. E.g. ClientHello
2022-12-12 08:35:04 +10:00
f974bd4ad6 move test function call into macro guard 2022-12-10 15:45:14 -08:00
8b296877ab fix for handling DEFAULT:... cipher suite list 2022-12-10 14:53:43 -08:00
389cf6ed0a adjust post auth support with TLS 1.3 2022-12-10 06:49:51 -08:00
5e434e62fb Support for WOLFSSL_BENCHMARK_FIXED_CSV, minor changes per #5871 feedback 2022-12-09 12:39:51 -08:00
11c4a0e228 Merge pull request #5866 from dgarske/ecc_pub_import
Fix API test `test_wc_ecc_import_raw` with SP math
2022-12-09 14:00:57 -06:00
793bd6620b Fix unicode char in logging.c. 2022-12-09 10:36:35 -08:00
52c6710783 Fix test_wc_ecc_import_raw to handle ECC_INF_E or MP_VAL on point failures. SP math returns MP_VAL in sp_256_ecc_is_point_4. 2022-12-09 10:32:46 -08:00
9d98cd6e50 Merge branch 'BenchmarkEnhancements' of https://github.com/gojimmypi/wolfssl into BenchmarkEnhancements 2022-12-09 10:10:04 -08:00
6c3e301006 Benchmark Consolidated Enhancements and Code Cleanup 2022-12-09 10:09:56 -08:00
85dc7a61c5 Detect SIZEOF_LONG in armclang and diab 2022-12-09 09:29:25 +01:00
c959d22b98 Merge pull request #5868 from dgarske/ecc_pub_math
Expose more ECC math functions and improve async shared secret
2022-12-09 08:37:26 +10:00
f8484fb5f3 Merge pull request #5869 from anhu/NO_SERVER_fix
Add proper gating on !NO_WOLFSSL_SERVER
2022-12-08 14:30:23 -08:00
5d9532b0ee Merge pull request #5865 from dgarske/fix_-5864
Fix for implicit conversion with 32-bit in SP math
2022-12-09 08:24:04 +10:00
ab6233a01b Merge pull request #5870 from anhu/fix_sgx_stdout
stdout is undeclared
2022-12-08 15:22:30 -07:00
374d6d368e Benchmark Consolidated Enhancements and Code Cleanup 2022-12-08 13:38:06 -08:00
3aa74e3c8c stdout is undeclared 2022-12-08 15:29:48 -05:00
cdaa4d8aa0 Add proper gating on !NO_WOLFSSL_SERVER
Found with the following configuration:

--enable-dtls --enable-dtls13 --enable-dtls-mtu CFLAGS="-DNO_WOLFSSL_SERVER"
2022-12-08 14:20:17 -05:00
9cb19e36fe Merge pull request #5867 from anhu/dont_make_broken_key
For compatibility `EC_KEY_new_by_curve_name` check that we found curve
2022-12-08 11:09:56 -08:00
9ad4e3f9ba Expose the safe version of point double/add and mulmod_ex with WOLFSSL_PUBLIC_ECC_ADD_DBL. Eliminate int wc_ecc_shared_secret_gen used by async/nb and improve async use of curve spec allocations. 2022-12-08 10:43:03 -08:00
937d247c7d Don't create a key if we don't support the curve.
Found with the following configuration:

./configure --enable-tls13 --disable-oldtls --enable-static --enable-singlethreaded --enable-dtls --enable-dtls13 --enable-dtls-mtu --enable-sp=yes,4096 --disable-shared --disable-sha3 --disable-dh --enable-curve25519 --enable-secure-renegotiation --enable-debug --enable-opensslextra 'CFLAGS=-DWOLFSSL_DTLS_ALLOW_FUTURE -DWOLFSSL_MIN_RSA_BITS=2048 -DWOLFSSL_MIN_ECC_BITS=256 -DFP_MAX_BITS=8192 -fomit-frame-pointer'
2022-12-08 12:13:12 -05:00
d264cbc899 Fix for implicit conversion with 32-bit in SP math.
Fixes `error: implicit conversion loses integer precision: sp_int64' (aka long long) to sp_digit (aka int)` building with `./configure CC="clang -m32" --enable-sp && make`
2022-12-08 08:31:02 -08:00
eb69ccb22c Merge pull request #5856 from icing/errq-improvements
Improvements in OpenSSL Compat ERR Queue handling.
2022-12-08 09:28:05 -07:00
02094ebb2e Updates after review by JacobBarthelmeh.
- fix err/ret rename leftover for python builds
- add documenetation to thread-local functions
- move generic queue functions up
2022-12-08 09:53:05 +01:00
bdadbefb4c Merge pull request #5862 from JacobBarthelmeh/Compatibility-Layer
map SSL_CTX_get_session_cache_mode compat API
2022-12-07 14:50:31 -08:00
1f607ee560 Merge pull request #5860 from tmael/entropy_memuse
Increase RNG_SECURITY_STRENGTH for FIPS
2022-12-08 08:26:07 +10:00
099135b2f9 Merge pull request #5861 from kosmas-valianos/FixTypo
Fix wrong function name in wolfSSL_X509_get_name_oneline()
2022-12-07 13:03:54 -08:00
94212e68e5 map SSL_CTX_get_session_cache_mode compat API 2022-12-07 11:35:48 -07:00
45f9ef5dd9 Improvements in OpenSSL Compat ERR Queue handling.
Configuration
- thread-local storaoge is selected when available
- '--enable-error-queue-per-thread' and '--disable-error-queue-per-thread' can
  be used as before to explicitly en-/disable the feature.

Implementation:
- with thread-local-storage, error queue is realized in one struct without
  allocations. Queue size is restricted to 16 entries (per thread), which
  is the same limit in OpenSSL 1.1.x.
- without thread-local-storage, all error queue operations are mutex locked
- wc_PeekErrorNodeLineData() and wc_GetErrorNodeErr() added for use by SSL
  functions to allow locked queue iterations/manipulations.
2022-12-07 18:14:45 +01:00
11f9bd85ee Fix wrong function name in wolfSSL_X509_get_name_oneline() 2022-12-07 16:00:05 +01:00
1e0886180b Adjust ENTROPY_SCALE_FACTOR for FIPS 2022-12-06 23:01:13 -08:00
f6cb13b11b Merge pull request #5851 from SparkiDev/sp_enable_asm_fix
SP: --enable-sp-asm now enables SP if not set
2022-12-06 17:37:15 -08:00
1de30c6b67 SP: --enable-sp-asm now enables SP if not set
Enabling SP with ASM didn't enable SP or error out when SP wasn't
configured. Now enables SP when '' and errors when 'no'.

SAKKE modinv used large amounts of stack. Change to have more temporary
memory allocated increased to cover the usage.
ECC, SAKKE: sp_<bits>_ecc_mulmod_<cpu><words>() used large amounts of
stack. Allocate when WOLFSSL_SMALL_STACK.

wc_DhCheckKeyPair() not available when HAVE_SELFTEST.
Wasn't compiled in before as WOLFSSL_HAVE_SP_DH wasn't defined.
2022-12-07 09:01:53 +10:00
e5d03cf5ad Merge pull request #5848 from philljj/fix_mingw64_build
Fix mingw-w64 build issues on windows.
2022-12-07 08:57:07 +10:00
5c020c6ad4 Increase RNG_SECURITY_STRENGTH for FIPS 2022-12-06 14:16:29 -08:00
ec11c22fb7 Merge pull request #5859 from anhu/ws
whitespace
2022-12-06 14:08:10 -08:00
246ce8dbe1 Cleanup spaces. 2022-12-06 15:24:34 -06:00
754440e0f2 whitespace 2022-12-06 15:12:44 -05:00
6bde6af973 Merge pull request #5858 from anhu/dtls13_fixups
Fixups for problems discovered while testing for DTLS 1.3
2022-12-06 10:44:26 -08:00
9e181e8ecb Merge pull request #5857 from gojimmypi/GitIgnore
gitignore old cmake, VisualGDB working & Espressif sdkconfig files
2022-12-06 10:44:05 -08:00
824c280d12 Merge pull request #5807 from lealem47/sniffer_error
Improvement for sniffer error messages
2022-12-06 09:40:07 -08:00
44a1ffa56e Merge pull request #5855 from ejohnstown/rdrand-ok
DRBG OK
2022-12-06 08:53:07 -08:00
a5f9e5c3c8 Merge pull request #5820 from SparkiDev/entropy_memuse
MemUse Entropy: enabled with HAVE_ENTROPY_MEMUSE
2022-12-06 08:52:45 -08:00
7935a11b3e Fixups for problems discovered while testing for DTLS 1.3 2022-12-06 11:30:23 -05:00
ef63a5287a Ignore old cmake, VisualGDB working & Espressif sdkconfig files 2022-12-06 08:10:14 -08:00
a6c98a11d9 Merge pull request #5845 from anhu/re-sign
Don't regenerate in wolfSSL_PEM_write_bio_X509().
2022-12-06 06:35:13 -08:00
1f6a9d442b MemUse Entropy: enabled with HAVE_ENTROPY_MEMUSE
--enable-entropy-memuse enables the software base entropy gatherer.

The entropy source uses difference in timing to read/write cache lines.
Random indeces into a buffer are updated with the high resolution timer
value which is fed into a hash to produce further random indeces.

The current time is added to the entropy samples at time of
conditioning.
2022-12-06 14:01:16 +10:00
47b8caa0b7 Merge pull request #5849 from SparkiDev/sp_int_sp_ecc_fix
SP int: fix when ECC specific size code included
2022-12-05 17:15:04 -08:00
3891cd65d8 DRBG OK
When initializing the RNG and are using RDRAND, or one of the other
replacement random number generators that could fall back to the
Hash_DRBG if unavailable, set the status to DRBG_OK. This would fix a
problem if someone assumes the DRBG status is meaningful.
2022-12-05 16:09:45 -08:00
f1daa2d356 fix other name san parsing and add RID cert to test parsing 2022-12-05 15:51:33 -08:00
6db2ea0672 SP int: fix when ECC specific size code included
Was enabled when !SP and HAVE_ECC
Now enabled when !WOLFSSL_SP_MATH and HAVE_ECC
2022-12-06 09:44:05 +10:00
f38c7303eb Merge pull request #5853 from douzzer/20221205-sp-int-bugprone-macro-parentheses
20221205-sp-int-bugprone-macro-parentheses
2022-12-06 09:18:40 +10:00
595f8a30d6 wolfcrypt/src/sp_int.c: fix bugprone-macro-parentheses in ALLOC_SP_INT() and ALLOC_SP_INT_ARRAY() introduced in aeca8cb17a. 2022-12-05 15:21:17 -06:00
9d9549fbd3 Merge pull request #5836 from anhu/kyber_cleanup
Remove kyber-90s and route all kyber through wolfcrypt.
2022-12-05 13:18:44 -08:00
312b488582 Remove double free 2022-12-05 15:39:14 -05:00
d3441545ef Merge pull request #5852 from SparkiDev/sp_c_perf_2
SP C, SP int: improve performance
2022-12-05 11:51:28 -08:00
5dee15d074 Merge pull request #5850 from SparkiDev/sp_exptmod_nct_err_fix
SP int: fix check of err in _sp_exptmod_nct
2022-12-05 11:24:12 -08:00
304f287a7e Merge pull request #5828 from SparkiDev/sp_int_static_size
SP int: check size required when using sp_int on stack
2022-12-05 11:23:25 -08:00
65a5ea7cae Make sure certs are identical in tests. 2022-12-05 13:57:53 -05:00
22141faf16 SP C, SP int: improve performance
In SP C: Improve performance of large digit mul and sqr.
In SP int: include optimized 16 digit mul and sqr when compiling SAKKE.
2022-12-05 14:17:09 +10:00
4601a57ff2 SP int: fix check of err in _sp_exptmod_nct 2022-12-05 09:36:28 +10:00
87113cc88d Fix mingw-w64 build issues on windows. 2022-12-03 17:00:44 -06:00
b99f5e5041 Merge pull request #5847 from douzzer/20221203-sp-int-missing-const
20221203-sp-int-missing-const
2022-12-03 12:39:33 -08:00
cd1a61288b wolfcrypt/src/sp_int.c: in _sp_mont_red(), add missing const in SP_WORD_SIZE == 32 codepath. 2022-12-03 10:14:15 -06:00
ea2d79338c Merge pull request #5846 from douzzer/20221202-dtls-crypt-only-gating
20221202-dtls-crypt-only-gating
2022-12-03 07:21:55 -08:00
57a5c9701d Missed a free of der 2022-12-02 17:23:47 -05:00
42c37b6831 eliminate need for --enable-kyber 2022-12-02 17:16:41 -05:00
f58f3bd986 Don't regenerate in test_wolfSSL_PEM_write_bio_X509(). We don't have the private key. 2022-12-02 16:41:24 -05:00
c506812cf0 Improvement for some sniffer error messages 2022-12-02 13:27:29 -08:00
3ea8dd2f67 src/dtls.c: add WOLFCRYPT_ONLY gating. 2022-12-02 15:13:31 -06:00
dd89fe269e Fix logic in GetSnifferServer 2022-12-02 13:13:16 -08:00
ed69bb33a6 Async Sniffer: Fix for decryption after second handshake 2022-12-02 13:11:23 -08:00
efd194ea74 Merge pull request #5842 from SparkiDev/sp_int_clang_tidy
SP int: fixes for static analyser clang-tidy
2022-12-02 07:42:00 -08:00
3239ff5b0e SP int: fixes for static analyser clang-tidy
Const poison sp_int.c to allow static analysers to work better.
sp_prime_is_prime_ex() checks whether a->used is negative to avoid bad
behavior.
2022-12-02 13:57:32 +10:00
c079455d3e Merge pull request #5839 from SparkiDev/sp_int_pub_apis
SP int: fix which APIs are public available wiht WOLFSSL_SP_MATH
2022-12-01 19:33:11 -08:00
39716737c1 SP int: fix which APIs are public available wiht WOLFSSL_SP_MATH
Make sp_rshd not available when WOLFSSL_SP_MATH in header.
sp_rshd is not required by any wolfCrypt code.
Fix sp_rshd comment on #endif
Make sp_div publicly available in some WOLFSSL_SP_MATH builds.
Delare sp_div for some WOLFSSL_SP_MATH builds.
Fix test.c to compile with WOLFSL_SP_MATH and HAVE_VALGRIND.
2022-12-02 09:11:35 +10:00
5f410b47b7 Merge pull request #5829 from SparkiDev/sp_invmod_fixes
SP int: fix error checks when modulus even
2022-12-01 15:05:22 -08:00
c59d6c36e4 Merge pull request #5838 from douzzer/20221201-fix-kcapi
20221201-fix-kcapi
2022-12-02 08:24:14 +10:00
8fb92a283a Merge pull request #5716 from rizlik/dtls_cookie_stateless
dtls: allow for stateless client hello parsing
2022-12-01 13:47:33 -08:00
1c7826b199 wolfcrypt/src/port/kcapi/kcapi_aes.c: fix error checking on KCAPI wc_AesGcmEncrypt() and wc_AesGcmDecrypt(). 2022-12-01 12:54:57 -06:00
d1e6ce064f Merge pull request #5832 from JacobBarthelmeh/fuzzing
free signer if malloc cases fail
2022-12-01 10:35:15 -08:00
1e8ecd3d71 Merge pull request #5830 from SparkiDev/sp_int_no64bit
SP int: check NO_64BIT before speculative using long long
2022-12-01 11:10:33 -07:00
fc4b008912 dtls: fix heap hint in XFREE 2022-12-01 16:47:37 +00:00
abbba4815e tests: add tests for stateless dtls v1.2 cookie 2022-12-01 16:47:37 +00:00
af00c89f18 dtls v1.2: stateless support WOLFSSL_DTLS_NO_HVR_ON_RESUME 2022-12-01 16:30:54 +00:00
cc7dad3ee6 dtls v1.2: support stateless client hello processing 2022-12-01 16:30:54 +00:00
5bc86b8c2c fix: dtls: always use version DTLS 1.0 in HelloVerifyRequest
see rfc6347 section 4.2.1
2022-12-01 16:30:54 +00:00
4fa1b9dd0a fix: AddRecordHeader: use correct minor when using DTLS 2022-12-01 16:30:54 +00:00
aff01121a2 fix: dtls v1.2: reset window when invoking DtlsResetState 2022-12-01 16:30:54 +00:00
173208728a fix: tls13: hash using right version when downgrading 2022-12-01 16:30:54 +00:00
2c35d7f9d2 fix: formatting and typos
dtls: fix debug message when downgrading

internal.c: fix typo
2022-12-01 16:30:53 +00:00
1388e66059 Merge pull request #5706 from icing/ha-quic
Set of QUIC related changes for HAProxy integration.
2022-12-01 06:11:14 -08:00
e5cfd96609 QUIC API support in OpenSSL compat layer, as needed by HAProxy integration.
- adding patch for HAProxy, see dod/QUIC.md, based on current master.
      For documentaton purposes, since HAProxy does not accept PRs. To be
      removed once forwarded to the project.
2022-12-01 10:12:35 +01:00
aeca8cb17a SP int: check size required when using sp_int on stack
SP int can be configured to declare temporary sp_ints.
Check that the requested number of digits is not larger than the max
supported (SP_INT_DIGITS).
Also check arrays of sp_ints too.
2022-12-01 12:53:52 +10:00
2d88fd3b75 Merge pull request #5835 from lealem47/zd15262
Making CTC_MAX_CRLINFO_SZ a compile-time option
2022-11-30 17:35:11 -08:00
e83e0693b9 SP int: check NO_64BIT before speculative using long long
ULLONG_MAX is not defined for old versions of C compiler.
An unsigned long long type may still be available though.
Don't use unsigned long long for a 64-bit type when NO_64BIT is defined.
2022-12-01 10:25:13 +10:00
c6a7afee74 Merge pull request #5834 from anhu/http
Correction to a webpage link.
2022-11-30 15:14:35 -08:00
eba6a6d9f6 Making CTC_MAX_CRLINFO_SZ a compile-time option 2022-11-30 14:24:23 -08:00
a2fb4c0788 Remove kyber-90s and route all kyber through wolfcrypt. 2022-11-30 17:17:28 -05:00
3b00c9abee Correction to a webpage link. 2022-11-30 16:27:50 -05:00
01833a369e free signer if malloc cases fail 2022-11-30 10:02:33 -08:00
fec7469c19 Tidy up Espressif ESP32 test and benchmark examples (#5800)
Tidy up Espressif ESP32 test and benchmark examples:
* add VisualGDB project and solution files for server and client
* "hardware in use revert to software" is now verbose level message
* Remove (void) TAG;  - not needed to appease compiler
* include esp_log.h lib with defined(WOLFSSL_ESPIDF)
* large ESP32 default stack size
* check for max number of arguments assembled into array
* cleanup & comments per code review
* wolfssl_test VisualGDB updates
* Espressif wolfssl_test default stack 55,000 bytes
2022-11-30 10:01:46 -08:00
c7c80be15e SP int: sp_invmod_div check div result before proceeding 2022-11-30 18:33:35 +10:00
faf848a915 SP int: fix error checks when modulus even 2022-11-30 18:15:30 +10:00
973de0e954 Merge pull request #5831 from SparkiDev/sp_int_div_clear_fix
SP int: don't call sp_clear unless no longer using sp_int
2022-11-30 02:15:19 -06:00
61c2fd9a2b SP int: don't call sp_clear unless no longer using sp_int
Put in casts to be sure no compiler complains.
Tidy up other parts of the code.
2022-11-30 16:36:48 +10:00
24cc8e7145 Merge pull request #5827 from douzzer/20221129-ecb-benchmark-throughput
20221129-ecb-benchmark-throughput
2022-11-29 18:12:23 -08:00
63051f3826 Merge pull request #5825 from SparkiDev/api_test_sep
Unit test: rework to be able to run API tests individually
2022-11-29 18:11:57 -08:00
fed3f53969 Merge pull request #5826 from kaleb-himes/gcc-11-12-fixes
Initialize variable causing failures with gcc-11 and gcc-12
2022-11-30 10:40:17 +10:00
4bacc25e22 examples/benchmark/tls_bench.c: fix for clang-analyzer-deadcode.DeadStores in bench_tls(). 2022-11-29 17:09:05 -06:00
b2f9838af4 Fix DSA public decode to allow extra buffer (in case private key is passed in). Fixes for clang-tidy "value stored never read". Allow showing line number and conditional with DEBUG_WOLFSSL_VERBOSE on TEST_RES_CHECK. 2022-11-29 14:58:52 -08:00
4d2b893fb3 Initialize variable causing failures with gcc-11 and gcc-12 2022-11-29 14:59:53 -07:00
a9b28c1562 wolfcrypt/benchmark/benchmark.c: make iteration increment in bench_aesecb_internal() even lumpier (by a factor of 10) to further reduce false positives from iteration overhead. 2022-11-29 14:39:44 -06:00
7310eb102f Whitespace and line length cleanups. 2022-11-29 09:52:11 -08:00
e4e53ab7ca Unit test: rework to be able to run API tests individually
Change API test cases to return a result.
Test success is now TEST_SUCCESS (1).
Test result can be returned with use of macro TEST_RES_CHECK().
Always print the id, name of the test and the result (skipped or
otherwise) before and after running the test case.

Changed test case output to go to stderr.
Fixed some formatting.

Add option to take index and/or name of test case to run.
Added option to list all API tests.
Added option to only run API tests.
Added options to show usage.
2022-11-29 12:37:20 +10:00
7aa796bdbd Merge pull request #5824 from SparkiDev/pkcs11_init_rv
PKCS#11: add initialization API that returns PKCS#11 return value
2022-11-28 14:31:03 -08:00
3046899966 Merge pull request #5821 from anhu/ntru_saber_purge
Purge NTRU and SABER. Not going to be standardized.
2022-11-28 08:28:11 -08:00
7697337703 Merge pull request #5816 from SparkiDev/sp_int_rework
SP int: Comment and rework some code
2022-11-28 08:26:58 -08:00
0c2f713ca3 Merge pull request #5823 from SparkiDev/arm32-ldrd-fixes
ARM32 ASM: don't use ldrd on user data
2022-11-28 08:25:23 -08:00
7005d416ce SP int: Comment and rework some code
Improvements to sp_int.c that make it slightly quicker and documented.
2022-11-28 18:06:09 +10:00
2d424f7d06 PKCS#11: add initialization API that returns PKCS#11 return value 2022-11-28 16:40:29 +10:00
847c478c45 ARM32 ASM: don't use ldrd on user data
Alignment fixes.
Regeneration of ARM32 has config.h included.
2022-11-28 12:59:58 +10:00
7c576de914 Fixes from testing 2022-11-25 16:00:09 -05:00
0bfa5c9836 Purge NTRU and SABER. Not going to be standardized. 2022-11-25 14:54:08 -05:00
ee91f4415d Merge pull request #5819 from miyazakh/enable_sp_math_conf
must have SP enabled with SP math
2022-11-25 21:16:29 +10:00
3597034a42 must have SP enabled with SP math 2022-11-25 08:41:11 +09:00
ba3022c32a Merge pull request #5818 from anhu/remove_WOLFSSL_HAVE_KYBER
Remove some unnecessary guarding. Preventing build on STM32.
2022-11-25 08:00:31 +10:00
558343dd2b Merge pull request #5817 from douzzer/20221124-wc_GetCurrentIdx-prototype
20221124-wc_GetCurrentIdx-prototype
2022-11-25 07:58:26 +10:00
5e191b7218 Remove some unnecessary guarding. Preventing build on STM32. 2022-11-24 11:49:12 -05:00
466b625b5d wolfcrypt/src/logging.c: add missing void arg list to definition of wc_GetCurrentIdx(). 2022-11-24 09:32:58 -06:00
d0fb9a0b30 Merge pull request #5809 from tmael/sp_static_mem
Support static memory with sp-math
2022-11-24 12:42:42 +10:00
cf8ea5c606 Merge pull request #5812 from ejohnstown/crl-ocsp
OCSP/CRL
2022-11-24 12:42:17 +10:00
88f3570fe4 OCSP/CRL
Added comments for the usage of OCSP_WANT_READ used with the CRL I/O
callback.
2022-11-23 16:35:10 -08:00
0a38553909 Merge pull request #5798 from JacobBarthelmeh/python
account for 'pulled' error nodes
2022-11-23 14:57:03 -08:00
a482ab367a Merge pull request #5781 from anhu/maxq10xx
Support for Analog Devices MAXQ1080 and MAXQ1065
2022-11-23 13:31:22 -08:00
909fd726cd OCSP/CRL
Fixing issue #3070. When the OCSP responder returns an unknown exception,
continue through to checking the CRL. Before, it was setting the flag
to check CRL, then clearing it because of the exception.
2022-11-23 10:50:12 -08:00
f3546b50fd Conform to pre-existing pattern. 2022-11-23 17:58:12 +00:00
6190666108 Support for Analog Devices MAXQ1080 and MAXQ1065 2022-11-23 11:57:31 -05:00
54466b670a Merge pull request #5810 from Uriah-wolfSSL/haproxy-integration
Added required config option and return value for HaProxy
2022-11-23 10:01:17 +10:00
4c95f64b77 Check NO_BIG_INT with static memory 2022-11-22 15:32:34 -08:00
b6ae17804a update comments and check error case 2022-11-22 11:22:38 -07:00
d373c0856a Added required config option and return value for HaProxy 2022-11-22 10:42:05 -06:00
5c7127ff24 Support static memory with sp-math 2022-11-22 08:17:27 -08:00
50f19ec225 Merge pull request #5806 from embhorn/zd15177
Fix X509_get1_ocsp to set num of elements in stack
2022-11-22 12:00:08 +01:00
55718d214c Merge pull request #5801 from philljj/zd15172
Fix leak in wolfSSL_X509_NAME_ENTRY_get_object.
2022-11-22 15:11:18 +10:00
dee73887b8 Fix X509_get1_ocsp to set num of elements in stack 2022-11-21 08:25:46 -06:00
73ecd604bd Merge pull request #5803 from douzzer/20221120-enable-brainpool
20221120-enable-brainpool
2022-11-21 10:08:50 +10:00
0da2a0a524 configure.ac: add --enable-brainpool, default on unless disable-ecccustcurves, and use it to enable brainpool in enable-all and enable-all-crypto, subject to override. 2022-11-20 11:00:50 -06:00
ba8731dc69 Merge pull request #5802 from douzzer/20221118-minor-fixes
20221118-minor-fixes
2022-11-19 08:11:53 -08:00
2fa206dec0 wolfcrypt/src/siphash.c: fix bugprone-macro-parentheses, and in wc_SipHash(), fix clang-diagnostic-overlength-strings around inline asm. 2022-11-18 22:43:13 -06:00
6f98a5b271 src/internal.c: in VerifyServerSuite(), narrow condition and fix return value in error check added in 647ce794dd. 2022-11-18 22:21:08 -06:00
39ee267a31 configure.ac: mutually harmonize --enable-all and --enable-all-crypto: add enable-siphash to enable-all, and add Brainpool to enable-all-crypto. 2022-11-18 22:13:22 -06:00
9f36d9e530 Merge pull request #5799 from tim-weller-wolfssl/gh5754-mips64-abi32
Add check for 64-bit ABI on MIPS64 before declaring a 64-bit CPU
2022-11-18 13:19:39 -07:00
153ab82ad8 Fix leak in wolfSSL_X509_NAME_ENTRY_get_object. 2022-11-18 11:23:15 -06:00
f586183d1e Add check for 64-bit ABI on MIPS64 before declaring a 64-bit CPU 2022-11-18 07:12:04 -06:00
34f8fa797e Merge pull request #5695 from embhorn/gh5693
Fix --enable-devcrypto build error for sys without u_int8_t type
2022-11-17 16:01:35 -07:00
143dac64a3 account for 'pulled' error nodes 2022-11-17 14:51:37 -08:00
bd7b442df3 Merge pull request #5796 from tmael/mem_err
Propagate malloc returning NULL up the call stack
2022-11-16 12:45:42 -08:00
2a2cf5671e Move error check in CompareSuites 2022-11-16 09:29:24 -08:00
647ce794dd unmask malloc returning NULL 2022-11-16 09:25:25 -08:00
38b511f297 Merge pull request #5651 from haydenroche5/engine_pss_fips_v5
Add RSA PSS salt defines to engine builds if not FIPS v2.
2022-11-15 16:30:45 -07:00
7d046e0eb8 Merge pull request #5793 from philljj/zd15041
Support ASN1/DER CRLs in LoadCertByIssuer.
2022-11-15 14:05:10 -08:00
17105606b1 Cleanup format and typos, and use WOLFSSL_FILETYPE. 2022-11-15 11:45:11 -06:00
dc9f46a3be Fix --enable-devcrypto build error for sys without u_int8_t type 2022-11-11 15:40:12 -06:00
9036c098b0 Merge pull request #5760 from cconlon/se050
NXP SE050: feature expansion and fixes
2022-11-11 13:31:05 -08:00
81ed2a60b4 Support ASN1/DER CRLs in LoadCertByIssuer.
This fixes hash based dir lookup of ASN1/DER CRLs in OpenSSL
compatible API. The function wolfSSL_X509_load_crl_file is
called with entry->dir_type, rather than hardcoded filetype.

A new test crl was added, and existing crl 0fdb2da4.r0 was
reorganized to a new dir.

Also, completes the stub wolfSSL_X509_LOOKUP_add_dir. A new
test function test_X509_LOOKUP_add_dir was added to tests/api.c
2022-11-11 15:13:00 -06:00
cb7f73d0a3 Merge pull request #5792 from JacobBarthelmeh/Testing
allow for cpuid public functions with non-intel build
2022-11-11 12:28:06 -08:00
45bf793b5a SE050 expansion: add RSA support, allow for larger key IDs, get/set key ID from ecc_key/RsaKey, fixes for SE050 hashing, remove XREALLOC dependency, API to store/get binary object, API to erase object, test.c compatibility 2022-11-11 12:14:14 -07:00
9c569b950a Merge pull request #5791 from douzzer/20221110-wc_DhAgree_Sync-uninited-use
20221110-wc_DhAgree_Sync-uninited-use
2022-11-11 09:01:52 -08:00
c78b669b42 allow for cpuid public functions with non-intel build 2022-11-11 09:42:02 -07:00
3bfff3bfc5 wolfcrypt/src/dh.c: fix benign uses of uninited var in wc_DhAgree_Sync(), introduced in #5782 -- see oss-fuzz #53177. 2022-11-11 08:51:17 -06:00
7887576032 Merge pull request #5788 from dgarske/small_build
Fix for misc `HashObject` to be excluded for `WOLFCRYPT_ONLY`
2022-11-10 16:03:25 -07:00
f4621a6807 Merge pull request #5786 from philljj/zd15125
Fix incorrect self signed error return.
2022-11-10 14:13:38 -08:00
5ad6ff23d5 Use local int lastErr instead of args->lastErr. 2022-11-10 13:46:51 -06:00
77ffacf6d1 Fix for build error with SHA2-256 disabled. 2022-11-10 11:38:08 -08:00
95a3fea947 Merge pull request #5789 from dgarske/aesccm256
Added AES CCM 256-bit test
2022-11-10 10:54:00 -07:00
154378220d Merge pull request #5790 from per-allansson/xcode-project-fixes
Xcode project fixes
2022-11-10 10:46:31 -07:00
3b23a49a5f Merge pull request #5761 from tim-weller-wolfssl/zd15084-x509-crl-fail
Link newly created x509 store's certificate manager to self by default
2022-11-10 06:10:18 -08:00
0e4621a794 IDE/XCODE: include armv8-xxx in projects 2022-11-10 09:44:56 +01:00
364b2ddc8f IDE/XCODE: include dtls.c/dtls13.c/tls13.c/quic.c/kdf.c in projects 2022-11-10 09:44:01 +01:00
c573ba9864 Merge pull request #5758 from per-allansson/dtls13-fips
Allow DTLS 1.3 to compile when FIPS is enabled
2022-11-09 18:18:06 -08:00
90d37f9786 Add AES CCM 256-bit test. 2022-11-09 17:46:07 -08:00
5d2124e70d Merge pull request #5787 from dgarske/fixes_minor
Fix for `test_wolfSSL_sk_CIPHER_description` incorrectly failing
2022-11-10 09:22:08 +10:00
3bc3ec25b8 Add link of newly created x509 store's certificate manager to self by default 2022-11-09 17:17:30 -06:00
35ccd880ed Fix for misc HashObject to be excluded for WOLFCRYPT_ONLY. 2022-11-09 15:07:36 -08:00
922771bf05 Merge pull request #5785 from miyazakh/undef_gcc4p8
fix compile error due to Werro=undef on gcc-4.8
2022-11-10 08:05:56 +10:00
57ae840f39 Fix for test_wolfSSL_sk_CIPHER_description incorrectly failing with TLS v1.3 NULL cipher. 2022-11-09 12:05:16 -08:00
961c696436 Fix incorrect self signed error return.
ASN_SELF_SIGNED_E was being overwritten with ASN_NO_SIGNER_E when
compiled with certreq and certgen.
2022-11-09 10:27:31 -06:00
231a4098fa Merge pull request #5783 from SparkiDev/sp_small_p521_fix
SP P521 small HAVE_COMP_KEY: sp_521_mont_sqr_n*
2022-11-09 06:07:12 -08:00
454cd02627 fix compile error due to Werro=undef on gcc-4.8 2022-11-09 14:00:50 +09:00
1938b117c2 Merge pull request #5782 from SparkiDev/dh_sp_agree_0_1_fix
DH: fix when using SP
2022-11-08 22:41:08 -06:00
3e58c63647 SP P521 small HAVE_COMP_KEY: sp_521_mont_sqr_n*
Specific compress key code for P521 doesn't need a n square function.

Fixing generation of x86_64 ASM scripts resulted in adding carriage
return to chacha_asm.S.
2022-11-09 11:43:13 +10:00
2d757eadd0 DH: fix when using SP
The agreed secret must not be 0 or 1 by SP800-56A, 5.7.1.1.
Check done when not using SP.
Add check to SP calling code.
2022-11-09 09:55:16 +10:00
eac3b4e189 Merge pull request #5752 from julek-wolfssl/alt-name-str-type
Set alt name type to V_ASN1_IA5STRING
2022-11-08 15:42:39 -08:00
dfa997a6fd Merge pull request #5780 from douzzer/20221105-benchmark-determinism-fixes
20221105-benchmark-determinism-fixes
2022-11-09 08:44:08 +10:00
72a4a8a377 Merge pull request #5599 from embhorn/gh5580
Fix casts in evp.c and build issue in ParseCRL
2022-11-09 08:40:31 +10:00
48ba365fd6 fixes for defects:
clang-analyzer-deadcode.DeadStores in examples/server/server.c;

-Werror=use-after-free and LeakSanitizer Direct leak in tests/api.c;

nullPointerRedundantCheck in src/pk.c which identified a semantically consequential flub.
2022-11-08 14:04:16 -06:00
ca1ca24bc9 wolfcrypt/benchmark/benchmark.c: fix formatting (column alignment) in asym tests; fix typo in asym_pq section. 2022-11-08 12:31:04 -06:00
4b30f47e9b Fix casts in evp.c and build issue in ParseCRL 2022-11-08 10:59:18 -06:00
bd83345c02 Merge pull request #5773 from dgarske/async_v5.5.3
Fixes for various tests that do not properly handle `WC_PENDING_E`
2022-11-08 14:47:23 +10:00
3d228415f4 Merge pull request #5734 from dgarske/zd15017
Fixes for async sniffer handling of packets with multiple TLS messages
2022-11-08 14:46:40 +10:00
d42f8e0834 Merge pull request #5600 from embhorn/zd14858
Add reference to wc_AesInit in Gmac API doc
2022-11-07 17:44:35 -08:00
826dfd8a23 Merge pull request #5766 from SparkiDev/x509_subj_dir_attr_fix
ASN X509 subject directory attribute: fix ASN template parsing
2022-11-07 17:41:27 -08:00
44e66fd7c7 Merge pull request #5762 from SparkiDev/pkcs11_find_no_class_type
PKCS#11: compile time check in finding keys
2022-11-07 17:40:50 -08:00
9c645cf5ce Merge pull request #5747 from SparkiDev/pkcs11_nullptr_user_pin
PKCS#11: User PIN can be NULL_PTR
2022-11-07 17:40:38 -08:00
2e362a193e Merge pull request #5742 from SparkiDev/sp_int_64bit_type
SP int: guess 64-bit type
2022-11-07 17:40:14 -08:00
20913a4201 Fix for sniffer with async to not terminate processing until all pending items have been processed. 2022-11-07 15:45:50 -08:00
887b4bd9f0 Merge pull request #5767 from haydenroche5/load_system_root_certs
Improve logic for enabling system CA certs on Apple devices.
2022-11-07 15:15:13 -08:00
829fd71714 Merge pull request #5779 from dgarske/compat_heap
Fixes for compatibility layer building with heap hint and OSSL callbacks
2022-11-08 08:59:26 +10:00
6ca8336c52 Fix for asynchronous sniffer edge case for back to back sessions where new session was created while still pending. 2022-11-07 13:52:40 -08:00
0fc303e1fc Do not throw warning when disabling feature automatically. 2022-11-07 13:10:19 -08:00
d2fe30349a Merge pull request #5778 from kaleb-himes/fix-azsphere-nightly-test
Update azsphere support to prevent compilation of file included inline
2022-11-07 12:48:31 -08:00
583940ee30 Merge pull request #5776 from SparkiDev/sp_int_mingw64_fix
SP int: support mingw64 again
2022-11-07 11:39:12 -08:00
59774ae576 Fixes for building with use of heap hint and compatibility layer. Fix for invalid OSSL callback function errors. 2022-11-07 11:33:39 -08:00
b052ef46ba Add new setting per peer review feedback 2022-11-07 11:25:01 -07:00
0a97aa83b6 Update azsphere support to prevent compilation of file included inline 2022-11-07 10:36:24 -07:00
b845c8bfc8 SP int: support mingw64 again
Check for _MSC_VER to determine that we are compiling for MSVC.
2022-11-07 16:34:26 +10:00
1ee3a78e4a Fixes for various tests that do not properly handle WC_PENDING_E. 2022-11-04 14:56:40 -07:00
d0f33f62f4 Fix missing config.h include in some ARMv8 files. 2022-11-04 13:53:22 -07:00
d7cbd8cd17 Improve logic for enabling system CA certs on Apple devices.
In configure.ac and CMakeLists.txt, check for the header
Security/SecTrustSettings.h. If this header is found, enable the feature. If
it isn't, disable it. For non-configure/non-CMake builds, require the user to
explicitly define HAVE_SECURITY_SECTRUSTSETTINGS_H if they want to use system
CA certs (handled in settings.h).
2022-11-04 13:52:45 -07:00
5d70f3efce Merge pull request #5730 from philljj/zd15040 2022-11-04 13:32:48 -07:00
4a917219f7 Merge pull request #5608 from SparkiDev/pk_c_rework_2 2022-11-04 13:32:36 -07:00
1ce5951f0d Merge pull request #5722 from dgarske/stm32 2022-11-04 13:32:11 -07:00
7cc2336af7 Merge pull request #5737 from SparkiDev/ecc_cofactor 2022-11-04 13:31:24 -07:00
e3621d5bb1 Merge pull request #5771 from dgarske/revert-5622-sniffer_sequence 2022-11-04 13:25:48 -07:00
dce1fc4766 Merge pull request #5703 from miyazakh/renesas_rx72n_simple 2022-11-04 11:43:08 -06:00
5f4cf53d87 Merge pull request #5772 from JacobBarthelmeh/OCSP 2022-11-04 09:46:42 -07:00
8225d3642b save next status with OCSP response verify 2022-11-03 22:39:47 -07:00
cbbe6fec94 Merge pull request #5763 from douzzer/20221031-benchmark-determinism 2022-11-03 14:52:59 -07:00
f610df59a9 Whitespace cleanups. 2022-11-03 14:38:43 -07:00
fbc4af8701 Merge pull request #5739 from anhu/no_WOLFSSL_DYN_CERT 2022-11-03 14:24:34 -07:00
7414dd7ea5 Merge pull request #5768 from kareem-wolfssl/maxCertpolSz 2022-11-03 14:23:17 -07:00
48bddc6d07 Update max Cert Policy size based on RFC 5280. 2022-11-03 11:49:15 -07:00
b140abd1fd wolfcrypt/benchmark/benchmark.c: add check_for_excessive_stime() and remove double declaration of base_rusage and cur_rusage. 2022-11-03 13:48:51 -05:00
1adc06d181 Fix for Intel QAT handling of sign R when cofactor is not 1. ZD 15017 2022-11-03 10:00:07 -07:00
4766a978cf ECC cofactor: fix check scalar bits
For shared secrets, when a curve has a cofactor, the private key (in
range of order) is multiplied by the cofactor before use.

If there is a cofactor involved, check bit size of scalar against
modulus instead of order.
2022-11-03 10:00:07 -07:00
1ec2b14922 Revert "Fix for sniffer to decode out of order packets" 2022-11-03 09:50:15 -07:00
336bef666a ASN X509 subject directory attribute: fix ASN template parsing
Support multiple attributes.
When Country of Citizenship, pull out PRINTABLE_STRING explicitly.
Each type of attribute has a different format.
2022-11-03 09:24:59 +10:00
a7635da9e6 Merge pull request #5765 from JacobBarthelmeh/release
update for version 5.5.3
2022-11-02 15:46:10 -07:00
9b895b74bf update for version 5.5.3 2022-11-02 13:58:37 -07:00
ae22babf8b PKCS#11: compile time check in finding keys
When WC_PKCS11_FIND_WITH_ID_ONLY defined, don't add key class and
type to attributes of search for by Id.
2022-11-01 17:38:46 +10:00
4ab41caf40 make static flags sym_header_printed, asym_header_printed, and pqasym_header_printed, local to the routines that use them (fixes an -Wunused-variable in -UBENCH_ASYM builds). 2022-11-01 01:12:17 -05:00
89182b829f wolfcrypt/benchmark/benchmark.c: add GENERATE_MACHINE_PARSEABLE_REPORT and LINUX_RUSAGE_UTIME codepaths;
fflush stdout after each scenario for line-buffered pipelining;

refactor csv_header_count into sym_header_printed, asym_header_printed, and pqasym_header_printed;

move SAKKE tests to precede PQ tests;

rename bench_stats_sym_check() to bench_stats_check();

add bench_stats_asym_finish_ex() accepting a "desc_extra" arg, and use it to disambiguate otherwise-homonymous SAKKE runs;

fix bench_aesecb_internal() to not check time (syscall) for every 3 blocks processed.
2022-11-01 00:15:37 -05:00
502a395723 Merge pull request #5757 from SparkiDev/enc_err_forcezero_fix
ForceZero fix: encryption fail and not EtM
2022-10-31 11:43:48 -06:00
0a88bb9779 Allow DTLS 1.3 to compile when FIPS is enabled 2022-10-31 08:42:13 +01:00
4efba8f437 ForceZero fix: encryption fail and not EtM
Zeroizing of plaintext on encryption failure will use wrong size when
not using Encrypt-then-MAC. Size may go negative and cast to unsigned.
2022-10-31 09:14:16 +10:00
8bbbdfa3f9 Set alt name type to V_ASN1_IA5STRING 2022-10-28 19:58:01 +02:00
0158c82487 Keep WOLFSSL_DYN_CERT 2022-10-28 13:37:55 -04:00
0ea0b887a5 Merge pull request #5749 from JacobBarthelmeh/release
update version to 5.5.2
2022-10-28 09:22:50 -07:00
8fd5a4061c Merge pull request #5748 from SparkiDev/arm32_asm_lr_fixup
ARM32 ASM: fix asm saving and restoring of registers
2022-10-28 07:37:02 -06:00
eb52083afd update version to 5.5.2 2022-10-28 06:25:33 -07:00
c4e758dda5 Fix X509 subject and issuer name_hash mismatch
Fix logging message and g++ invalid conversion error.
2022-10-27 19:31:30 -05:00
7bd8ced7af ARM32 ASM: fix asm saving and restoring of registers
Fix push and pop generated at beginning and end of function.
2022-10-28 09:51:32 +10:00
4b648e7e08 PKCS#11: User PIN can be NULL_PTR
Allow TokenInit to store NULL for User Pin.
New APIs to handle not setting User PIN.
2022-10-28 08:52:18 +10:00
822f11d1a1 Fix X509 subject and issuer name_hash mismatch
Refactor duplicate code a bit more.
2022-10-27 15:15:55 -05:00
319901a85c Merge pull request #5743 from SparkiDev/tls_perf_fix_forcezero
TLS performance fix: ForceZero minimization
2022-10-27 13:43:17 -06:00
7366a9edbd Merge pull request #5744 from SparkiDev/regression_fixes_4
Regresssion testing fixes
2022-10-27 11:49:52 -06:00
e9d37b9bd1 addressed code review 2022-10-27 16:52:04 +09:00
fd7544ca19 Regresssion testing fixes
Ed25519 and Ed448 need to enable certs.

If no system CA certs can't be parsed,
wolfSSL_CTX_load_system_CA_certs() will fail. Don't try test if RSA and
ECC are not enabled.

Fix benchmark.c so that e is defined when WOLFSSL_BENCHMARK_ALL defined.

MAX_LENGTH_SZ is 4 and supports lengths up to 2^24 - one byte for length
and 3 bytes of length.
(new gcc compiler fix)
2022-10-27 17:47:48 +10:00
b1e37377a1 TLS performance fix: ForceZero minimization
Don't ForceZero the output buffer before free.
ForceZero it when encryption fails.

ShrinkInputBuffer needs to zeroize input buffer even if not currently
encrypting as it may be using the buffer on wolfSSL object reuse.

Fix SP to zeroize the whole buffer.

Fix DH to check cBuf when WOLFSSL_CHECK_MEM_ZERO defined.
2022-10-27 17:00:42 +10:00
1c09a67f6a Merge pull request #5735 from SparkiDev/aes_gcm_c_dec_auth
AES GCM decrypt C: don't decrypt when auth tag invalid
2022-10-26 22:41:25 -06:00
7a4657c881 Fixes from review 3 2022-10-27 11:25:27 +10:00
8519988d57 SP int: guess 64-bit type
When ULLONG_MAX not defined and long is the 32-bit type, speculatively
use long long as the 64-bit type.
2022-10-27 10:19:21 +10:00
294a26ba0c Merge pull request #5708 from JacobBarthelmeh/OCSP 2022-10-26 15:43:15 -07:00
fe28702891 Fixes for async sniffer handling of packets with multiple TLS messages. Other minor cleanups for spelling and CheckPreRecord SnifferSession deference. 2022-10-26 15:28:02 -07:00
e26d4f84fc Improvements for AES GCM on STM32. Cleanups for STM32 example. 2022-10-26 14:10:19 -07:00
8f2d35bb84 Merge pull request #5741 from douzzer/20221026-fixes-QUIC-and-ALPN
20221026-fixes-QUIC-and-ALPN
2022-10-26 15:03:28 -06:00
b477804462 Merge pull request #5725 from julek-wolfssl/rpm-pkg 2022-10-26 13:33:16 -07:00
b31567e752 Fix X509 subject and issuer name_hash mismatch
Refactor duplicate code, and better error messages.
2022-10-26 15:27:15 -05:00
d08c204466 remove extra memset 2022-10-26 12:54:17 -07:00
1608037c6b Merge pull request #5740 from JacobBarthelmeh/release
minor warning fixes
2022-10-26 14:09:01 -05:00
4d36d494b2 Merge pull request #5738 from SKlimaRA/SKlimaRA/fix-backslash-random-c
removed backslash
2022-10-26 12:42:49 -05:00
33617588fc fix setting dynamic flag with ocsp and asn template 2022-10-26 10:31:50 -07:00
8d6ee0b26a minor warning fixes 2022-10-26 10:48:51 -06:00
0c79ca1de1 Fix for STM32 PKA with coefSign for non 256-bit curves. Don't check point for STM PKA. ZD14928 2022-10-26 09:44:58 -07:00
dfa603e502 fixes for warnings and defects around QUIC and ALPN -- fixes for clang-diagnostic-gnu-zero-variadic-macro-arguments, clang-analyzer-deadcode.DeadStores, clang-analyzer-core.UndefinedBinaryOperatorResult, clang-analyzer-security.insecureAPI.strcpy, and an overrun prevention assert in wolfSSL_ALPN_GetPeerProtocol(). 2022-10-26 11:32:06 -05:00
a26b89f66b fix leak with multiple entries 2022-10-26 09:29:06 -07:00
9486721bb8 Prevent WOLFSSL_NO_MALLOC from breaking RSA certificate verfication 2022-10-26 12:11:55 -04:00
be07401856 Fix X509 subject and issuer name_hash mismatch
Use WOLFSSL_ERROR_MSG for errors, don't leak canonName, and better
error handling and comments.
2022-10-26 10:25:05 -05:00
6fa43a3d84 removed backslash 2022-10-26 15:03:31 +02:00
5db2d53d54 Fixes from review part 2 2022-10-26 16:04:05 +10:00
2d19f00dd5 Merge pull request #5736 from douzzer/20221025-fixes-wolfsentry-and-armv7a
20221025-fixes-wolfsentry-and-armv7a
2022-10-26 12:38:01 +10:00
e68c7bb74d Move file and BIO reading out to ssl_misc.c 2022-10-26 10:28:20 +10:00
e477571168 Fixes from review part 1 2022-10-26 10:28:20 +10:00
dad62fc182 pk.c: rework DH API and improve PEM read/write
Reorganized the DH APIs into groups.
Reworked all DH APIs.
Improved testing of DH API.

Implemented wolfSSL_PEM_read_RSAPublicKey() and
wolfSSL_PEM_write_RSA_PUBKEY().
Fix public key PEM write implementations to use the correct
header/footer names.
Added support for "RSA PUBLIC KEY" in header and footer in DerToPemEx().

Reworked PEM read/write APIs to be independent. No longer create an EVP
to use common function - common functionality refectored out.
Similarly file APIs don't create a BIO and call the partner APIs.

Improved testing of PEM read/write APIs.

Generic read BIO from memory BIO now returns the buffer instead of
allocating memory and reading.
No longer reading chunks when a file BIO.

Added wolfssl_make_rng() to create or get get global random. All RSA and
DH APIs now use this. DH_generate_parameters() creates a random object
and use global on error rather than just using global random.

Changed implementations to use BIO_new_fp() instead of create a new BIO
and setting file pointer.
2022-10-26 10:28:20 +10:00
8d8371ac5a Merge pull request #5717 from icing/sni-alpn-order
Changing ALPN selection to a deterministic point in the handshake.
2022-10-26 09:47:23 +10:00
0f9279ce52 Merge pull request #5684 from SparkiDev/ssl_sess_version_check
SSL session retrieval: check protocol version
2022-10-25 17:29:54 -06:00
55ab33a4a4 AES GCM decrypt C: don't decrypt when auth tag invalid 2022-10-26 09:25:28 +10:00
baa19c1092 tests/api.c: fix 3 clang-analyzer-deadcode.DeadStores. 2022-10-25 18:17:22 -05:00
29a5c04c2e add test case 2022-10-25 15:35:37 -07:00
7381846edb fix case of copying over status to existing struct 2022-10-25 15:33:17 -07:00
2575047ea2 wolfcrypt/src/port/arm/armv8-aes.c: define FIPS_NO_WRAPPERS, rather than undefine HAVE_FIPS, to fix FIPS builds. 2022-10-25 17:24:34 -05:00
e464d374c0 fix whitespace. 2022-10-25 17:24:34 -05:00
263123e7b4 wolfssl/test.h: add unsigned attribute to type of buffer passed to wolfsentry_config_json_feed() (sync with wolfsentry e22878b666). 2022-10-25 17:24:34 -05:00
084fabc733 Merge pull request #5731 from SparkiDev/armv7a_aes_fixup
AES-CBC decrypt ARMv8 no hw crypto: fixes
2022-10-25 17:23:45 -05:00
5c3b3e6ede Merge pull request #5733 from ejohnstown/assert-whitespace 2022-10-25 13:45:54 -07:00
e803e5916c Assert Consistency
1. Make whitespace in asserts consistent.
2. Added typecasting of the string inputs for AssertStr.
2022-10-25 11:42:51 -07:00
8b7668f771 Fix X509 subject and issuer name_hash mismatch
Fix api test and cleanup.
2022-10-25 13:00:22 -05:00
e7a121325b Merge pull request #5720 from julek-wolfssl/nid-defines 2022-10-25 10:34:59 -07:00
d052feeff2 Merge pull request #5675 from embhorn/zd14968
Fix coverity issues
2022-10-25 10:08:40 -07:00
2b72a50688 Merge pull request #5662 from Uriah-wolfSSL/haproxy-update-2.6.0 2022-10-25 07:47:54 -07:00
2ae815e2ee Use WOLFSSL_ERROR_MSG for error logs 2022-10-25 13:13:44 +02:00
55091c6464 Add small test 2022-10-25 13:13:14 +02:00
370b9f4d40 Merge pull request #5729 from JacobBarthelmeh/Benchmark
fix for define guards in benchmark app
2022-10-24 19:54:35 -07:00
e9a7c36c7b AES-CBC decrypt ARMv8 no hw crypto: fixes
Handle in and out buffer being the same.
2022-10-25 11:32:47 +10:00
9d1ed9c5d1 Merge pull request #5728 from douzzer/20221024-armv7a-enable-all
20221024-armv7a-enable-all
2022-10-25 11:28:31 +10:00
e3153f3997 Fix X509 subject and issuer name_hash mismatch 2022-10-24 18:09:44 -05:00
65d7d43497 use a check for if defined rather than value of macro 2022-10-24 16:32:19 -06:00
3677253b55 fixes and comments for buildability, warnings, and clarity, re WOLFSSL_ARMASM_NO_HW_CRYPTO, in configure.ac, wolfcrypt/src/port/arm/armv8-aes.c, and wolfcrypt/test/test.c. 2022-10-24 17:31:48 -05:00
eb4c3e06eb revert NO_MAIN_DRIVER behavior in benchmark app 2022-10-24 16:27:23 -06:00
19e30b081f Resolved sanitizer issue. 2022-10-24 16:27:18 -05:00
010fb64f74 Merge pull request #5718 from kareem-wolfssl/fpMaxBits 2022-10-24 12:27:59 -07:00
879f788bb9 Setting ssl->alpn_peer_requested_length to 0 when freeing ssl->alpn_peer_requested. 2022-10-24 10:27:16 +02:00
a1203917c5 Update after review by haydenroche5. 2022-10-24 10:17:29 +02:00
53bc10eb76 Merge pull request #5723 from Anthony-Tatowicz/ECC384-benchmark
Add SECP384 and SECP521 to bench
2022-10-22 11:03:26 -07:00
3aec9a15ce Merge pull request #5726 from ejohnstown/nucleus-thread
Nucleus Thread Types
2022-10-21 20:22:39 -07:00
1f82e90dbf Add SECP384 and SECP521 to bench 2022-10-21 18:50:59 -05:00
4859a00c2a Merge pull request #5698 from SparkiDev/aes_arm32_no_hw 2022-10-21 12:34:22 -07:00
a60a15d544 Merge pull request #5721 from philljj/zd15011 2022-10-21 12:32:03 -07:00
7c8dafab2f Nucleus Thread Types
Add a type block for Nucleus RTOS's thread types.
2022-10-21 11:40:59 -07:00
6aff27c5c8 Resolved valgrind issue. Updated ASN1_TIME usage per feedback.
Refactored wolfSSL_d2i_OCSP_CERTID per feedback.
2022-10-21 13:16:32 -05:00
e409acc0f7 cite RFC 5280 in DIST_POINT_NAME comment 2022-10-21 12:38:04 -05:00
378d475c5f Merge pull request #5724 from Anthony-Tatowicz/doc-fixes
Doc Example Typo Fix
2022-10-21 09:27:01 -07:00
3ddc766b38 rpmbuild: update with fixes
- Pass in the build configuration to the output rpm package
- Compiler test fails in %configure step in %prep due to missing linker script (injected by rpmbuild). Moving to %build section.
- .la files not wanted in rpm package and delete .la file after install step
- Compiler test fails due to missing linker script (injected by rpmbuild)
https://fedoraproject.org/wiki/Changes/RemoveLaFiles#Upgrade.2Fcompatibility_impact
- Conditional include sp_int.h
- FIPS header and hash update
2022-10-21 14:22:08 +02:00
92c7faafb7 Doc typo fix 2022-10-20 17:17:24 -05:00
1bde7b3d47 Merge pull request #5665 from SparkiDev/sp_msvc_x64_asm_fix 2022-10-20 15:09:29 -07:00
fdffdd241f Merge pull request #5711 from philljj/add_SSL_set1_host 2022-10-20 15:02:24 -07:00
bfe8b9b76c correct DIST_POINT_NAME type value 2022-10-20 15:10:36 -05:00
3591ce773c Merge pull request #5719 from ejohnstown/dh-test-key2 2022-10-20 10:29:26 -07:00
3339443260 Change NID_* from enum to #define 2022-10-20 17:07:32 +02:00
02d37f08fc Do not direclty return but goto exit label for cleanup of allocated resources in case ALPN selection or SNI callback fails. 2022-10-20 12:33:08 +02:00
057fdd30d3 Properly check the defined() combinations that make ALPN and SNI available for testing. 2022-10-20 09:21:36 +02:00
31222618b9 DH Test Keys
1. Add a flag to the DH test to indicate that the second key is initted.
2. Add a flag to the DH test to indicate that the RNG is initted.

Fixes an issue where the DH wolfCrypt test can crash or lock up when
the DH parameters file is missing. Localized to the test only.
2022-10-19 16:15:53 -07:00
5892655ab0 Don't override user-set FP_MAX_BITS when building FIPSv2. 2022-10-19 11:51:07 -07:00
86605c92ce Merge pull request #5714 from ejohnstown/inline-guard 2022-10-19 08:33:07 -07:00
f1cf96846a Changing ALPN selection to a deterministic point in the handshake. 2022-10-19 15:25:52 +02:00
90eefc2824 fix unit test when RSA disabled 2022-10-18 21:03:41 -05:00
930604f195 Merge pull request #5712 from haydenroche5/user_settings_asm
Make some improvements to user_settings_asm.h.
2022-10-18 17:10:39 -06:00
7399f72fb3 Merge pull request #5715 from douzzer/20221018-linux6v1-and-WOLFSSL_CALLBACKS-fixes
20221018-linux6v1-and-WOLFSSL_CALLBACKS-fixes
2022-10-18 15:30:05 -06:00
44eb6e447e Merge pull request #5713 from kaleb-himes/fix-fipsv2-win10 2022-10-18 13:02:59 -07:00
895a2e1ac5 WOLFSSL_CALLBACKS codepaths: fixes for bugprone-unused-return-value, bugprone-macro-parentheses, readability-named-parameter, and clang-analyzer-deadcode.DeadStores 2022-10-18 13:34:42 -05:00
c8c107a09e linuxkm/: fixes to deal with kernel 6.1+ show_free_areas() mess. 2022-10-18 13:34:24 -05:00
353a8a0275 Inline Function Guard
Fixed an inline function aes.c that was included, but never used. Added
similar preprocessor guard around it as when it is used.
2022-10-18 10:51:51 -07:00
c25e9d9994 FIPSv2 builds on win10 adjust for new fastmath default in settings.h 2022-10-18 10:50:01 -06:00
e3ced9f9ae Make some improvements to user_settings_asm.h.
For the CMake and autotools flows, enabling user_settings.h will define the
macro WOLFSSL_USER_SETTINGS_ASM. This will cause the generated
user_settings_asm.h to be included in the .S assembly files. If the user is
building without autotools or CMake, these files will include user_settings.h
directly, unless WOLFSSL_USER_SETTINGS_ASM is defined.
2022-10-18 09:20:06 -07:00
af518f8c86 adjust saving new OCSP cert 2022-10-18 08:33:13 -07:00
b7c4ddba72 Merge pull request #5663 from lealem47/scan_build 2022-10-18 08:10:33 -07:00
c5df62e647 Merge pull request #5705 from icing/earlydata-client 2022-10-18 07:26:46 -07:00
9726d1f6eb Allowing use of SSL/CTX_set_max_early_data() for client side.
- updating english doc and test cases
2022-10-18 10:40:18 +02:00
591101fd8b AES for ARM32 without using crypto hardware instructions
AES-ECB, AES-CBC, AES-CTR, AES-GCM, AES-CCM
Fix ldrd and strd to use even first first register and have
second register be next after first.
2022-10-18 08:31:53 +10:00
327b66d3ed Miscellaneous fixes from scan-build and KDF refactor & small build fixes 2022-10-17 14:34:08 -07:00
7e35919cc0 Add SSL_set1_host 2022-10-17 16:23:38 -05:00
a272731d45 Merge pull request #5707 from JacobBarthelmeh/Testing
free PKCS7 in test case
2022-10-17 11:21:48 -07:00
bc1c087701 free PKCS7 in test case 2022-10-17 08:24:38 -07:00
60aac9039d remove aesccm 2022-10-15 11:05:25 +09:00
60a8f6dff9 Add simple example working on Rx72n
Use T4-Tiny IP stack
2022-10-15 10:01:21 +09:00
f48b736ec3 Changed some WOLFSSL_ASN1_TIME handling and other fixes. 2022-10-14 17:09:35 -05:00
6f1db6c03a Merge pull request #5697 from cconlon/pkcs7SignedCertSet
PKCS#7: Fix SignedData verification when signer cert is not first in SET
2022-10-14 16:05:40 -06:00
2c503a5b34 Merge pull request #5682 from JacobBarthelmeh/Testing
additional sanity checks on debug callback
2022-10-14 09:25:14 -07:00
a1de8655da Merge pull request #5699 from SparkiDev/sp_cortexm_iccarm 2022-10-14 09:00:50 -07:00
b54eca4cfe Merge pull request #5700 from kaleb-himes/macOS-C++-proj-settings-rev2 2022-10-14 08:06:22 -07:00
6685ce7a10 Merge pull request #5702 from haydenroche5/ecc_nb_shared_secret_fix
Fix output length bug in SP non-blocking ECC shared secret gen.
2022-10-13 18:15:54 -07:00
40f1ba7e33 Fix output length bug in SP non-blocking ECC shared secret gen.
This was incorrectly being set to 32 for P-384/521 due to a bug in the SP gen
script.
2022-10-13 16:18:20 -07:00
6829c956b7 Merge pull request #5701 from dgarske/20221013_fixes 2022-10-13 14:59:41 -07:00
757549dd1b Merge pull request #5674 from rizlik/hrr_size_fix 2022-10-13 12:57:35 -07:00
843ea32dc7 Merge pull request #5694 from philljj/fix_enable-fastmath_disable-rsa_build 2022-10-13 12:49:25 -07:00
e2566bab21 Various build fixes:
* Fix api.c build error with `NO_FILESYSTEM` and `WOLFSSL_CERT_EXT`.
* Fix for building tests/suites.c with static memory (missing `LARGEST_MEM_BUCKET`).
* Always expose `wc_ecc_set_rng` for compatibility.
2022-10-13 12:49:06 -07:00
1b0171fe3e fix PKCS7 SignedData verification when signer cert is not first in SET 2022-10-13 11:03:13 -06:00
2fa2f8e88d fix: wrong size using DTLSv1.3 in RestartHandshakeHashWithCookie
HRR_MAX_HS_HEADER_SZ does not consider DTLS handshake extra fields.
2022-10-13 17:42:58 +02:00
656ad8959d Fix enable-fastmath with disable-rsa build.
Consistently guard WOLFSSL_MAX_RSA_BITS with both defines.
2022-10-13 10:10:10 -05:00
e47a213ea3 Fix settings following testing 2022-10-13 08:32:29 -04:00
47e3ffade6 SP Cortex-M: suport for ICCARM
Change ifdefs to use GNUC form for conditional branch for ICCARM.
2022-10-13 14:26:43 +10:00
4fa0deadda Merge pull request #5696 from ejohnstown/wc_only 2022-10-12 17:11:06 -07:00
b838d65a72 wincrypt.h requires windows.h, which isn't included in internal.h when WOLFCRYPT_ONLY set 2022-10-12 15:33:23 -07:00
dc8997d4b6 Added more APIs for HaProxy integration. 2022-10-12 15:45:09 -05:00
478b0cd4aa Added more APIs for HaProxy integration. 2022-10-12 15:27:31 -05:00
248952648d Fix enable-fastmath with disable-rsa build.
WOLFSSL_MAX_RSA_BITS was being checked against ENCRYPT_BASE_BITS
even though RSA is disabled.
2022-10-12 15:26:05 -05:00
3c7f01d853 Added WOLFSSL_ASN1_TIME to CRL 2022-10-12 15:10:29 -05:00
0f0496ae8f Added WOLFSSL_ASN1_TIME to CRL 2022-10-12 14:30:26 -05:00
5cbb099dc9 Updated per PR comments. 2022-10-12 14:06:57 -05:00
9117f8b51b Added more APIs for HaProxy integration. 2022-10-12 14:06:57 -05:00
b798c5f3a0 Added wolfSSL_X509_REVOKED_get_revocationDate() 2022-10-12 14:06:56 -05:00
72839d05f5 Merge pull request #5692 from douzzer/20221012-fix-file-modes-and-tweak-user_settings_asm.sh 2022-10-12 11:39:17 -07:00
46ecd909e9 Merge pull request #5691 from philljj/fix_lowresource_build 2022-10-12 09:35:48 -07:00
67c194edf8 scripts/user_settings_asm.sh: give priority to user_settings.h found via the supplied search path arguments, and fall back to current directory; use POSIX sh variable expansions for prefix trimming and variable existence testing; trim trailing slash from supplied search path arguments; direct error messages to stderr. 2022-10-12 11:20:56 -05:00
e05d044cf9 fix file modes. 2022-10-12 11:16:20 -05:00
06511a0f2e tiny fix for broken lowresource build option 2022-10-11 17:54:42 -05:00
927f4c445d additional sanity checks on debug callback 2022-10-11 13:14:59 -07:00
4d37e8d687 Merge pull request #5680 from embhorn/gh5679
Fix tirtos build
2022-10-11 11:31:41 -07:00
0a36091afd Merge pull request #5687 from danielinux/forcezero-fastmath
ForceZero enabled with USE_FAST_MATH
2022-10-11 11:23:05 -07:00
c9336865d0 ForceZero enabled with USE_FAST_MATH 2022-10-11 17:38:58 +02:00
3b33c962c4 Merge pull request #5660 from haydenroche5/load_system_root_certs
Add support for wolfSSL_CTX_load_system_CA_certs on Windows and Mac.
2022-10-11 08:38:57 -07:00
80b826b510 Merge pull request #5647 from kaleb-himes/macOS-C++-proj-settings 2022-10-11 08:00:52 -07:00
5f0d85adb5 Merge pull request #5666 from per-allansson/windows-wolfio-connect-timeout-bug 2022-10-11 07:42:46 -07:00
43809b5f97 SSL session retrieval: check protocol version
When looking up the session by ID on the server, check that the protocol
version of the SSL and session match on TLS 1.3 or not.
TLS 1.3 sessions don't work with TLS 1.2 handshakes and vice-versa.
2022-10-11 11:07:05 +10:00
b7f74962ad Merge pull request #5683 from douzzer/20221010-fixes-missing-field-initializers-etc
20221010-fixes-missing-field-initializers-etc
2022-10-10 16:29:27 -07:00
4d9aacbe87 Merge pull request #5678 from SparkiDev/curve448_32bit_fix
Curve448 32-bit C code: handle corner case
2022-10-10 16:28:43 -07:00
af4987628f wolfssl/test.h: fix bugprone-macro-parentheses. 2022-10-10 17:08:51 -05:00
1bca5d80a1 configure.ac: fix hard tab. 2022-10-10 16:51:19 -05:00
e48e406def CMakeLists.txt: add handling for WARNING_C_FLAGS in setup for CMAKE_C_FLAGS, to allow override warning config, e.g. without -Werror. 2022-10-10 16:48:49 -05:00
02863d2e81 configure.ac: when FIPS 140-3, disable AES-GCM streaming API, unless "dev". 2022-10-10 16:37:38 -05:00
6456b244d3 tests/api.c: refactor struct initializer using XMEMCPY() to mollify -Werror=missing-field-initializers in C++ builds. 2022-10-10 16:18:33 -05:00
ea5e814dfa Fix tirtos build 2022-10-10 11:36:40 -05:00
b1f97c6bc0 Merge pull request #5652 from rizlik/send_alert_on_version_mismatch 2022-10-10 11:16:11 +02:00
46091b7c7d Curve448 32-bit C code: handle corner case
For sqr and mul (28/32 bits) the sums of products can exceed maximum
64-bit signed value. Handle last sum value, that may cause overflow,
separately.
Fix formatting of overflow last line.
2022-10-10 11:33:46 +10:00
12bfa24ecc Merge pull request #5559 from tmael/crl_bs_p 2022-10-09 09:45:49 -07:00
47ccd924c2 Merge pull request #5657 from julek-wolfssl/dtls-1.2-stateless 2022-10-09 09:31:07 -07:00
018204f904 Merge pull request #5677 from kaleb-himes/small-stack-refactor-fix
Fix: test.c not printing out status of tests
2022-10-08 11:26:36 -07:00
65c872e910 Merge pull request #5670 from dgarske/smallstack_fixes2
Fix for Linux kernel module and stdio.h
2022-10-08 09:08:13 -06:00
7a265dcd2f Fix: test.c not printing out status of tests 2022-10-08 08:34:34 -06:00
b4e0137d37 Fix coverity issues 2022-10-07 14:49:05 -05:00
98ac4a6f9c Add ability to toggle system CA certs support. 2022-10-07 12:34:00 -07:00
5704c83f78 Unused param 2022-10-07 12:24:52 -07:00
e4da4f60d9 Implemented suggested changes 2022-10-07 11:24:09 -07:00
a738927846 Add CRL binary search, CRL_STATIC_REVOKED_LIST 2022-10-07 11:24:09 -07:00
82fbb7920a Merge pull request #5624 from julek-wolfssl/dtlscid-prb 2022-10-07 09:48:19 -07:00
b4e5ee3f6b Merge pull request #5672 from SparkiDev/kyber_inc_fix
Kyber: only include source when not FIPS
2022-10-07 08:39:54 -07:00
aaea77bce3 Merge pull request #5669 from JacobBarthelmeh/Docs
update changelog notes
2022-10-07 08:29:19 -05:00
b45ab0ae15 Add dtlscid.test to make check testing 2022-10-07 10:44:42 +02:00
5c85c8e128 Merge pull request #5658 from philljj/fix_wolfSSL_sk_X509_new 2022-10-06 17:18:03 -07:00
82bee5d6f1 Merge pull request #5671 from SparkiDev/aes_x86_asm_fix 2022-10-06 17:14:28 -07:00
b50a786cb2 Add support for wolfSSL_CTX_load_system_CA_certs on Windows and Mac.
Additionally, fix CMake build to add WOLFSSL_X86_64_BUILD when building for
x86_64.
2022-10-06 17:12:21 -07:00
be41af6527 Kyber: only include source when not FIPS 2022-10-07 08:33:05 +10:00
34a03f6646 AES-GCM x86: fix for AESNI implementation
Jump to non-inplace decrypt update when pointers are different.
2022-10-07 08:16:08 +10:00
bc78ecfa6c Fix for linuxkm and stdio.h. 2022-10-06 14:36:09 -07:00
af7c0e9b74 Merge pull request #5668 from dgarske/smallstack_fixes 2022-10-06 14:29:41 -07:00
e720d4ab3b update changelog notes 2022-10-06 14:31:25 -06:00
8ff6dc2a9a clean up wolfSSL_sk_X509_new 2022-10-06 14:13:30 -05:00
0eb4a7807b Fixes from small stack refactor (#5631). Resolves these multi-test errors:
```
wolfssl/wolfcrypt/mem_track.h:700:9: error: Memory leak: shim_args [memleak]
        return ret;
        ^

wolfssl/wolfssl/wolfcrypt/types.h:1248:17: error: unknown type name ‘pthread_t’
 1248 |         typedef pthread_t     THREAD_TYPE;
```
2022-10-06 11:32:27 -07:00
4962134ff5 Merge pull request #5667 from tim-weller-wolfssl/wolfssl-strongswan-update 2022-10-06 09:56:01 -07:00
7f42792616 DTLS 1.2: Test stateless server connection 2022-10-06 18:53:13 +02:00
d2f672db96 Merge pull request #5661 from kaleb-himes/aes_asm_FIPS_checkouts 2022-10-06 08:52:41 -07:00
474bc6ee1a Remove unused ASN1_GENERALIZEDTIME enum value (conflicts with strongSwan ASN enum and wolfSSL OpenSSL compatibility layer) 2022-10-06 09:23:56 -05:00
68dc01e7b7 fix bug with wolfIO_TcpConnect not working with timeout
- non-blocking connect() on Windows returns SOCKET_ERROR + WSAEWOULDBLOCK
- the check for fd against FD_SETSIZE is wrong (and not needed) on Windows
2022-10-06 14:14:33 +02:00
800830187b Fixes for SP and x86_64 with MSVC
Add inline implementations of assembly snippets for MSVC.
Missing multiplier when index memory address.
2022-10-06 15:35:50 +10:00
18b54f2ae7 Merge pull request #5664 from kaleb-himes/SGX_FIXUP 2022-10-05 15:18:55 -07:00
2bd3814953 fix failed Visual Studio Build Test 2022-10-05 15:08:08 -05:00
6178b3e365 Fixup builds using WOLFSSL_LOG_PRINTF (SGX test exposed) 2022-10-05 13:54:22 -06:00
ebb378096a test: DTLSv1.2: send alert when version negotiation fails 2022-10-05 20:29:23 +02:00
84748757b0 tests: refactor ticket-nonce-test callbacks to re-use code 2022-10-05 20:29:23 +02:00
a7a7a25ab0 ssl: move wolfSSL_GetSide outside ATOMIC_USER guard 2022-10-05 20:29:23 +02:00
de6187f599 tls: send protocol_version fatal alert on version mismatch
see rfc5246 Appendix E
2022-10-05 20:29:23 +02:00
1e2397aa5a Implement peer review feedback and enhance PAA settings 2022-10-05 10:52:12 -06:00
a2b48aac53 Update v5 checkout for sha256_asm and sha512_asm 2022-10-05 10:00:47 -06:00
df5fd87f0b Modify checkout of aes_asm.S (and .asm) given commit 6f4af15 2022-10-05 09:12:47 -06:00
cb5828235b Merge pull request #5653 from haydenroche5/load_system_root_certs
Add --sys-ca-certs option to example client.
2022-10-04 18:25:50 -07:00
6f4af1581b Merge pull request #5650 from SparkiDev/aes_x86_asm 2022-10-04 16:40:02 -07:00
c989dd9590 Merge pull request #5641 from haydenroche5/user_settings_asm
Generate an assembler-safe user_settings.h in configure.ac and CMakeLists.txt.
2022-10-05 07:51:56 +10:00
79d9bc376f Merge pull request #5631 from dgarske/smallstack 2022-10-04 14:39:17 -07:00
66ce7635b9 AES x86 ASM: new assembly
Added new x86 assembly for AES.
AES-CBC decrypt only 4 blocks at a time (not 6 or 8) due to reduces
register count.
GCM implementation for AVX2, AVX1 and AESNI only.
Disabled looking for other assembly files for x86.
2022-10-05 07:34:42 +10:00
984649eeac Correct wolfSSL_sk_X509_new in OpenSSL compatible API 2022-10-04 15:20:32 -05:00
0006d1f91c Fix benchmark with small stack and WOLFSSL_RSA_VERIFY_ONLY. 2022-10-04 08:39:42 -07:00
354cd2ed50 DTLS 1.2: Reset state when sending HelloVerifyRequest 2022-10-04 16:22:59 +02:00
3bcd4b45df Generate an assembler-safe user_settings.h in configure.ac and CMakeLists.txt.
For user_settings.h builds, .S assembly files need to include user_settings.h
in order to get the defines used by the build. However, a user_settings.h may
contain code only understood by a C compiler and not the assembler (e.g. a
typedef). This commit makes it so our autotools and CMake builds produce a file
user_settings_asm.h when doing a user_settings.h build. This generated header
contains only the preprocessor directives from the user_settings.h. As a result,
it can be safely included by our assembly code files.
2022-10-03 16:00:32 -07:00
58d482428e Merge pull request #5649 from philljj/zd14898 2022-10-03 14:00:45 -07:00
bfa13376fa Merge pull request #5642 from lealem47/WIN_snifftest 2022-10-03 13:49:06 -07:00
09f4a94b24 Fixes for small stack in TLS v1.3, HKDF and SHA2. Add new WC_ASN_HASH_SHA256 build option to allow forcing SHA2-256 for the internal certificate calculations. Fixes for integer.c with small stack (allocate only the size needed, not the max). 2022-10-03 12:52:11 -07:00
b91e48d770 Add snifftest vcxproj file and documentation 2022-10-03 10:22:53 -07:00
8101800cd9 Merge pull request #5656 from douzzer/20220930-wolfsentry-API-update
20220930-wolfsentry-API-update
2022-10-03 09:12:16 -07:00
898ddac159 Add --sys-ca-certs option to example client.
Using this option will call wolfSSL_CTX_load_system_CA_certs on the client ctx.
2022-10-03 09:05:23 -07:00
d0540adac2 wolfssl/test.h: update wolfSentry calls for API changes in wolfSentry-0.6.0. 2022-09-30 22:28:21 -05:00
db6ffae376 Merge pull request #5655 from lealem47/api_test_leak
Fix for EVP_PKEY_DH memory leak
2022-09-30 17:26:30 -07:00
e77c3849a0 Fix for evp key leak in unit tests 2022-09-30 16:02:07 -07:00
f9506dc05a Add small stack to DoClientHello Suites (360 bytes). Add small stack for DRBG health test. Refactor of the small stack into its own header, to allow easier use in other files. Minor build fixes. 2022-09-30 14:06:31 -07:00
f02fe73eb4 Correct default setting 2022-09-30 14:02:07 -06:00
6506c45918 Merge pull request #5654 from douzzer/20220930-fixes-smallstack-shellcheck-etc
20220930-fixes-smallstack-shellcheck-etc
2022-09-30 12:13:00 -07:00
acb35029a0 wolfssl/ssl.h: remove redundant prototype for wolfSSL_CTX_set_default_verify_paths(). 2022-09-30 12:06:31 -05:00
548d432df3 wolfcrypt/test/test.c: fix gating, and smallstack refactors, for ecc_test_deterministic_k(), ecc384_test_deterministic_k(), and ecc521_test_deterministic_k(). 2022-09-30 12:06:15 -05:00
ddad526e64 wolfcrypt/benchmark/benchmark.c: fix clang-tidy complaints around ungrouped string continuation and unparenthesized macro args. 2022-09-30 12:05:57 -05:00
e9520fe131 shellcheck-guided fixes in IDE/XilinxSDK/bench.sh, IDE/XilinxSDK/combine.sh, IDE/XilinxSDK/graph.sh, and scripts/bench/bench_functions.sh. 2022-09-30 12:05:40 -05:00
eccba1401f fix valgrind leak in new unit test 2022-09-30 11:24:54 -05:00
08009e73fc Add RSA PSS salt defines to engine builds if not FIPS v2.
WOLFSSL_PSS_LONG_SALT and WOLFSSL_PSS_SALT_LEN_DISCOVER are supported in our
latest FIPS module (v5). These should be defined for engine builds as long as
the FIPS version isn't v2.
2022-09-30 08:21:15 -07:00
5070994ae2 Merge pull request #5644 from tim-weller-wolfssl/crossworks-test-update 2022-09-30 08:00:01 -07:00
0f66c90b54 implement sk_X509_shift for zd 14898 2022-09-29 23:04:31 -05:00
8ae08d594e Add user_settings.h for Intel/M1 FIPSv2 macOS C++ projects 2022-09-29 16:06:08 -06:00
bba3193f9c Merge pull request #5595 from haydenroche5/async_ticket_dec_fix
Handle WC_PENDING_E from ticketEncCb in DoClientTicket properly.
2022-09-29 14:41:35 -07:00
591d1ada94 Merge pull request #5615 from JacobBarthelmeh/RSAPSS 2022-09-29 14:39:05 -07:00
5524500e85 Merge pull request #5166 from sjaeckel/versal-bringup
Versal bringup
2022-09-29 13:27:13 -07:00
26f01168b5 Merge pull request #5645 from rizlik/fix_bad_heap_hint
fix: tls13: fix wrong heap hint argument of XFREE
2022-09-29 13:06:31 -07:00
ab44c89ab4 Merge pull request #5626 from haydenroche5/load_system_root_certs
Add a function to load system CA certs into a WOLFSSL_CTX.
2022-09-29 11:03:26 -07:00
a5a9ab96e6 Merge pull request #5524 from rizlik/protocol_version_alerts
Dtls13: improvements
2022-09-29 10:59:06 -07:00
d0bf083050 Merge pull request #5643 from SparkiDev/gen_arm32_fixup
ARM32 assembly code: fixed scripts
2022-09-29 10:20:06 -07:00
e971bd7315 add FreeRTOS example to include.am 2022-09-29 09:57:23 -06:00
32eca32c97 fix: tls13: fix wrong heap hint argument of XFREE 2022-09-29 17:56:59 +02:00
0e57e9858f Integrate Xilinx Versal
* add Versal specific glue
   The same structure of an "XSecure client" is used throughout the API's,
   therefor define it once and re-use in all clients.
* integrate Versal AES-GCM engine
* integrate Versal SHA3-384 engine
* add versal support to tests
  - There's no intermediate-hash API for Versal.
* add specific test with large AAD
   Test only with `n*16 byte` wide chunks of AAD, so it gets processed in the
   hardware engine.
* add specific test with misaligned AES-GCM arguments
* integrate Versal RSA engine
* disable failing RSA test-case when Xilinx Crypto is enabled
* introduce define `WOLFSSL_XILINX_CRYPT_VERSAL`
* integrate Versal TRNG engine
* allow using Versal TRNG w/o wolfcrypt DRBG
   Versal TRNG already provides a HRNG mode which does the same as the
   wolfcrypt DRBG implementation.
* add support for user-supplied nonce to Versal TRNG
* add `wc_XsecureErrorToString()` to map PLM error codes to messages.
* integrate Versal EcDSA engine
* update tests to work with Versal EcDSA
   If deterministic K is enabled, the tests failed here since the Versal
   EcDSA engine doesn't support the SECP256R1 curve yet.
* Xilinx crypto engines like aligned memory very much
   Make this a default choice, not via the user configuration.
* add Xilinx-specific `WOLFSSL_MSG()` equivalent
   `WOLFSSL_XIL_MSG()` does the same as `WOLFSSL_MSG()` besides waiting for
   1 second before printing to stdout, since the PLM maybe prints to same and
   outputs would be mixed up.
   This waiting can be disabled by defining `WOLFSSL_XIL_MSG_NO_SLEEP`.
* add option to enable DPA CounterMeasures in AES-GCM crypto engine
* add "command mode" to Xilinx bare-metal example
* update Xilinx default user settings
* add script to execute benchmarks
* add scripts to create graphics
* add Vitis 2022.1 example projects

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-29 09:39:57 -06:00
f24cf38f01 Update benchmarks
* add option to run benchmarks with and w/o AAD
   This adds the possibility to benchmark AES-GCM and AES-CCM both with and
   w/o AAD, with the option to also run both.
   The default behavior when wolfSSL provides the `main()` function is
   unchanged.
   The default behavior when wolfSSL doesn't provide the `main()` function has
   been changed to "run both benchmarks - with and w/o ADD".
* add option to run benchmarks against 4096bit RSA&DH keys
* remove `BENCH_SIZE` macro from benchmark.c
* pre-define benchmark sizes in a single place, before it had to be done in two places
* improve `benchmark_static_init()`
   - static variable doesn't need to be in global scope
   - add option to force re-init
   - add more static variables to be reset
* add `-blocks` option to benchmarks
* expose benchmark `main()` as `wolfcrypt_benchmark_main()`
* fix benchmark `-?` output
* use correct SI/Binary prefix in benchmarks
* use a separate column per detail in CSV output of benchmark
* add `-aad_size` option to benchmark
* don't always print symmetric CSV headers
* always use M[i]B/s when output format is CSV
* Versal specific patches for benchmarks
   This also removes the default define for `COUNTS_PER_SECOND` for Xilinx
   targets, since I prefer to have a build failure over wrongly calculated
   output.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-29 09:39:57 -06:00
f4e258d196 Generic changes
* fix compilation warning
* adjust SHA3-384 test error-codes
   The way the codes were constructed before, they were not unique.
* unify code
   Instead of having `ifdef`'s in the code, define our own wrapper around
   the keysource as required.
* add CMake option for help-text in wolfCrypt tests
* expose test `main()` as `wolfcrypt_test_main()`
* Don't overwrite previously set errors
* add FreeRTOS support for Xilinx demo
* move `fp_reverse` from `tfm.c` to `wolfmath.c` and rename to
  `mp_reverse`.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-29 09:39:57 -06:00
14b776c9a4 Adding C library support furnction to write a buffer (always to UART) 2022-09-29 10:34:16 -05:00
5a55ec6968 ARM32 assembly code: fixed scripts
Generation scripts fixed for ARM32.
Regenerated output inlcudes:
  - support for ARM32 architectures less than 7
  - SP code also ensures parameters are in specific registers
2022-09-29 09:04:05 +10:00
754d274d8c Merge pull request #5593 from rizlik/ticket_nonce_size
tls13: support ticketNonce with size bigger than MAX_TICKET_NONCE_SZ
2022-09-29 08:11:22 +10:00
cec6341e23 Merge pull request #5640 from kaleb-himes/ARMv8-FIPSv2-MOD-TEST
Do not perform IV Wrap test when using cert3389 inlined armasm
2022-09-29 08:01:54 +10:00
ae4228f928 tests: add WOLFSSL_TICKE_NONCE_MALLOC tests 2022-09-28 19:54:14 +02:00
c508ff3da9 internal.h: allow customization of MAX_TICKET_NONCE_STATIC_SZ 2022-09-28 19:54:14 +02:00
56d6087749 tls13: support ticketNonce bigger than MAX_TICKET_NONCE_SZ
to enable it, use WOLFSSL_TICKET_NONCE_MALLOC define
2022-09-28 19:54:14 +02:00
aa5d074d23 dtls13: abide g++ compiler errors
```
src/tls13.c:5330:72: error: invalid conversion from 'void*' to 'const byte*' {aka 'const unsigned char*'} [-fpermissive]
 5330 |             ret = wc_HmacUpdate(&cookieHmac, ssl->buffers.dtlsCtx.peer.sa,
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                                        |
      |                                                                        void*
./wolfssl/wolfcrypt/hmac.h:191:55: note:   initializing argument 2 of 'int wc_HmacUpdate(Hmac*, const byte*, word32)'
  191 | WOLFSSL_API int wc_HmacUpdate(Hmac* hmac, const byte* in, word32 sz);
```
2022-09-28 18:42:39 +02:00
d8e10d8ef4 DTLS 1.3: Always reset state on HRR 2022-09-28 18:42:39 +02:00
c72d315325 DTLS 1.3: Don't add HRR to ssl->dtls13Rtx
Signed-off-by: Marco Oliverio <marco@wolfssl.com>
2022-09-28 18:42:38 +02:00
145086f776 DTLS 1.3: Clear ssl->dtls13SendingAckOrRtx in ssl.c 2022-09-28 18:42:38 +02:00
3c60926bfa tests: silently dropping bad records after handshake in DTLS 2022-09-28 18:42:38 +02:00
6e4a3ecdbd tests: add negative version negotation tests 2022-09-28 18:42:38 +02:00
b3ecdd2ecb dtls13: support stateless cookie exchange on blocking socket 2022-09-28 18:42:38 +02:00
0b525a52c4 tls13: send protocol_version alert on failed version negotiation 2022-09-28 18:42:38 +02:00
88ec118e89 dtls13: drop unencrypted messages after epoch 1 2022-09-28 18:42:38 +02:00
400671dc7c dtls: drop non-handshake messages before cookie exchange 2022-09-28 18:42:38 +02:00
8cae05348c Add a function to load system CA certs into a WOLFSSL_CTX.
This new function, wolfSSL_CTX_load_system_CA_certs, currently only supports
Linux-based OS's. It searches through conventional CA directories and once it
finds one, attempts to load CA certs from it. After the first directory is
found, we don't check the others.

This commit also adds a function wolfSSL_get_system_CA_dirs, which returns a
pointer to an array of directories where wolfSSL_CTX_load_system_CA_certs will
look for CA certs. This is used in a unit test, where we only want to expect
success if one of these directories actually exists on the test system.

Finally, this commit adds support for SSL_CTX_set_default_verify_paths to the
compatibility layer. It doesn't model the exact behavior of its OpenSSL
counterpart; it's mostly a wrapper around wolfSSL_CTX_load_system_CA_certs,
manipulating the return value of that function to conform to OpenSSL's
conventions.
2022-09-28 08:50:46 -07:00
2d1f22c35a Merge pull request #5639 from Anthony-Tatowicz/master
Add Irq install for Aruix example
2022-09-28 06:55:56 -04:00
d61656d5e7 Do not perform IV Wrap test when using cert3389 inlined armasm 2022-09-27 17:15:19 -06:00
f1e2165c59 Merge pull request #5638 from JacobBarthelmeh/release 2022-09-27 14:21:19 -07:00
eb5076bb89 update changelog for release 5.5.1 2022-09-27 13:40:00 -06:00
ffe052e845 Merge pull request #5634 from douzzer/20220926-fixes
20220926-fixes
2022-09-27 11:49:20 -06:00
13d53b5297 Add Irq install for Aruix example 2022-09-27 12:04:27 -05:00
dde5ef558b Merge pull request #5633 from SparkiDev/sp_mod_fix
SP int all: sp_mod
2022-09-27 10:23:03 -06:00
cc03e3fdab wolfcrypt/src/misc.c ByteReverseWords(): mollify MSVC re C4311. 2022-09-27 10:05:07 -05:00
cfe0278d35 wolfcrypt/src/misc.c ByteReverseWords(): fix misaligned word accesses under armv7a-asm. 2022-09-27 02:02:31 -05:00
1ffe4275ae fix whitespace 2022-09-26 23:32:59 -05:00
34fd412fd6 SP int all: sp_mod
sp_mod wasn't checking return of sp_init_size.
Add _sp_init_size change and change calls.
2022-09-27 10:05:13 +10:00
8617de86c1 Merge pull request #5632 from JacobBarthelmeh/Testing
Misc. testing items
2022-09-27 08:25:18 +10:00
1e348eb7bd sanity check on return value 2022-09-26 10:40:41 -07:00
cc4e8df56d cast to fix warning in test case 2022-09-26 10:13:06 -07:00
9d9fa0132e Merge pull request #5622 from lealem47/sniffer_sequence
Fix for sniffer to decode out of order packets
2022-09-26 07:53:00 -07:00
b4077d80c9 Merge pull request #5620 from JacobBarthelmeh/Certs
fix for return value of x509 print
2022-09-25 19:32:52 -07:00
b1a69f6469 Merge pull request #5630 from dgarske/deos_cleanups
Support for DEOS RTEMS and minor build fixes
2022-09-26 09:06:49 +10:00
55a0f6d97b Support for RTEMS in the DEOS user_settings.h template and time. Fix for bio.c and OPENSSL_EXTRA which needs XATOI. Fix for SP math ECC with 384-bit and 521-bit curves enabled. 2022-09-25 10:41:05 -07:00
f80fb7f1aa Merge pull request #5625 from dgarske/esp32_cleanups
Fixes for various build configurations
2022-09-23 20:46:44 -05:00
221fd275fd Fixes for building without SHAKE. 2022-09-23 14:50:16 -07:00
2421727b1c Merge pull request #5441 from kareem-wolfssl/quietShutdown
Make wolfSSL quiet_shutdown functions available when using OPENSSL_EXTRA_X509_SMALL.
2022-09-23 14:40:29 -07:00
606f58a851 Spelling and whitespace cleanups. 2022-09-23 13:58:58 -07:00
b42631c721 Fix for ESP32 wolfcrypt_test entry point. 2022-09-23 13:58:49 -07:00
792eac9484 Fixes for building the API unit test without filesystem NO_FILESYSTEM. 2022-09-23 13:58:17 -07:00
7a69415e79 Fix for possible memory leak on failure in RSA/DH public key decode with heap based math. 2022-09-23 13:53:16 -07:00
c29e602ea5 Fix for building with WOLFSSL_ASN_TEMPLATE and IGNORE_NAME_CONSTRAINTS. 2022-09-23 13:52:55 -07:00
7970d5d794 Merge pull request #5152 from SparkiDev/armv7a_neon_asm
ARM ASM: ARMv7a with NEON instructions
2022-09-23 08:46:03 -07:00
62670d9263 Merge pull request #5619 from kaleb-himes/AZURE-fix2
Fix undesirable kyber dependencies when not building kyber (#2)
2022-09-22 19:55:50 -07:00
1b9656f72d ARM ASM: add fpu directive to assembly files 2022-09-23 12:31:39 +10:00
aa1a95e70b Merge pull request #5621 from tmael/sp_1024_sakke
Wrap 1024 single precision math with WOLFCRYPT_HAVE_SAKKE
2022-09-23 08:52:05 +10:00
a322e09150 Fix for sniffer to decode out of order packets 2022-09-22 15:12:51 -07:00
7805ffeee0 Fix enable-sp=1024 2022-09-22 14:03:40 -07:00
f113e92495 Merge pull request #5612 from kareem-wolfssl/base16Ending
Update Base16_Encode so the ending null terminator is optional.
2022-09-22 13:24:19 -07:00
938ab16907 Also address assembly file 2022-09-22 14:15:46 -06:00
39815a53fa fix for return value of x509 print 2022-09-22 14:09:50 -06:00
77676537f6 Fix undesirable kyber dependencies when not building kyber (#2) 2022-09-22 10:43:03 -06:00
7ca9e4f084 Merge pull request #5616 from julek-wolfssl/dtls13.test-proxy-path
dtls13.test: Allow setting UDP_PROXY_PATH in env
2022-09-22 09:15:32 -07:00
13555bebcd Merge pull request #5617 from kaleb-himes/FIX-AZURE-TEST
Fix undesirable kyber dependencies when not building kyber
2022-09-22 09:04:35 -07:00
f271bef7b5 Merge pull request #5618 from lealem47/dc
Fix for incorrect DN NID and confusion with DC
2022-09-21 15:00:25 -07:00
216d4afaad Merge pull request #5611 from tim-weller-wolfssl/zd14815-updates
Updates to remove build warnings and test/example code update to avoid memory leak
2022-09-21 14:33:37 -07:00
f177d9364a Fix for incorrect DN NID and confusion with DC 2022-09-21 13:11:12 -07:00
62766b0758 Updates to remove warnings and build issues found with IAR tools. Update test function / example to avoid memory leak. Update to pass error codes along rather than mask them at lower levels.
Make logic to avoid masking return error conditionally compiled based on STSAFE configuration

Update logic at second crypto-callback location to return error code rather than mask it
2022-09-21 14:16:49 -05:00
913bbc8f79 Merge pull request #5613 from kareem-wolfssl/staticEccFix
Fix bad casts in wc_EccPublicKeyDecode when using WOLFSSL_ECC_CURVE_STATIC with custom curves.
2022-09-21 11:38:06 -07:00
38d4df0c0f Merge pull request #5610 from kareem-wolfssl/v5Fips
Restore v5-dev/v5-ready configure options.
2022-09-21 12:56:27 -05:00
680182cab5 Merge pull request #5614 from rizlik/oobread
Fix: parsing oob read in dtls1.3
2022-09-21 10:08:32 -07:00
d672f10f7e Fix undesirable kyber dependencies when not building kyber 2022-09-21 09:58:38 -06:00
2bf583aa57 Merge pull request #5526 from miyazakh/qt_jenkins_fix
Fix qt nightly test failure
2022-09-21 09:38:45 -06:00
f9b2ef47c9 dtls13.test: Allow setting UDP_PROXY_PATH in env 2022-09-21 16:49:53 +02:00
dc0b2553fc handle certificates with RSA-PSS signature that have RSAk public keys 2022-09-21 08:24:09 -06:00
400d3c6963 dtls13: Dtls13ParseUnifiedRecordLayer: add overflow check 2022-09-21 16:01:35 +02:00
804081e7c2 fix: GetDtls13RecordHeader:requires correct minimum size 2022-09-21 16:01:35 +02:00
a36604079b Merge pull request #5609 from philljj/master
Fixes DTLS 1.3 client use-after-free error
2022-09-21 06:38:09 -07:00
1a983b4a8f session: use plain buffer to store ticket nonce in ticket 2022-09-21 14:51:07 +02:00
2578f2c8f2 ARMv8 32 Inline ASM: fixes
Force parameters to use specific registers.
Shift/rotate amount must have '#' prepended.
2022-09-21 10:45:50 +10:00
ca392fb200 ARM32 ASM Inline: fix SHA-256 inline asm to compile 2022-09-21 09:58:16 +10:00
c6bd297bd2 Fix bad casts in wc_EccPublicKeyDecode when using WOLFSSL_ECC_CURVE_STATIC with custom curves. 2022-09-20 15:37:12 -07:00
c146fcf581 Update Base16_Encode so the ending null terminator is optional. 2022-09-20 14:44:01 -07:00
76afcc1da4 Restore v5-dev/v5-ready configure options as customers are currently using them. 2022-09-20 14:26:15 -07:00
90c9363af8 Merge pull request #5538 from satoshiyamaguchi/trial5
Add wolfSSL_EVP_PKEY_new_CMAC_key to OpenSSL compatible API
2022-09-20 13:01:52 -07:00
427383233d Fix formatting, add check to not support plain HTTP requests in DTLS 2022-09-20 14:41:11 -05:00
624aca80dc Merge pull request #5606 from julek-wolfssl/zd14813-cont
0 len sz is allowed
2022-09-20 09:49:17 -07:00
8336dbf366 Fixes DTLS 1.3 client use-after-free error 2022-09-20 09:17:08 -05:00
c6ea68a118 Fix two not freed WOLFSSL_CMAC_CTX. 2022-09-20 23:10:22 +09:00
05b6cb5279 internal: drops bad DTLS records on established connection 2022-09-20 11:18:30 +02:00
655ac3e822 refactor: new define to remove some preprocessor directives 2022-09-20 11:18:26 +02:00
43715d1bb5 Merge pull request #5607 from haydenroche5/140_3_version_fixes
Clean up some FIPS versioning logic in configure.ac and WIN10 user_settings.h.
2022-09-19 20:48:25 -06:00
d212974d5e Clean up some FIPS versioning logic in configure.ac and WIN10 user_settings.h.
configure.ac: Get rid of v5-RC8, v5-RC9, v5-RC10, v5-RC11, v5-ready, and v5-dev.
v5-ready is now just ready and v5-dev just dev.
IDE/WIN10/user_settings.h: Make the FIPS blocks define HAVE_FIPS. Change WCv5.0
block to WCv5.0-RC12. Change FIPS Ready block to use HAVE_FIPS_VERSION_MINOR 3
instead of HAVE_FIPS_VERSION_MINOR 2.
2022-09-19 15:26:06 -07:00
73dbc873bd Merge pull request #5586 from julek-wolfssl/dtls-misc-security
Add missing minor security checks
2022-09-19 09:47:00 -07:00
cf3d9df443 Merge pull request #5605 from julek-wolfssl/gitignore
Add async and fips test folders to gitignore
2022-09-19 09:36:06 -07:00
0b81a584cc Merge pull request #5604 from SparkiDev/mp_init_size_fizes_2
SP int: mp_init_size fixes when SP_WORD_SIZE == 8
2022-09-19 06:50:26 -07:00
8ca4a6086e 0 len sz is allowed
In async mode, we always store all handshake messages before processing them. The server hello done message has a length of 0 but we still need to store it to process it.
2022-09-19 14:00:13 +02:00
9eac8bf5a9 Add async and fips test folders to gitignore 2022-09-19 11:42:45 +02:00
23e9cf2dc1 Test AEAD limits only without WOLFSSL_TLS13_IGNORE_AEAD_LIMITS 2022-09-19 10:30:29 +02:00
dd32f30306 Merge pull request #5601 from douzzer/20220917-fixes
20220917-fixes
2022-09-19 13:50:25 +10:00
e7dba670d6 SP int: mp_init_size fix for sp_mont_norm
sp_mont_norm should check wrong parameter when determining whether the
calculation values will fit.
2022-09-19 10:04:30 +10:00
02e51953fd SP int: mp_init_size fixes when SP_WORD_SIZE == 8
Setting an integer may have a value larger than one word being set.
Check size of SP int in this case.
2022-09-19 09:26:47 +10:00
e43a7843b6 Merge pull request #5603 from kaleb-himes/scripts-update
Address Issue pointed out in (now deleted) comment on an old merge
2022-09-19 09:06:39 +10:00
9a193a3e02 Address Issue pointed out in (now deleted) comment on an old merge 2022-09-18 08:45:18 -06:00
001592a8a3 fix qt nightly test 2022-09-18 13:56:55 +09:00
ac0d7f4d84 src/internal.c:
in DtlsMsgNew(), iff WOLFSSL_ASYNC_CRYPT, allow sz==0 allocation, to fix infinite loop in ProcessReplyEx() around DoDtlsHandShakeMsg();

in DtlsMsgAssembleCompleteMessage() restore fix from 0603031362 for pointerOutOfBounds (undefined behavior) construct;

in ProcessReplyEx(), in WOLFSSL_DTLS13 case ack, check and propagate error from DoDtls13Ack() (fix from @guidovranken).
2022-09-17 13:02:51 -05:00
0fc80f5f85 wolfcrypt/src/sp_int.c: catch and propagate errors from sp_init_size() in sp_invmod() and sp_gcd() to fix clang-analyzer-core.UndefinedBinaryOperatorResult. 2022-09-17 12:55:48 -05:00
02cc7bf82e fix whitespace/linelength/indentation. 2022-09-17 12:53:37 -05:00
64f2a0cafe Extend wolfSSL_EVP_PKEY_free for freing EVP_PKEY of CMAC.
Fix EVP_PKEY not freed in unit test (test_wolfSSL_EVP_PKEY_new_CMAC_key).
2022-09-17 14:44:45 +09:00
e6bd6a94a0 Merge pull request #5521 from TakayukiMatsuo/clientverify 2022-09-16 16:55:38 -06:00
7a728c0c48 Merge pull request #5569 from SparkiDev/kyber
Kyber: Add option to build Kyber API
2022-09-16 14:56:02 -06:00
fa30ab37b3 Add reference to wc_AesInit in Gmac API doc 2022-09-16 15:54:32 -05:00
c6f6086b15 Merge pull request #5576 from julek-wolfssl/dtls-windows
Fix build errors and warnings for MSVC with DTLS 1.3
2022-09-16 11:11:46 -06:00
b780ad6da0 Merge pull request #5594 from julek-wolfssl/zd14813
Do not allow 0 size DtlsMsg
2022-09-16 10:21:54 -06:00
43b16f67b9 Merge pull request #5596 from SparkiDev/mac_m1_arm_sha256_fix
Aarch64 SHA-256 Mac M1 fix
2022-09-16 09:13:23 -07:00
24d0112d2c Merge pull request #5581 from SparkiDev/sp_int_size_fix
SP int: mp_init_size() fix
2022-09-16 08:29:06 -07:00
a948c78ac7 addressed review comments. remove Qt case guard 2022-09-16 21:25:42 +09:00
9ef10b5435 Check return of DtlsMsgCreateFragBucket() 2022-09-16 12:13:12 +02:00
bf4be901e4 Add prototypes for w64wrapper functions 2022-09-16 11:28:29 +02:00
4b3718543e Aarch64 SHA-256 Mac M1 fix
Inline assembly is told K when finished is not important but K is
changing. Take a local copy of K and mark as a changing value.
2022-09-16 13:20:48 +10:00
7062ed0a2c ChaCha ARM 32-bit: get debug working
r7 is needed for debug.
Needed to use stack explicitly rather than let compiler use r7.
2022-09-16 11:29:30 +10:00
e52730d008 SP int: mp_init_size() and check size fixes
Check size passed to mp_init_size() 1..SP_INT_DIGITS.
More checks of parameters to SP int functions to ensure result is big
enough to hold value calculated.
2022-09-16 10:13:33 +10:00
a98cda3516 fix qsscertificate test failure 2022-09-16 07:48:05 +09:00
523c16130d Merge pull request #5579 from douzzer/20220911-fixes-re-multi-test
20220911-fixes-re-multi-test
2022-09-16 08:29:41 +10:00
d18a654f74 wolfcrypt/src/sp_int.c: address peer review around _sp_zero(), sp_init(), and sp_init_size(), re sp_int_minimal. 2022-09-15 14:33:45 -05:00
4591e5635b Handle WC_PENDING_E from ticketEncCb in DoClientTicket properly.
ticketEncCb can return WC_PENDING_E. If it does in DoClientTicket, we need to
propagate this up to the calling function (e.g. DoPreSharedKeys), rather than
treating it as a failure.

I tested this by running the following experiment

./examples/server/server -v 4 -r &
./examples/client/client -v 4 -r

and adding the following async simulation code to wc_ChaCha20Poly1305_Decrypt:

#ifdef WOLFSSL_ASYNC_CRYPT
    static int testAsync = 0;
    if ((testAsync++ % 2) == 0) {
        return WC_PENDING_E;
    }
#endif

Prior to these changes, you can see that the WC_PENDING_E will not be handled
properly in DoClientTicket (using gdb). A full TLS handshake proceeds from
there. With this commit, running the same experiment shows the pending error
being handled properly.
2022-09-15 11:35:51 -07:00
5d2610c96d wolfssl/wolfcrypt/sp_int.h and wolfcrypt/src/sp_int.c: add struct sp_int_minimal, with same structure as struct sp_int but only one digit, to allow error-free access to sp_ints allocated with ALLOC_SP_INT() with fewer than SP_INT_DIGITS digits, and use the new type in _sp_zero() and sp_init_size() to eliminate -Werror=array-bounds on _sp_zero() under gcc-13. 2022-09-15 13:16:27 -05:00
23b16c09d7 linuxkm/Makefile: add support for $KBUILD_EXTRA_FLAGS. 2022-09-15 13:16:27 -05:00
2a96d62e43 Merge pull request #5573 from embhorn/zd14802
Add WOLFSSL_ATECC_TFLXTLS for Atmel port
2022-09-15 08:59:40 -07:00
4b3f6ada8a Do not allow 0 size DtlsMsg 2022-09-15 16:18:24 +02:00
1941fb2b35 Keep a separate drop counter for each epoch 2022-09-15 15:49:05 +02:00
67473bac28 Code review fixes
- Mark old epochs as invalid so we don't attempt to decrypt with them
- Return a non-zero value if possible in unit tests
- Move Dtls13CheckAEADFailLimit to dtls13.c
- Reset state in processreply
2022-09-15 14:39:33 +02:00
63ba2f7b8f TLS 1.3: Check maximum records encrypted with one key set 2022-09-15 12:17:46 +02:00
4e9106c355 Enforce maximum amount of failed decryptions in DTLS 1.3 2022-09-15 12:17:46 +02:00
c7de58ebaf Add code to fallback to S/W if TSIP cannot handle 2022-09-15 11:16:37 +09:00
ad39e8f77d Kyber: fix OQS memory leak 2022-09-15 09:18:47 +10:00
37adf0ff06 Merge pull request #5592 from douzzer/20220914-fix-quic-test-default-build
20220914-fix-quic-test-default-build
2022-09-14 14:15:46 -06:00
f21b021bb6 Merge pull request #5590 from SparkiDev/tlsx_symbol_fix
TLSX: function not used
2022-09-14 09:10:56 -06:00
8b641df116 Merge pull request #5588 from SparkiDev/tls13_cs_fixes
TLSv1.3 cipher suites: fixes
2022-09-14 09:06:31 -06:00
eef67478e9 tests/quic.c: gate QuicConversation_fail() definition to avoid -Wunused-function. 2022-09-14 09:46:07 -05:00
17df33cef8 Fix TLS 1.3 testsuite for wolfssl64.sln solution 2022-09-14 11:39:27 +02:00
e8d5cf9662 TLSX: function not used 2022-09-14 09:52:26 +10:00
79d85f6c13 TLS cipher suite: improvements
wolfSSL_clear: check return from InitSSL_Suites() call.
TLS13: check ClientHello cipher suite length is even.
Silently remove duplicate cipher suites from user input.
Add tests of duplicate cipher suite removal.
2022-09-14 09:26:00 +10:00
3cafde2519 Merge pull request #5589 from SparkiDev/sp_mac_m1_asm
SP; Mac M1 failure fix
2022-09-13 16:35:57 -06:00
fa8c158f3c Merge pull request #5587 from tim-weller-wolfssl/dev-win-build-fips-update
Remove FIPS preprocessor defines from Windows build options
2022-09-13 13:47:51 -07:00
12ec2272d6 Merge pull request #5585 from icing/groups-key-share
wolfSSL_set1_curves_list(), wolfSSL_CTX_set1_curves_list() improvements.
2022-09-13 10:36:25 -06:00
1a0073b558 Add WOLFSSL_ATECC_TFLXTLS for Atmel port 2022-09-13 11:04:58 -05:00
7f2659bb9b add test-tls13-pq-2.conf to include.am 2022-09-13 10:51:07 -04:00
62c415fd50 Kyber: fixes
Don't define WOLFSSL_HAVE_KYBER unless configured.
Only compile code in ext_kyber.c when WOLFSSL_HAVE_KYBER defined.
Include config.h and settings in ext_kyber.c. This allowed
HAVE_VISIBILITY to be defined.
Cleanup kyber.h.
2022-09-13 10:07:28 -04:00
bcf4dbe697 Changes inspired by Feedback from Sean.
Define WOLFSSL_HAVE_KYBER when HAVE_LIBOQS is defined.
Fix some misleading debug output.
Fix benchmarking logic.
2022-09-13 10:07:28 -04:00
a2635be9e6 wolfCrypt support for external Kyber implementations (liboqs and pqm4) 2022-09-13 10:07:28 -04:00
8c1e2c52e7 Kyber: Add option to build Kyber API
wolfSSL Kyber implementation not included.
Added tests and benchmarking.
2022-09-13 10:07:27 -04:00
531f125925 Fix build without TLS13. 2022-09-13 11:18:27 +02:00
bebb686217 Fixes for different build scenarios:
- fix the type cast in SMALL_STACK builds
- only use new behviour when wolfSSL_set_groups() is available
2022-09-13 11:10:59 +02:00
112fc540bb Fix build errors and warnings for MSVC with DTLS 1.3 2022-09-13 10:13:44 +02:00
5e945f94b4 TLSv1.3 cipher suites: fixes
Handle multiple instances of the same cipher suite being in the server's
list.
Fix client order negotiation of cipher suite when doing pre-shared keys.
2022-09-13 17:25:11 +10:00
38418b31f1 Merge pull request #5197 from JacobBarthelmeh/OCSP
RSA-PSS with OCSP and add simple OCSP response der verify test case
2022-09-13 15:10:00 +10:00
99d60a0781 SP; Mac M1 failure fix
Give the compiler a hint that mask needs special attention.
2022-09-13 13:54:06 +10:00
e867f0d312 Merge pull request #5574 from haydenroche5/ecc_nb_tls
Add support for non-blocking ECDHE/ECDSA in TLS/DTLS layer.
2022-09-12 16:24:00 -06:00
ba12d72e7a Remove FIPS preprocessor defines from Windows build command-line options (values specified via user_settings.h) 2022-09-12 15:54:36 -05:00
2eee35ef8f Merge pull request #5582 from SparkiDev/small_stack_cache_fix
Small Stack Cache: make work again
2022-09-12 09:53:10 -06:00
ba5aeb3501 Merge pull request #5583 from SparkiDev/psk_only_tls_fix
PSK only TLS: fix ENCRYPT_LEN
2022-09-12 09:26:28 -06:00
be72549388 Merge pull request #5584 from SparkiDev/tls13_midbox_fix
TLS 1.3 Middle-Box compat: fix missing brace
2022-09-12 09:15:10 -06:00
c6c4134542 wolfSSL_set1_curves_list(), wolfSSL_CTX_set1_curves_list() improvements.
- Use wolfSSL API wolfSSL_set_groups() and wolfSSL_CTX_set_groups()
  to configure curves list
- This sets ssl->groups and ctx->groups accordingly and makes
  TLSX_KEY_SHARE generation respect the selection and precedence.
- Add tests in quic to assert the order of selections.
2022-09-12 14:31:58 +02:00
375b9c1a59 TLS 1.3 Middle-Box compat: fix missing brace 2022-09-12 13:11:49 +10:00
005f77180b PSK only TLS: fix ENCRYPT_LEN
Allow no PK algorithms and TLS to build and test.
Use PSK cipher suite with GCM if AES-CBC not available.
2022-09-12 11:21:01 +10:00
e0a47ca6c1 Small Stack Cache: make work again
Fix Small Stack Cache option so that it works with various options
including ALT_ECC_SIZE.
Allow ALT_ECC_SIZE when SP math all or SP math is compiled in.
2022-09-12 10:52:34 +10:00
2c4c7ba6da ARM v7a ASM: 128-bit registers not supported
Cortex-A5 - Cortex-A9 only support 64-bit wide NEON.
Remove use of WOLFSSL_ARM_ARCH_NO_VREV.
Use WOLFSSL_ARM_ARCH_NEON_64BIT to indicate to use 64-bit NEON registers
and not 128-bit NEON registers.
2022-09-12 10:00:18 +10:00
fa6bc79f8b Merge pull request #5578 from douzzer/20220909-fixes
20220909-fixes
2022-09-09 16:37:35 -06:00
460b6f1ecc Merge pull request #5577 from tmael/vx_entropy
Improves entropy with VxWorks
2022-09-09 15:51:24 -06:00
6c71777ca6 no verify on renewing ocsp response 2022-09-09 13:58:43 -07:00
0603031362 fix whitespace in wolfssl/wolfcrypt/settings.h;
fix bugprone-macro-parentheses in wolfssl/ssl.h;

fix pointerOutOfBounds and declaration-after-statement in src/internal.c DtlsMsgAssembleCompleteMessage().
2022-09-09 15:25:06 -05:00
82781043c4 Add entropy to VxWorks 2022-09-09 12:44:56 -07:00
757a18ab7e Merge pull request #5496 from SKlimaRA/SKlimaRA/SetCipherListBytes
Support for setting cipher list with bytes
2022-09-09 13:42:51 -06:00
23ba1e7e98 Minor cleanups. Gate these API's on OPENSSL_EXTRA or WOLFSSL_SET_CIPHER_BYTES to keep code size reduced. 2022-09-09 10:49:49 -07:00
6526ffc5f8 Merge pull request #5567 from haydenroche5/hmac_sha1_fix
Fix HMAC compat layer function for SHA-1.
2022-09-09 09:45:21 -06:00
3bd91c6ab8 wolfcrypt/src/pkcs7.c: revert 57a7430b6a, which broke SCEP use case, and redo using a simple stack variable initialization approach. 2022-09-09 10:09:14 -05:00
7418ddcae6 Refactor nofail tests into test_wolfSSL_client_server_nofail 2022-09-09 16:04:30 +02:00
0a1332c4df Additional checks for secure renegotiation 2022-09-09 15:33:27 +02:00
f7c31dbf64 Merge pull request #5575 from SparkiDev/sp_int_no_64
SP int: default to 16 bit word size when NO_64BIT defined
2022-09-08 18:30:30 -07:00
0db0032b31 ARM32 ASM: vrev not always available
Provide alternative assembly instructions to vrev when
WOLFSSL_ARM_ARCH_NO_VREV is defined.
2022-09-09 10:19:17 +10:00
3b8f3a0897 SP int: default to 16 bit word size when NO_64BIT defined 2022-09-09 08:33:30 +10:00
14a521ca25 Make --enable-asynccrypt-sw imply --enable-asynccrypt.
Simplifies configuration.
2022-09-08 15:23:22 -07:00
200ca9db4b Merge pull request #5572 from tim-weller-wolfssl/zd14615-config-updates
Configuration consistency fixes for RSA keys and way to force disable of private keys
2022-09-08 13:19:11 -06:00
226a8b676d Add support for non-blocking ECDHE/ECDSA in TLS/DTLS layer.
This requires the async code.
2022-09-08 11:34:59 -07:00
e49efbc101 Merge pull request #5544 from haydenroche5/async_sw
Migrate async names from "test" to "software."
2022-09-08 10:18:26 -07:00
f49d84e17a fix typo and pipe ocsp response creation to /dev/null 2022-09-08 09:02:31 -07:00
52653c654d Merge pull request #5571 from julek-wolfssl/sk-cmp-param-fix
Set correct types in wolfSSL_sk_*_new functions
2022-09-08 08:47:20 -07:00
7c153a49ec Merge pull request #5570 from SparkiDev/sp_noasm
SP: config option to force no asm
2022-09-08 07:49:24 -07:00
64376d4d9e Merge pull request #5555 from julek-wolfssl/dtls-fragment-buckets
Don't over-allocate memory for DTLS fragments
2022-09-08 07:46:04 -07:00
1b90d4fad2 Configuration consistency fixes and addition of new config option to disable private key
Add way to disable private keys in wolfcrypt (settings). Make RSA integer usage match structure configuration.
2022-09-08 09:36:18 -05:00
28af88788a Set correct types in wolfSSL_sk_*_new functions
- Use WOLF_SK_COMPARE_CB() to generate the correct types instead of using void* for the callback parameters.
- Remove WOLFSSL_STACK.comp entirely since it is not used anywhere. Ignore input parameters that used to set this member.
2022-09-08 11:55:32 +02:00
81321fc10e SP: config option to force no asm
Added to configure.ac the option to specify SP to be built with ASM as
x64 defaults to with asm.
2022-09-08 16:20:15 +10:00
4deae6dcc6 Remove duplicate defines for EVP_get_cipherbyname and EVP_get_digestbyname. 2022-09-07 16:32:25 -07:00
9d6e157fc5 add asn template version 2022-09-07 16:15:19 -07:00
4066568315 Merge pull request #5564 from douzzer/20220907-fixes
20220907-fixes
2022-09-07 16:03:37 -07:00
5dc1732036 Fix define name
WOLFSSL_ARMASM_NO_CRYPTO -> WOLFSSL_ARMASM_NO_HW_CRYPTO
2022-09-08 08:39:00 +10:00
18450eb94b Fix HMAC compat layer function for SHA-1.
This function would only accept the string "SHA" for SHA-1-based HMAC, but it
should also accept "SHA1." This is similar to how wolfSSL_EVP_get_digestbyname
allows both "SHA" and "SHA1." We didn't have a test for this in api.c. I added
one, and it failed before my fix here.
2022-09-07 15:25:31 -07:00
d1ffe30f13 Merge pull request #5566 from kaleb-himes/OE40-45-support
Proposed changes based on customer report(s) under consideration by t…
2022-09-07 13:45:06 -07:00
ac1a0293e2 Merge pull request #5565 from tmael/workbench_doc
Improve Workbench docs
2022-09-07 13:41:37 -07:00
ef7377d64c fix whitespace and line length. 2022-09-07 15:30:32 -05:00
57a7430b6a wolfcrypt/src/pkcs7.c: in wc_PKCS7_DecryptKtri(), refactor handling of OAEP keys to fix uninited value access detected by clang-analyzer-core.UndefinedBinaryOperatorResult; fix whitespace. 2022-09-07 15:14:26 -05:00
28a82237d9 RSA-PSS signed OCSP responses 2022-09-07 13:12:43 -07:00
9c88d8ac2c Merge pull request #5547 from JacobBarthelmeh/mcux
Port to RT685 with FreeRTOS
2022-09-07 12:54:54 -07:00
b2a80cbe65 Disable warning for MSVC 2022-09-07 12:05:29 -07:00
3ac985c2f1 Proposed changes based on customer report(s) under consideration by the team 2022-09-07 11:34:27 -06:00
0f0aae72c2 Improve Workbench docs 2022-09-07 09:58:23 -07:00
22bad7b06b fix spelling 2022-09-07 09:57:34 -06:00
d75bb2de62 Merge pull request #5561 from SparkiDev/sp_math_openssl_fix
SP math: fix build configuration with opensslall
2022-09-07 07:12:13 -07:00
bc1fca8c85 Merge pull request #5562 from SparkiDev/sp_int_521_fix
SP int: fix for SP_INT_DIGITS calc
2022-09-07 07:12:01 -07:00
1d2cd7af0f Expose API for src/api.c 2022-09-07 13:04:33 +02:00
28895ed0cd Use a union and struct for padding in DtlsFragBucket
Zero length arrays are not allowed so `byte padding[0]` is not a valid member. Changed to use a union and struct instead.
2022-09-07 13:04:26 +02:00
8bf3e0829e Don't over-allocate memory for DTLS fragments
Don't reserve the full message length of memory. Instead we only allocate memory for the fragments that we have already received. We also dynamically combine memory fragments when we receive overlap.
2022-09-07 13:04:06 +02:00
1fe9f2d894 SP int: fix for SP_INT_DIGITS calc
Implementation of sp_mont_red needs words * 2 + 1.
2022-09-07 17:22:22 +10:00
05634e286d SP math: fix build configuration with opensslall
./configure '--disable-shared' '--enable-keygen' '--enable-certgen'
'--enable-certreq' '--enable-certext' '--enable-ocsp' '--enable-crl'
'--enable-pwdbased' '--enable-opensslall' '--enable-pkcs7'
'--enable-pkcs12' '--enable-sp' '--enable-sp-math' '--disable-rsa'
'--disable-dh' '--enable-ecc'
2022-09-07 15:42:33 +10:00
12680a967a Merge pull request #5560 from douzzer/20220906-fixes
20220906-fixes
2022-09-06 17:56:33 -07:00
7d67ffac69 Fixup assembly to compile with ARMv7a 2022-09-07 09:30:06 +10:00
805b0eb606 ARM ASM: ARMv7a with NEON instructions
Change to build assembly code for ARMv7a with NEON instruction set.
./configure -host=armv7a --enable-armasm
Added ARM32 SHA-256 NEON only implementation.
2022-09-07 09:29:56 +10:00
602116c3f2 Merge pull request #5558 from embhorn/zd14776
Fix warning in DecodeAltNames
2022-09-06 16:00:02 -07:00
761fde31ad Merge pull request #5478 from miyazakh/rsaesoaep 2022-09-06 15:45:40 -06:00
bf29d6b2c7 wolfcrypt/test/test.c: refactor shake256_absorb_test() and shake256_test() to use a single buffer for "large_input", malloc()ed when WOLFSSL_SMALL_STACK, to stay within stack limits of all-max-func-stack-2k; move a couple declarations in openssl_test() to resolve declaration-after-statement. 2022-09-06 13:28:57 -05:00
14082ceeb9 CMakeLists.txt: add SHAKE128 coverage. 2022-09-06 13:28:45 -05:00
d72b401e8e Merge pull request #5545 from icing/evp_chacha
Add ChaCha20 as available cipher in the EVP API.
2022-09-06 10:42:54 -07:00
dcf215d52c Fix warning in DecodeAltNames 2022-09-06 11:33:30 -05:00
e2de8f3b6c Merge pull request #5554 from rizlik/dtls_cid_fix
fix: dtls13: do not negotiate ConnectionID in HelloRetryRequest
2022-09-06 09:28:25 -07:00
7b0128f9ac Merge pull request #5541 from SparkiDev/ecc_sign_k_nondyn
ECC sign_k: don't have it dynamically allocated
2022-09-06 07:52:45 -07:00
1a3c34ea99 Merge pull request #5557 from SparkiDev/sp_rsa_max_fix
RSA max and SP_INT_BITS: disabled RSA fix
2022-09-06 07:52:18 -07:00
a33368f314 Merge pull request #5516 from embhorn/zd14732 2022-09-06 13:51:58 +02:00
5927c4063a Removing FIXME comments after the fixing has been done. doh. 2022-09-06 10:06:02 +02:00
9b319b3782 Remove dependency on POLY1305 on testing CHACHA20 only. 2022-09-06 10:06:02 +02:00
9f47999002 Add ChaCha20 as available cipher in the EVP API.
- wire the wc_ChaCha_* implementation into the EVP API
  as `wolfSSL_EVP_chacha20`
- follow IV conversions of OpenSSL
- add test case
- have QUIC support use this for header protection when
  CHACHA20_POLY1305 has been negotiated in the handshake.
2022-09-06 10:06:02 +02:00
4b12d2f4ec RSA max and SP_INT_BITS: disabled RSA fix
Checking WOLFSSL_MAX_RSA_BITS against SP_INT_BITS even though RSA is
disabled.

/configure --disable-shared --enable-sp --enable-sp-math --disable-rsa
--disable-dh --enable-ecc
2022-09-06 17:15:22 +10:00
483d7189c7 Merge pull request #5512 from SparkiDev/tls13_64bit_milli
Make time in milliseconds 64-bits
2022-09-05 16:19:03 -07:00
31b8edd192 Merge pull request #5552 from SparkiDev/ed_make_key_fixes
Ed make public key wasn't checking whether private key set
2022-09-05 16:13:41 -07:00
e7dbb5b375 Merge pull request #5548 from dgarske/whitespace
Whitespace cleanup
2022-09-06 07:54:29 +10:00
aee81764f2 fix: dtls13: do not negotiate ConnectionID in HelloRetryRequest 2022-09-05 17:00:09 +02:00
38781bd7cf added testing for wolfSSL_set_cipher_list_bytes() 2022-09-05 16:57:07 +02:00
e76361d544 Merge pull request #5551 from SparkiDev/sha3_asm_fix
SHA-3: check BMI1 availablity for ASM
2022-09-05 05:03:52 -06:00
f153e65102 SHA-3: check BMI1 availablity for ASM
Added benchmarking of SHAKE128 and SHAK256.
2022-09-05 14:11:02 +10:00
f807c70637 Ed make public key wasn't checking whether private key set
Ed25519 and Ed448 make public key APIs now check whether the private key
was set.
The private key and public key flags setting and clearing also updated.
Testing of unset private key and calling make public key added for
Ed25519 and Ed448.
2022-09-05 12:21:51 +10:00
49065373aa Merge branch 'fix_sha256_debug' of github.com:gojimmypi/wolfssl 2022-09-04 19:26:38 -06:00
4ac113d135 ECDSA sign_k allocated when not WOLFSSL_NO_MALLOC
Fix up other WOLFSSL_NO_MALLOC issues.
2022-09-05 10:56:17 +10:00
b95df7529c Improve usage of 64-bit implementation of TimeNowInMilli
Change to use 64-bits for types stored - use WOLFSSL_32BIT_MILLI_TIME if
a 64-bit type is not available.
TimeNowInMill() returns 0 on error instead of GETTIME_ERROR.
2022-09-05 10:47:25 +10:00
69ed2b56d4 Replace a variable of AES-128 key size to the constant AES_128_KEY_SIZE 2022-09-04 13:31:24 +09:00
b52d193ee3 Fix an implicit type conversion 2022-09-03 23:56:54 +09:00
aa036b6ea4 Merge pull request #5532 from anhu/sphincs
Add sphincs to wolfCrypt.
2022-09-02 11:56:11 -07:00
232a750cc2 Whitespace cleanup. 2022-09-02 09:54:17 -07:00
4a8a11315b Merge pull request #5536 from SparkiDev/sha3_x64
SHA-3 improvements
2022-09-02 09:46:14 -07:00
8ca63b93a4 Merge pull request #5539 from dgarske/ocsp_async
Fix for async with OCSP non-blocking in `ProcessPeerCerts`
2022-09-02 10:42:09 -06:00
11bb8b3dc4 Merge pull request #5543 from SparkiDev/rsa_max_size_fix
RSA max key size checks
2022-09-02 09:26:19 -07:00
10ce703d71 Add sphincs to wolfCrypt.
Note that we will not support sphincs in TLS so nothing above wolfcrypt changes.
2022-09-02 11:53:55 -04:00
daadd4a1b7 Merge pull request #5540 from dgarske/socksz
Fixes for building with 32-bit and socket size sign/unsigned mismatch
2022-09-02 16:33:41 +10:00
959386422e Migrate async names from "test" to "software."
See async PR 52.
2022-09-01 17:53:18 -07:00
3bf6baf596 RSA max key size checks
Detect when certificate's RSA public key size is too big and fail on
loading of certificate.
Fix unit test to only attempt to use 3072 bit RSA-PSS keys when
RSA_MAX_SIZE supports it.
2022-09-02 10:37:12 +10:00
cef590131a ECC sign_k: don't have it dynamically allocated 2022-09-02 09:18:42 +10:00
23fd6456c2 Merge pull request #5534 from dgarske/zd14420
Fix for async session tickets
2022-09-02 08:50:35 +10:00
ef451d316c Make time in milliseconds 64-bits
Allow for longer session ticket lives.
2022-09-02 08:45:07 +10:00
f530101ef1 Fix for async with OCSP non-blocking in ProcessPeerCerts. ZD 14754. 2022-09-01 14:39:52 -07:00
65ca72c5a2 Improve EVP support for CHACHA20_POLY1305 (#5527)
* Add test case for OpenSSLs capability to init a evp context partially in several calls.
* EVP handling of CHACHA20_POLY1305 improvment
- save key at ctx for Init()s without IV
- reuse stored key for Init()s with new IV, reusing ctx
- free and zero key on ctx clenaup
* Adding type cast to XMALLOC to force compiler compatibility.
* EVP: using same DYNAMIC_TYPE in alloc and free of chacha20_poly1305 key.
Co-authored-by: Stefan Eissing <stefan.eissing@greenbytes.de>
2022-09-01 13:23:42 -07:00
2695f36642 Fixes for building with 32-bit and socket size sign/unsigned mismatch.
Tested with: `./configure --enable-all CFLAGS="-m32 -DXSOCKLENT=int" LDFLAGS="-m32" && make`
2022-09-01 11:39:34 -07:00
ba8ffc765d Merge pull request #5513 from rizlik/hrr_default
DTLSv1.3: Do HRR Cookie exchange by default
2022-09-01 07:45:18 -07:00
0222833f7e Merge pull request #5535 from douzzer/20220831-analyzer-coddling
20220831-analyzer-coddling
2022-09-01 07:40:11 -07:00
8ccef9f0d3 Merge pull request #5531 from embhorn/zd14665
Check return from call to wc_Time
2022-09-01 09:35:49 -05:00
85776f0069 Add wolfSSL_EVP_PKEY_new_CMAC_key to OpenSSL compatible API 2022-09-01 18:00:43 +09:00
08b89fbef9 server: add optional argument to -J disable hrr cookie 2022-09-01 09:37:35 +02:00
401cfbd8e4 dtls13: enable hrr cookie by default 2022-09-01 09:37:35 +02:00
edd723cc84 ssl: add new wolfSSL_disable_hrr_cookie() API to disable hrr cookie
Add a way to disable hrr cookie so it can be enabled by default for DTLS
connections.
2022-09-01 09:37:34 +02:00
ce8959ea77 SHA-3 improvements
Add x86_64 assembly code:
  - BMI2
  - AVX2 (using ymm, slower than BMI2)
  - AVX2 of 4 similtaneous hashes
Add SHAKE128 functions and tests.
Add Absorb and Squeeze functions for SHAKE128 and SHAK256 and tests.
Add doxygen for SHA-3 and SHAKE functions.
Update other generated x86_64 assembly files to include settings.h.
2022-09-01 17:11:58 +10:00
ea3959f2f6 analyzer coddling:
in api.c test_wolfSSL_dtls12_fragments_spammer(), inhibit clang-analyzer-deadcode.DeadStores;

in asn.c ParseCRL_Extensions() old (!WOLFSSL_ASN_TEMPLATE) version, fix bounds check to prevent overshift;

in misc.c ctMaskCopy(), use `*(x + i)`, not x[i], to tiptoe around cppcheck-2.9 objectIndex bug.
2022-08-31 22:56:08 -05:00
db6d69143e Merge pull request #5533 from lealem47/crlPrintFix
Add missing DN nid to work with PrintName()
2022-08-31 18:32:55 -07:00
fe583faf32 Merge pull request #5501 from haydenroche5/ecc_non_block
Add support for non-blocking ECC key gen and shared secret gen for P-256/384/521.
2022-08-31 18:31:28 -07:00
96ab26e6e9 Fix for async session tickets. ZD14420
```
./configure --enable-all --enable-asynccrypt CFLAGS="-DWOLFSSL_NO_DEF_TICKET_ENC_CB" && make
./examples/server/server -v 4 -r &
./examples/client/client -v 4 -r
```
2022-08-31 15:28:49 -07:00
2df1c25263 Add missing DN nid to work with PrintName() 2022-08-31 15:18:12 -07:00
41207f5d9b Add support for non-blocking ECC key gen and shared secret gen for
P-256/384/521.

New functions:

- sp_ecc_make_key_256_nb
- sp_ecc_make_key_384_nb
- sp_ecc_make_key_521_nb
- sp_ecc_secret_gen_256_nb
- sp_ecc_secret_gen_384_nb
- sp_ecc_secret_gen_521_nb

This commit also tweaks the testing for ECDSA testing in test.c. Instead of
testing with one of P-256/384/521, we test with all that are available.
2022-08-31 14:34:26 -07:00
38e4ecc27c Merge pull request #5529 from anhu/wextra
Fix Windows CMakeList compiler options
2022-08-31 14:04:24 -07:00
5a25525b2e Check return from call to wc_Time 2022-08-31 15:20:07 -05:00
9531552795 Merge pull request #5522 from tim-weller-wolfssl/update-ide-win10-build
Update ide win10 build files to add missing sp source files
2022-08-31 12:45:17 -07:00
b1301d9dc4 Merge pull request #5518 from CallumMcLoughlin/master
Allow Post Quantum Keyshare for DTLS 1.3
2022-08-31 12:29:08 -07:00
f0812fa21f Added vcpkg instructions to the INSTALL file. 2022-08-31 11:41:43 -07:00
8722a46d52 Merge pull request #5503 from julek-wolfssl/dtls-fragments
DTLS limit fragments
2022-08-31 09:53:09 -07:00
3b8d230223 Merge pull request #5515 from anhu/custExtDoc
Improve `wc_SetCustomExtension` documentation
2022-08-31 08:35:04 -07:00
f7482d96e6 Windows cl.exe does not support -Wextra other flags 2022-08-31 10:32:55 -04:00
1d9d8bdefb Removed sp_c64.c due to reliance on 128-bit type, replaced with sp_x86_64.c and _asm.asm. 2022-08-31 07:15:05 -07:00
71b1aca373 Merge branch 'master' into update-ide-win10-build 2022-08-31 06:32:20 -07:00
54bd786707 DTLS limit fragments
- Limit the amount of fragments we store per a DTLS connection
- Error out when we reach the DTLS fragment connection limit
2022-08-31 14:24:20 +02:00
44f81f8bc0 Merge pull request #5525 from JacobBarthelmeh/release
Release version 5.5.0
2022-08-30 10:35:13 -07:00
4ce1cf1d7c update RPM build 2022-08-30 08:50:41 -07:00
d75ce08d75 update readme for release 5.5.0 2022-08-30 09:31:28 -06:00
43388186bb Tidy up TLS 1.3 and DTLS 1.3 check 2022-08-30 19:59:36 +12:00
565d1b33e5 Update examples to allow post quantum KEM within DTLS 1.3 2022-08-30 18:39:57 +12:00
1afc92dd7b internal.c: WC_SHA256_DIGEST_SIZE for wc_Sha256GetHash when WOLFSSL_DEBUG_TLS 2022-08-29 17:06:52 -07:00
29f2dee991 handeling DER to internal of an OCSP response with no optional certificates 2022-08-29 15:25:50 -07:00
ac3cdb42b7 free structure in test case and return 0 from ocsp renew script 2022-08-29 15:25:50 -07:00
5b5f673c51 add simple ocsp response der verify test case 2022-08-29 15:25:50 -07:00
69d60f5099 Merge branch 'master' into update-ide-win10-build 2022-08-29 09:13:51 -07:00
a7f86f9473 Merge pull request #5517 from JacobBarthelmeh/Testing
misc. testing items from static analysis tools
2022-08-29 08:48:51 -07:00
11c553ea1d Merge pull request #5520 from julek-wolfssl/sni-tls-1.2
SNI can appear in ServerHello for TLS 1.2
2022-08-29 09:36:53 -06:00
88deaf9b5c SNI can appear in ServerHello for TLS 1.2
Co-authored-by: Eric Blankenhorn <eric@wolfssl.com>
2022-08-29 14:22:10 +02:00
91d3cd7111 Allow Post Quantum Keyshare for DTLS 1.3 2022-08-28 17:35:28 +12:00
1e673aee3b scan-build warning fix 2022-08-26 16:29:11 -07:00
ad0fd15a0d static analysis fix from infer 2022-08-26 14:55:42 -07:00
ce2cf3439d subject info. acc. should contain a CA repo entry not OCSP 2022-08-26 14:39:20 -07:00
1c83438eb3 Add compatibility layer macros 2022-08-26 14:56:35 -05:00
b1e9cc320b Add documentation telling the user not to modify a buffer. 2022-08-26 14:27:27 -04:00
e88bd66501 Merge pull request #5514 from julek-wolfssl/wolfSSL_EVP_MD_CTX_copy_ex-leak
Cleanup output object in wolfSSL_EVP_MD_CTX_copy_ex before copy
2022-08-26 11:08:17 -07:00
1bf441de4d add MCUXpresso IDE projects 2022-08-26 10:51:10 -07:00
b3fa6f654e no realloc, adjustable static test size, fsl RTC 2022-08-26 09:15:33 -06:00
d84bfd511d Merge pull request #5511 from SparkiDev/sp_submod_neg_fix
SP math: don't modify sign in sp_div
2022-08-26 08:07:37 -07:00
2fb3f58c03 Cleanup output object in wolfSSL_EVP_MD_CTX_copy_ex before copy 2022-08-26 13:07:45 +02:00
8b2719cc83 SP math: don't modify sign in sp_div
Not need to modify sign of a and d in sp_div().
Signs cached at start and used to calculate sign result.
2022-08-26 08:47:49 +10:00
1976601811 Merge pull request #5505 from julek-wolfssl/dtls-plaintext
Ignore plaintext on established connections
2022-08-25 07:25:03 -07:00
b9cee17b01 Merge pull request #5508 from SparkiDev/aes_ctr_arm32_neon_fix2
AES-CTR ARM32 ASM: Fix 128-bit counter increment
2022-08-25 07:04:48 -07:00
bd13fcc92a AES-CTR ARM32 ASM: Fix 128-bit counter increment
Include hash.h to sp_int.h for when no public key algorithms compiled in
- need WC_MAX_DIGEST_SIZE.
2022-08-25 14:54:00 +10:00
842d415de0 Merge pull request #5507 from haydenroche5/general_names_leak
Fix wolfSSL_GENERAL_NAMES_free memory leak.
2022-08-24 21:05:53 -07:00
2c829f19d3 Merge pull request #5506 from dgarske/dtlscid
Fixes for build warnings and string macros for DTLS CID
2022-08-25 13:52:55 +10:00
9f39ffdba7 Fix wolfSSL_GENERAL_NAMES_free memory leak.
This function was just freeing the stack object itself of GENERAL_NAMES with
wolfSSL_sk_free, but this doesn't free the data in the items of the stack. The
fix is to replace wolfSSL_sk_free with wolfSSL_sk_GENERAL_NAME_free.
2022-08-24 18:42:30 -07:00
a0448155d5 Fix for type warnings in example for DTLS CID ./configure --enable-dtls --enable-dtlscid --enable-dtls13. 2022-08-24 16:02:05 -07:00
8268214297 Merge pull request #5504 from ejohnstown/ppc-warn
API Test Fixes for GCC/PowerPC Warnings
2022-08-24 15:19:53 -07:00
159a3c8b03 Ignore plaintext on established connections 2022-08-24 21:40:19 +02:00
c4a61af311 drafted test case 2022-08-24 20:45:54 +02:00
a668953f70 cr fix 2022-08-24 20:35:56 +02:00
9b65f5819c API Test Fixes for GCC/PowerPC Warnings
1. In api.c, change the name of the devId global to testDevId.
2. In api.c, for the SNI test, some of the pointers were multiply
   typecast eventually to `void **`. An older compiler didn't like
   that. Just use void pointer.
2022-08-24 11:30:56 -07:00
7ea904c873 Added CertNew() and CertFree() info. (#5502)
* Updated wc_CertNew() dox for the return value listings, small changes to
description and add some detail to the example per peer review.
2022-08-24 13:09:50 -04:00
9b12011d71 Merge pull request #5499 from SparkiDev/aes_ctr_arm32_asm
AES-CTR ARM32 crypto ASM fix
2022-08-24 09:59:49 -07:00
53b74e2d32 Merge pull request #5498 from SparkiDev/tls_ecc_sig_fault
Check ECC signature in TLS
2022-08-24 09:59:06 -07:00
124cff60f1 Merge pull request #5500 from SparkiDev/sp_int_div_ss_rework
Rework sp_div to work around static analysis error
2022-08-24 09:58:13 -07:00
d087cbea1b Rework sp_div to work around static analysis error
Fix _sp_exptmod_mont_ext() to handle when number of bits in exponent is
a multiple of the window size.
2022-08-24 12:31:21 +10:00
9228354d29 AES-CTR ARM32 crypto ASM fix
Fix handling of counter to support incrementing across all bytes in
ARM32 crypto asm.
Added test cases for wrapping of counter when 2 blocks are being
encrypted to check assembly alternative path.
2022-08-24 10:51:56 +10:00
2571f65e85 Check ECC signature in TLS
Verifying gnerated ECC signature in TLS handshake code to mitigate when
an attacker can gain knowledge of the private key through fault
injection in the signing process.
Requires WOLFSSL_CHECK_SIG_FAULTS to be defined.
2022-08-24 09:01:18 +10:00
3b6124cf34 Merge pull request #5497 from douzzer/20220823-fixits
20220823-fixits
2022-08-23 13:45:02 -07:00
8f70f98640 wolfcrypt/src/asn.c: refactor _SMALL_STACK code path in ParseCRL_Extensions() to fix memory leaks and heap-use-after-free. 2022-08-23 13:52:42 -05:00
dcebd0d349 wolfssl/wolfcrypt/logging.h: when !WOLFSSL_VERBOSE_ERRORS, define WOLFSSL_ERROR_VERBOSE(e) as (void)(e) to avert clang-analyzer-deadcode.DeadStores, and avert bare semicolons. 2022-08-23 13:50:56 -05:00
769fb7cbee Merge pull request #5453 from rizlik/dtls_cid
Support ConnectionID Extension DTLS Negotiation
2022-08-23 11:29:25 -07:00
cab6ecd130 Merge pull request #5404 from JacobBarthelmeh/PKCS7
fix for not having default pkcs7 signed attributes
2022-08-23 11:04:17 -07:00
5c65974170 Fix for dynamic type macro typo. 2022-08-23 09:32:11 -07:00
9d5305ad07 Merge pull request #5495 from julek-wolfssl/ticket-alignment
Remove WOLFSSL_GENERAL_ALIGNMENT from WOLFSSL_TICKET_ENC_SZ calculation
2022-08-23 08:13:42 -07:00
3a8e6f2280 fix: add explicit cast to abide g++ compiler 2022-08-23 16:58:24 +02:00
f3262005e4 add basic ConnectionID DTLS tests 2022-08-23 16:58:24 +02:00
90fcd95f9b server/client: add --cid option to use ConnectionID extension 2022-08-23 16:58:24 +02:00
cfbd061625 add initial support for ConnectionID DTLS extension 2022-08-23 16:58:24 +02:00
83fad7bb45 drafted setting cipher list with bytes api 2022-08-23 14:16:43 +02:00
ae049706c6 Remove WOLFSSL_GENERAL_ALIGNMENT from WOLFSSL_TICKET_ENC_SZ calculation 2022-08-23 11:57:41 +02:00
171af05e96 tlsx: expose TLSX_Push
To be able to implement extension in separate compilation unit
2022-08-23 10:00:06 +02:00
bf9f4b88e4 Merge pull request #5494 from douzzer/20220822-bugprone-macro-parentheses
20220822-bugprone-macro-parentheses
2022-08-22 17:16:48 -07:00
48463f6d54 Merge pull request #5388 from lealem47/crlPrint
Adding X509_CRL_print() function
2022-08-22 17:16:19 -07:00
f9ca944106 Addressing some more feedback 2022-08-22 14:47:11 -07:00
1063090e38 fix bugprone-macro-parentheses in WOLFSSL_CRYPTO_EX_DATA_IGNORE_PARAMS() added in 8b2fcd0643. 2022-08-22 16:34:28 -05:00
bd49d37aaf Merge pull request #5492 from embhorn/zd14694
Fix for AddPacketInfo with WOLFSSL_CALLBACKS
2022-08-22 14:59:29 -06:00
91a7b8067c Addressing some PR feedback 2022-08-22 12:04:15 -07:00
c7c6fd98d7 Merge pull request #5491 from icing/quic-doc-update
Update of the QUIC documentation
2022-08-22 12:00:12 -07:00
b9d9dc02bb Merge pull request #5476 from julek-wolfssl/session-buffers
Remove WOLFSSL_SESSION_TYPE_REF buffers from WOLFSSL_SESSION
2022-08-22 11:59:39 -07:00
c0815b3bc6 Merge pull request #5493 from kaleb-himes/openssl3_0_testing_supplemental
Supplemental fix in addition to #5470
2022-08-22 11:14:49 -07:00
36facf52c9 Merge pull request #5490 from TakayukiMatsuo/no_rsa
Fixed build errors raised when NO_RSA is defined
2022-08-22 10:07:39 -07:00
d50e740c97 Merge pull request #5488 from julek-wolfssl/get_ex_new_index-docs
Add documentation explaining get_ex_new_index API limitations
2022-08-22 09:51:36 -07:00
a7e318a7ad Merge pull request #5484 from lealem47/allocators
Adding allocator funcs for dtls peer (for wrappers)
2022-08-22 09:29:54 -07:00
ce5a749fcb Merge pull request #5489 from SparkiDev/aes_ctr_arm_asm
AES-CTR ARM crypto ASM fix
2022-08-22 09:28:22 -07:00
1e5de8255e Merge pull request #5472 from satoshiyamaguchi/trial3
Add/Extend PEM_read compatibility API's
2022-08-22 09:24:39 -07:00
8f4b467f47 Fixing line lengths and SMALL_STACK code path 2022-08-22 09:17:23 -07:00
689d45eb59 Merge pull request #5425 from SparkiDev/ecc_sp_uncomp_ret
ECC SP uncompress: use error return
2022-08-22 09:00:52 -07:00
f98d8c5024 Update Windows 10 Visual Studio FIPS build file to include single-precision (sp) files to resolve missing symbols during link 2022-08-22 08:40:45 -07:00
77dec16b3b Supplemental fix in addition to #5470 2022-08-22 08:00:40 -06:00
22c44bd762 Fix for AddPacketInfo with WOLFSSL_CALLBACKS 2022-08-22 08:01:21 -05:00
240c261772 Update of the QUIC documentation
- explain what the QUIC support is
- examples of ngtcp2 use
- what is needed for HTTP/3
2022-08-22 14:36:14 +02:00
0dbd0ffb4e Merge pull request #5483 from embhorn/zd14659 2022-08-22 14:28:29 +02:00
e565d0d7de Refactor and code review
- Refactor object hashing into one function
- Allow multiple WOLFSSL_ASSERT_SIZEOF_GE in one function
2022-08-22 14:19:48 +02:00
8b2fcd0643 Add documentation explaining get_ex_new_index API limitations 2022-08-22 12:16:51 +02:00
c7d28e3bb9 ECC SP uncompress: use error return 2022-08-22 16:21:30 +10:00
48e7035af8 Fix build error when NO_RSA is defined 2022-08-22 14:03:19 +09:00
f7a8d4a44a AES-CTR ARM crypto ASM fix
Fix handling of counter to support incrementing across all bytes in ARM
crypto asm.
Added test cases for wrapping of counter.

Extracted ARM ASM for AES-CTR.
Use ASM to created encrypted temporary block.
2022-08-22 10:36:48 +10:00
26c61f8e0f Merge pull request #5473 from icing/quic-hello-retry
Respect disabled curves on HelloRetryRequests
2022-08-22 08:32:30 +10:00
2059d05b7a checking some ret values, fix trailing whitespace 2022-08-19 12:40:42 -07:00
2a65220527 Adding X509_CRL_print() function 2022-08-19 12:21:35 -07:00
da136e0c49 Adding allocator funcs for dtls peer (for wrappers) 2022-08-19 10:59:55 -07:00
b417f94435 Merge pull request #5485 from SparkiDev/tls13_state_string_long
wolfSSL_state_string_long - update for TLS 1.3 and DTLS 1.3
2022-08-19 10:09:09 -07:00
f3b9cfa71c Merge pull request #5487 from icing/tls13_early_nr
Improved EarlyData Indicator reply fix based on PR #5486
2022-08-19 09:54:17 -07:00
a7c0c4649e Fixing Handshake Hash update when Preshared Keys offered by client,
but none of them was accepted.

- This applies to TLSv1.3 and QUIC
- QUIC test case to trigger the bug enabled
2022-08-19 15:56:20 +02:00
1d0e83bd1a Merge pull request #5474 from julek-wolfssl/zd14644-2
Match OpenSSL self signed error return.
2022-08-19 06:46:26 -07:00
3d8562f07b Fixes for build and runtime issues 2022-08-19 08:12:04 -05:00
6cb0caa0a0 Adding disabledCurves as a member of WOLFSSL in the OPENSSL_EXTRA case.
- inheriting from WOLFSSL_CTX on creation
- enabling on WOLFSSL only when wolfSSL_set1_curves_list() is called
2022-08-19 11:03:23 +02:00
7a5170b6e1 Improved EarlyData Indicator reply fix based on PR #5486
- PR #5486 had test failures in tls13.test and quit unit.test
- the extension was no longer added in SessionTicket messages
- added extra parameter to clarify how the TLSX is used
2022-08-19 10:07:06 +02:00
a66516d3a5 Extending quic resumption tests. 2022-08-19 09:02:28 +02:00
61c7003520 Fix whitespace 2022-08-19 12:38:07 +09:00
4b8cd6c62b wolfSSL_state_string_long - update for TLS 1.3 and DTLS 1.3 2022-08-19 09:41:01 +10:00
06022e85a3 Fix avoidSysCalls logic 2022-08-18 19:43:40 +02:00
969ad96dee examples/{client,server}/{client,server}.c: remove spurious commas in --pqc help strings, and mollify clang-tidy bugprone-suspicious-missing-comma re --force-curve help strings. (#5480) 2022-08-18 13:32:58 -04:00
4d0ea62857 Refactor ticket size to not accidentally go over WOLFSSL_TICKET_ENC_SZ
- Optimize memory usage. Write directly to ssl->session->ticket in CreateTicket() and use a hash to make sure the InternalTicket was encrypted.
- DoClientTicket does not fatally error out anymore. Errors in the ticket result in the ticket being rejected instead.
2022-08-18 19:08:43 +02:00
6316e26bdc Adding the forgotten wolfSSL_CTX_free() at the end of the new test_quic_key_share case. 2022-08-18 10:24:18 +02:00
e830a0f613 Merge pull request #5434 from satoshiyamaguchi/trial4 2022-08-17 17:04:36 -06:00
aa812c8aa9 Added support for P384 pre-share in server (#5442)
Added support for new server `--force-curve` option.
2022-08-17 15:30:48 -07:00
91a49da4b8 Merge pull request #5468 from SparkiDev/wolfssl_clear 2022-08-17 15:51:25 -06:00
d494894268 Add to parse RSA ES OAEP Oid 2022-08-18 06:43:31 +09:00
91d1bbbd44 Merge pull request #5477 from douzzer/20220817-make-quic-optional
20220817-make-quic-optional
2022-08-17 14:34:12 -07:00
5b260ac52e configure.ac: remove enable-quic from enable-all feature set;
remove ENABLED_QUIC="yes" from "$ENABLED_CURL" = "yes" setup section;
add ENABLED_CURVE25519=yes if $ENABLED_QUIC = yes;

tests/unit.c: move QuicTest() and SrpTest() before SuiteTest().
2022-08-17 14:25:38 -05:00
68f71d0d96 Remove WOLFSSL_SESSION_TYPE_REF buffers from WOLFSSL_SESSION 2022-08-17 19:29:07 +02:00
be378a346e Merge pull request #5475 from dgarske/rsa_pss_async
Fixes for RSA PSS with `--enable-asynccrypt` in `ConfirmSignature`
2022-08-17 12:04:05 -05:00
b9c9ad0339 Fixes for RSA PSS with --enable-asynccrypt in ConfirmSignature. 2022-08-17 08:20:06 -07:00
3918a2e29a Renaming the named_curve parameter to curve_id to avoid shadowing. 2022-08-17 17:01:18 +02:00
008e947fec Match OpenSSL self signed error return.
OpenSSL compat expects ASN_SELF_SIGNED_E when a self signed cert can't be verified. This is useful when translating the error with GetX509Error into a X509_V_ERR_* error.
2022-08-17 12:40:16 +02:00
d6548b6b88 Small refactoring of named group handling for readability and de-duplicating of code.
- add wolfSSL_CTX_curve_is_disabled() and wolfSSL_curve_is_disabled()
  to have common checks on wether a curve has been disabled by user
- add macros returning 0 for above function when OPENSSL_EXTRA is not
  defined, enabling use without #fidef check
- add macros for checking if named groups are in a certain range
  WOLFSSL_NAMED_GROUP_IS_FFHDE()
  WOLFSSL_NAMED_GROUP_IS_PQC()

Fixed QuicTransportParam_free() use without case when compiling
with c++.
2022-08-17 11:46:48 +02:00
f5a257c383 Add WOLFSSL_LEAVE to wolfSSL_PEM_read_RSA_PUBKEY and wolfSSL_PEM_read_PUBKEY 2022-08-17 14:23:50 +09:00
7435402c30 Fixes to better handle re-use of a WOLFSSL object via wolfSSL_clear. 2022-08-16 15:44:05 -07:00
3f7d56d957 Merge pull request #5471 from icing/quic-mem-leak
Fix memory leak in QUIC transport parameters extension
2022-08-16 13:22:20 -07:00
be2a6cbeb9 Merge pull request #5420 from Uriah-wolfSSL/ms_abi
Ms abi
2022-08-16 09:21:14 -07:00
3434210b13 Fix memory leak in QUIC transport parameters extension 2022-08-16 18:13:25 +02:00
091fc71c74 Fix EVP_PKEY not freed and FILE pointer not closed 2022-08-17 01:03:09 +09:00
e1b3f14d35 Fix FILE pointer not closed in tests/api.c 2022-08-17 00:11:29 +09:00
524f9ebd32 Add argument check and error message to wolfSSL_PEM_read_RSA_PUBKEY 2022-08-16 17:35:51 +09:00
55eb460d1a Merge pull request #5403 from SparkiDev/ecc_import_priv_order
ECC import priv: validate priv is less than order
2022-08-15 21:36:46 -07:00
a954cf82e3 Merge pull request #5469 from anhu/init_CertName
Initialize the Enc memberss of CertName struct.
2022-08-15 20:42:26 -07:00
8aa2bde3c2 Merge pull request #5470 from kaleb-himes/openssl3_0_testing
Allow for renegotiation testing with openssl 3.0 installed on jenkins…
2022-08-16 11:02:22 +10:00
1dd318741d Allow for renegotiation testing with openssl 3.0 installed on jenkins slaves (also tested with openssl 1.1) 2022-08-15 16:33:06 -06:00
52ed047a44 Fix a mismatched decl and impl 2022-08-15 12:13:05 -04:00
23a01b3276 SP: CT from_mp when sp_digit bits equal mp_digit bits.
Made constant time copy of values from an mp_int int array of sp_digit.
Stops OOB writes when mp_int is bigger than it should be.
2022-08-15 09:02:24 -07:00
5e7cff71fd Initialize the Enc memberss of CertName struct.
Tested by reproducing the problem in an example and confirming fix makes problem
go away.
2022-08-15 11:43:33 -04:00
e56a2355ca Merge pull request #5464 from julek-wolfssl/zd14644
Translate the verify callback error to an X509_V_ERR_* value when OPENSSL_COMPATIBLE_DEFAULTS is defined
2022-08-15 06:30:36 -07:00
7e00b32c71 Corrected line spacing incorrect arg passings. 2022-08-14 20:16:42 -05:00
28f22859bb Merge pull request #5451 from embhorn/zd14428
Fix TSIP ret value in TLSX_KeyShare_ProcessEcc
2022-08-14 11:27:20 -07:00
dfb3616d50 Merge pull request #5465 from douzzer/20220812-fixes
20220812-fixes
2022-08-14 08:03:40 -07:00
fba534dce0 Add wolfSSL_PEM_read_RSA_PUBKEY to OpenSSL compatible API 2022-08-14 16:08:22 +09:00
f515916f68 Add liboqs integration to CMake build system (#5407)
* Add liboqs integration to CMake build system

* Rephrase WOLFSSL_OQS option

* Add new FindOQS.cmake file to cmake/include.am

Co-authored-by: Disyer <denialmc1@gmail.com>
2022-08-12 16:23:24 -04:00
e382905311 CMakeLists.txt: synchronize CMAKE_C_FLAGS with diagnostic flags set in autotools-generated Makefile (-Wall -Wextra -Wno-unused -Werror), and fix WOLFSSL_RSA_PSS to add -DWOLFSSL_PSS_LONG_SALT as needed by changes to test_wolfSSL_CertRsaPss() in fb531dacc2 (gating of those changes is also added in this commit). 2022-08-12 15:18:41 -05:00
b4f1b6d04d fix whitespace and C++-style comments. 2022-08-12 15:18:27 -05:00
60437bba6e Merge pull request #5378 from anhu/dilithium
Initial commit to add Dilithium NIST PQC winner.
2022-08-12 09:29:42 -07:00
0d78bd2127 Merge pull request #5459 from dgarske/docs
Improve documentation for CMAC
2022-08-12 10:37:07 -04:00
551acd2b19 Translate verify callback error with compat layer 2022-08-12 16:27:31 +02:00
126a570a37 Add HAVE_WOLFSSL_MSG_EX define when WOLFSSL_MSG_EX is available 2022-08-12 16:27:31 +02:00
90c65bd50b Merge pull request #5458 from icing/quic-earlydata
QUIC fixes for handling of early data
2022-08-11 17:52:29 -07:00
c66a21c40a Add Zephyr support for nRF5340 with CryptoCell-312, PSA Crypto fixes (#5418)
* PSA: set AES key bits, define PSA_ALG_NONE/PSA_KEY_ID_NULL if needed
* Zephyr: add TimeNowInMilliseconds() for tls13.c, clock_settime() for test.c, update CMakeLists.txt
* Skip including unistd.h for Zephyr in benchmark.c
* Zephyr: update README, add nRF5340dk support to wolfssl_test sample app
* Zephyr: add wolfCrypt benchmark sample app
* Zephyr: add nRF5340 support to tls_thread sample app
* PSA: use specific hash algo with psa_sign/verify_hash()
* Zephyr: add support for PSA Crypto API with PK callbacks to wolfssl_tls_threaded sample app
* Zephyr: add new files to zephyr/include.am
2022-08-11 17:42:05 -07:00
3f4b3605a6 Merge pull request #5460 from douzzer/20220811-quic-fixes-and-OLD-TLS-gating
20220811-quic-fixes-and-OLD-TLS-gating
2022-08-11 17:36:06 -07:00
d4646696ed Merge pull request #5448 from julek-wolfssl/ext-msg-check
Validate that extensions appear in correct messages
2022-08-12 08:39:42 +10:00
2b38ba0300 Merge pull request #5455 from dgarske/zd14420
Fix for handling `WC_PENDING_E` from decrypt session ticket callback
2022-08-12 08:20:57 +10:00
017c4e7a41 fix gating and unused-variable warnings in src/quic.c wolfSSL_quic_aead_is_{gcm,ccm,chacha20}();
fix TLS version gating in tests/quic.c;

fix gating in src/ssl.c for wolfSSLv2_client_method() and wolfSSLv2_server_method();

reorganize prototypes in wolfssl/ssl.h for wolf*_method*() to group systematically by protocol version and gate correctly on support for that version in the build.
2022-08-11 14:58:59 -05:00
5445b183ed Adding CMAC documentation. Fixes ZD14601. 2022-08-11 12:00:19 -07:00
b3de591c6f Rename of buffer to tmpbuffer to avoid collision with customer setup test. 2022-08-11 20:06:46 +02:00
499b9c4f35 Merge pull request #5456 from SparkiDev/ssl_set1_curve_fix
wolfSSL_CTX_set1_curves_list: X25519 and X448 defines
2022-08-11 09:19:25 -07:00
53fd4b37f2 QUIC fixes for handling of early data
- new internal field for keeping early data enabled status,
  as QUIC does not call SSL_write_early_data() itself.
- using read_/write_early_data() methods in QUIC handshake
  when early data is enabled. This triggers the internals
  that emit the proper early data indication handlings.
2022-08-11 18:08:37 +02:00
fef84e2c4c Fixes for asn_public.h documentation. Fix spelling error. 2022-08-11 08:58:32 -07:00
82a900b438 Initial commit to add Dilithium NIST PQC winner.
Also:

* added HAVE_FALCON guards as needed.
* corrected minor falcon bugs as I found them.
* handling OID sum collision between DILITHIUM_LEVEL5 and DILITHIUM_AES_LEVEL3

Tested with the following commands:

examples/server/server -v 4 -l TLS_AES_256_GCM_SHA384 \
    -c ~/tmp/dilithium_aes_level5_entity_cert.pem \
    -k ~/tmp/dilithium_aes_level5_entity_key.pem \
    -A ~/tmp/dilithium_aes_level5_root_cert.pem --pqc P521_KYBER_LEVEL5

examples/client/client -v 4 -l TLS_AES_256_GCM_SHA384 \
    -c ~/tmp/dilithium_aes_level5_entity_cert.pem \
    -k ~/tmp/dilithium_aes_level5_entity_key.pem \
    -A ~/tmp/dilithium_aes_level5_root_cert.pem --pqc P521_KYBER_LEVEL5

with permutations of SHAKE,AES variants and levels 2,3,5
2022-08-11 11:38:31 -04:00
5e6c45a6fb Merge pull request #5397 from SparkiDev/cert_rsa_pss
Certs with RSA-PSS sig
2022-08-11 08:19:12 -07:00
66644c2e31 Merge pull request #5457 from kaleb-himes/openssl-test-stuck-fix
Fix a very frequent stuck scenario with the openssl.test script
2022-08-11 07:43:23 -07:00
8efc8b0819 Fix up other test scripts using the same logic 2022-08-11 06:26:43 -06:00
a317126509 Validate that extensions appear in correct messages 2022-08-11 10:53:10 +02:00
dd2a6410d1 Merge pull request #5454 from dgarske/docs_hashtype
Improve the documentation for HMAC hash types
2022-08-11 16:50:55 +10:00
87d96c9c96 Merge pull request #5452 from icing/quic-resume
QUIC session resumption and early data handshake handling.
2022-08-10 22:33:13 -07:00
995100eed1 Fix for handling WC_PENDING_E from decrypt session ticket callback. ZD14420 2022-08-10 22:20:49 -07:00
9ec61d4ce4 Merge pull request #5449 from douzzer/20220809-quic-fixes
20220809-quic-fixes
2022-08-10 21:56:45 -07:00
4d8a713783 wolfSSL_CTX_set1_curves_list: X25519 and X448 defines
Support wolfSSL_CTX_set1_curves_list being available when X25519 and/or
X448 only defined.
Don't recognize X25519 or X448 if corresponding define is not set.
Enable test in api.c.
2022-08-11 14:13:04 +10:00
fb531dacc2 Certs with RSA-PSS sig
Add support for parsing and verifying certificates with RSA-PSS
signatures. Including check PSS parameters in key with those in
signature algorithm.
Add support for parsing private RSA PSS key.
Add support for parsing public RSA PSS key.
2022-08-11 09:43:01 +10:00
a0e1c2567e Fix a very frequent stuck scenario with the openssl.test script 2022-08-10 17:41:54 -06:00
5ef47cc86f Addressed code review. 2022-08-10 17:18:38 -05:00
8197f958a9 address peer review on PR #5449. 2022-08-10 13:33:57 -05:00
f771181e1a fixes for issues introduced in #5384:
added numerous missing _SMALL_STACK code paths (PK objects on the stack);

in settings.h, enable WOLFSSL_SMALL_STACK_STATIC by default when WOLFSSL_SMALL_STACK is defined (NO_WOLFSSL_SMALL_STACK_STATIC to override);

fixes for unsafe strcat()s in tests/quic.c;

fix for unsafe macro WOLFSSL_IS_QUIC();

fix to exclude quic from enable-all when enable-linuxkm (quic needs opensslextra, and opensslextra currently only works in-kernel in cryptonly builds);

fix for signed/unsigned clash in wolfSSL_quic_receive().
2022-08-10 13:33:56 -05:00
c707186b9f Improve the documentation for HMAC hash types. 2022-08-10 09:23:01 -07:00
b46693f8c8 Merge pull request #5445 from douzzer/20220808-fixes
20220808-fixes (unchecked snprintf() retvals)
2022-08-10 10:21:07 -06:00
ea04ffc99f QUIC session resumption and early data handshake handling.
In test with ngtcp2 example client using openssl, session resumption
against a QUIC wolfssl server failed. The error was tracked down to
wolfSSL believing EaryData needs to be handled and returning SUCCESS
from wolfSSL_SSL_do_handshake() after the server Finished had been
sent.

However the handshake was not complete and ngtcp2 invoked the
post_handshake processing for new data arriving from the client.
This failed a check in post processing that the ssl->handShakeState
actually was HANDSHAKE_DONE.

The workaround in this PR repeats do_handshake until the ssl
state acually says it is complete. This way, session resumption works.

Either this alternative do_handshake() is merged for QUIC protocol
hanlders. Or we need to fix the 'normal' do_handshake() to no return
SUCCESS when early data is expected on a QUIC WOLFSSL.
2022-08-10 15:17:30 +02:00
bcb9f3f70d Fix TSIP ret value in TLSX_KeyShare_ProcessEcc 2022-08-10 08:15:24 -05:00
c07d0fe4b4 address peer review:
use camel case not underscores in variable names;

restore use of const int variables for buffer sizes in several spots (for ease of smallstack code paths should they be needed);

use more MISRAish flow control in X509PrintSignature().

also, capture the retval from several more snprintf()s to pass directly to wolfSSL_BIO_write(), avoiding frivolous strlen()s.
2022-08-09 23:23:11 -05:00
eceee6ac95 Merge pull request #5444 from anhu/PQ_get_curve_name
Bugfix: wolfSSL_get_curve_name() will now print post-quantum group names.
2022-08-09 16:53:55 -07:00
57dc263d05 Make clang happy. 2022-08-09 14:35:59 -04:00
fa97923005 Merge pull request #5384 from icing/quic
QUIC support for wolfSSL
2022-08-09 10:13:29 -07:00
5049b16325 Param correction. 2022-08-08 19:43:54 -05:00
371fbc698c src/x509.c: mollify bugprone-unused-return-value warnings around XSNPRINTF();
fix various possible buffer overruns;

fix various runtime-error-driven memory leaks;

various refactors for efficiency, clarity, and safety, including refactors to eliminate unsafe XSTRNCAT() calls.
2022-08-08 18:55:38 -05:00
f8c9393235 Added ABI tags for certs, wc_CertNew(), wc_CertFree()
wc_CertNew() and wc_CertFree() is for use by ABI type aplications, and
others, for having wolfCrypt perform the new/free of the certification
structure w/o the application needing too, and more importantly, needing
to contain knowledge of the structure.
2022-08-08 18:12:06 -05:00
ae0faa40cf Bugfix: wolfSSL_get_curve_name() will now print post-quantum group names. 2022-08-08 17:51:45 -04:00
e3310984b6 Merge pull request #5443 from TakayukiMatsuo/doalert 2022-08-08 15:22:18 -06:00
039bf721c4 Merge pull request #5440 from miyazakh/sce_compile_failure 2022-08-08 10:36:15 -06:00
b0aaf4a23d Minor ABI updates. 2022-08-08 10:16:05 -05:00
c9c19c82b3 Added next set of ABI for ECC APIs 2022-08-08 09:08:24 -05:00
65d402d8d7 Revert "Revert "Removed duplicate WOLFSSL_ABI tag.""
This reverts commit e5c51b2638a374aa987c30be8598a78e3f370c7a.
2022-08-08 09:08:24 -05:00
d283510aa9 Revert "Removed duplicate WOLFSSL_ABI tag."
This reverts commit d17021bc4e8e3f12b0c0406f7fe400ed4c0bc2cd.
2022-08-08 09:08:23 -05:00
f2677c29ec Removed duplicate WOLFSSL_ABI tag. 2022-08-08 09:08:23 -05:00
cc8fb1f978 git push origin ms_abi 2022-08-08 09:08:23 -05:00
b200d65a6a Added new ABI reference hooks. This is round two, more to come. 2022-08-08 09:08:23 -05:00
46f423b8b9 Added ABI macros for managing interface changes 2022-08-08 09:08:23 -05:00
4431438fb2 add QUIC support. 2022-08-08 13:24:00 +02:00
7004157869 Merge pull request #5387 from TakayukiMatsuo/tk14445
Suppress build errors when defining some disable macros
2022-08-07 20:09:41 -07:00
9fd56c9c5c Changes in response to other PRs 2022-08-08 02:10:14 +09:00
79fb1783c4 Suppress build errors when defining some disable macros 2022-08-07 17:11:22 +09:00
2d2c55f1c1 Merge pull request #5431 from haydenroche5/wolfssl_error
Expand error queue usage with new macro WOLFSSL_ERROR_VERBOSE.
2022-08-05 15:14:44 -07:00
96fcc129ec Merge pull request #5213 from JacobBarthelmeh/req
expand functions included in opensslextra and add REQ print out
2022-08-05 13:20:21 -07:00
2288082d9a Make wolfSSL quiet_shutdown functions available when using OPENSSL_EXTRA_X509_SMALL. 2022-08-05 11:51:34 -07:00
3bf21b5a05 Expand error queue usage with new macro WOLFSSL_ERROR_VERBOSE.
We have users who need to debug errors coming out of libwolfssl in production,
where --enable-debug isn't an option. Our error queue implementation is the
solution, but our usage of WOLFSSL_ERROR isn't consistent. This commit greatly
expands our usage of WOLFSSL_ERROR. There are too many error cases to tackle
all at once, and not all error cases are particularly meaningful or likely to be
hit in regular operation of the library. I've tried to focus on errors that
users are likely to hit, and I've chosen to ignore things like the mountain of
BUFFER_E and BAD_FUNC_ARG cases (for the most part). I've also tried to expand
WOLFSSL_ERROR usage in files where we haven't been using it historically
(e.g. aes.c), so the pattern is now there for other developers to follow. In
order to prevent these additions from exploding the size of libwolfssl, they're
all behind a new macro, WOLFSSL_ERROR_VERBOSE. If WOLFSSL_VERBOSE_ERRORS is
defined, WOLFSSL_ERROR_VERBOSE just maps to WOLFSSL_ERROR.
2022-08-05 10:32:18 -07:00
d6c895d19d use or with all/extra macro guard 2022-08-05 09:31:42 -07:00
83f1ade1fc use extension free function with opensslextra and remove debug printf 2022-08-05 09:15:35 -07:00
cedfe9938a Fix the comment about the argument of wolfSSL_PEM_read_RSAPrivateKey. 2022-08-06 00:15:49 +09:00
4f181576ef Fix the position of wolfSSL_PEM_read_RSAPrivateKey definition in pem.h 2022-08-06 00:14:30 +09:00
192f081833 Merge pull request #5439 from SparkiDev/tls13_ext_msgs 2022-08-05 10:49:13 +02:00
f30b3f1163 fix compile error 2022-08-05 16:00:09 +09:00
c35b47f265 TLS !.3: restrict extension validity by message
Extensions ServerName, SupportedGroups and ALPN must not appear in
server_hello.
Removed server_hello from the valid checks.
2022-08-05 08:26:09 +10:00
56be09005f Merge pull request #5427 from julek-wolfssl/dtls-timeout-and-closed-socket
DTLS socket and timeout fixes
2022-08-05 08:13:14 +10:00
ff512a34c6 adjust temporary buffer size and memory free'ing 2022-08-04 15:11:24 -07:00
7465691c70 Merge pull request #5437 from douzzer/20220804-fixes
20220804 fixes
2022-08-04 13:55:03 -07:00
9d5e633a96 wolfcrypt/src/pkcs12.c: add WOLFSSL_SMALL_STACK path in freeDecCertList(). 2022-08-04 11:16:47 -05:00
d7e33b3293 wolfcrypt/src/asn.c: fix null pointer deref in SetReqAttribSingle() (clang-analyzer-core.NonNullParamChecker). 2022-08-04 11:12:09 -05:00
99dad91344 Merge pull request #5435 from douzzer/20220803-gcc-12-ASAN
20220803-gcc-12-ASAN
2022-08-04 08:41:26 -07:00
6d4f0146ca Refactor sending alert on decryption failure
Take sending of the alert outside of DecryptTls() and DecryptTls13(). The alert is now sent in ProcessReplyEx().
2022-08-04 12:06:26 +02:00
ebcfa31993 Refactor checking socket type into a function 2022-08-04 11:35:27 +02:00
3278210e1c Silently discard DTLS msgs that fail decryption
Don't send alerts when decryption fails inside a DTLS connection.
TLS should always send a bad_record_mac when decryption fails.
2022-08-04 11:27:45 +02:00
fd1e8c49eb Reset timeout when reading a valid DTLS message
- Increment the DTLS 1.3 timeout on a long timeout
2022-08-04 11:27:45 +02:00
67d518544b EmbedReceiveFrom: fix when using a TCP socket
- recvfrom() returns 0 on a closed TCP socket
- TCP sockets set WOLFSSL_CBIO_ERR_ISR on a timeout
2022-08-04 11:27:45 +02:00
9ea3e173d0 Merge pull request #5277 from JacobBarthelmeh/req_attr
expand subject name and req attribute support
2022-08-04 14:32:14 +10:00
2c2a7750a4 Merge pull request #5414 from darktohka/feature/chacha20-poly1305-evp
Integrate chacha20-poly1305 into the EVP interface
2022-08-03 18:21:17 -07:00
1dc848d8e3 Merge pull request #5429 from dgarske/sniffer_async2
Fix for sniffer to ensure the session was polled before trying to reprocess it
2022-08-04 08:18:55 +10:00
e32cfb79e5 Merge pull request #5419 from dgarske/aurix
Support for Infineon AURIX IDE and minor compiler warnings.
2022-08-04 08:01:57 +10:00
3f07900c1b Merge pull request #5432 from embhorn/zd14172
Fix dead code warnings and build error
2022-08-03 15:01:20 -07:00
791250c6c0 Merge pull request #5428 from TakayukiMatsuo/rx65n_fix
Fix build error and update manuals for Renesas RX boards
2022-08-03 11:04:25 -07:00
6e8417e631 wolfssl/wolfcrypt/blake2-int.h: remove alignment specs on __blake2s_state and __blake2b_state, as they are unneeded, and are not honored by gcc-12+ in stack allocations, leading to (true positive) misaligned-access errors from ASAN. 2022-08-03 12:30:45 -05:00
a7f0c92c0d src/internal.c: in GetCipherKeaStr(), when gcc-12 or higher and __SANITIZE_ADDRESS__, wrap in a pragma to ignore -Wstringop-overread, due to false positives. 2022-08-03 12:30:29 -05:00
664fe390d6 Merge pull request #5382 from icing/announce-pskkem-plain
Announce TLSX_PSK_KEY_EXCHANGE_MODES in non-resuming ClientHello
2022-08-03 07:40:24 -07:00
0c1add08e3 Merge pull request #5416 from darktohka/feature/chacha20-outl-bytes
Ensure ChaCha20 updates out length during cipher update
2022-08-03 07:26:02 -07:00
4937557ddc Merge pull request #5422 from julek-wolfssl/dtls-async-fix
Fix dtls + async multi-test misc errors
2022-08-03 07:24:58 -07:00
ecdccb6180 Fix build error with WOLFSSL_AES_DIRECT 2022-08-03 09:09:28 -05:00
f713c75a73 Fix dead code warnings in evpCipherBlock and wc_CryptKey 2022-08-03 08:08:00 -05:00
53e0483e47 Support for Infineon AURIX IDE. Fixes for Aurix compiler warnings. 2022-08-02 16:53:47 -07:00
72b0f15075 Merge pull request #5424 from anhu/curl_ftps_fix 2022-08-02 23:22:11 +02:00
9d2ed67a5c Fix for sniffer to ensure the session was polled before trying to reprocess it. 2022-08-02 08:11:21 -07:00
013ad0d564 Add wolfSSL_PEM_read_RSAPrivateKey to OpenSSL compatible API 2022-08-03 00:02:40 +09:00
fd412ed298 Fix so curl can do FTPS on TLS 1.3 with session resumption. 2022-08-02 10:51:14 -04:00
3c51d872ea Fix build error and update manuals 2022-08-02 16:45:37 +09:00
9db4ae64b9 Merge pull request #5423 from douzzer/20220729-fixes
20220729-fixes
2022-08-02 08:03:53 +10:00
99ed727179 add WOLFSSL_CERT_NAME_ALL macro guard and new values to set subject 2022-08-01 10:52:09 -07:00
52b80ea52a expand functions included in opensslextra and add REQ print out 2022-08-01 09:21:43 -07:00
4602e6d892 Merge pull request #5426 from rizlik/epoch_bits_fix
fix: dtls13: use correct buffer index to get epoch bits
2022-08-01 07:41:44 -07:00
8878922f95 fix: dtls13: use correct buffer index to get epoch bits
Fixes: d079662765
2022-08-01 14:24:20 +02:00
791508220f wolfssl/internal.h: fix spurious assert failure on jumbo RSA key configurations (> 8192 bits); mollify bugprone-macro-parentheses. 2022-07-29 09:33:14 -05:00
fb2feee9b6 Fix dtls + async multi-test misc errors
DTLS uses DtlsMsgStore() to process messages when using async crypto. A check was skipping the storing straight to DtlsMsgDrain().
2022-07-29 15:49:49 +02:00
a943de7969 Changes after PR review.
- removed additions to REAME.md
- changed coding style of conditional PSKKEM announce
  as requested.
2022-07-29 11:26:08 +02:00
1db8013566 Update README with note about change in TLSX_PSK_KEY_EXCHANGE_MODES use. 2022-07-29 11:18:56 +02:00
c8008e29b9 Announce TLSX_PSK_KEY_EXCHANGE_MODES in non-resuming ClientHello.
- can be reverted to previous style by defining NO_TLSX_PSKKEM_PLAIN_ANNOUNCE
- QUIC interop testing reveals that at least QUIC stacks refrain from
  issuing session tickets unless the ClientHello shows this extension.
2022-07-29 11:18:56 +02:00
da422eb422 Merge pull request #5406 from SparkiDev/mp_int_size
Maths bit size: ensure size is right
2022-07-28 15:36:58 -07:00
d568e8c893 Merge pull request #5413 from SparkiDev/x509_san_crit
ASN template: allow SAN to be critical
2022-07-28 15:14:23 -07:00
ac85000a02 Merge pull request #5415 from douzzer/20220728-fixes
20220728-fixes
2022-07-28 12:48:40 -07:00
fde2097503 Merge pull request #5405 from SparkiDev/clang-x86
TFM: change inline x86 asm code to compile with clang
2022-07-28 08:42:17 -07:00
e599bb5048 Mark chacha20-poly1305 as an AEAD cipher 2022-07-28 18:36:52 +03:00
e3dd7677c8 Add tests for chacha20-poly1305 EVP integration 2022-07-28 18:21:12 +03:00
e8febaf414 Ensure ChaCha20 updates out length during cipher update 2022-07-28 18:06:41 +03:00
545ba58cc0 sp_int.c sp_div(): add missing (err == MP_OKAY) clause to fix null ptr deref. 2022-07-28 09:28:36 -05:00
3ac04fa3ee wolfcrypt/benchmark/benchmark.c: fix gating for #include <unistd.h>. 2022-07-28 09:28:36 -05:00
52cc73a6a4 Integrate chacha20-poly1305 into the EVP interface 2022-07-28 13:01:35 +03:00
70c38f2183 Cert: SAN extension critical
Add field to Cert to indicate SAN extension is critical.
Handle the field being set when encoding.
2022-07-28 14:16:56 +10:00
824d44b705 Merge pull request #5412 from douzzer/20220726-multi-test-fixes
20220726-multi-test-fixes
2022-07-27 20:44:46 -07:00
7b65a1f1c2 Merge pull request #5411 from anhu/selfsigned_template
Fix ASN template to use the subject as issuer if cert is selfsigned
2022-07-27 16:02:14 -07:00
6ecf2c0a5e Merge pull request #5399 from SparkiDev/sp_exptmod_reduce
SP int: exptmod ensure base is less than modulus
2022-07-27 15:43:16 -07:00
58cc326621 Calcuate ---> Calculate 2022-07-27 16:56:45 -04:00
33579045f2 Fix ASN template code to use the subject as issuer if cert is selfsigned. 2022-07-27 16:38:17 -04:00
9256d6aa7c src/internal.c: fixes for redundant assignments and preprocessor typo. 2022-07-27 14:42:00 -05:00
c63e22701f src/pk.c: fix type mismatch in return value. 2022-07-27 14:42:00 -05:00
ed449d5b20 wolfsentry integration: avoid redundant and frivolous dispatches (ssl.c wolfSSL_connect(), wolfSSL_negotiate(), wolfSSL_accept(); tls13.c wolfSSL_connect_TLSv13(), wolfSSL_accept_TLSv13()). 2022-07-27 14:42:00 -05:00
feb911c612 Merge pull request #5398 from dgarske/make_dist_small
Script to produce a small source/header only package
2022-07-27 14:33:59 -05:00
a56d25d58e Merge pull request #5408 from julek-wolfssl/FreeAsyncCtx-location
FreeAsyncCtx should only be called when advancing state
2022-07-27 09:59:28 -07:00
0f0b7c553c Keep .i files needed for fast math. Use test_paths.h from .in to remove user path info. 2022-07-27 08:33:27 -07:00
6f282c2c57 Merge pull request #5402 from rizlik/dke_rsa
doClientKeyExchange improvements
2022-07-27 08:01:16 -07:00
e9b3b5936f FreeAsyncCtx should only be called when advancing state
The call to FreeAsyncCtx after SendBuffered was added to clean up state when we are ready to advance state. If we do not advance state, then clean up should be handled in the relevant state.
2022-07-27 14:14:22 +02:00
460845ba49 Maths bit size: ensure size is right
Ensure WOLFSSL_MAX_RSA_BITS works.
Fix SP math size defines.
Regression testing maths implementations.
2022-07-27 18:58:30 +10:00
788348dce2 TFM: change inline x86 asm code to compile with clang 2022-07-27 14:05:37 +10:00
01aad13c38 Rework 2022-07-27 12:02:15 +10:00
f31c8223f2 fix for not having default pkcs7 signed attributes 2022-07-26 16:45:44 -07:00
9ac3c9ec05 ECC import priv: validate priv is less than order
Valid private key must be less than order.
Check on import when WOLFSSL_VALIDATE_ECC_IMPORT defined.
2022-07-27 09:29:07 +10:00
9c480ece66 Fix to use the new outTmp. 2022-07-26 15:48:58 -07:00
c2476e3858 SP int: exptmod ensure base is less than modulus
Ensure sp_div uses rem only when rem is big enough.
2022-07-27 08:48:28 +10:00
5f47adba3c Merge pull request #5401 from dgarske/cmake_install_spmathall 2022-07-26 15:02:42 -07:00
856ea2ffc8 internal.c: RsaDec improvements 2022-07-26 20:59:01 +02:00
1727efbc2c internal.c: rsa decription buffer handling 2022-07-26 20:59:01 +02:00
2e1e8d2789 misc.c: introduce ctMaskCopy() 2022-07-26 20:59:01 +02:00
344ad48f03 Fix for CMake not installing sp_int.h for SP math all. 2022-07-26 11:29:21 -07:00
1003dfeefc Merge pull request #5392 from JacobBarthelmeh/caam
more macro guards with CAAM builds
2022-07-26 09:41:21 -07:00
9e213cab19 Fixes for the script (from Douzzer). 2022-07-26 08:50:27 -07:00
a5b1838d8f Merge pull request #5393 from TakayukiMatsuo/leakfix 2022-07-26 09:44:19 -06:00
a05b38059e Merge pull request #5385 from miyazakh/sce_jenkins_fail 2022-07-26 09:41:46 -06:00
48016adf52 Script to produce a small source/header only package (with CMake support) 2022-07-25 17:08:13 -07:00
a98642ba61 Merge pull request #5383 from julek-wolfssl/negating-ciphersuites
Expand SetCipherList()
2022-07-25 08:26:47 -07:00
97970d87a5 Merge pull request #5350 from SparkiDev/sp_math_fixes_1
SP math
2022-07-25 08:18:55 -07:00
7174e6766b Merge pull request #5391 from embhorn/gh5366
Fix to copy TLS version with wolfSSL_write_dup
2022-07-25 07:56:14 -07:00
cceb35abe2 Merge pull request #5394 from SparkiDev/pathlen_set_0
Cert path length: add flag to indicate path length set
2022-07-25 07:54:30 -07:00
ec565250ed Merge pull request #5395 from SparkiDev/encrypt_len_fix
ENCRYPT_LEN fix
2022-07-25 07:53:50 -07:00
5a0afc512e Fix memory leak in ECDHE with TSIP 2022-07-25 19:43:32 +09:00
e7cd1562b4 Expand SetCipherList()
- support disabling ciphersuites starting from the default list
2022-07-25 11:14:16 +02:00
8e20a5900c ENCRYPT_LEN fix
Fix check for WOLFSSL_SP_MATH_ALL and WOLFSSL_SP_MATH instead of
WOLFSSL_SP_MATH twice.
2022-07-25 09:35:43 +10:00
8fa2449a63 Cert path length: add flag to indicate path length set
A path length is allowed to be 0.
Can't check path len for 0 to determine when value is set.
Added flag to indicate path length is set.
2022-07-25 09:07:14 +10:00
56bec875b4 Merge pull request #5390 from kareem-wolfssl/bnGenPrimeRsa
Update sp_rand_prime's preprocessor gating to match wolfSSL_BN_generate_prime_ex's.
2022-07-25 08:10:06 +10:00
35d40f263e more macro guards with CAAM builds 2022-07-22 16:19:55 -07:00
4369873540 Fix to copy TLS version with wolfSSL_write_dup 2022-07-22 15:09:35 -05:00
dc92ec2aa9 Update sp_rand_prime's preprocessor gating to match wolfSSL_BN_generate_prime_ex's. 2022-07-22 11:07:46 -07:00
6f2889c07d BIO_eof returns 1 when no more data remains in the BIO 2022-07-22 13:24:32 +02:00
491ebb7a3d fixed compile error due to degression
fixed memory leak in wc_SCE_EccVerify
2022-07-22 08:29:05 +09:00
dc8b796d1d Merge pull request #5347 from dgarske/async_sess_tick
Support for asynchronous session ticket callback
2022-07-22 08:04:48 +10:00
02e512142c Merge pull request #5359 from haydenroche5/unit_test_refactor
Begin refactor of api.c.
2022-07-21 15:52:40 -05:00
281825db20 Merge pull request #5353 from rizlik/dtls13_async_fixes
Dtls13 async fixes
2022-07-21 13:24:35 -07:00
69e2f5243c Merge pull request #5326 from gojimmypi/ESP32_HW_Update_PR
Espressif ESP32 Hardware Acceleration Update and Cleanup
2022-07-21 12:09:09 -07:00
163acb89af dtls13: consider certificate_request processed on WC_PENDING_E
The error is due to the message triggered by the processing of the
message (Connect()->SendTls13Certificate/SendTls13CertificateVerify/SendTls13Verify). Consider
the message processed to avoid double processing.
2022-07-21 12:00:18 -07:00
aca83b42d7 fix: dtls13: send immediately post-handshake certificate request 2022-07-21 12:00:18 -07:00
53dde1dafe dtls12: async: store the message only if async is really used 2022-07-21 12:00:18 -07:00
964ea85d3d Fix typos for dynamic types in dtls13.c. 2022-07-21 12:00:18 -07:00
dce63fdfb3 async: fix issue with DTLSv1.3 2022-07-21 12:00:16 -07:00
07afc594a8 dtls13: aesthetic only changes 2022-07-21 11:55:50 -07:00
b5ce0b021e Merge pull request #5381 from rizlik/async_fix
fix: async: don't rewind index if post-handshake connect() fails
2022-07-21 11:53:15 -07:00
c5e7ccca2c Merge pull request #5380 from danielinux/typo-doc
Fixed typo in dox_comments
2022-07-21 11:52:56 -07:00
daf5135642 Begin refactor of api.c.
- Modify all existing tests to return an int. This moves us in the direction of
being able to return error/success from a test rather than just calling abort
when something fails. Also, all tests now have the same signature, so they can
easily be members of an array of test cases.
- Wrap each test in a TEST_CASE struct, which just stores a pointer to the test
function and the name of the test, for now. In the future, other metadata can
be added (e.g. should this test be run/skipped) to TEST_CASE, if desired.
- Modify all tests to return 0 on success. Right now, this doesn't do us much
good because the failure mechanism isn't returning some value != 0, it's
abort.
- Add TestSetup and TestCleanup functions that run before and after each test,
respectively. The former does nothing right now, and the latter clears the
error queue, if the error queue is compiled in.
2022-07-21 10:12:26 -07:00
1281d97b1e Merge pull request #5373 from haydenroche5/error_queue_fix
Fix backwards behavior for various wolfSSL_ERR* functions.
2022-07-21 09:35:21 -06:00
a235de25fe fix: async: don't rewind index if post-handshake connect() fails
During post-handshake authentication async code mistakes connect() error code
with the error code of DoTls13CertificateRequest and wrongly rewinds the buffer.

The bug was never triggered because of side effects of ShrinkBuffer (removed in
40cb6e0853)
2022-07-21 16:35:43 +02:00
a18b1939ac Fixed typo in dox_comments 2022-07-21 10:19:51 +02:00
c60fae8731 wc_Sha256Free checks lockDepth for Espressif RTOS 2022-07-21 09:08:10 +02:00
bd28b52aaa #include "wolfssl/wolfcrypt/settings.h" 2022-07-21 09:06:01 +02:00
9da0ff0f31 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into ESP32_HW_Update_PR 2022-07-21 08:21:17 +02:00
58aec606c6 wolfSSL license, not wolfSSH 2022-07-21 08:12:54 +02:00
6937062b9a wolfSSL license, not wolfSSH 2022-07-21 08:09:19 +02:00
a4e3dc9638 Merge pull request #5379 from douzzer/20220720-fixes
20220720-fixes
2022-07-20 21:34:08 -06:00
8605195709 Support for asynchronous session ticket callback (can return WC_PENDING_E). Requires wolfAsyncCrypt support. ZD 14420. 2022-07-20 16:43:17 -07:00
542c53f3ac snip out errant "#/" strings added to various text files by copyright boilerplate update in 8eaa85e412. 2022-07-20 18:23:28 -05:00
a3fd714501 configure.ac: allow --enable-opensslextra with --enable-linuxkm if --enable-cryptonly is also given. 2022-07-20 18:21:29 -05:00
3842889649 src/tls13.c: in SendTls13ClientHello(), move nullness check on WOLFSSL* ssl back to the start of the function. 2022-07-20 18:19:58 -05:00
706ab6aac0 Merge pull request #5377 from kareem-wolfssl/rsaKeyEncipher
Don't require digital signature bit for static RSA cipher suites.  Make wolfSSL_CTX_clear_options available without OPENSSL_EXTRA.
2022-07-20 15:28:55 -07:00
bd2b510487 Merge pull request #5376 from dgarske/sniff_tlsv12_sessticket
Fixes for sniffer session ticket resumption with TLS v1.2
2022-07-21 08:22:33 +10:00
9450fa1412 Merge pull request #5375 from LinuxJedi/se050-private-key-add
Add ECC private key insertion for SE050
2022-07-20 12:42:13 -07:00
741d61574b Make wolfSSL_CTX_clear_options available without OPENSSL_EXTRA. 2022-07-20 12:24:47 -07:00
873890316c Don't require digital signature bit for static RSA cipher suites. 2022-07-20 12:08:20 -07:00
564f79c91a Merge pull request #5371 from douzzer/20220719-linuxkm-get_thread_size-no-thunks
linuxkm: inhibit thunk generation in get_thread_size.
2022-07-20 11:48:48 -07:00
1c7f64cce9 Fixes for sniffer session ticket resumption with TLS v1.2. ZD14531. 2022-07-20 11:18:19 -07:00
b46a308544 Merge pull request #5361 from embhorn/zd14491
Fix for build with NO_TLS
2022-07-20 09:28:23 -07:00
e6da540fb3 Fix backwards behavior for various wolfSSL_ERR* functions.
wolfSSL_ERR_get_error and wolfSSL_ERR_peek_error_line_data should return the
earliest error in the queue (i.e. the error at the front), but prior to this
commit, they returned the latest/most recent one instead.

In DoAlert, we were adding an error to the queue for all alerts. However, a
close_notify isn't really an error. This commit makes it so DoAlert only adds
errors to the queue for non-close_notify alerts. In ReceiveData, similarly, we
were adding an error to the queue when the peer sent a close_notify, as
determined by ssl->error == ZERO_RETURN. Now, we don't add an error in this
case.
2022-07-20 08:56:48 -07:00
07d2940757 Fix issue caused by undo in IDE 2022-07-20 16:42:09 +01:00
ab60865178 Merge pull request #5374 from julek-wolfssl/dtls-multiple-msgs
ShrinkInputBuffer should not be called in the middle of ProcessReply
2022-07-20 08:27:56 -07:00
d7b4abfa0b Fixups to the SE050 ECC pkey insert function 2022-07-20 16:25:39 +01:00
719e814841 Merge pull request #5370 from rizlik/dtls13_partial_read_fixes
dtlsv1.3 fixes
2022-07-20 08:03:29 -07:00
e4c1e71b38 Merge pull request #5364 from embhorn/zd14519
Fix wolfSSL_Init error handling
2022-07-20 08:03:08 -07:00
f4191a102b Merge pull request #5304 from SKlimaRA/SKlimaRA/cert-pathlen
drafted pathlen for cert struct
2022-07-20 07:54:13 -07:00
aab2459d1f Merge pull request #5372 from JacobBarthelmeh/copyright
update copyright year to 2022
2022-07-20 07:52:05 -07:00
c029b23043 Merge pull request #5308 from SparkiDev/ecies_gen_iv
ECIES: Google Pay generates IV and places it before msg
2022-07-20 06:46:14 -07:00
2e0d53a07d fix: dtls13: use correct handshaketype on hello retry request 2022-07-20 15:25:50 +02:00
3850e6b554 fix: dtls13: use aes for record numbers encryption if using aes-ccm 2022-07-20 15:25:50 +02:00
066f17faad fix: dtls13: hello_retry_request type isn't an encrypted message 2022-07-20 15:25:50 +02:00
c0fc87342c tls13: avoid spurious state advances in connect/accept state machine 2022-07-20 15:25:50 +02:00
11dfb713e9 openssl_compatible_default: use DTLSv1.0 as minDowngrade in DTLS 2022-07-20 15:25:46 +02:00
6711756b03 dtls13: support stream-based medium
Don't assume that the underlying medium of DTLS provides the full message in a
single operation. This is usually true for message-based socket (eg. using UDP)
and false for stream-based socket (eg. using TCP).

Commit changes:

- Do not error out if we don't have the full message while parsing the header.
- Do not assume that the record header is still in the buffer when decrypting
  the message.
- Try to get more data if we didn't read the full DTLS header.
2022-07-20 14:53:07 +02:00
40cb6e0853 ShrinkInputBuffer should not be called in the middle of ProcessReply 2022-07-20 11:57:48 +02:00
ea34fb1643 Add ECC private key insertion for SE050
This adds a utility function which allows an ECC private key to be
inserted into the SE050's permanent storage.
2022-07-20 10:45:26 +01:00
66c5a947fd XSTRNCPY, fixed typos 2022-07-20 08:56:59 +02:00
09bba3510f ECIES: Google Pay ECIES
Generates IV and places it before msg
Uses 12 byte IV with AES-CTR
Add API to explicitly set KDF salt.
2022-07-20 09:30:47 +10:00
8eaa85e412 update copyright year to 2022 2022-07-19 10:44:31 -06:00
8b904e9082 Fix for build with NO_TLS 2022-07-19 11:12:18 -05:00
0dac3ec022 linuxkm: inhibit thunk generation in get_thread_size. 2022-07-19 10:20:04 -05:00
1a44bad8cc drafted test case for path len 2022-07-19 15:34:20 +02:00
3d721bd533 more WOLFSSL_CERT_EXT 2022-07-19 11:00:36 +02:00
6ce5f645f3 added ASN template code and WOLFSSL_CERT_EXT, still missing testcase 2022-07-19 10:38:47 +02:00
9a3efb67b8 Merge pull request #5368 from lealem47/disableAes
Fix for --disable-aes without --disable-aesgcm
2022-07-18 15:05:59 -07:00
feb3f889af Merge pull request #5369 from embhorn/zd14522
Fix var init in wc_ecc_shared_secret
2022-07-18 14:17:53 -07:00
cee9f9a871 Fix for --disable-aes without --disable-aesgcm 2022-07-18 10:26:20 -07:00
c63abe398f Merge pull request #5321 from miyazakh/tsip_add_usecase 2022-07-18 09:35:43 -06:00
f55fe7fccd Fix var init in wc_ecc_shared_secret 2022-07-18 09:13:07 -05:00
218ab7e396 Merge pull request #5362 from haydenroche5/ssl_set_options_public
Make wolfSSL_(get|set)_options available outside compat layer.
2022-07-15 10:36:29 -07:00
e7303d697b Fix wolfSSL_Init error handling 2022-07-15 09:30:30 -05:00
8a757ef7cf Merge pull request #5363 from dgarske/se050_curve25519
Fixes for SE050 Curve25519 endianness
2022-07-15 08:49:27 +01:00
15725400a7 addressed review comments 5 2022-07-15 13:46:30 +09:00
a1b7c29309 Make wolfSSL_(get|set)_options available outside compat layer.
Also make wolfSSL_CTX_get_options available.
2022-07-14 16:03:58 -07:00
dec8a7fd93 Fixes for SE050 Curve25519 endianness (SDK assumes little endian). Fix for ECC se050_ecc_shared_secret use of wrong pointer on error handle free. 2022-07-14 15:34:50 -07:00
6cc2665a81 Merge pull request #5358 from SparkiDev/sp_int_armv6
SP int ARM32: replace clz instruction when not supported
2022-07-14 15:32:00 -07:00
350ff552c4 Merge pull request #5351 from kojo1/renesas-csp 2022-07-14 16:10:34 -06:00
abba59f735 order of array of names for asn template build 2022-07-14 13:15:59 -07:00
8862e1f8cf resolve name conflict 2022-07-14 09:41:36 -07:00
e3c65d86d6 Merge pull request #5360 from LinuxJedi/se050-sign-fix-b
Missed a small part of my original SE050 sign fix
2022-07-14 06:39:11 -07:00
fd885d89eb Added multi thread use case
Improve not to use forward declaration struct definition

 - include ssl.h rather than forward declaration struct to resolve struct name
 - to include ssl.h, it needs to avoid cyclic reference for crypt structure. therefore, Sha and Aes definitions are moved to another header file
2022-07-14 17:25:21 +09:00
3f390efb24 Missed a small part of my original SE050 sign fix
Empty keyId handling now exists so we shouldn't return `BAD_FUNC_ARG`.
2022-07-14 07:47:33 +01:00
c211b90aab Merge pull request #5357 from dgarske/se050_fixes
Fixes for SE050 ED25519 private key loading and Curve25519/ECC handle leak
2022-07-14 07:14:54 +01:00
5098cdcd76 Merge pull request #5356 from dgarske/asn_rfc8410
Fixes for ED25519/ED448 private key with public key export (RFC8410)
2022-07-14 07:11:03 +01:00
f6c4e295b1 add more subject name support and expande REQ attributes creation support 2022-07-13 22:02:49 -07:00
5dcb1ba21f remove carriage return from CONF strings 2022-07-13 22:02:49 -07:00
b69af856de Ed ASN template: change for IMPLICIT public key in private key
Fix KATs in test.c to match new expected format.
2022-07-14 10:19:43 +10:00
33b3ebb1e9 SP int ARM32: replace clz instruction when not supported 2022-07-14 09:37:28 +10:00
2d5bc72c9b Fixes for ED25519/ED448 private key with public key export (RFC8410). Added length only support. 2022-07-13 16:17:08 -07:00
586ae71dac Fixes for SE050 ECC and Curve25519 with TLS. 2022-07-13 10:50:10 -07:00
a2b7b44163 Merge pull request #5342 from Uriah-wolfSSL/dtls_for_win
Example DTLS v1.3 build settings for Windows Visual Studio
2022-07-13 09:27:46 -07:00
065991bab5 Merge pull request #5348 from douzzer/20220707-attend-return-values
20220707-attend-return-values
2022-07-13 08:50:29 -07:00
1b6ce6150e unsigned pathlen 2022-07-13 09:07:02 +02:00
96fe356dd8 SP math
Enable ForceZero for SP math and all RSA.
Disable use of 128-bit type in SP unless WOLFSSL_UINT128_T_DEFINED is
defined.
2022-07-13 14:54:34 +10:00
69bf0345c4 Renesas cs+ project. Remove depreciated algorithms 2022-07-13 10:24:44 +09:00
dc231dc099 peer review: add explanatory comment for printf() macro in test.c; rearrange test.h to avoid awkward forward declaration and add some topical grouping. 2022-07-12 18:19:52 -05:00
a4e452ec6a New file for adding needed configuration options to enable DTLS including DTLS version 1.3. This is an example file to be used for testing, eval, demos, etc. 2022-07-12 15:53:21 -05:00
357ace8408 * Updated README.txt w/ how to use user_settings_dtls.h.
* Added dtls13.c to build project files.
* Added user_settiings.dtls.h to include.am.
2022-07-12 15:53:21 -05:00
b64949d564 wolfcrypt/benchmark/benchmark.c: fix gating for #include <errno.h>, and add #include <unistd.h> for _exit(). 2022-07-11 23:15:43 -05:00
ccc5952369 global fixup to check or explicitly ignore return values from failable library/system calls that weren't already being checked;
add wolfCrypt error codes IO_FAILED_E "Input/output failure" and SYSLIB_FAILED_E "System/library call failed";

tests/api.c and tests/unit.c: flush stdout for error message in Fail() macro, add fflush(stdout) after printf()s, print success message at end of unit_test(), and send several error messages to stderr instead of stdout;

wolfcrypt/test/test.c: add fallthrough macro definition of printf() that pairs it with fflush(stdout);

unit.h: in definition of macro AssertPtr(), add PRAGMA_GCC("GCC diagnostic ignored \"-Wpedantic\"");

sp_int.c: refactor several lingering instances of "if (0) { ... }" code pattern to #if 0 ... #endif.
2022-07-11 22:28:09 -05:00
e30899b676 Merge pull request #5334 from LinuxJedi/se050-fixes
Fixes to SE050 port
2022-07-11 16:15:08 -07:00
22c3a1fc6f Merge pull request #5346 from dgarske/async_rel_v5.4.0
Async release v5.4.0 patches
2022-07-11 17:11:06 -06:00
34c576d2a7 Fixes for possible NULL dereference for heap hint in pk.c Fix typo in api.c test for dynamic type. 2022-07-11 14:41:11 -07:00
57aac1c50b Merge pull request #5345 from JacobBarthelmeh/release
Release version 5.4.0
2022-07-11 11:10:10 -07:00
a48129eb99 update README for release 2022-07-11 07:28:15 -07:00
032d59b077 adjust sizeof type for getsockopt argument 2022-07-11 07:10:11 -07:00
86662bca2f update library version to 5.4.0 2022-07-08 16:04:26 -07:00
7379e377ab cast for g++ warning 2022-07-08 15:11:29 -07:00
983b9fc5fb Merge pull request #5343 from dgarske/ecc_oid_coding
Fixes for ECC OID encoding/decoding
2022-07-08 15:38:47 -06:00
4892435004 Fix for wc_ecc_get_curve_id_from_oid with combinations of HAVE_OID_ENCODING and HAVE_OID_DECODING. Fix in SetCurve for unused outSz with HAVE_OID_ENCODING. 2022-07-08 13:00:09 -07:00
66aed8193a Merge pull request #5341 from dgarske/various_20220708
Various fixes and cleanups
2022-07-08 13:56:51 -06:00
56325143f1 Merge pull request #5340 from anhu/micrium_alt_ecc_size
Gate ALT_ECC_SIZE on NO_MALLOC and STATIC_MEMORY since they conflict.
2022-07-08 09:53:07 -07:00
720030b5a9 Improvements to error handling for AddSessionToClientCache. 2022-07-08 09:06:51 -07:00
03a32250da Fix for KCAPI HMAC forcing use of software for HKDF. 2022-07-08 09:06:30 -07:00
3d124c093e Fix PK function name in log. Remove the ECC logging (spams benchmark with --enable-debug). 2022-07-08 09:06:08 -07:00
905f71d80d Fix with macro redefinition error if building with NO_WOLFSSL_ALLOC_ALIGN. 2022-07-08 09:05:29 -07:00
f7595cc77d Merge pull request #5338 from julek-wolfssl/tcp-sendto
sendto can't specify addr on a TCP socket
2022-07-08 09:39:39 -06:00
2d6b6d62b2 Gate ALT_ECC_SIZE on NO_MALLOC and STATIC_MEMORY since they conflict. 2022-07-08 10:52:01 -04:00
a2b75e313a Merge pull request #5339 from douzzer/20220708-DUW_TEST-bugprone-macro-parentheses
tests/api.c: fix bugprone-macro-parentheses in DUW_TEST().
2022-07-08 07:46:20 -07:00
48d3cf593e tests/api.c: fix bugprone-macro-parentheses in DUW_TEST(). 2022-07-08 07:57:29 -05:00
251642a44a sendto can't specify addr on a TCP socket
From the man page
       If  sendto()  is used on a connection-mode (SOCK_STREAM, SOCK_SEQPACKET) socket, the arguments dest_addr and
       addrlen are ignored (and the error EISCONN may be returned when they are not NULL  and  0),  and  the  error
       ENOTCONN  is  returned  when the socket was not actually connected.
2022-07-08 12:14:23 +02:00
58cb91602d Merge pull request #5337 from douzzer/20220707-DtlsUpdateWindowGTSeq-overshift
20220707-DtlsUpdateWindowGTSeq-overshift
2022-07-07 21:53:26 -07:00
c9e9a421e9 Merge pull request #5336 from SparkiDev/aes_ctr_opt
AES-CTR: improve performance when multiple blocks
2022-07-07 21:51:08 -07:00
91438c1087 wolfssl/wolfcrypt/settings.h: refactor Math Library Selection for clarity, and to include WOLFSSL_SP_MATH as an available math back end. 2022-07-07 21:02:16 -05:00
49d292ec4f Merge pull request #5335 from SparkiDev/ecc_imp_exp_fix
ECC import and export fixes
2022-07-07 17:52:20 -07:00
b952c2f777 src/internal.c: add codepath in _DtlsUpdateWindowGTSeq() to avoid a word32 overshift. 2022-07-07 19:36:20 -05:00
2bfac42d65 AES-CTR: improve performance when multiple blocks
When in and out aren't the same pointer, for multiples of block size
input:
  - generate the counters into the output buffer
  - encrypt output buffer
  - XOR in the input
Faster than encrypting a block at a time.
2022-07-08 09:56:20 +10:00
70b9833e98 ECC import and export fixes
On raw import, don't import ordinates that are larger than the curve
size.
On export of compressed point, don't export ordinate if it is larger
than the curve size.
2022-07-08 08:54:53 +10:00
4e1e1e922a Merge pull request #5278 from ejohnstown/dtls-seq
Refactor DTLS Window Update (Fix #5211)
2022-07-07 10:22:21 -07:00
5e453ad932 Merge pull request #5323 from SparkiDev/sha512_arm32_asm_align 2022-07-07 09:47:37 -06:00
e295328436 Fix window handling around word32 boundary 2022-07-07 17:37:10 +02:00
34d897e433 Fixes to SE050 port
This fixes the following things:

* Memory leaks in SE050 SHA messages
* Add key to SE050 for ECC sign hash function
* Remove circular include
* Correct prototype for `se050_hash_final`
* A few defined check fixes
2022-07-07 16:11:54 +01:00
a771baf551 Merge pull request #5332 from SparkiDev/memusage_fix_2
SP math: fix configure.ac to allow its use
2022-07-07 07:40:13 -07:00
738d79c5d5 Merge pull request #5330 from SparkiDev/aesni_no_sse4
AESNI: fix configure to use minimal compiler flags
2022-07-06 20:44:40 -07:00
2111d6b179 Merge pull request #5322 from SparkiDev/sp_math_all_arm32_div_word_fix
SP math all: fix div word for ARM32
2022-07-06 22:18:07 -05:00
74baa0dafa SP math: fix configure.ac to allow its use
Choosing SP and SP math was resulting in only integer.c being used.
Fixed now.
Reorder realloc calls for memory logging to ensure scripts can match
allocate and free calls.
2022-07-07 12:16:12 +10:00
644050a736 Merge pull request #5329 from douzzer/20220706-fips-and-aarch64-fixes
20220706-fips-and-aarch64-fixes
2022-07-06 18:39:38 -07:00
cb6fa921a4 Merge pull request #5328 from haydenroche5/cmake_sp_math_all_default
Make changes to CMake to support SP math default.
2022-07-06 18:39:30 -07:00
8f3449ffea Refactor DTLS Window Update (Fix #5211)
1. Rename _DtlsUpdateWindow() as wolfSSL_Dtls_UpdateWindow() and make
   it public so it may be tested.
2. Rename the internal functions DtlsWindowUpdate(), DtlsWindowCheck(),
   and DtlsUpdateWindowGTSeq() as _DtlsWindowUpdate() and
   _DtlsWindowCheck(), and _DtlsUpdateWindowGTSeq().
3. When updating the DTLS sequence window, and the next sequence
   number (lo) wraps to zero, increment the next sequence number (hi)
   by 1.
4. Fix an off-by-one error that wrapped around when saving the
   packet sequence number in the bit-field window.
5. Adding a test for wolfSSL_DtlsUpdateWindow() function. With many test
   cases. It is set up in a table format with running check values.
6. Change location of incrementing the difference when calculating the
   location for setting the bit.
7. Updated the check of the sequence difference in the GT scenario.
8. In the DTLS window update functions remove newDiff and just use diff.
9. Handle the cases where the DTLS window crosses the high order word
   sequence number change.
10. Add a debug option to print out the state of the DTLS sequence number
   window.
2022-07-06 18:20:06 -07:00
90c2f4ad00 Merge pull request #5327 from kareem-wolfssl/connectRetFix
Fix storage of SendBuffered's return code in wolfSSL_Connect.
2022-07-06 17:53:04 -07:00
9ba77300f9 AESNI: fix configure to use minimal compiler flags 2022-07-07 09:30:48 +10:00
992c7b3b6f SP math all: fix div word for ARM32
Fixup sp_mulmod NULL access.
2022-07-07 08:56:31 +10:00
82b1dc0cd0 wolfcrypt/src/asn.c: move final return in DecodeECC_DSA_Sig() outside the NO_STRICT_ECDSA_LEN gate, to avoid no-return-from-non-void. 2022-07-06 17:39:59 -05:00
eff4fe398b src/include.am: fix gating around sha* and BUILD_ARMASM, to avoid empty-translation-unit warnings for sha{256,512}.c on armasm builds. 2022-07-06 17:37:43 -05:00
7c49449a79 wolfcrypt/src/port/arm/armv8-sha512.c: gate out Sha512_Family_GetHash() in builds that have 224 and 256 bit hashes gated out, to fix unused function warning. 2022-07-06 17:35:15 -05:00
6b6abfac54 examples/client/client.c: remove break after err_sys() to mollify clang-tidy unreachable-break sensor. 2022-07-06 17:32:26 -05:00
19106a9510 configure.ac and tests/api.c: lock out compkey on FIPS 140-3 RC12 and ready, and add backward-compat code in test_wc_ecc_export_x963_ex() to allow RC12 compkey builds to pass unit.test. 2022-07-06 17:31:56 -05:00
d9bf39ffaa Make changes to CMake to support SP math default.
We recently made SP math the default big integer math library. Some changes to
the CMake code are needed for this to work.
2022-07-06 14:14:12 -07:00
44a49aeefa Fix potentially uninitialized variables in Dtls13SetRecordNumberKeys. 2022-07-06 13:45:15 -07:00
c8f5bd3d61 Fix storage of SendBuffered's return code in wolfSSL_Connect. Store in ret initially, only store in ssl->error if there's an error. This matches the logic in wolfSSL_accept. 2022-07-06 12:09:47 -07:00
b2d1bf96ed Merge pull request #5276 from rizlik/dtls13_client_downgrade
Dtls: improve version negotiation
2022-07-06 11:57:53 -07:00
a7fa7875e4 Merge pull request #5244 from julek-wolfssl/wpas-dpp
Support for new DPP and EAP-TEAP/EAP-FAST in wpa_supplicant
2022-07-06 11:35:52 -07:00
e92034cf6f Merge pull request #5274 from JacobBarthelmeh/Certs
remove subject/issuer email from altEmailNames list
2022-07-06 10:48:21 -07:00
e2484a97f2 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into ESP32_HW_Update_PR 2022-07-06 09:32:07 -07:00
8bb6ff8dbb Espressif HW acceleration update & cleanup 2022-07-06 09:30:49 -07:00
711b2bb17a add a test case 2022-07-06 09:39:03 -06:00
a171bebba4 Fix the wc_EccPublicKeyToDer_ex doxy. 2022-07-06 07:58:18 -07:00
3abffc3a3c doc: add documentation for wolfDTLS[v1_3]_*_method() 2022-07-06 16:18:44 +02:00
683adb5917 tests: add dtls downgrade tests 2022-07-06 16:18:44 +02:00
fd4836772b examples: support DTLS version downgrading 2022-07-06 16:18:44 +02:00
df7e81d187 dtls: support version negotiation 2022-07-06 16:18:44 +02:00
8fe3f51ecb dtls13: client: recompute transcript hash on downgrade
If a lower version is negotiated, the transcript hash must be recomputed using
the <= v1.2 rules.
2022-07-06 16:18:44 +02:00
5d74c49ecb dtls13: allow processing of HelloVerifyRequest to support downgrade
HelloVerifyRequest is used in DTLSv1.2 to perform a return routability check, so
it can be the legitim reply from a DTLSv1.2 server to a ClientHello.
2022-07-06 16:18:44 +02:00
ec8149cd69 Merge pull request #5324 from julek-wolfssl/dtls13-hrr-fix
TLSX_COOKIE is only defined with WOLFSSL_SEND_HRR_COOKIE
2022-07-06 06:56:25 -07:00
9b085a44be sessionSecretCb should only be called when a ticket is present 2022-07-06 15:08:57 +02:00
63b4c475d4 wolfSSL_set_session_secret_cb: fix for NULL input 2022-07-06 14:23:08 +02:00
39e53c2b7c Add wc_EccPublicKeyToDer_ex doxygen entry 2022-07-06 11:59:29 +02:00
ef73409fd4 TLSX_COOKIE is only defined with WOLFSSL_SEND_HRR_COOKIE 2022-07-06 10:04:15 +02:00
8b73feb8ef SHA-512 ARM NEON: ensure data being hashed is 64-bit aligned 2022-07-06 16:18:18 +10:00
ff6edbff94 refactor name constraint checks 2022-07-05 17:20:50 -06:00
9a256ca002 Merge pull request #5288 from haydenroche5/openldap
Add --enable-openldap option to configure.ac.
2022-07-05 16:04:51 -07:00
4376ade9c8 Merge pull request #5123 from fabiankeil/configure-amd64-support
configure: Improve defaults for 64-bit BSDs
2022-07-05 13:52:02 -07:00
08488b0fae Merge pull request #5318 from embhorn/gh5314
Fix typos and bad macro names
2022-07-05 12:34:35 -07:00
f5a5d4ada5 Enhance OpenLDAP support.
- Add --enable-openldap to configure.ac
- Fix some issues around subject alt names and the WOLFSSL_GENERAL_NAME struct.
2022-07-05 10:40:07 -07:00
eb9a9ceef8 configure: Improve defaults for 64-bit BSDs
... by consistently treating host cpu "amd64" like host cpu "x86_64".

Tested on ElectroBSD amd64.
2022-07-05 19:37:31 +02:00
ded3f4e9b6 Merge pull request #5284 from julek-wolfssl/dtls-good-ch-cb
DTLS 1.3: additions for event driven server in wolfssl-examples
2022-07-05 10:14:59 -07:00
1c009e8f91 Merge pull request #5311 from SparkiDev/ed_check_pubkey
Ed25519/Ed448: assume public key is not trusted
2022-07-05 09:25:50 -07:00
394f36a0d7 Fix typos and bad macro names 2022-07-05 10:31:11 -05:00
4caffee590 ForceZero the private key on import error 2022-07-05 13:44:31 +02:00
20e5c98b2c Error out when server indicates resumption but does full handshake 2022-07-05 09:42:39 +02:00
fd7bf8d04d Do resuming check as soon as we get a non-resumption msg 2022-07-05 08:49:00 +02:00
144f2612e4 wc_ecc_export_x963_ex returns LENGTH_ONLY_E on a NULL output 2022-07-05 08:49:00 +02:00
8e84560f71 CSR: confirm the signature when verify == VERIFY 2022-07-05 08:49:00 +02:00
afaf41823c wpa_supplicant uses larger challenge passwords for x509 requests 2022-07-05 08:49:00 +02:00
5179741ddb wpas: validate ecc points are on the curve 2022-07-05 08:48:37 +02:00
ee3636f2e7 wc_EccPublicKeyToDer_ex: exporting the public key in compressed form 2022-07-05 08:48:18 +02:00
448cde5a4b Support for new DPP in wpa_supplicant
- Add null check to asn template code in MakeCertReq and test
- ENABLED_ECCCUSTCURVES can also be "all"
2022-07-05 08:48:18 +02:00
4a962b7fb2 Ed25519/448: improvements
Check lengths of buffers in import functions.
priv/pub key set flag set on success only.
2022-07-05 09:02:05 +10:00
1b64b82a6f Merge pull request #5316 from LinuxJedi/fix-embos-mutex
Use the correct mutex type for embOS
2022-07-04 11:51:20 -07:00
07b8f45d35 Merge pull request #5315 from rizlik/dtls_doDtls_fix
fix: examples/server: dtls mode checking
2022-07-04 10:20:20 -07:00
f8c67345d6 Use the correct mutex type for embOS
OS_MUTEX_Lock() is acutally a non-blocking mutex lock, for
wc_LockMutex() we need a blocking mutex. Switch to this.
2022-07-04 15:59:36 +01:00
9dc2c27e3d Expand wolfDTLS_SetChGoodCb() docs 2022-07-04 14:31:24 +02:00
10c8a1668e Reset cookie when resetting DTLS 1.3 state 2022-07-04 12:52:25 +02:00
a8adde66c8 Use wc_HmacInit and wc_HmacFree in cookie logic 2022-07-04 12:51:50 +02:00
00391a5ace Rename callback to wolfDTLS_SetChGoodCb and add doxygen for it. Clarify DTLS_CTX.connected. Fix build errors for ./configure --enable-dtls --enable-dtls13 --disable-examples CFLAGS="-DNO_WOLFSSL_SERVER". 2022-07-04 11:08:39 +02:00
7ea13bf5bf Apply connected to sendto and address code review 2022-07-04 11:08:39 +02:00
dd7073740b DTLS 1.3: tie cookie to peer address 2022-07-04 11:08:39 +02:00
e605cfeccb Add docs for new features 2022-07-04 11:08:39 +02:00
afdd5648aa Address code review 2022-07-04 11:08:39 +02:00
d72edd03b8 dtls: wolfSSL_set_dtls_fd_connected
wolfSSL_set_dtls_fd_connected sets the connected socket file descriptor. This descriptor should be called without addr and addr_len.
2022-07-04 11:08:39 +02:00
c6aa4fc526 DTLS 1.3: allow the server to operate without maintaining state 2022-07-04 11:08:39 +02:00
8fb48464e3 Add callback when we parse a verified ClientHello 2022-07-04 11:08:39 +02:00
80f3db6e1d fix: examples/server: dtls mode checking
This fixes using ssl to check if we are using dtls or not, when ssl is not yet
valid.

Fix: 060dfe1a69
2022-07-04 10:21:11 +02:00
1077829f9d Merge pull request #5313 from douzzer/20220701-sp_div-deadstore
fix clang-analyzer-deadcode.DeadStores in sp_div().
2022-07-04 08:32:50 +10:00
7b9c214b3c Merge pull request #4985 from kareem-wolfssl/iarWarningsFix
Fix compilation warnings from IAR.
2022-07-04 08:23:26 +10:00
b16c2a2aef fix clang-analyzer-deadcode.DeadStores in sp_div(). 2022-07-01 23:49:58 -05:00
5819332f89 Merge pull request #5312 from dgarske/fips_v5dev
FIPS in core hash using SHA2-256 and SHA2-384
2022-07-01 23:25:52 -05:00
6c7db7318e Merge pull request #5309 from kareem-wolfssl/arrayBoundFix
Pass in and check output length in SetCurve.
2022-07-01 18:58:42 -07:00
b9be5c2c24 Update to FIPS v5-ready will use latest master. Support for FIPS in core hash using SHA2-256 and SHA2-384 in fips_test.h. Fixes for MATH_INT_T. Fix error: ‘tls13_kdf_test’ declared ‘static’ but never defined. 2022-07-01 15:40:21 -07:00
bb68766bda For ED255219 and ED448 if importing private only and public key is already set then check it. 2022-07-01 14:13:45 -07:00
90749b7f88 Don't declare tls13_kdf_test if TLS 1.3 is not enabled, to avoid unused function warning. 2022-07-01 13:22:16 -07:00
96aedc2f47 Fix SetCurve max sizes. Add fix for potentially uninitialized type in ProcessReplyEx. 2022-07-01 13:18:33 -07:00
7a7d8d170d Pass in and check output length in SetCurve. 2022-07-01 13:18:33 -07:00
bd75e1d6a4 Merge pull request #5307 from kareem-wolfssl/miscfixes2
Fix a couple of STM32 bugs, and add some missing mutex frees.
2022-07-01 09:46:22 -07:00
0459e83a59 Merge pull request #5310 from SparkiDev/memusage_fix_1
TLS memusage: reduce usage
2022-07-01 09:13:05 -07:00
2c943282f0 Ed25519/Ed448: assume public key is not trusted
In defense against attack, assume the imported public key is not trusted
and check it matches the private key if set.
Added APIs that allow application to explicitly trust public key.
Original APIs default to not trusting public key.
2022-07-01 09:05:43 -07:00
b9a8f18a97 Merge pull request #5300 from douzzer/20220629-multi-test-fixes
20220629-multi-test-fixes
2022-07-01 16:22:05 +10:00
7d58dc5678 TLS memusage: reduce usage
Reduce the amount allocated to reduce maximum overall dynamic memory
usage.
Rework ServerKeyExchange by extracting the handling of the signed data.
2022-07-01 14:24:59 +10:00
b2e7f4a8eb Fix cast spacing. Don't cast in wolfSSL_X509_set_version, check is valid as is. 2022-06-30 16:26:43 -07:00
7555cd0685 Fix a couple of STM32 bugs, and add some missing mutex frees. 2022-06-30 16:11:16 -07:00
402a4dafd4 Merge pull request #5306 from kareem-wolfssl/ltc_ed235519
Fix missing return checks in KSDK ED25519 code.
2022-06-30 16:06:45 -07:00
fc5f1f5eca Merge pull request #5305 from dgarske/cryptonly
Improvements to configure.ac cryptonly and math selection
2022-06-30 17:55:27 -05:00
2bdcbcc8be src/tls13.c: fix whitespace. 2022-06-30 17:17:50 -05:00
4f6527353b src/{pk.c,x509.c}: style/clarity cleanups from dgarske. 2022-06-30 17:07:35 -05:00
1a9388b935 src/pk.c: fix misuses around snprintf(). 2022-06-30 17:07:35 -05:00
28213ad198 src/x509.c: fix wolfSSL_X509_signature_print() to print raw signature algorithm as hex digits, not as an (unprintable) string; fix printed-null bug in wolfSSL_X509_NAME_print_ex() (relates particularly to calls from wolfSSL_X509_NAME_print_ex_fp()). 2022-06-30 17:07:35 -05:00
5bd8288b37 fix printed-null bug in wolfssl_print_number(). 2022-06-30 17:07:35 -05:00
b7ec529f61 wolfcrypt/src/siphash.c: in wc_SipHash(), use FALL_THROUGH macro, not /* fall-through */. 2022-06-30 17:07:35 -05:00
867a1f7afa Merge pull request #5289 from TakayukiMatsuo/tls13 2022-06-30 15:49:53 -06:00
e09bbb1989 Fix compilation warnings from IAR. 2022-06-30 14:30:06 -07:00
13beadbfc3 Fix missing return checks in KSDK ED25519 code. 2022-06-30 13:35:00 -07:00
2f1e236305 Improvements to --enable-cryptonly in configure.ac output. Improvement to math select order in configure.ac and stray heap math=yes. 2022-06-30 12:42:55 -07:00
ed1fdc410e Merge pull request #5303 from SparkiDev/match_dyn_type_fix_1
Fix mismatched dynamic types
2022-06-30 08:56:43 -07:00
26a62b4b9e drafted pathlen for cert struct 2022-06-30 17:16:10 +02:00
ba19737627 Add support for TLS1.3 2022-06-30 23:00:05 +09:00
e8e35c9a92 Merge pull request #5301 from SparkiDev/aes_gcm_word_ct
AES-GCM: make word implementation of GMULT constant time
2022-06-29 20:26:33 -07:00
1ba9ea9759 Fix mismatched dynamic types 2022-06-30 13:00:57 +10:00
9cc928cb29 Merge pull request #5299 from SparkiDev/sp_submod_fix
SP int math; submod fix
2022-06-29 18:52:15 -07:00
8b93d4510d AES-GCM: make word implementation of GMULT constant time
If performance is impacted then define: AES_GCM_GMULT_NCT
2022-06-30 09:29:04 +10:00
0159f17692 SP int math; submod fix
Fix for sp_submod() to reduce by modulus when a or b are equal to
modulus as well as when greater.
2022-06-30 08:53:25 +10:00
f2acaa8ee9 Merge pull request #5242 from SKlimaRA/SKlimaRA/strict-verification
zd14249
2022-06-30 08:19:42 +10:00
28d149a103 Merge pull request #5297 from ejohnstown/esp-build
ESP-IDF Build Cleanup
2022-06-29 14:03:02 -07:00
e941a729a7 Merge pull request #5290 from embhorn/gh5270
Add support for aligned data with clang llvm
2022-06-29 12:14:42 -05:00
2257030792 Merge pull request #5296 from dgarske/sniffer
Sniffer fixes (async TLS v1.3, async removal of `WC_HW_WAIT_E` and sanitize leak)
2022-06-29 09:16:54 -07:00
999d3b3ab7 Merge pull request #5298 from douzzer/20220628-multi-test-and-crossbuild-fixes
20220628-multi-test-and-crossbuild-fixes
2022-06-29 09:14:59 -07:00
5adf7e4eb7 wolfcrypt/src/asn.c wc_BuildEccKeyDer(): fix for clang-analyzer-deadcode.DeadStores. 2022-06-28 19:14:58 -05:00
90aaeb283e wolfcrypt/src/siphash.c: add missing !WOLFSSL_NO_ASM clause in gate around inline asm. 2022-06-28 18:19:58 -05:00
ce61653a9a wolfcrypt/src/asn.c: fixes for ARM portability (GetASN_Items()), unintended fallthrough (OidFromId()), and uninitialized variable (DecodeSubjInfoAcc()). 2022-06-28 18:18:42 -05:00
17659ed48c configure.ac: when --enable-fips=disabled, don't touch DEF_SP_MATH/DEF_FAST_MATH;
don't enable sp-math-all asm gates when !ENABLED_ASM;

add --with-arm-target to allow selecting thumb or cortex in conjunction with a full --host tuple (e.g. --host=armv6zk-softfloat-linux-gnueabi --with-arm-target=thumb).
2022-06-28 18:15:28 -05:00
d76c46a96f Fix for sniffer async issue with TLS v1.3. 2022-06-28 16:01:06 -07:00
f51c29d3ca Merge pull request #5293 from SparkiDev/asnt_setecc
ASN template: Handle HAVE_OID_ENCODING
2022-06-28 15:45:13 -07:00
e56394a2ab ESP-IDF Build Cleanup
1. Update the list of files to leave out of the build. They are ones
   that are included into ssl.c automatically.
2022-06-28 15:38:58 -07:00
092b37f709 Merge pull request #5287 from haydenroche5/aes_ctr_clear_left_on_iv_set
Clear the leftover byte count in Aes struct when setting IV.
2022-06-29 08:30:01 +10:00
28df62921a Merge pull request #5292 from dgarske/freertos_memtrack
Fix for using track memory feature with FreeRTOS.
2022-06-29 08:00:36 +10:00
e49f07694e Fix for sniffer possible malloc of zero size causing a -fsanitize=address leak report. 2022-06-28 12:54:25 -07:00
5ade360d9e Fix to avoid using WC_HW_WAIT_E for sniffer. ZD14398 2022-06-28 12:38:57 -07:00
b87b255d52 Merge pull request #5295 from rizlik/dtls13_bugfix
server: fix wrong minVersion setting when non in dtls
2022-06-28 09:35:23 -07:00
741393e84f Merge pull request #5291 from kaleb-himes/FRDM-K64-Fixes
Add necessary includes for cross-builds
2022-06-28 09:35:06 -07:00
14c65e0117 Merge pull request #5281 from miyazakh/example_japanese_translate 2022-06-28 10:08:06 -06:00
cb80ffc1b5 Merge pull request #5251 from kojo1/ja 2022-06-28 09:51:21 -06:00
d4d7e2e5f2 Merge pull request #5294 from SparkiDev/sp_math_all_no_128bit
SP math all: don't use sp_int_word when SQR_MUL_ASM available
2022-06-28 07:38:42 -07:00
060dfe1a69 server: fix wrong minVersion setting when non in dtls 2022-06-28 12:10:18 +02:00
22336d30e5 SP math all: don't use sp_int_word when SQR_MUL_ASM available
1. _WIN64 doesn't have 128-bit type but now can use 64-bit sp_int_digit
when assembly code snippets are being used.
2. Fix sp_div() to support values closer to maximum size.
3. Fix builds to work for more configurations.
4. Have ECC uncompressed code keep intermediate values in range of
maximum (x^3 calculation fixed).
5. Fix configuation.ac's check of FIPS for using signed SP Math All.
Default now not signed as intended.
2022-06-28 15:51:53 +10:00
3c3a90c988 ASN template: Handle HAVE_OID_ENCODING
When HAVE_OID_ENCODING is defined, the named curve OID is encoded rather
than the full OID.
Use SetCurve to get the OID encoding in ASN template implemenation.
2022-06-28 09:04:42 +10:00
31498de7a9 Fix for using track memory feature with FreeRTOS. 2022-06-27 14:08:45 -07:00
9d11e9092f Add necessary includes for cross-builds 2022-06-27 13:50:27 -06:00
94e7eacc5f Merge pull request #5072 from JacobBarthelmeh/Compatibility-Layer
add support for importing private only EC key to a WOLFSSL_EVP_PKEY s…
2022-06-27 12:34:00 -07:00
456e463640 Merge pull request #5283 from SparkiDev/sp_arm32_asm_rework
SP ASM ARM32: reworked generation using common asm ruby code
2022-06-27 09:17:20 -07:00
b84b808b1b Merge pull request #5167 from ejohnstown/cac-ext
Add support for some FPKI certificate cases, UUID, FASC-N, PIV extension
2022-06-27 09:06:15 -07:00
999fa8394e SP ASM ARM32: reworked generation using common asm ruby code
Add support for ARMv6 and ARMv3.
2022-06-27 11:19:50 +10:00
10dfd8d129 Clear the leftover byte count in Aes struct when setting IV.
Setting the key already does this. The same needs to be done when setting the
IV.
2022-06-26 15:56:05 +04:00
55414290df Merge pull request #5286 from douzzer/20220624-multi-test-fixes-sp-math-default
20220624-multi-test-fixes-sp-math-default
2022-06-24 19:26:49 -07:00
9211825121 sp_int.c: fix refactor of undefined-semantics shift in _sp_mul(). 2022-06-24 18:04:51 -05:00
790584113f configure.ac: WOLFSSL_WPAS[_SMALL] requires OPENSSL_EXTRA. 2022-06-24 16:38:56 -05:00
49740c5543 initialize variables 2022-06-24 15:21:20 -06:00
9a29dfc8cb fix whitespace. 2022-06-24 16:08:38 -05:00
047c662af8 fix math errors unmasked by change to sp-math-all as default math back end. 2022-06-24 15:56:54 -05:00
940d0140f9 configure.ac fixes related to change in default math back end (to sp-math-all): wolfRand doesn't use fastmath;
FIPS v5-dev follows the non-FIPS default (now sp-math-all);

add -DWC_NO_CACHE_RESISTANT to AM_CFLAGS when $ENABLED_HARDEN != yes;

add ENABLED_BIGNUM sensor and use it in linuxkm math back end assert;

add configuration callout for "Side-channel Hardening" reporting value of $ENABLED_HARDEN.
2022-06-24 15:55:08 -05:00
1977a13754 improve comment for FPKI additions 2022-06-24 12:04:26 -06:00
8dfcc76f50 Merge pull request #5279 from embhorn/gh5273
Fix config with WOLFSSL_WPAS_SMALL
2022-06-24 11:22:58 -06:00
5ef507c78d Merge pull request #5280 from douzzer/20220623-enable-dh-const
--enable-dh=const
2022-06-24 08:29:35 -07:00
ce977e8c0b requested review changes 2 2022-06-24 15:37:10 +02:00
00b82888bc Merge pull request #4759 from dgarske/sp_math_default
Enable wolfSSL SP Math all (sp_int.c) by default
2022-06-23 16:14:54 -07:00
c34c32f621 translated Japanese messages 2022-06-24 08:09:28 +09:00
43e11ec756 improve comments for subject name email matching 2022-06-23 15:52:28 -06:00
4de90efbe2 clear out PKEY when setting new key 2022-06-23 14:21:53 -07:00
a5250482ce examples/: refactor a couple help strings to avoid hitting clang-tidy bugprone-suspicious-missing-comma. 2022-06-23 15:25:23 -05:00
768737d21e configure.ac: support --enable-dh=const, and link with libm ("LT_LIB_M") only if ENABLED_DH = yes. 2022-06-23 15:00:59 -05:00
79ea30a957 memory free on failure, spelling, better function name 2022-06-23 13:40:45 -06:00
02dde373d1 Add support for aligned data with clang llvm 2022-06-23 13:26:11 -05:00
78d3284c3c Fix for FIPS 140-2 and older ACVP math selection. Fix for building with "--disable-sp-math-all --disable-fastmath". Fix for building SAKKE with HAVE_WOLF_BIGINT. 2022-06-23 11:10:44 -07:00
e2ad62b3d1 Merge pull request #5266 from rizlik/udp_help
examples: update usage() with DTLSv1.3 version
2022-06-23 09:27:53 -07:00
7fb17e0584 Fix build error with --enable-opensslextra=x509small --enable-debug 2022-06-23 11:26:57 -05:00
1cdc81546d Fix config with WOLFSSL_WPAS_SMALL 2022-06-23 09:19:14 -05:00
ee12c12e98 Fixes required to make SP Math default
fasthugemath means turn on fastmath
Use sp_int_digit and not sp_digit in sp_int.c.
test.c needs to use large static buffer when SP Math used like fastmath.
When building static memroy, SP math all without WOLFSSL_SP_NO_MALLOC is
a valid configuration.
Fix freeing of bigint in sp_int.c.
Cast x to a signed value to negate and then back to unsigned. (For
Windows builds.)
Remove warning about empty file on Windows about integer.obj.
Allow RSA verify only and RSA public only to be used with other public
key algorithms.
If building for FIPS, then older versions of RSA and ECC require SP Math
to support negative numbers.
Get old FIPS files building with SP int.
Disallow --enable-sp-math and --enable-sp-math-all.
When just --enable-sp-math on configuration line then disable SP Math
all.
2022-06-23 14:15:54 +10:00
8d804f6378 Merge pull request #5260 from dgarske/sp_ecc_nb_hash
Fix for SP math ECC non-blocking to always check `hashLen`
2022-06-23 07:59:28 +10:00
fdc4cdf5ec examples: update usage() with DTLSv1.3 version 2022-06-22 18:50:18 +02:00
acc9f3701a Merge pull request #5261 from dgarske/sha3_shake_flags
Configure fixes for SHA3 and SHAKE256
2022-06-22 11:50:28 +10:00
40dda7e80f fix XMALLOC in test and add filesystem macro guard 2022-06-21 17:24:14 -06:00
deb0c3e6fa Merge pull request #5272 from lealem47/skip
Display SKIP instead of PASS when tests skipped for make check
2022-06-21 16:06:58 -07:00
4db7732d78 Fixes for --enable-sha3 reproducibility with small. Fixes for shake256 typo and making sure WOLFSSL_NO_SHAKE256 gets set when disabled. Replaces PR #4225. 2022-06-21 16:02:42 -07:00
7d62fd09e4 remove subject/issuer email from altEmailNames list 2022-06-21 16:59:36 -06:00
74d692d6d5 Fix for SP math ECC non-blocking to always check hashLen. ZD14141 2022-06-21 15:54:01 -07:00
9e1ecf3fb5 Merge pull request #5194 from TakayukiMatsuo/heaphint 2022-06-21 16:39:07 -06:00
7dbf1a5154 Merge pull request #5262 from miyazakh/qt_unit_failure 2022-06-21 16:35:37 -06:00
bd536d3c9d Merge pull request #5229 from miyazakh/sce_example_update 2022-06-21 16:33:54 -06:00
40d9473e6a Display SKIP instead of PASS when tests skipped for make check 2022-06-21 13:11:08 -07:00
b8cff49044 Merge pull request #5268 from anhu/micrium_dtls_guard
Fix missing WOLFSSL_DTLS guard in Micrium build
2022-06-21 12:01:47 -07:00
099afe4419 errant if 2022-06-21 11:33:08 -04:00
beddc777d4 milliseconds not only for DTLS13 2022-06-21 11:07:19 -04:00
f05bcb30e0 div by 4 in milliseconds 2022-06-21 10:48:48 -04:00
ff4eabb17f same fix to MicriumReceive 2022-06-21 10:42:20 -04:00
1e84d1eb67 Change inspired by Rizlik review comments. 2022-06-21 10:22:44 -04:00
d41745cd28 Merge pull request #5269 from anhu/micrium_xstr
Fixup XSTR processing for MICRIUM
2022-06-20 16:23:06 -07:00
0b0518bd55 Fixup XSTR processing for MICRIUM 2022-06-20 17:00:24 -04:00
73435389ed Fix missing WOLFSSL_DTLS in Micrium build 2022-06-20 16:33:04 -04:00
38ac96aefb Merge pull request #5267 from douzzer/20220620-multi-test-fixes
20220620-multi-test-fixes
2022-06-20 12:13:39 -07:00
69ca1d37c0 fixes for defects identified by wolfssl-multi-test: whitespace, missing void in arg lists, and -Wunused-but-set-variable found by clang-15 (prerelease). 2022-06-20 10:54:55 -05:00
7c827d3a82 requested review changes 2022-06-20 11:27:09 +02:00
db6c14e7f9 Merge pull request #5265 from SparkiDev/dh_api_names
DH: Fix names wolSSL_* -> wolfSSL_*
2022-06-19 20:24:12 -07:00
fab05f2527 DH: Fix names wolSSL_* -> wolfSSL_* 2022-06-20 08:58:35 +10:00
59e19cfd6c Merge pull request #5258 from dgarske/stm32u5_bench
Fixes for STM32 Hash/PKA and additional benchmark
2022-06-20 08:33:25 +10:00
b5cac49be9 fix qt_unit_test_failure
add/remove spaces and line-feed to be the same as before
2022-06-18 10:04:10 +09:00
390908bccc Merge pull request #5236 from SparkiDev/mem_zero
Check memory is zeroized
2022-06-17 12:01:34 -07:00
92fcea39db Fix for DES3 with STM32 and STM32_CRYPTO_AES_ONLY (broken in #5223) . Add U5 PKA support and benchmarks. Fix MD5 with OPENSSL_EXTRA and HAVE_MD5_CUST_API. 2022-06-17 11:50:29 -07:00
9c5821569f For STM32 hashing to wait for hash done on block size + 1 word. Updated the STM32U5 benchmarks. Added note about new GCM_TABLE_4BIT. 2022-06-17 09:07:45 -07:00
2f6b5a97a4 Merge pull request #5257 from SparkiDev/i2d_RSA_fix
i2d AIPs move pointer on when a pointer to a buffer is passed in
2022-06-16 21:44:23 -07:00
6a0682d422 i2d AIPs move pointer on when a pointer to a buffer is passed in
Restore behaviour to be compatible with OpenSSL.
Replace comparison of DER data using AsserStrEQ to use memcmp.
2022-06-17 12:36:06 +10:00
66775d90d4 Merge pull request #5250 from dgarske/rsa_public
Fix to expose the RSA public DER export functions with certgen
2022-06-17 12:25:19 +10:00
4fc709d2af Merge pull request #5256 from dgarske/cert_chain_der
Fixes for loading a DER/ASN.1 certificate chain
2022-06-17 11:55:49 +10:00
6795e1bf21 Attempt to fix issue with duplicate prototype wc_RsaKeyToPublicDer with FIPS v2 selftest. 2022-06-16 16:51:51 -07:00
e34dda9383 Fix to expose the RSA public DER export function with certgen. The core function SetRsaPublicKey was being compiled, but the wrappers wc_RsaKeyToPublicDer and wc_RsaKeyToPublicDer_ex were not included. 2022-06-16 16:36:17 -07:00
128ebf54e9 Fix for loading certificate DER chain longer than 2 deep. Fix to properly trap BUFFER_E in ProcessUserChain. ZD14048. 2022-06-16 16:19:37 -07:00
fe8169c830 Add multi thread use case for RA6M4
fix devId conflict while using multi threads

update README

Fix TSIP examples bcause of updating user context
2022-06-17 07:44:12 +09:00
2834c22ce0 Merge pull request #5204 from lealem47/basicConst
Encoding the X509 Basic Constraint when CA:FALSE
2022-06-17 08:33:57 +10:00
f2abf1892c Merge pull request #5255 from lealem47/i2d_RSA
Call RSA_To_Der instead of RSA_To_Der_ex in i2dd_RSA key funcs
2022-06-16 14:43:58 -07:00
1322c1a0b2 Merge pull request #5248 from lealem47/no_aes
Fix build failure caused by missing NO_AES macro guard
2022-06-16 13:18:09 -07:00
911f361285 Call RSA_To_Der instead of RSA_To_Der_ex in i2d_RSA key funcs 2022-06-16 12:26:47 -07:00
8c0157c035 Merge pull request #5253 from rizlik/clang_uninit
kdf: fix clang uninitialized.Assign
2022-06-16 11:06:43 -07:00
8f7db87f01 Merge pull request #5249 from dgarske/rsa_ifc
Cleanup the RSA consistency check
2022-06-16 09:14:08 -07:00
5e63740c6c Ensuring that X509 Basic Constraint is set when CA:FALSE 2022-06-16 08:46:52 -07:00
7560199f18 Merge pull request #5254 from rizlik/nigthly_fixes
dtls: abide deadstore static analyzer warnings
2022-06-16 07:42:38 -07:00
8f0da12824 Merge pull request #5252 from SparkiDev/mod_zero
TFM: mp_exptmod_ex didn't handle exceptional cases
2022-06-16 07:42:17 -07:00
6a0c6049ce dtls: abide deadstore static analyzer warnings 2022-06-16 14:02:09 +02:00
621f4f14af kdf: fix clang uninitialized.Assign
commit f1ce0cc95d tigger static analyzer warnings
about unitialized assign.
2022-06-16 13:55:46 +02:00
6d2a41b9fd Enable wolfSSL SP Math all (sp_int.c) by default. If --enable-fastmath or USE_FAST_MATH is set the older tfm.c fast math will be used. To use the old integer.c heap math use --enable-heapmath or USE_INTEGER_HEAP_MATH. 2022-06-16 10:57:30 +10:00
8145ee6cef TFM: mp_exptmod_ex didn't handle exceptional cases
fp_exptmod_ex() changed to match execptional case handling in
fp_exptmod().
2022-06-16 10:47:00 +10:00
1b29f7353a Check memory is zeroized
Add a define WOLFSSL_CHECK_MEM_ZERO to turn on code that checks that
memory that must be zeroized before going out of use is zero.
Everytime sensitive data is put into a allocated buffer or stack buffer;
the address, its length and a name is stored to be checked later.
Where the stack buffer is about to go out of use, a call is added to
check that the required parts are zero.

wc_MemZero_Add() adds an address with length and name to a table of
addressed to be checked later.
wc_MemZero_Check() checks that the memory associated with the address is
zeroized where required.
mp_memzero_add() adds mp_int's data pointer with length and name to
table.
mp_memzero_check() checks that the data pointer is zeroized where
required.

Freeing memory will check the address. The length was prepended on
allocation.
Realloction was changed for WOLFSSL_CHECK_MEM_ZERO to perform an
allocate, check, copy, free.
2022-06-16 10:22:32 +10:00
8f68e32ef1 initial tranlation of API headers in JA 2022-06-16 08:24:18 +09:00
7e1549c684 Cleanup the RSA consistency check. Should only be enabled for FIPS v2 (3389), FIPS v5 or later. Can be forcefully enabled for non-FIPS using WOLFSSL_RSA_KEY_CHECK. The existing WOLFSSL_NO_RSA_KEY_CHECK macro will also disable it. This change was introduced in PR #4359. 2022-06-15 14:46:23 -07:00
fb704774a0 Merge pull request #4907 from rizlik/dtls13
DTLSv1.3 support
2022-06-15 13:57:02 -07:00
9bcbd645d6 Fix build failure caused by missing NO_AES macro guard 2022-06-15 13:30:56 -07:00
dab0d5a7b0 Merge pull request #5240 from SparkiDev/sp_armv6
SP ARM32: support for arch with no ldrd/strd and clz
2022-06-15 11:28:30 -07:00
d9d8b7e2d8 Merge pull request #5245 from SparkiDev/force_zero
Memory zeroization fixes
2022-06-15 11:16:04 -07:00
aa8df1af78 Fixes for building without DTLS v1.2 and TLS v1.2. Fixes for explicit cast warnings. 2022-06-15 10:49:18 -07:00
3a9176bcc9 scripts: test for dtls13 retransmission
Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-06-15 10:46:43 -07:00
25cf98a417 test: add DTLSv1.3 test suites 2022-06-15 10:46:43 -07:00
12a3efeca8 client/server: tolerate WANT_WRITE errors 2022-06-15 10:46:43 -07:00
4e112419f5 examples: client/server: support DTLSv1.3 (-u -v4)
This commits add some new options to examples/[server,client] to support testing
of DTLS v1.3.

client: add waitTicket option

If this option is used, the client will wait until it receives a sessionTicket
from the server. This is useful when testing DTLS retransmission.

client: add waitKeyUpdate option

When this option is set, the client waits until the UpdateKey message is
acknowledged by the server. This is useful to test DTLS retransmission logic
2022-06-15 10:46:43 -07:00
c1dc90d9b0 server: request cert only once if doing post-handshake auth 2022-06-15 10:46:43 -07:00
ca05ad2dc0 dtls13: introduce wolfSSL_dtls_13_has_pending_msg() API 2022-06-15 10:46:43 -07:00
e2abdf23a7 internal: return from wolfSSL_Peek() with sz 0 if we don't have data
This way we can use wolfSSL_Peek() invoked with sz == 0 to process pending
records and, if none of this records is an application data record, we will not
block.
2022-06-15 10:46:43 -07:00
dfc9873c0f dtls13: support KeyUpdate messages 2022-06-15 10:46:43 -07:00
d1924928c0 dtls13: support retransmission
Introduce ACK and retransmission logic, encapsulated in a Dtls13RtxFsm
object. The retransmission or the sending of an ACK is scheduled by setting the
appropriate flag inside the Dtls13RtxFSM object but the actual writing on the
socket is deferred and done in wolfSSL_Accept/Connect.

* Retransmission

Each sent message is encapsulated in a Dtl13RtxRecord and saved on a list. If we
receive an ACK for at record, we remove it from the list so it will be not
retransmitted further, then we will retransmit the remaining
ones. Retransmission is throttled: beside link congestion, this also avoid too
many sequence numbers bounded with a record.

* ACK

For each received record we save the record sequence number, so we can send an
ACK if needed. We send an ACK either if explicitly needed by the flight or if we
detect a disruption.

Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-06-15 10:46:43 -07:00
d079662765 dtls13: support fragmentation, sending and receiving
This commit implements the core of the header parsing, building, and the sending
and receiving routines that handle fragmentation and defragmentation.

* In DTLSv1.3 the header used for protected messages is a variable-length header,
and it is described RFC9147 Section 4.

* Fragmentation happens after building the full message, if necessary. If the
underlying I/O can't send a fragment because of a WANT_WRITE error, the sending
of fragments will continue in the next invocation of
wolfSSL_connect/wolfSSL_accept/wolfSSL_write. In this case the message is saved
in a buffer inside the WolfSSL object.

* Defragmentation works like DTLSv1.2 defragmentation, and re-use
most of the same code.

* The Dtls13AddHeaders() function does not add the record layer header, but it
lefts space for it. It is eventually placed by BuildTls13Message() to allow
easier management of sequence numbers.
2022-06-15 10:46:43 -07:00
173077b142 dtls: refactor DtlsUpdateWindow() window
split the DtlsUpdateWindow() function, so part of the code can be reused by
DTLSv1.3 code.
2022-06-15 10:46:43 -07:00
30fb664163 internal.c: add runProcessingOneRecord section
DTLSv1.3 needs to do some operation per-record, this commit adds an appropriate
section to ProcessReplyEx.
2022-06-15 10:46:43 -07:00
2696c3cdd3 dtls13: change encryption keys dynamically based on the epoch
In DTLSv1.3, because of retransmission and reordering, we may need to encrypt or
decrypt records with older keys. As an example, if the server finished message
is lost, the server will need to retransmit that message using handshake traffic
keys, even if he already used the traffic0 ones (as, for example, to send
NewSessionTicket just after the finished message).

This commit implements a way to save the key bound to a DTLS epoch and setting
the right key/epoch when needed.
2022-06-15 10:46:43 -07:00
de04973051 dtls13: record number encryption and decryption 2022-06-15 10:46:43 -07:00
60834ba516 dtls13: new methods and version negotiation 2022-06-15 10:46:42 -07:00
9d22e11776 misc.c: introduce w64wrapper to handle 64bit numbers
as word64 is not always available, introduce an abstract type and companion
operations. They use a word64 if available and fallback on word32[2] otherwise.
2022-06-15 10:46:42 -07:00
7586851734 dtls13: export functions
They will be used by DTLSv1.3 code
2022-06-15 10:46:42 -07:00
d8ac35579c dtls13: add autotools, cmake build options and vstudio paths 2022-06-15 10:46:42 -07:00
d51ba35ff9 Merge pull request #5246 from rizlik/dtls_header_fixes
dtls: handshake header parsing fixes
2022-06-15 09:33:41 -07:00
6630a83182 dtls: handshake header parsing fixes 2022-06-15 12:00:26 +02:00
e073500e8e SP ARM32 ASM: Improve performance of P-256 mont mul/sqr 2022-06-15 16:39:13 +10:00
af4fff80db SP ARM32: support for arch with no ldrd/strd and clz
Defined WOLFSSL_SP_ARM_ARCH to be less than 7 to use alternative
instructions.
2022-06-15 12:07:49 +10:00
f1ce0cc95d Memory zeroization fixes
Zeroize secrets in stack buffers and allocated memory.
mp_forcezero to ensure private MP integers are zeroized.
Fix whitespace and add some comments.
2022-06-15 11:26:11 +10:00
9656963f61 Merge pull request #5231 from dgarske/glitch_harden
Added sanity check on TLS encrypt to trap against glitching
2022-06-15 09:48:18 +10:00
ed5470c991 Merge pull request #5239 from dgarske/asn_decode_ext
Fix for ASN template parsing of extended key usage
2022-06-15 09:29:44 +10:00
0cac6cef39 Merge pull request #5237 from anhu/bench_psk
Support psk ciphersuites in benchmarks.
2022-06-14 16:12:15 -07:00
ed6c9639d6 Merge pull request #5243 from douzzer/20220614-multi-test-fixups
20220614-multi-test-fixups
2022-06-14 16:11:44 -07:00
f414e65d4b linuxkm: eliminate duplicative WOLFSSL_KTHREADS macro (just use WOLFSSL_LINUXKM). 2022-06-14 12:45:30 -05:00
2f4864cab2 Added sanity check on TLS encrypt to trap against glitching. 2022-06-14 09:37:44 -07:00
22eee3206d Fixups from review by dgarske 2022-06-14 11:13:28 -04:00
a22da10956 linuxkm: tweak setup of wolfSSL_Mutex to assure complete type availability in applications (client modules). 2022-06-14 09:45:33 -05:00
5a8c130040 fix whitespace 2022-06-14 09:43:05 -05:00
a0dd92234b draft 2022-06-14 13:37:49 +02:00
c0f49b57e1 Fix for ASN template parsing of DecodeExtKeyUsage. ZD 14344. 2022-06-13 16:50:20 -07:00
4d4ee3b2db Support psk ciphersuites in benchmarks.
Also fixed some small errors during shutdown in benchmarks.

Tested with:

./configure --enable-psk CFLAGS=-DWOLFSSL_STATIC_PSK
make all check
./examples/benchmark/tls_bench
2022-06-13 13:33:51 -04:00
c59ec54713 initialize variable to fix warning 2022-06-10 06:22:54 -06:00
ba20f54b5b add UPN other name parsing and updating skip 2022-06-09 21:32:55 -06:00
86023378f8 free decoded cert in test case and x509 2022-06-06 14:31:41 -07:00
2cd9ca0c8f add support for asn template build 2022-06-06 09:42:03 -07:00
13135e72db Add a global variable for heap-hint, mainly in case heap info cannot be referenced by TSIP 2022-06-01 10:24:03 +09:00
36db5ef929 add test case for UUID and FASC-N 2022-05-23 09:17:42 -07:00
cdfdefe9af improve checking on UUID getter function 2022-05-22 17:18:20 -07:00
9e4de4bfc8 add FASC-N and UUID alt. name support 2022-05-22 17:18:20 -07:00
62cb2b4ca9 ASN.1 Additions for FPKI/CAC
1. Add some OIDs used in the Federal PKI Policy Authority standard.
2. Added the SubjectDirectoryAttributes extension to certificate
   parsing. (limited to country of citizenship)
3. Rename constant label SUBJECT_INFO_ACCESS to SUBJ_INFO_ACC_OID
4. Added the SubjectInfoAccess extension to certificate parsing.
   (limited to one URL)
5. Add the SSH extended key usage flags.
6. Use some of the template changes on the new certificate items.
2022-05-22 17:18:20 -07:00
cd2c7e1438 guard on test case for ecc curves 2022-04-25 09:01:24 -06:00
8ea953f8c0 add support for importing private only EC key to a WOLFSSL_EVP_PKEY struct 2022-04-22 10:20:42 -06:00
1498 changed files with 442598 additions and 129778 deletions

2
.github/SECURITY.md vendored
View File

@ -6,7 +6,7 @@ If you discover a vulnerability, please report it to support@wolfssl.com
1. Include a detailed description
2. Include method to reproduce and/or method of discovery
3. We will evaulate the report promptly and respond to you with findings.
3. We will evaluate the report promptly and respond to you with findings.
4. We will credit you with the report if you would like.
**Please keep the vulnerability private** until a fix has been released.

32
.github/workflows/async.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Async Tests
on:
workflow_call:
jobs:
make_check:
strategy:
matrix:
config: [
# Add new configs here
'--enable-asynccrypt --enable-all --enable-dtls13',
'--enable-asynccrypt-sw',
]
name: make check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout wolfSSL
- name: Test wolfSSL async
run: |
./async-check.sh setup
./configure ${{ matrix.config }}
make check
- name: Print errors
if: ${{ failure() }}
run: |
if [ -f test-suite.log ] ; then
cat test-suite.log
fi

32
.github/workflows/docker-Espressif.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Espressif examples tests
on:
workflow_call:
jobs:
espressif_latest:
name: latest Docker container
runs-on: ubuntu-latest
container:
image: espressif/idf:latest
steps:
- uses: actions/checkout@v3
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
espressif_v4_4:
name: v4.4 Docker container
runs-on: ubuntu-latest
container:
image: espressif/idf:release-v4.4
steps:
- uses: actions/checkout@v3
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
espressif_v5_0:
name: v5.0 Docker container
runs-on: ubuntu-latest
container:
image: espressif/idf:release-v5.0
steps:
- uses: actions/checkout@v3
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh

50
.github/workflows/docker-OpenWrt.yml vendored Normal file
View File

@ -0,0 +1,50 @@
# This workflow tests out new libraries with existing OpenWrt builds to check
# there aren't any compatibility issues. Take a look at Docker/OpenWrt/README.md
name: OpenWrt test
on:
workflow_call:
jobs:
build_library:
name: Compile libwolfssl.so
runs-on: ubuntu-latest
container:
image: alpine:latest
steps:
- name: Install required tools
run: apk add argp-standalone asciidoc bash bc binutils bzip2 cdrkit coreutils diffutils elfutils-dev findutils flex musl-fts-dev g++ gawk gcc gettext git grep intltool libxslt linux-headers make musl-libintl musl-obstack-dev ncurses-dev openssl-dev patch perl python3-dev rsync tar unzip util-linux wget zlib-dev autoconf automake libtool
- uses: actions/checkout@v3
- name: Compile libwolfssl.so
run: ./autogen.sh && ./configure --enable-all && make
- name: Upload libwolfssl.so
uses: actions/upload-artifact@v3
with:
name: openwrt-libwolfssl.so
path: src/.libs/libwolfssl.so
retention-days: 1
compile_container:
name: Compile container
runs-on: ubuntu-latest
needs: build_library
strategy:
fail-fast: false
matrix:
release: [ "22.03-SNAPSHOT", "21.02-SNAPSHOT" ] # some other versions: 21.02.0 21.02.5 22.03.0 22.03.3 snapshot
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: actions/download-artifact@v3
with:
name: openwrt-libwolfssl.so
path: Docker/OpenWrt/.
- name: Build but dont push
uses: docker/build-push-action@v3
with:
context: Docker/OpenWrt
platforms: linux/amd64
push: false
tags: openwrt-test:latest
build-args: DOCKER_BASE_CONTAINER=openwrt/rootfs:x86-64-${{ matrix.release }}
cache-from: type=gha
cache-to: type=gha,mode=max

51
.github/workflows/haproxy.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: HaProxy Tests
on:
workflow_call:
jobs:
haproxy_check:
strategy:
fail-fast: false
matrix:
# List of refs to test
ref: [ master ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-quic --enable-haproxy
install: true
- name: Checkout VTest
uses: actions/checkout@v3
with:
repository: vtest/VTest
path: VTest
- name: Build VTest
working-directory: VTest
# Special flags due to: https://github.com/vtest/VTest/issues/12
run: make FLAGS='-O2 -s -Wall'
- name: Checkout HaProxy
uses: actions/checkout@v3
with:
repository: haproxy/haproxy
path: haproxy
ref: ${{ matrix.ref }}
- name: Build HaProxy
working-directory: haproxy
run: >-
make -j TARGET=linux-glibc DEBUG='-DDEBUG_MEMORY_POOLS -DDEBUG_STRICT'
USE_OPENSSL_WOLFSSL=1 USE_QUIC=1 SSL_INC=$GITHUB_WORKSPACE/build-dir/include/
SSL_LIB=$GITHUB_WORKSPACE/build-dir/lib/ ADDLIB=-Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
- name: Test HaProxy
working-directory: haproxy
run: make reg-tests reg-tests/ssl VTEST_PROGRAM=$GITHUB_WORKSPACE/VTest/vtest

11
.github/workflows/hostap-files/Makefile vendored Normal file
View File

@ -0,0 +1,11 @@
obj-m := mac80211_hwsim.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
install:
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
depmod -A
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean

2
.github/workflows/hostap-files/README vendored Normal file
View File

@ -0,0 +1,2 @@
Makefile and directory used in .github/workflows/hostap.yml to
compile the mac80211_hwsim kernel module.

View File

@ -0,0 +1,120 @@
#CC=ccache gcc
CONFIG_DRIVER_NONE=y
CONFIG_DRIVER_NL80211=y
CONFIG_RSN_PREAUTH=y
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
#CONFIG_TLS=openssl
CONFIG_TLS=wolfssl
CONFIG_EAP=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_TLS=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_GTC=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_PAX=y
CONFIG_EAP_PSK=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_FAST=y
CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_UNAUTH_TLS=y
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
CONFIG_EAP_EKE=y
CONFIG_PKCS12=y
CONFIG_RADIUS_SERVER=y
CONFIG_IPV6=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_FULL_DYNAMIC_VLAN=y
CONFIG_VLAN_NETLINK=y
CONFIG_LIBNL32=y
CONFIG_LIBNL3_ROUTE=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_WPS=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
#CONFIG_WPS_STRICT=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_P2P_MANAGER=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_WPA_CLI_EDIT=y
CONFIG_ACS=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_WNM=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_SQLITE=y
CONFIG_SAE=y
CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CFLAGS += -DCONFIG_RADIUS_TEST
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_h += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_n += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_h += -fsanitize=undefined
#LIBS_n += -fsanitize=undefined
#LIBS_c += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_TAXONOMY=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_OWE=y
CONFIG_DPP=y
CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y
CONFIG_AIRTIME_POLICY=y

View File

@ -0,0 +1,707 @@
sae_pk
sae_pk_group_negotiation
sae_pk_sec_3
sae_pk_sec_5
sae_pk_group_20
sae_pk_group_21
sae_pk_group_20_sae_group_19
sae_pk_group_20_sae_group_21
sae_pk_group_19_sae_group_20
sae_pk_password_without_pk
sae_pk_only
sae_pk_modes
sae_pk_not_on_ap
sae_pk_mixed
sae_pk_mixed_immediate_confirm
sae_pk_missing_ie
sae_pk_unexpected_status
sae_pk_invalid_signature
sae_pk_invalid_fingerprint
sae_pk_and_psk
sae_pk_and_psk_invalid_password
sae_pk_invalid_pw
sae
sae_password_ecc
sae_pmksa_caching
sae_pmksa_caching_pmkid
sae_pmksa_caching_disabled
sae_groups
sae_group_nego
sae_group_nego_no_match
sae_anti_clogging
sae_forced_anti_clogging
sae_mixed
sae_and_psk
sae_and_psk2
sae_wpa3_roam
sae_mixed_mfp
sae_mfp
sae_missing_password
sae_key_lifetime_in_memory
sae_oom_wpas
sae_proto_ecc
sae_proto_ffc
sae_proto_commit_delayed
sae_proto_commit_replay
sae_proto_confirm_replay
sae_proto_hostapd
sae_proto_hostapd_ecc
sae_proto_hostapd_ffc
sae_proto_hostapd_status_126
sae_proto_hostapd_status_127
sae_reflection_attack_ecc
sae_reflection_attack_ecc_internal
sae_commit_override
sae_commit_override2
sae_commit_invalid_scalar_element_ap
sae_commit_invalid_element_ap
sae_commit_invalid_scalar_element_sta
sae_commit_invalid_element_sta
sae_anti_clogging_proto
sae_no_random
sae_invalid_anti_clogging_token_req
sae_password
sae_password_short
sae_password_long
sae_connect_cmd
sae_password_id
sae_password_id_ecc
sae_password_id_ffc
sae_password_id_only
sae_password_id_pwe_looping
sae_password_id_pwe_check_ap
sae_password_id_pwe_check_sta
sae_forced_anti_clogging_pw_id
sae_reauth
sae_sync
sae_confirm_immediate
sae_confirm_immediate2
sae_pwe_group_19
sae_pwe_group_20
sae_pwe_group_21
sae_pwe_group_28
sae_pwe_group_29
sae_pwe_group_30
sae_pwe_group_1
sae_pwe_group_2
sae_pwe_group_22
sae_pwe_h2e_only_ap
sae_pwe_h2e_only_ap_sta_forcing_loop
sae_pwe_loop_only_ap
sae_h2e_rejected_groups
sae_h2e_rejected_groups_unexpected
sae_h2e_password_id
sae_pwe_in_psk_ap
sae_auth_restart
sae_rsne_mismatch
sae_h2e_rsnxe_mismatch
sae_h2e_rsnxe_mismatch_retries
sae_h2e_rsnxe_mismatch_assoc
sae_h2e_rsnxe_mismatch_ap
sae_h2e_rsnxe_mismatch_ap2
sae_h2e_rsnxe_mismatch_ap3
sae_forced_anti_clogging_h2e
sae_forced_anti_clogging_h2e_loop
sae_okc
sae_okc_sta_only
sae_okc_pmk_lifetime
sae_pmk_lifetime
sae_and_psk_multiple_passwords
sae_pmf_roam
sae_ocv_pmk
sae_ocv_pmk_failure
sae_reject
eap_tls_pkcs8_pkcs5_v2_des3
eap_tls_pkcs8_pkcs5_v15
eap_tls_session_resumption
eap_tls_session_resumption_expiration
eap_tls_session_resumption_radius
eap_tls_sha512
eap_tls_sha384
eap_tls_ext_cert_check
eap_tls_errors
ap_wpa2_delayed_m3_retransmission
ap_wpa2_delayed_m1_m3_retransmission
ap_wpa2_delayed_m1_m3_retransmission2
ap_wpa2_delayed_group_m1_retransmission
ap_wpa2_delayed_group_m1_retransmission_igtk
ap_wpa2_delayed_m1_m3_zero_tk
ap_wpa2_plaintext_m1_m3
ap_wpa2_plaintext_m1_m3_pmf
ap_wpa2_plaintext_m3
ap_wpa2_plaintext_group_m1
ap_wpa2_plaintext_group_m1_pmf
ap_wpa2_test_command_failures
ap_wpa2_gtk_initial_rsc_tkip
ap_wpa2_gtk_initial_rsc_ccmp
ap_wpa2_gtk_initial_rsc_ccmp_256
ap_wpa2_gtk_initial_rsc_gcmp
ap_wpa2_gtk_initial_rsc_gcmp_256
ap_wpa2_igtk_initial_rsc_aes_128_cmac
ap_wpa2_igtk_initial_rsc_bip_gmac_128
ap_wpa2_igtk_initial_rsc_bip_gmac_256
ap_wpa2_igtk_initial_rsc_bip_cmac_256
ap_wpa2_psk
ap_wpa2_psk_file
ap_wpa2_psk_file_keyid
ap_wpa2_psk_mem
ap_wpa2_ptk_rekey
ap_wpa2_ptk_rekey_blocked_ap
ap_wpa2_ptk_rekey_blocked_sta
ap_wpa2_ptk_rekey_anonce
ap_wpa2_ptk_rekey_ap
ap_wpa2_sha256_ptk_rekey
ap_wpa2_sha256_ptk_rekey_ap
ap_wpa2_psk_file_errors
ap_wpa2_psk_wildcard_ssid
ap_wpa2_gtk_rekey
ap_wpa2_gtk_rekey_request
ap_wpa2_gtk_rekey_failure
ap_wpa2_gtk_rekey_fail_1_sta
ap_wpa2_gmk_rekey
ap_wpa2_strict_rekey
ap_wpa2_psk_ext
ap_wpa2_psk_unexpected
ap_wpa2_psk_ext_retry_msg_3
ap_wpa2_psk_ext_retry_msg_3b
ap_wpa2_psk_ext_retry_msg_3c
ap_wpa2_psk_ext_retry_msg_3d
ap_wpa2_psk_ext_retry_msg_3e
ap_wpa2_psk_ext_delayed_ptk_rekey
ap_wpa2_psk_ext_eapol
ap_wpa2_psk_ext_eapol_retry1
ap_wpa2_psk_ext_eapol_retry1b
ap_wpa2_psk_ext_eapol_retry1c
ap_wpa2_psk_ext_eapol_retry1d
ap_wpa2_psk_ext_eapol_type_diff
ap_wpa2_psk_ext_eapol_key_info
ap_wpa2_psk_supp_proto
ap_wpa2_psk_supp_proto_no_ie
ap_wpa2_psk_supp_proto_ie_mismatch
ap_wpa2_psk_supp_proto_ok
ap_wpa2_psk_supp_proto_no_gtk
ap_wpa2_psk_supp_proto_anonce_change
ap_wpa2_psk_supp_proto_unexpected_group_msg
ap_wpa2_psk_supp_proto_msg_1_invalid_kde
ap_wpa2_psk_supp_proto_wrong_pairwise_key_len
ap_wpa2_psk_supp_proto_wrong_group_key_len
ap_wpa2_psk_supp_proto_gtk_tx_bit_workaround
ap_wpa2_psk_supp_proto_gtk_keyidx_0_and_3
ap_wpa2_psk_supp_proto_no_gtk_in_group_msg
ap_wpa2_psk_supp_proto_too_long_gtk_in_group_msg
ap_wpa2_psk_supp_proto_too_long_gtk_kde
ap_wpa2_psk_supp_proto_gtk_not_encrypted
ap_wpa2_psk_supp_proto_no_igtk
ap_wpa2_psk_supp_proto_igtk_ok
ap_wpa2_psk_supp_proto_igtk_keyid_swap
ap_wpa2_psk_supp_proto_igtk_keyid_too_large
ap_wpa2_psk_supp_proto_igtk_keyid_unexpected
ap_wpa2_psk_wep
ap_wpa2_psk_ifdown
ap_wpa2_psk_drop_first_msg_4
ap_wpa2_psk_disable_enable
ap_wpa2_psk_incorrect_passphrase
ap_wpa2_psk_no_random
ap_wpa2_psk_assoc_rsn
ap_wpa2_psk_ft_workaround
ap_wpa2_psk_assoc_rsn_pmkid
ap_wpa2_eapol_retry_limit
ap_wpa2_disable_eapol_retry
ap_wpa2_disable_eapol_retry_group
ap_wpa2_psk_mic_0
ap_wpa2_psk_local_error
ap_wpa2_psk_inject_assoc
ap_wpa2_psk_no_control_port
ap_wpa2_psk_ap_control_port
ap_wpa2_psk_ap_control_port_disabled
ap_wpa2_psk_rsne_mismatch_ap
ap_wpa2_psk_rsne_mismatch_ap2
ap_wpa2_psk_rsne_mismatch_ap3
ap_wpa2_psk_rsnxe_mismatch_ap
ap_wpa2_psk_ext_key_id_ptk_rekey_ap0
ap_wpa2_psk_ext_key_id_ptk_rekey_ap1
ap_wpa2_psk_ext_key_id_ptk_rekey_ap2
ap_wpa2_psk_ext_key_id_ptk_rekey_sta0
ap_wpa2_psk_ext_key_id_ptk_rekey_sta1
ap_wpa2_psk_ext_key_id_ptk_rekey_sta2
ap_wpa2_eap_sim
ap_wpa2_eap_sim_imsi_identity
ap_wpa2_eap_sim_imsi_privacy_key
ap_wpa2_eap_sim_imsi_privacy_attr
ap_wpa2_eap_sim_sql
ap_wpa2_eap_sim_config
ap_wpa2_eap_sim_id_0
ap_wpa2_eap_sim_id_1
ap_wpa2_eap_sim_id_2
ap_wpa2_eap_sim_id_3
ap_wpa2_eap_sim_ext
ap_wpa2_eap_sim_ext_replace_sim
ap_wpa2_eap_sim_ext_replace_sim2
ap_wpa2_eap_sim_ext_replace_sim3
ap_wpa2_eap_sim_ext_auth_fail
ap_wpa2_eap_sim_change_bssid
ap_wpa2_eap_sim_no_change_set
ap_wpa2_eap_sim_ext_anonymous
ap_wpa2_eap_sim_ext_anonymous_no_pseudonym
ap_wpa2_eap_sim_oom
ap_wpa2_eap_aka
ap_wpa2_eap_aka_imsi_identity
ap_wpa2_eap_aka_imsi_privacy_key
ap_wpa2_eap_aka_imsi_privacy_attr
ap_wpa2_eap_aka_imsi_privacy_key_expired
ap_wpa2_eap_aka_sql
ap_wpa2_eap_aka_config
ap_wpa2_eap_aka_ext
ap_wpa2_eap_aka_ext_auth_fail
ap_wpa2_eap_aka_prime
ap_wpa2_eap_aka_prime_imsi_identity
ap_wpa2_eap_aka_prime_imsi_privacy_key
ap_wpa2_eap_aka_prime_sql
ap_wpa2_eap_aka_prime_ext_auth_fail
ap_wpa2_eap_aka_prime_ext
ap_wpa2_eap_ttls_pap
ap_wpa2_eap_ttls_pap_subject_match
ap_wpa2_eap_ttls_pap_check_cert_subject
ap_wpa2_eap_ttls_pap_incorrect_password
ap_wpa2_eap_ttls_chap
ap_wpa2_eap_ttls_chap_altsubject_match
ap_wpa2_eap_ttls_chap_incorrect_password
ap_wpa2_eap_ttls_mschap
ap_wpa2_eap_ttls_mschap_incorrect_password
ap_wpa2_eap_ttls_mschapv2
ap_wpa2_eap_ttls_invalid_phase2
ap_wpa2_eap_ttls_mschapv2_suffix_match
ap_wpa2_eap_ttls_mschapv2_domain_match
ap_wpa2_eap_ttls_mschapv2_incorrect_password
ap_wpa2_eap_ttls_mschapv2_utf8
ap_wpa2_eap_ttls_eap_gtc
ap_wpa2_eap_ttls_eap_gtc_incorrect_password
ap_wpa2_eap_ttls_eap_gtc_no_password
ap_wpa2_eap_ttls_eap_gtc_server_oom
ap_wpa2_eap_ttls_eap_gtc_oom
ap_wpa2_eap_ttls_eap_md5
ap_wpa2_eap_ttls_eap_md5_incorrect_password
ap_wpa2_eap_ttls_eap_md5_no_password
ap_wpa2_eap_ttls_eap_md5_server_oom
ap_wpa2_eap_ttls_eap_mschapv2
ap_wpa2_eap_ttls_eap_mschapv2_no_password
ap_wpa2_eap_ttls_eap_mschapv2_server_oom
ap_wpa2_eap_ttls_eap_sim
ap_wpa2_eap_ttls_eap_sim_ext
ap_wpa2_eap_ttls_eap_vendor
ap_wpa2_eap_peap_eap_sim
ap_wpa2_eap_peap_eap_sim_ext
ap_wpa2_eap_fast_eap_sim_ext
ap_wpa2_eap_ttls_eap_aka
ap_wpa2_eap_peap_eap_aka
ap_wpa2_eap_peap_eap_mschapv2
ap_wpa2_eap_peap_eap_mschapv2_domain
ap_wpa2_eap_peap_eap_mschapv2_incorrect_password
ap_wpa2_eap_peap_crypto_binding
ap_wpa2_eap_peap_crypto_binding_server_oom
ap_wpa2_eap_peap_params
ap_wpa2_eap_peap_eap_gtc
ap_wpa2_eap_peap_eap_tls
ap_wpa2_eap_peap_eap_vendor
ap_wpa2_eap_tls
ap_wpa2_eap_tls_blob
ap_wpa2_eap_tls_blob_pem
ap_wpa2_eap_tls_blob_missing
ap_wpa2_eap_tls_with_tls_len
ap_wpa2_eap_tls_pkcs12
ap_wpa2_eap_tls_pkcs12_blob
ap_wpa2_eap_tls_pkcs12_blob_pem
ap_wpa2_eap_tls_diff_ca_trust
ap_wpa2_eap_tls_diff_ca_trust2
ap_wpa2_eap_tls_diff_ca_trust3
ap_wpa2_eap_tls_neg_suffix_match
ap_wpa2_eap_tls_neg_domain_match
ap_wpa2_eap_tls_neg_subject_match
ap_wpa2_eap_tls_neg_altsubject_match
ap_wpa2_eap_unauth_tls
ap_wpa2_eap_ttls_server_cert_hash
ap_wpa2_eap_ttls_server_cert_hash_invalid
ap_wpa2_eap_pwd
ap_wpa2_eap_pwd_nthash
ap_wpa2_eap_pwd_salt_sha1
ap_wpa2_eap_pwd_salt_sha256
ap_wpa2_eap_pwd_salt_sha512
ap_wpa2_eap_pwd_groups
ap_wpa2_eap_pwd_invalid_group
ap_wpa2_eap_pwd_disabled_group
ap_wpa2_eap_pwd_as_frag
ap_wpa2_eap_gpsk
ap_wpa2_eap_sake
ap_wpa2_eap_eke
ap_wpa2_eap_eke_many
ap_wpa2_eap_eke_serverid_nai
ap_wpa2_eap_eke_server_oom
ap_wpa2_eap_ikev2
ap_wpa2_eap_ikev2_as_frag
ap_wpa2_eap_ikev2_oom
ap_wpa2_eap_pax
ap_wpa2_eap_psk
ap_wpa2_eap_psk_oom
ap_wpa2_eap_interactive
ap_wpa2_eap_ext_enable_network_while_connected
ap_wpa2_eap_vendor_test
ap_wpa2_eap_vendor_test_oom
ap_wpa2_eap_fast_gtc_identity_change
ap_wpa2_eap_fast_eap_vendor
ap_wpa2_eap_tls_ocsp
ap_wpa2_eap_tls_ocsp_multi
ap_wpa2_eap_tls_ocsp_key_id
ap_wpa2_eap_tls_ocsp_ca_signed_good
ap_wpa2_eap_tls_ocsp_ca_signed_revoked
ap_wpa2_eap_tls_ocsp_ca_signed_unknown
ap_wpa2_eap_tls_ocsp_server_signed
ap_wpa2_eap_tls_ocsp_invalid_data
ap_wpa2_eap_tls_ocsp_invalid
ap_wpa2_eap_tls_ocsp_unknown_sign
ap_wpa2_eap_tls_intermediate_ca
ap_wpa2_eap_tls_ocsp_multi_revoked
ap_wpa2_eap_tls_domain_suffix_match_cn_full
ap_wpa2_eap_tls_domain_match_cn
ap_wpa2_eap_tls_domain_suffix_match_cn
ap_wpa2_eap_tls_domain_suffix_mismatch_cn
ap_wpa2_eap_tls_domain_mismatch_cn
ap_wpa2_eap_ttls_long_duration
ap_wpa2_eap_ttls_server_cert_eku_client
ap_wpa2_eap_ttls_server_cert_eku_client_server
ap_wpa2_eap_ttls_server_pkcs12
ap_wpa2_eap_ttls_server_pkcs12_extra
ap_wpa2_eap_ttls_dh_params_server
ap_wpa2_eap_ttls_dh_params_dsa_server
ap_wpa2_eap_ttls_dh_params_not_found
ap_wpa2_eap_ttls_dh_params_invalid
ap_wpa2_eap_reauth
ap_wpa2_eap_reauth_ptk_rekey_blocked_sta
ap_wpa2_eap_request_identity_message
ap_wpa2_eap_sim_aka_result_ind
ap_wpa2_eap_sim_zero_db_timeout
ap_wpa2_eap_too_many_roundtrips
ap_wpa2_eap_too_many_roundtrips_server
ap_wpa2_eap_too_many_roundtrips_server2
ap_wpa2_eap_expanded_nak
ap_wpa2_eap_sql
ap_wpa2_eap_non_ascii_identity
ap_wpa2_eap_non_ascii_identity2
ap_wpa2_eap_unexpected_wep_eapol_key
ap_wpa2_eap_session_ticket
ap_wpa2_eap_no_workaround
ap_wpa2_eap_tls_check_crl
ap_wpa2_eap_tls_check_crl_not_strict
ap_wpa2_eap_tls_crl_reload
ap_wpa2_eap_tls_check_cert_subject
ap_wpa2_eap_tls_check_cert_subject_neg
ap_wpa2_eap_tls_oom
ap_wpa2_eap_tls_macacl
ap_wpa2_eap_oom
ap_wpa2_eap_tls_13
ap_wpa2_eap_tls_13_ocsp
ap_wpa2_eap_tls_13_missing_prot_success
ap_wpa2_eap_tls_13_fragmentation
ap_wpa2_eap_ttls_13
ap_wpa2_eap_peap_13
ap_wpa2_eap_tls_13_ec
ap_wpa2_eap_sim_db
ap_wpa2_eap_sim_db_sqlite
ap_wpa2_eap_assoc_rsn
ap_wpa2_eap_status
ap_wpa2_eap_gpsk_ptk_rekey_ap
ap_wpa2_eap_wildcard_ssid
ap_wpa2_eap_psk_mac_addr_change
ap_wpa2_eap_server_get_id
ap_wpa2_radius_server_get_id
ap_wpa2_eap_tls_tod
ap_wpa2_eap_tls_tod_tofu
ap_wpa2_eap_sake_no_control_port
ap_wpa2_tdls
ap_wpa2_tdls_concurrent_init
ap_wpa2_tdls_concurrent_init2
ap_wpa2_tdls_decline_resp
ap_wpa2_tdls_long_lifetime
ap_wpa2_tdls_long_frame
ap_wpa2_tdls_reneg
ap_wpa2_tdls_wrong_lifetime_resp
ap_wpa2_tdls_diff_rsnie
ap_wpa2_tdls_wrong_tpk_m2_mic
ap_wpa2_tdls_wrong_tpk_m3_mic
ap_wpa2_tdls_double_tpk_m2
ap_wpa2_tdls_responder_teardown
dpp_network_intro_version
dpp_network_intro_version_change
dpp_network_intro_version_missing_req
dpp_tcp_pkex
dpp_tcp_pkex_auto_connect_2
dpp_tcp_pkex_auto_connect_2_status
dpp_tcp_pkex_auto_connect_2_status_fail
dpp_tcp_pkex_while_associated
dpp_tcp_pkex_while_associated_conn_status
dpp_controller_relay_pkex
dpp_push_button
dpp_push_button_session_overlap_sta
dpp_push_button_session_overlap_ap
dpp_push_button_session_overlap_configurator
dpp_push_button_2sta
dpp_push_button_r_hash_mismatch_sta
dpp_push_button_i_hash_mismatch_ap
dpp_push_button_r_hash_mismatch_ap
dpp_push_button_ext_conf
dpp_push_button_wpas_conf
dpp_private_peer_introduction
dpp_qr_code_parsing
dpp_uri_version
dpp_uri_supported_curves
dpp_uri_host
dpp_qr_code_parsing_fail
dpp_qr_code_curves
dpp_qr_code_curves_brainpool
dpp_qr_code_unsupported_curve
dpp_qr_code_keygen_fail
dpp_qr_code_curve_select
dpp_qr_code_auth_broadcast
dpp_configurator_enrollee
dpp_configurator_enrollee_prime256v1
dpp_configurator_enrollee_secp384r1
dpp_configurator_enrollee_secp521r1
dpp_configurator_enrollee_brainpoolP256r1
dpp_configurator_enrollee_brainpoolP384r1
dpp_configurator_enrollee_brainpoolP512r1
dpp_configurator_enroll_conf
dpp_qr_code_curve_prime256v1
dpp_qr_code_curve_secp384r1
dpp_qr_code_curve_secp521r1
dpp_qr_code_curve_brainpoolP256r1
dpp_qr_code_curve_brainpoolP384r1
dpp_qr_code_curve_brainpoolP512r1
dpp_qr_code_set_key
dpp_qr_code_auth_mutual
dpp_qr_code_auth_mutual2
dpp_qr_code_auth_mutual_p_256
dpp_qr_code_auth_mutual_p_384
dpp_qr_code_auth_mutual_p_521
dpp_qr_code_auth_mutual_bp_256
dpp_qr_code_auth_mutual_bp_384
dpp_qr_code_auth_mutual_bp_512
dpp_auth_resp_retries
dpp_qr_code_auth_mutual_not_used
dpp_qr_code_auth_mutual_curve_mismatch
dpp_qr_code_auth_hostapd_mutual2
dpp_qr_code_listen_continue
dpp_qr_code_auth_initiator_enrollee
dpp_qr_code_auth_initiator_either_2
dpp_qr_code_auth_initiator_either_3
dpp_config_legacy
dpp_config_legacy_psk_hex
dpp_config_fragmentation
dpp_config_legacy_gen
dpp_config_legacy_gen_psk
dpp_config_dpp_gen_prime256v1
dpp_config_dpp_gen_secp384r1
dpp_config_dpp_gen_secp521r1
dpp_config_dpp_gen_expiry
dpp_config_dpp_gen_expired_key
dpp_config_dpp_gen_3rd_party
dpp_config_dpp_override_prime256v1
dpp_config_dpp_override_secp384r1
dpp_config_override_objects
dpp_config_signed_connector_error_no_dot_1
dpp_config_signed_connector_error_no_dot_2
dpp_config_signed_connector_error_unexpected_signature_len
dpp_config_no_csign
dpp_config_no_signed_connector
dpp_config_unexpected_signed_connector_char
dpp_config_root_not_an_object
dpp_config_no_wi_fi_tech
dpp_config_unsupported_wi_fi_tech
dpp_config_no_discovery
dpp_config_no_discovery_ssid
dpp_config_too_long_discovery_ssid
dpp_config_no_cred
dpp_config_no_cred_akm
dpp_config_unsupported_cred_akm
dpp_config_error_legacy_no_pass
dpp_config_error_legacy_too_long_pass
dpp_config_error_legacy_psk_with_sae
dpp_config_error_legacy_no_pass_for_sae
dpp_config_error_legacy_invalid_psk
dpp_config_error_legacy_too_short_psk
dpp_config_connector_error_ext_sign
dpp_config_connector_error_too_short_timestamp
dpp_config_connector_error_invalid_timestamp
dpp_config_connector_error_invalid_timestamp_date
dpp_config_connector_error_invalid_time_zone
dpp_config_connector_error_invalid_time_zone_2
dpp_config_connector_error_expired_1
dpp_config_connector_error_expired_2
dpp_config_connector_error_expired_3
dpp_config_connector_error_expired_4
dpp_config_connector_error_expired_5
dpp_config_connector_error_expired_6
dpp_config_connector_error_no_groups
dpp_config_connector_error_empty_groups
dpp_config_connector_error_missing_group_id
dpp_config_connector_error_missing_net_role
dpp_config_connector_error_missing_net_access_key
dpp_config_connector_error_net_access_key_mismatch
dpp_akm_sha256
dpp_akm_sha384
dpp_akm_sha512
dpp_network_introduction
dpp_network_introduction_expired
dpp_and_sae_akm
dpp_ap_config
dpp_ap_config_p256_p256
dpp_ap_config_p256_p384
dpp_ap_config_p384_p256
dpp_ap_config_p384_p384
dpp_ap_config_p521_p256
dpp_ap_config_p521_p384
dpp_ap_config_bp256_bp256
dpp_ap_config_bp384_bp384
dpp_ap_config_bp512_bp512
dpp_ap_config_p256_bp256
dpp_ap_config_bp256_p256
dpp_ap_config_p521_bp512
dpp_ap_config_reconfig_configurator
dpp_auto_connect_1
dpp_auto_connect_2
dpp_auto_connect_2_connect_cmd
dpp_auto_connect_2_sta_ver1
dpp_auto_connect_2_ap_ver1
dpp_auto_connect_2_ver1
dpp_auto_connect_2_conf_ver1
dpp_auto_connect_legacy
dpp_auto_connect_legacy_ssid_charset
dpp_auto_connect_legacy_sae_1
dpp_auto_connect_legacy_sae_2
dpp_auto_connect_legacy_psk_sae_1
dpp_auto_connect_legacy_psk_sae_2
dpp_auto_connect_legacy_psk_sae_3
dpp_auto_connect_legacy_pmf_required
dpp_qr_code_auth_responder_configurator
dpp_qr_code_auth_responder_configurator_group_id
dpp_qr_code_auth_enrollee_init_netrole
dpp_qr_code_hostapd_init
dpp_qr_code_hostapd_init_offchannel
dpp_qr_code_hostapd_init_offchannel_neg_freq
dpp_qr_code_hostapd_ignore_mismatch
dpp_test_vector_p_256
dpp_test_vector_p_256_b
dpp_test_vector_p_521
dpp_pkex
dpp_pkex_v2
dpp_pkex_p256
dpp_pkex_p384
dpp_pkex_p521
dpp_pkex_bp256
dpp_pkex_bp384
dpp_pkex_bp512
dpp_pkex_config
dpp_pkex_no_identifier
dpp_pkex_identifier_mismatch
dpp_pkex_identifier_mismatch2
dpp_pkex_identifier_mismatch3
dpp_pkex_5ghz
dpp_pkex_test_vector
dpp_pkex_code_mismatch
dpp_pkex_code_mismatch_limit
dpp_pkex_curve_mismatch
dpp_pkex_curve_mismatch_failure
dpp_pkex_curve_mismatch_failure2
dpp_pkex_exchange_resp_processing_failure
dpp_pkex_commit_reveal_req_processing_failure
dpp_pkex_config2
dpp_pkex_no_responder
dpp_pkex_after_retry
dpp_pkex_hostapd_responder
dpp_pkex_v2_hostapd_responder
dpp_pkex_hostapd_initiator
dpp_pkex_v2_hostapd_initiator
dpp_pkex_hostapd_initiator_fallback
dpp_pkex_hostapd_initiator_no_response
dpp_pkex_hostapd_errors
dpp_pkex_nak_curve_change
dpp_pkex_nak_curve_change2
dpp_hostapd_configurator
dpp_hostapd_configurator_enrollee_v1
dpp_hostapd_configurator_responder
dpp_hostapd_configurator_fragmentation
dpp_hostapd_enrollee_fragmentation
dpp_hostapd_enrollee_gas_timeout
dpp_hostapd_enrollee_gas_timeout_comeback
dpp_hostapd_enrollee_gas_errors
dpp_hostapd_enrollee_gas_proto
dpp_hostapd_enrollee_gas_tx_status_errors
dpp_hostapd_configurator_override_objects
dpp_own_config
dpp_own_config_group_id
dpp_proto_after_wrapped_data_auth_req
dpp_auth_req_stop_after_ack
dpp_auth_req_retries
dpp_auth_req_retries_multi_chan
dpp_proto_after_wrapped_data_auth_resp
dpp_proto_after_wrapped_data_auth_conf
dpp_proto_after_wrapped_data_conf_req
dpp_proto_after_wrapped_data_conf_resp
dpp_proto_stop_at_pkex_exchange_resp
dpp_proto_stop_at_pkex_cr_req
dpp_proto_stop_at_pkex_cr_resp
dpp_proto_network_introduction
dpp_hostapd_auth_conf_timeout
dpp_hostapd_auth_resp_retries
dpp_tcp
dpp_tcp_port
dpp_tcp_mutual
dpp_tcp_mutual_hostapd_conf
dpp_tcp_conf_init
dpp_tcp_conf_init_hostapd_enrollee
dpp_tcp_controller_management_hostapd
dpp_tcp_controller_management_hostapd2
dpp_tcp_controller_start_failure
dpp_tcp_init_failure
dpp_controller_rx_failure
dpp_controller_rx_errors
dpp_conn_status_success
dpp_conn_status_wrong_passphrase
dpp_conn_status_no_ap
dpp_conn_status_connector_mismatch
dpp_conn_status_assoc_reject
dpp_conn_status_success_hostapd_configurator
dpp_mud_url
dpp_mud_url_hostapd
dpp_config_save
dpp_config_save2
dpp_config_save3
dpp_nfc_uri
dpp_nfc_uri_hostapd
dpp_nfc_uri_hostapd_tag_read
dpp_nfc_negotiated_handover
dpp_nfc_negotiated_handover_diff_curve
dpp_nfc_negotiated_handover_hostapd_sel
dpp_nfc_negotiated_handover_hostapd_req
dpp_nfc_errors_hostapd
dpp_with_p2p_device
dpp_pfs_ap_0
dpp_pfs_ap_1
dpp_pfs_ap_2
dpp_pfs_connect_cmd
dpp_pfs_connect_cmd_ap_2
dpp_pfs_connect_cmd_ap_2_sae
dpp_pfs_ap_0_sta_ver1
dpp_pfs_errors
dpp_qr_code_auth_rand_mac_addr
dpp_enterprise
dpp_enterprise_tcp
dpp_enterprise_tcp2
dpp_qr_code_config_event_initiator
dpp_qr_code_config_event_initiator_set_comeback
dpp_qr_code_config_event_initiator_slow
dpp_qr_code_config_event_initiator_failure
dpp_qr_code_config_event_initiator_no_response
dpp_qr_code_config_event_initiator_both
dpp_tcp_qr_code_config_event_initiator
dpp_qr_code_config_event_responder
dpp_discard_public_action

View File

@ -0,0 +1,163 @@
#CC=ccache gcc
#CONFIG_TLS=openssl
CONFIG_TLS=wolfssl
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_TLV=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_EKE=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_FAST=y
CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
CONFIG_USIM_SIMULATOR=y
CONFIG_SIM_SIMULATOR=y
#CONFIG_PCSC=y
CONFIG_IPV6=y
CONFIG_DRIVER_NONE=y
CONFIG_PKCS12=y
CONFIG_CTRL_IFACE=unix
CONFIG_WPA_CLI_EDIT=y
CONFIG_OCSP=y
#CONFIG_ELOOP_POLL=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_DEBUG_FILE=y
CONFIG_WPS=y
#CONFIG_WPS_STRICT=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
CONFIG_WPS_ER=y
#CONFIG_WPS_REG_DISABLE_OPEN=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NL80211=y
CFLAGS += -I/usr/include/libnl3
CONFIG_LIBNL32=y
CONFIG_IBSS_RSN=y
CONFIG_AP=y
CONFIG_MESH=y
CONFIG_P2P=y
CONFIG_WIFI_DISPLAY=y
CONFIG_ACS=y
CONFIG_BGSCAN_SIMPLE=y
CONFIG_BGSCAN_LEARN=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_TDLS=y
CONFIG_TDLS_TESTING=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_HT_OVERRIDES=y
CONFIG_VHT_OVERRIDES=y
CONFIG_HE_OVERRIDES=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y
CONFIG_EXT_PASSWORD_TEST=y
CONFIG_EXT_PASSWORD_FILE=y
CONFIG_EAP_UNAUTH_TLS=y
CONFIG_SAE=y
CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_WNM=y
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_p += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_c += -fsanitize=undefined
#LIBS_p += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_PMKSA_CACHE_EXTERNAL=y
CONFIG_OWE=y
CONFIG_DPP=y
CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y

View File

@ -0,0 +1,119 @@
#CC=ccache gcc
CONFIG_DRIVER_NONE=y
CONFIG_DRIVER_NL80211=y
CONFIG_RSN_PREAUTH=y
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
CONFIG_TLS=wolfssl
CONFIG_EAP=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_TLS=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_GTC=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_PAX=y
CONFIG_EAP_PSK=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_FAST=y
#CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_UNAUTH_TLS=y
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
CONFIG_EAP_EKE=y
CONFIG_PKCS12=y
CONFIG_RADIUS_SERVER=y
CONFIG_IPV6=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_FULL_DYNAMIC_VLAN=y
CONFIG_VLAN_NETLINK=y
CONFIG_LIBNL32=y
CONFIG_LIBNL3_ROUTE=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_WPS=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
#CONFIG_WPS_STRICT=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_P2P_MANAGER=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_WPA_CLI_EDIT=y
CONFIG_ACS=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_WNM=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_SQLITE=y
CONFIG_SAE=y
#CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CFLAGS += -DCONFIG_RADIUS_TEST
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_h += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_n += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_h += -fsanitize=undefined
#LIBS_n += -fsanitize=undefined
#LIBS_c += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_TAXONOMY=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_OWE=y
#CONFIG_DPP=y
#CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y
CONFIG_AIRTIME_POLICY=y

View File

@ -0,0 +1,284 @@
sae
sae_password_ecc
sae_pmksa_caching
sae_pmksa_caching_pmkid
sae_pmksa_caching_disabled
sae_groups
sae_group_nego
sae_group_nego_no_match
sae_anti_clogging
sae_forced_anti_clogging
sae_mixed
sae_and_psk
sae_and_psk2
sae_wpa3_roam
sae_mixed_mfp
sae_mfp
sae_missing_password
sae_key_lifetime_in_memory
sae_oom_wpas
sae_proto_ecc
sae_proto_ffc
sae_proto_commit_delayed
sae_proto_commit_replay
sae_proto_confirm_replay
sae_proto_hostapd
sae_proto_hostapd_ecc
sae_proto_hostapd_ffc
sae_proto_hostapd_status_126
sae_proto_hostapd_status_127
sae_reflection_attack_ecc
sae_reflection_attack_ecc_internal
sae_commit_override
sae_commit_override2
sae_commit_invalid_scalar_element_ap
sae_commit_invalid_element_ap
sae_commit_invalid_scalar_element_sta
sae_commit_invalid_element_sta
sae_anti_clogging_proto
sae_no_random
sae_bignum_failure_unsafe_group
sae_invalid_anti_clogging_token_req
sae_password
sae_password_short
sae_password_long
sae_connect_cmd
sae_password_id
sae_password_id_ecc
sae_password_id_ffc
sae_password_id_only
sae_password_id_pwe_looping
sae_password_id_pwe_check_ap
sae_password_id_pwe_check_sta
sae_forced_anti_clogging_pw_id
sae_reauth
sae_sync
sae_confirm_immediate
sae_confirm_immediate2
sae_pwe_group_19
sae_pwe_group_20
sae_pwe_group_21
sae_pwe_group_1
sae_pwe_group_2
sae_pwe_group_22
sae_pwe_h2e_only_ap
sae_pwe_h2e_only_ap_sta_forcing_loop
sae_pwe_loop_only_ap
sae_h2e_rejected_groups
sae_h2e_rejected_groups_unexpected
sae_h2e_password_id
sae_pwe_in_psk_ap
sae_auth_restart
sae_rsne_mismatch
sae_h2e_rsnxe_mismatch
sae_h2e_rsnxe_mismatch_retries
sae_h2e_rsnxe_mismatch_assoc
sae_h2e_rsnxe_mismatch_ap
sae_h2e_rsnxe_mismatch_ap2
sae_h2e_rsnxe_mismatch_ap3
sae_forced_anti_clogging_h2e
sae_forced_anti_clogging_h2e_loop
sae_okc
sae_okc_sta_only
sae_okc_pmk_lifetime
sae_pmk_lifetime
sae_and_psk_multiple_passwords
sae_pmf_roam
sae_ocv_pmk
sae_ocv_pmk_failure
sae_reject
eap_tls_pkcs8_pkcs5_v2_des3
eap_tls_pkcs8_pkcs5_v15
eap_tls_sha512
eap_tls_sha384
eap_tls_errors
eap_proto_peap_errors_server
eap_proto_peap_errors
ap_wpa2_delayed_m3_retransmission
ap_wpa2_delayed_m1_m3_retransmission
ap_wpa2_delayed_m1_m3_retransmission2
ap_wpa2_delayed_group_m1_retransmission
ap_wpa2_delayed_group_m1_retransmission_igtk
ap_wpa2_delayed_m1_m3_zero_tk
ap_wpa2_plaintext_m1_m3
ap_wpa2_plaintext_m1_m3_pmf
ap_wpa2_plaintext_m3
ap_wpa2_plaintext_group_m1
ap_wpa2_plaintext_group_m1_pmf
ap_wpa2_test_command_failures
ap_wpa2_gtk_initial_rsc_tkip
ap_wpa2_gtk_initial_rsc_ccmp
ap_wpa2_gtk_initial_rsc_ccmp_256
ap_wpa2_gtk_initial_rsc_gcmp
ap_wpa2_gtk_initial_rsc_gcmp_256
ap_wpa2_igtk_initial_rsc_aes_128_cmac
ap_wpa2_igtk_initial_rsc_bip_gmac_128
ap_wpa2_igtk_initial_rsc_bip_gmac_256
ap_wpa2_igtk_initial_rsc_bip_cmac_256
ap_wpa2_psk
ap_wpa2_psk_file
ap_wpa2_psk_file_keyid
ap_wpa2_psk_mem
ap_wpa2_ptk_rekey
ap_wpa2_ptk_rekey_blocked_ap
ap_wpa2_ptk_rekey_blocked_sta
ap_wpa2_ptk_rekey_anonce
ap_wpa2_ptk_rekey_ap
ap_wpa2_sha256_ptk_rekey
ap_wpa2_sha256_ptk_rekey_ap
ap_wpa2_psk_file_errors
ap_wpa2_psk_wildcard_ssid
ap_wpa2_gtk_rekey
ap_wpa2_gtk_rekey_request
ap_wpa2_gtk_rekey_failure
ap_wpa2_gmk_rekey
ap_wpa2_strict_rekey
ap_wpa2_psk_ext
ap_wpa2_psk_unexpected
ap_wpa2_psk_ext_retry_msg_3
ap_wpa2_psk_ext_retry_msg_3b
ap_wpa2_psk_ext_retry_msg_3c
ap_wpa2_psk_ext_retry_msg_3d
ap_wpa2_psk_ext_retry_msg_3e
ap_wpa2_psk_ext_delayed_ptk_rekey
ap_wpa2_psk_ext_eapol
ap_wpa2_psk_ext_eapol_retry1
ap_wpa2_psk_ext_eapol_retry1b
ap_wpa2_psk_ext_eapol_retry1c
ap_wpa2_psk_ext_eapol_retry1d
ap_wpa2_psk_ext_eapol_type_diff
ap_wpa2_psk_ext_eapol_key_info
ap_wpa2_psk_wep
ap_wpa2_psk_ifdown
ap_wpa2_psk_drop_first_msg_4
ap_wpa2_psk_disable_enable
ap_wpa2_psk_incorrect_passphrase
ap_wpa2_psk_no_random
ap_wpa2_psk_assoc_rsn
ap_wpa2_psk_ft_workaround
ap_wpa2_psk_assoc_rsn_pmkid
ap_wpa2_eapol_retry_limit
ap_wpa2_disable_eapol_retry
ap_wpa2_disable_eapol_retry_group
ap_wpa2_psk_mic_0
ap_wpa2_psk_local_error
ap_wpa2_psk_inject_assoc
ap_wpa2_psk_no_control_port
ap_wpa2_psk_ap_control_port
ap_wpa2_psk_ap_control_port_disabled
ap_wpa2_psk_rsne_mismatch_ap
ap_wpa2_psk_rsne_mismatch_ap2
ap_wpa2_psk_rsne_mismatch_ap3
ap_wpa2_psk_rsnxe_mismatch_ap
ap_wpa2_psk_ext_key_id_ptk_rekey_ap0
ap_wpa2_psk_ext_key_id_ptk_rekey_ap1
ap_wpa2_psk_ext_key_id_ptk_rekey_ap2
ap_wpa2_psk_ext_key_id_ptk_rekey_sta0
ap_wpa2_psk_ext_key_id_ptk_rekey_sta1
ap_wpa2_psk_ext_key_id_ptk_rekey_sta2
ap_wpa2_eap_sim
ap_wpa2_eap_sim_sql
ap_wpa2_eap_sim_config
ap_wpa2_eap_sim_id_0
ap_wpa2_eap_sim_id_1
ap_wpa2_eap_sim_id_2
ap_wpa2_eap_sim_id_3
ap_wpa2_eap_sim_ext
ap_wpa2_eap_sim_ext_replace_sim
ap_wpa2_eap_sim_ext_replace_sim2
ap_wpa2_eap_sim_ext_replace_sim3
ap_wpa2_eap_sim_ext_auth_fail
ap_wpa2_eap_sim_change_bssid
ap_wpa2_eap_sim_no_change_set
ap_wpa2_eap_sim_ext_anonymous
ap_wpa2_eap_sim_ext_anonymous_no_pseudonym
ap_wpa2_eap_sim_oom
ap_wpa2_eap_aka
ap_wpa2_eap_aka_sql
ap_wpa2_eap_aka_config
ap_wpa2_eap_aka_ext
ap_wpa2_eap_aka_ext_auth_fail
ap_wpa2_eap_aka_prime
ap_wpa2_eap_aka_prime_sql
ap_wpa2_eap_aka_prime_ext_auth_fail
ap_wpa2_eap_aka_prime_ext
ap_wpa2_eap_ttls_invalid_phase2
ap_wpa2_eap_ttls_eap_vendor
ap_wpa2_eap_fast_eap_sim
ap_wpa2_eap_fast_eap_aka
ap_wpa2_eap_peap_params
ap_wpa2_eap_peap_eap_gtc
ap_wpa2_eap_peap_eap_vendor
ap_wpa2_eap_ttls_server_cert_hash
ap_wpa2_eap_ttls_server_cert_hash_invalid
ap_wpa2_eap_pwd
ap_wpa2_eap_pwd_nthash
ap_wpa2_eap_pwd_salt_sha1
ap_wpa2_eap_pwd_salt_sha256
ap_wpa2_eap_pwd_salt_sha512
ap_wpa2_eap_pwd_groups
ap_wpa2_eap_pwd_invalid_group
ap_wpa2_eap_pwd_disabled_group
ap_wpa2_eap_pwd_as_frag
ap_wpa2_eap_gpsk
ap_wpa2_eap_sake
ap_wpa2_eap_ikev2
ap_wpa2_eap_ikev2_as_frag
ap_wpa2_eap_ikev2_oom
ap_wpa2_eap_pax
ap_wpa2_eap_psk
ap_wpa2_eap_psk_oom
ap_wpa2_eap_interactive
ap_wpa2_eap_ext_enable_network_while_connected
ap_wpa2_eap_vendor_test
ap_wpa2_eap_vendor_test_oom
ap_wpa2_eap_ttls_ocsp_revoked
ap_wpa2_eap_ttls_ocsp_unknown
ap_wpa2_eap_ttls_optional_ocsp_unknown
ap_wpa2_eap_ttls_long_duration
ap_wpa2_eap_ttls_server_cert_eku_client
ap_wpa2_eap_ttls_server_cert_eku_client_server
ap_wpa2_eap_ttls_dh_params
ap_wpa2_eap_ttls_dh_params_dsa
ap_wpa2_eap_ttls_dh_params_not_found
ap_wpa2_eap_ttls_dh_params_invalid
ap_wpa2_eap_ttls_dh_params_blob
ap_wpa2_eap_ttls_dh_params_server
ap_wpa2_eap_ttls_dh_params_dsa_server
ap_wpa2_eap_reauth
ap_wpa2_eap_reauth_ptk_rekey_blocked_sta
ap_wpa2_eap_request_identity_message
ap_wpa2_eap_sim_aka_result_ind
ap_wpa2_eap_sim_zero_db_timeout
ap_wpa2_eap_too_many_roundtrips
ap_wpa2_eap_too_many_roundtrips_server
ap_wpa2_eap_too_many_roundtrips_server2
ap_wpa2_eap_expanded_nak
ap_wpa2_eap_sql
ap_wpa2_eap_non_ascii_identity
ap_wpa2_eap_non_ascii_identity2
ap_wpa2_eap_unexpected_wep_eapol_key
ap_wpa2_eap_oom
ap_wpa2_eap_sim_db
ap_wpa2_eap_sim_db_sqlite
ap_wpa2_eap_assoc_rsn
ap_wpa2_eap_status
ap_wpa2_eap_gpsk_ptk_rekey_ap
ap_wpa2_eap_wildcard_ssid
ap_wpa2_eap_psk_mac_addr_change
ap_wpa2_eap_server_get_id
ap_wpa2_radius_server_get_id
ap_wpa2_eap_sake_no_control_port
ap_wpa2_tdls
ap_wpa2_tdls_concurrent_init
ap_wpa2_tdls_concurrent_init2
ap_wpa2_tdls_decline_resp
ap_wpa2_tdls_long_lifetime
ap_wpa2_tdls_long_frame
ap_wpa2_tdls_reneg
ap_wpa2_tdls_wrong_lifetime_resp
ap_wpa2_tdls_diff_rsnie
ap_wpa2_tdls_wrong_tpk_m2_mic
ap_wpa2_tdls_wrong_tpk_m3_mic
ap_wpa2_tdls_double_tpk_m2
ap_wpa2_tdls_responder_teardown

View File

@ -0,0 +1,163 @@
#CC=ccache gcc
#CONFIG_TLS=openssl
CONFIG_TLS=wolfssl
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_TLV=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_EKE=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_FAST=y
#CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
CONFIG_USIM_SIMULATOR=y
CONFIG_SIM_SIMULATOR=y
#CONFIG_PCSC=y
CONFIG_IPV6=y
CONFIG_DRIVER_NONE=y
CONFIG_PKCS12=y
CONFIG_CTRL_IFACE=unix
CONFIG_WPA_CLI_EDIT=y
CONFIG_OCSP=y
#CONFIG_ELOOP_POLL=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_DEBUG_FILE=y
CONFIG_WPS=y
#CONFIG_WPS_STRICT=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
CONFIG_WPS_ER=y
#CONFIG_WPS_REG_DISABLE_OPEN=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NL80211=y
CFLAGS += -I/usr/include/libnl3
CONFIG_LIBNL32=y
CONFIG_IBSS_RSN=y
CONFIG_AP=y
CONFIG_MESH=y
CONFIG_P2P=y
CONFIG_WIFI_DISPLAY=y
CONFIG_ACS=y
CONFIG_BGSCAN_SIMPLE=y
CONFIG_BGSCAN_LEARN=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_TDLS=y
CONFIG_TDLS_TESTING=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_HT_OVERRIDES=y
CONFIG_VHT_OVERRIDES=y
CONFIG_HE_OVERRIDES=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y
CONFIG_EXT_PASSWORD_TEST=y
CONFIG_EXT_PASSWORD_FILE=y
CONFIG_EAP_UNAUTH_TLS=y
CONFIG_SAE=y
#CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_WNM=y
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_p += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_c += -fsanitize=undefined
#LIBS_p += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_PMKSA_CACHE_EXTERNAL=y
CONFIG_OWE=y
#CONFIG_DPP=y
#CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y

View File

@ -0,0 +1,23 @@
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="root">
<allow own="fi.epitest.hostap.WPASupplicant"/>
<allow send_destination="fi.epitest.hostap.WPASupplicant"/>
<allow send_interface="fi.epitest.hostap.WPASupplicant"/>
<allow own="fi.w1.wpa_supplicant1"/>
<allow send_destination="fi.w1.wpa_supplicant1"/>
<allow send_interface="fi.w1.wpa_supplicant1"/>
<allow receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
</policy>
<policy context="default">
<deny own="fi.epitest.hostap.WPASupplicant"/>
<deny send_destination="fi.epitest.hostap.WPASupplicant"/>
<deny send_interface="fi.epitest.hostap.WPASupplicant"/>
<deny own="fi.w1.wpa_supplicant1"/>
<deny send_destination="fi.w1.wpa_supplicant1"/>
<deny send_interface="fi.w1.wpa_supplicant1"/>
<deny receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
</policy>
</busconfig>

279
.github/workflows/hostap.yml vendored Normal file
View File

@ -0,0 +1,279 @@
name: hostap and wpa-supplicant Tests
on:
workflow_call:
jobs:
build_wolfssl:
strategy:
matrix:
include:
- build_id: hostap-build1
wolf_extra_config: --disable-tls13
- build_id: hostap-build2
wolf_extra_config: --enable-brainpool --enable-wpas-dpp
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-20.04
steps:
# No way to view the full strategy in the browser (really weird)
- name: Print strategy
run: |
cat <<EOF
${{ toJSON(matrix) }}
EOF
- if: ${{ runner.debug }}
name: Enable wolfSSL debug logging
run: |
echo "wolf_debug_flags=--enable-debug" >> $GITHUB_ENV
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: >-
--enable-wpas CFLAGS=-DWOLFSSL_STATIC_RSA
${{ env.wolf_debug_flags }} ${{ matrix.wolf_extra_config }}
install: true
- name: Upload built lib
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.build_id }}
path: build-dir
retention-days: 1
# Build wpa_supplicant with wolfSSL and hostapd with OpenSSL and interop.
hostap_test:
strategy:
fail-fast: false
matrix:
# should hostapd be compiled with wolfssl
hostapd: [true, false]
# should wpa_supplicant be compiled with wolfssl
wpa_supplicant: [true, false]
# Fix the versions of hostap and osp to not break testing when a new
# patch is added in to osp. hostap_cherry_pick is used to apply the
# commit that updates the certificates used for testing. Tests are read
# from the corresponding configs/hostap_ref/tests file.
config: [
{
hostap_ref: hostap_2_10,
hostap_cherry_pick: 5679ec5c3dda25a0547a5f66407fd9b0b55fd04a,
remove_teap: true,
# TLS 1.3 does not work for this version
build_id: hostap-build1,
},
# Test the dpp patch
{
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
hostap_cherry_pick: 5679ec5c3dda25a0547a5f66407fd9b0b55fd04a,
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
build_id: hostap-build2
},
]
# parallelize the tests to be able to run all tests within 10 minutes
# Update the <total server> in the ./run-tests.py step when changing.
server: [1, 2, 3, 4, 5]
exclude:
# don't test openssl on both sides
- hostapd: false
wpa_supplicant: false
# no hostapd support for dpp yet
- hostapd: true
config: {
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
build_id: hostap-build2
}
name: hwsim test
# For openssl 1.1
runs-on: ubuntu-20.04
needs: build_wolfssl
steps:
# No way to view the full strategy in the browser (really weird)
- name: Print strategy
run: |
cat <<EOF
${{ toJSON(matrix) }}
EOF
- name: Print computed job run ID
run: |
SHA_SUM=$(sha256sum << 'END_OF_HEREDOC' | cut -d " " -f 1
${{ toJSON(github) }}
END_OF_HEREDOC
)
echo "our_job_run_id=$SHA_SUM" >> $GITHUB_ENV
echo Our job run ID is $SHA_SUM
- name: Checkout wolfSSL
uses: actions/checkout@v3
with:
path: wolfssl
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# hostap dependencies
sudo apt-get install -y libpcap0.8 libpcap-dev curl libcurl4-openssl-dev \
libnl-3-dev binutils-dev libssl-dev libiberty-dev libnl-genl-3-dev \
libnl-route-3-dev libdbus-1-dev linux-modules-extra-`uname -r` \
bridge-utils
sudo pip3 install pycryptodome
- name: Enable mac80211
run: |
sudo modprobe mac80211
lsmod | grep mac80211
- if: ${{ runner.debug }}
name: Enable hostap debug logging
run: |
echo "hostap_debug_flags=-d" >> $GITHUB_ENV
- name: Download lib
uses: actions/download-artifact@v3
with:
name: ${{ matrix.config.build_id }}
path: build-dir
- name: Setup d-bus
working-directory: wolfssl/.github/workflows/hostap-files
run: |
sudo cp dbus-wpa_supplicant.conf /usr/share/dbus-1/system.d/wpa_supplicant.conf
sudo service dbus reload
# This is super hack-ish :P
# If you are trying to reproduce this on a more generic system, you can
# just run `sudo apt install linux-modules-extra-$(uname -r)` and
# this should have the module in the package. No need to compile it.
- name: Compile and install mac80211_hwsim
working-directory: wolfssl/.github/workflows/hostap-files
run: |
# The tag will be the first two numbers of from uname -r
LINUX_TAG=$(uname -r | grep -oP '^\d+\.\d+')
# Download the correct version of the driver
wget https://raw.githubusercontent.com/torvalds/linux/v$LINUX_TAG/drivers/net/wireless/mac80211_hwsim.c
wget https://raw.githubusercontent.com/torvalds/linux/v$LINUX_TAG/drivers/net/wireless/mac80211_hwsim.h
make
sudo make install
sudo modprobe mac80211_hwsim
lsmod | grep mac80211_hwsim
sudo rmmod mac80211_hwsim
- name: Checkout hostap
uses: actions/checkout@v3
with:
repository: julek-wolfssl/hostap-mirror
path: hostap
ref: ${{ matrix.config.hostap_ref }}
# necessary for cherry pick step
fetch-depth: 0
- if: ${{ matrix.config.hostap_cherry_pick }}
name: Cherry pick certificate update
working-directory: hostap
run: git cherry-pick -n -X theirs ${{ matrix.config.hostap_cherry_pick }}
- if: ${{ matrix.config.osp_ref }}
name: Checkout OSP
uses: actions/checkout@v3
with:
repository: wolfssl/osp
path: osp
ref: ${{ matrix.config.osp_ref }}
- if: ${{ matrix.config.osp_ref }}
name: Apply patch files
working-directory: hostap
run: |
for f in $GITHUB_WORKSPACE/osp/hostap-patches/pending/*
do
patch -p1 < $f
done
- if: ${{ matrix.hostapd }}
name: Setup hostapd config file
run: |
cp wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/hostapd.config \
hostap/hostapd/.config
cat <<EOF >> hostap/hostapd/.config
CFLAGS += -I$GITHUB_WORKSPACE/build-dir/include -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
LIBS += -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
EOF
- if: ${{ matrix.wpa_supplicant }}
name: Setup wpa_supplicant config file
run: |
cp wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/wpa_supplicant.config \
hostap/wpa_supplicant/.config
cat <<EOF >> hostap/wpa_supplicant/.config
CFLAGS += -I$GITHUB_WORKSPACE/build-dir/include -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
LIBS += -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
EOF
- name: Build hostap
working-directory: hostap/tests/hwsim/
run: ./build.sh
- if: ${{ matrix.hostapd }}
name: Confirm hostapd linking with wolfSSL
run: ldd hostap/hostapd/hostapd | grep wolfssl
- if: ${{ matrix.wpa_supplicant }}
name: Confirm wpa_supplicant linking with wolfSSL
run: ldd hostap/wpa_supplicant/wpa_supplicant | grep wolfssl
- if: ${{ matrix.config.remove_teap }}
name: Remove EAP-TEAP from test configuration
working-directory: hostap/tests/hwsim/auth_serv
run: |
sed -e 's/"erp-teap@example.com"\tTEAP//' -i eap_user.conf
sed -e 's/"erp-teap@example.com"\tMSCHAPV2\t"password"\t\[2\]//' -i eap_user.conf
sed -e 's/"TEAP"\t\tTEAP//' -i eap_user.conf
sed -e 's/TEAP,//' -i eap_user.conf
- name: Run tests
id: testing
working-directory: hostap/tests/hwsim/
run: |
# Run tests in increments of 50 to cut down on the uploaded log size.
while mapfile -t -n 50 ary && ((${#ary[@]})); do
TESTS=$(printf '%s\n' "${ary[@]}" | tr '\n' ' ')
# Retry up to three times
for i in {1..3}; do
HWSIM_RES=0
# Logs can grow quickly especially in debug mode
sudo rm -rf logs
sudo ./start.sh
sudo ./run-tests.py ${{ env.hostap_debug_flags }} --split ${{ matrix.server }}/5 $TESTS || HWSIM_RES=$?
sudo ./stop.sh
if [ "$HWSIM_RES" -eq "0" ]; then
break
fi
done
echo "test ran $i times"
if [ "$HWSIM_RES" -ne "0" ]; then
exit $HWSIM_RES
fi
done < $GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/tests
- name: Change failure log permissions
if: ${{ failure() && steps.testing.outcome == 'failure' }}
working-directory: hostap/tests/hwsim/
run: |
sudo chown -R $USER:$USER logs
zip -9 -r logs.zip logs/current
- name: Upload failure logs
if: ${{ failure() && steps.testing.outcome == 'failure' }}
uses: actions/upload-artifact@v3
with:
name: hostap-logs-${{ env.our_job_run_id }}
path: hostap/tests/hwsim/logs.zip
retention-days: 5

View File

@ -1,28 +0,0 @@
name: macOS Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: brew
run: brew install automake libtool
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck

31
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: CI
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
jobs:
espressif:
uses: ./.github/workflows/docker-Espressif.yml
multi-compiler:
uses: ./.github/workflows/multi-compiler.yml
openwrt:
uses: ./.github/workflows/docker-OpenWrt.yml
os-check:
uses: ./.github/workflows/os-check.yml
async:
uses: ./.github/workflows/async.yml
stunnel:
uses: ./.github/workflows/stunnel.yml
openvpn:
uses: ./.github/workflows/openvpn.yml
hostap:
uses: ./.github/workflows/hostap.yml
# TODO: Currently this test fails. Enable it once it becomes passing.
# haproxy:
# uses: ./.github/workflows/haproxy.yml

34
.github/workflows/multi-compiler.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Multiple compilers and versions
on:
workflow_call:
jobs:
my_matrix:
name: Compiler test
strategy:
fail-fast: false
matrix:
include:
- CC: gcc-9
CXX: g++-9
- CC: gcc-10
CXX: g++-10
- CC: gcc-11
CXX: g++-11
- CC: gcc-12
CXX: g++-12
- CC: clang-12
CXX: clang++-12
- CC: clang-13
CXX: clang++-13
- CC: clang-14
CXX: clang++-14
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
run: ./autogen.sh && ./configure && make && make dist

69
.github/workflows/openvpn.yml vendored Normal file
View File

@ -0,0 +1,69 @@
name: OpenVPN Tests
on:
workflow_call:
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-openvpn
install: true
- name: Upload built lib
uses: actions/upload-artifact@v3
with:
name: wolf-install-openvpn
path: build-dir
retention-days: 1
openvpn_check:
strategy:
fail-fast: false
matrix:
# List of refs to test
ref: [ master, release/2.6, v2.6.0 ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v3
with:
name: wolf-install-openvpn
path: build-dir
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev \
linux-libc-dev man2html libcmocka-dev python3-docutils \
libtool automake autoconf libnl-genl-3-dev libnl-genl-3-200
- if: ${{ matrix.ref != 'master' }}
name: Build and test openvpn with fsanitize
run: |
echo 'extra_c_flags=CFLAGS="-fsanitize=address -fno-omit-frame-pointer -O2"' >> $GITHUB_ENV
- name: Build and test openvpn
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: OpenVPN/openvpn
ref: ${{ matrix.ref }}
path: openvpn
configure: >-
--with-crypto-library=wolfssl
WOLFSSL_CFLAGS="-I$GITHUB_WORKSPACE/build-dir/include/ -I$GITHUB_WORKSPACE/build-dir/include/wolfssl"
WOLFSSL_LIBS="-L$GITHUB_WORKSPACE/build-dir/lib -lwolfssl"
${{ env.extra_c_flags }}
check: true
- name: Confirm OpenVPN built with wolfSSL
working-directory: ./openvpn
run: ldd src/openvpn/openvpn | grep wolfssl

122
.github/workflows/os-check.yml vendored Normal file
View File

@ -0,0 +1,122 @@
name: Ubuntu-Macos-Windows Tests
on:
workflow_call:
jobs:
make_check:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
config: [
# Add new configs here
'',
'--enable-all --enable-asn=template',
'--enable-all --enable-asn=original',
'--enable-harden-tls',
'--enable-tls13 --enable-session-ticket --enable-dtls --enable-dtls13
--enable-opensslextra --enable-sessioncerts
CPPFLAGS=''-DWOLFSSL_DTLS_NO_HVR_ON_RESUME -DHAVE_EXT_CACHE
-DWOLFSSL_TICKET_HAVE_ID -DHAVE_EX_DATA -DSESSION_CACHE_DYNAMIC_MEM'' ',
]
name: make check
runs-on: ${{ matrix.os }}
steps:
- name: Build and test wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
configure: ${{ matrix.config }}
check: true
make_user_settings:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
user-settings: [
# Add new user_settings.h here
'examples/configs/user_settings_all.h',
]
name: make user_setting.h
runs-on: ${{ matrix.os }}
steps:
- name: Build and test wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
configure: --enable-usersettings
check: true
user-settings: ${{ matrix.user-settings }}
make_user_settings_testwolfcrypt:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
user-settings: [
# Add new user_settings.h here
'examples/configs/user_settings_min_ecc.h',
'examples/configs/user_settings_wolfboot_keytools.h',
'examples/configs/user_settings_wolftpm.h',
]
name: make user_setting.h (testwolfcrypt only)
runs-on: ${{ matrix.os }}
steps:
- name: Build and test wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
configure: --enable-usersettings --disable-examples
check: false
user-settings: ${{ matrix.user-settings }}
- name: Run wolfcrypt/test/testwolfcrypt
run: ./wolfcrypt/test/testwolfcrypt
# Has to be dedicated function due to the sed call
make_user_all:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
name: make user_setting.h (with sed)
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- if: ${{ matrix.os == 'macos-latest' }}
run: brew install automake libtool
- run: ./autogen.sh
- name: user_settings_all.h with compatibility layer
run: |
cp ./examples/configs/user_settings_all.h user_settings.h
sed -i -e "s/if 0/if 1/" user_settings.h
./configure --enable-usersettings
make
make check
windows_build:
name: Windows Build Test
runs-on: windows-latest
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: wolfssl64.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
steps:
- uses: actions/checkout@v3
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

61
.github/workflows/stunnel.yml vendored Normal file
View File

@ -0,0 +1,61 @@
name: stunnel Tests
on:
workflow_call:
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-stunnel
install: true
- name: Upload built lib
uses: actions/upload-artifact@v3
with:
name: wolf-install-stunnel
path: build-dir
retention-days: 1
stunnel_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
ref: [ 5.67 ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v3
with:
name: wolf-install-stunnel
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v3
with:
repository: wolfssl/osp
path: osp
- name: Build and test stunnel
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: mtrojnar/stunnel
ref: stunnel-${{ matrix.ref }}
path: stunnel
patch-file: $GITHUB_WORKSPACE/osp/stunnel/${{ matrix.ref }}/stunnel-${{ matrix.ref }}.patch
configure: --enable-wolfssl SSLDIR=$GITHUB_WORKSPACE/build-dir
check: true
- name: Confirm stunnel built with wolfSSL
working-directory: ./stunnel
run: ldd src/stunnel | grep wolfssl

View File

@ -1,26 +0,0 @@
name: Ubuntu Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck

View File

@ -1,38 +0,0 @@
name: Windows Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: wolfssl64.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

29
.gitignore vendored
View File

@ -10,7 +10,7 @@ ctaocrypt/src/src/
*.cache
.dirstamp
*.user
configure
configure
config.*
!cmake/config.in
*Debug/
@ -73,6 +73,7 @@ examples/sctp/sctp-server
examples/sctp/sctp-server-dtls
examples/sctp/sctp-client
examples/sctp/sctp-client-dtls
examples/asn1/asn1
server_ready
snifftest
output
@ -379,6 +380,9 @@ IDE/XCODE/Index
/IDE/QNX/example-cmac/cmac-test
/IDE/QNX/CAAM-DRIVER/wolfCrypt
# Xilinx
/IDE/XilinxSDK/data
# Emacs
*~
@ -390,3 +394,26 @@ cmake_install.cmake
# GDB Settings
\.gdbinit
libFuzzer
# Pycharm and other IDEs
\.idea
# FIPS
XXX-fips-test
# ASYNC
async
# Generated user_settings_asm.h.
user_settings_asm.h
# VisualGD
**/.visualgdb
# Espressif sdk config default should be saved in sdkconfig.defaults
# we won't track the actual working sdkconfig files
/IDE/Espressif/**/sdkconfig
# auto-created CMake backups
**/CMakeLists.txt.old

View File

@ -1,6 +1,6 @@
# CMakeList.txt
#
# Copyright (C) 2006-2020 wolfSSL Inc.
# Copyright (C) 2006-2023 wolfSSL Inc.
#
# This file is part of wolfSSL. (formerly known as CyaSSL)
#
@ -28,23 +28,25 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
You must delete them, or cmake will refuse to work.")
endif()
project(wolfssl VERSION 5.2.0 LANGUAGES C ASM)
project(wolfssl VERSION 5.6.3 LANGUAGES C ASM)
# shared library versioning
# increment if interfaces have been added, removed or changed
set(LIBTOOL_CURRENT 32)
set(LIBTOOL_CURRENT 40)
# increment if source code has changed set to zero if current is incremented
set(LIBTOOL_REVISION 0)
set(LIBTOOL_REVISION 1)
# increment if interfaces have been added set to zero if interfaces have been
# removed or changed
set(LIBTOOL_AGE 0)
set(LIBTOOL_AGE 5)
math(EXPR LIBTOOL_SO_VERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}")
set(LIBTOOL_FULL_VERSION ${LIBTOOL_SO_VERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION})
set(WOLFSSL_DEFINITIONS)
set(WOLFSSL_LINK_LIBS)
set(WOLFSSL_INCLUDE_DIRS)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/functions.cmake)
####################################################
@ -101,6 +103,7 @@ check_function_exists("inet_ntoa" HAVE_INET_NTOA)
check_function_exists("memset" HAVE_MEMSET)
check_function_exists("socket" HAVE_SOCKET)
check_function_exists("strftime" HAVE_STRFTIME)
check_function_exists("__atomic_fetch_add" HAVE_C___ATOMIC)
include(CheckTypeSize)
@ -167,6 +170,15 @@ find_package(Threads)
# Example for map file and custom linker script
#set(CMAKE_EXE_LINKER_FLAGS " -Xlinker -Map=output.map -T\"${CMAKE_CURRENT_SOURCE_DIR}/linker.ld\"")
if(DEFINED WARNING_C_FLAGS)
set(CMAKE_C_FLAGS "${WARNING_C_FLAGS} ${CMAKE_C_FLAGS}")
elseif(WIN32)
# Windows cl.exe does not support the -Wextra, -Wno-unused and -Werror flags.
set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
else()
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused -Werror ${CMAKE_C_FLAGS}")
endif()
####################################################
# Build Options
####################################################
@ -284,9 +296,9 @@ endif()
# Hello Retry Request Cookie
add_option("WOLFSSL_HRR_COOKIE"
"Enable the server to send Cookie Extension in HRR with state (default: disabled)"
"no" "yes;no")
"undefined" "yes;no;undefined")
if(WOLFSSL_HRR_COOKIE)
if("${WOLFSSL_HRR_COOKIE}" STREQUAL "yes")
if(NOT WOLFSSL_TLS13)
message(WARNING "TLS 1.3 is disabled - disabling HRR Cookie")
override_cache(WOLFSSL_HRR_COOKIE "no")
@ -296,6 +308,42 @@ if(WOLFSSL_HRR_COOKIE)
endif()
endif()
# DTLS v1.3
add_option("WOLFSSL_DTLS13"
"Enable wolfSSL DTLS v1.3 (default: disabled)"
"no" "yes;no")
if(WOLFSSL_DTLS13)
if (NOT WOLFSSL_DTLS)
message(FATAL_ERROR "DTLS13 requires DTLS")
endif()
if (NOT WOLFSSL_TLS13)
message(FATAL_ERROR "DTLS13 requires TLS13")
endif()
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_DTLS13")
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_W64_WRAPPER")
if ("${WOLFSSL_HRR_COOKIE}" STREQUAL "undefined")
message(WARNING "DTLS1.3 is enabled - enabling HRR Cookie")
override_cache(WOLFSSL_HRR_COOKIE "yes")
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SEND_HRR_COOKIE")
endif()
if (WOLFSSL_AES)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_AES_DIRECT")
endif()
endif()
# DTLS ConnectionID support
add_option("WOLFSSL_DTLS_CID"
"Enables wolfSSL DTLS CID (default: disabled)"
"no" "yes;no")
if(WOLFSSL_DTLS_CID)
if(NOT WOLFSSL_DTLS13)
message(FATAL_ERROR "CID are supported only for DTLSv1.3")
endif()
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_DTLS_CID")
endif()
# RNG
add_option("WOLFSSL_RNG"
"Enable compiling and using RNG (default: enabled)"
@ -343,6 +391,24 @@ add_option(WOLFSSL_OPENSSLEXTRA
"Enable extra OpenSSL API, size+ (default: disabled)"
"no" "yes;no")
add_option(WOLFSSL_OPENSSLALL
"Enable all OpenSSL API, size++ (default: disabled)"
"no" "yes;no")
add_option(WOLFSSL_ASIO
"Enable asio support (default: disabled)"
"no" "yes;no")
if (WOLFSSL_ASIO)
list(APPEND WOLFSSL_DEFINITIONS
"-DWOLFSSL_ASIO" "-DASIO_USE_WOLFSSL"
"-DBOOST_ASIO_USE_WOLFSSL" "-DHAVE_EX_DATA"
"-DSSL_TXT_TLSV1_2" "-DOPENSSL_NO_SSL2" "-DOPENSSL_NO_SSL3"
"-DHAVE_OCSP" "-DWOLFSSL_KEY_GEN")
override_cache(WOLFSSL_OPENSSLALL "yes")
override_cache(WOLFSSL_OPENSSLEXTRA "yes")
endif()
if (WOLFSSL_OPENSSLEXTRA AND NOT WOLFSSL_OPENSSLCOEXIST)
list(APPEND WOLFSSL_DEFINITIONS
"-DOPENSSL_EXTRA"
@ -353,10 +419,36 @@ if (WOLFSSL_OPENSSLEXTRA AND NOT WOLFSSL_OPENSSLCOEXIST)
"-DWOLFSSL_FORCE_CACHE_ON_TICKET")
endif()
if (WOLFSSL_OPENSSLALL)
list(APPEND WOLFSSL_DEFINITIONS
"-DOPENSSL_ALL" "-DWOLFSSL_EITHER_SIDE" "-DWC_RSA_NO_PADDING"
"-DWC_RSA_PSS" "-DWOLFSSL_PSS_LONG_SALT" "-DWOLFSSL_TICKET_HAVE_ID"
"-DWOLFSSL_ERROR_CODE_OPENSSL" "-DWOLFSSL_CERT_NAME_ALL")
endif()
# TODO: - IPv6 test apps
set(WOLFSSL_SLOW_MATH "yes")
# liboqs
add_option(WOLFSSL_OQS
"Enable integration with the OQS (Open Quantum Safe) liboqs library (default: disabled)"
"no" "yes;no")
if (WOLFSSL_OQS)
find_package(OQS)
if (OQS_FOUND)
list(APPEND WOLFSSL_LINK_LIBS ${OQS_LIBRARY})
list(APPEND WOLFSSL_INCLUDE_DIRS ${OQS_INCLUDE_DIR})
set(HAVE_LIBOQS 1)
list(APPEND WOLFSSL_DEFINITIONS
"-DHAVE_TLS_EXTENSIONS"
"-DHAVE_LIBOQS")
endif()
endif()
# TODO: - Lean PSK
# - Lean TLS
# - Low resource
@ -482,7 +574,7 @@ endif()
# SHA224
set(SHA224_DEFAULT "no")
if(("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") OR
if(("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|AMD64|arm64") OR
("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64"))
if(NOT WOLFSSL_AFALG AND NOT WOLFSSL_DEVCRYPTO AND
(NOT WOLFSSL_FIPS OR ("${FIPS_VERSION}" STREQUAL "v2")))
@ -496,7 +588,7 @@ add_option("WOLFSSL_SHA224"
# SHA3
set(SHA3_DEFAULT "no")
if(("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") OR
if(("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|AMD64|arm64") OR
("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64"))
if(NOT WOLFSSL_FIPS OR ("${FIPS_VERSION}" STREQUAL "v2"))
set(SHA3_DEFAULT "yes")
@ -512,6 +604,11 @@ add_option("WOLFSSL_SHAKE256"
"Enable wolfSSL SHAKE256 support (default: enabled on x86_64/aarch64)"
"no" "yes;no;small")
# SHAKE128
add_option("WOLFSSL_SHAKE128"
"Enable wolfSSL SHAKE128 support (default: enabled on x86_64/aarch64)"
"no" "yes;no;small")
# SHA512
add_option("WOLFSSL_SHA512"
"Enable wolfSSL SHA-512 support (default: enabled)"
@ -854,12 +951,13 @@ else()
endif()
if(WOLFSSL_RSA_PSS)
list(APPEND WOLFSSL_DEFINITIONS "-DWC_RSA_PSS")
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_PSS_LONG_SALT")
endif()
# DH
add_option("WOLFSSL_DH"
"Enable DH (default: enabled)"
"yes" "yes;no")
"yes" "yes;no;const")
if(WOLFSSL_OPENSSH)
override_cache(WOLFSSL_DH "yes")
@ -874,6 +972,11 @@ else()
endif()
endif()
if("${WOLFSSL_DH}" STREQUAL "const")
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_DH_CONST")
set(WOLFSSL_DH_CONST "yes")
endif()
# TODO: - Anonymous
# ASN
@ -971,7 +1074,7 @@ endif()
# Base64
set(BASE64_ENCODE_DEFAULT "no")
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|AMD64|arm64")
set(BASE64_ENCODE_DEFAULT "yes")
endif()
@ -991,7 +1094,8 @@ add_option("WOLFSSL_DES3" ${WOLFSSL_DES3_HELP_STRING} "no" "yes;no")
if(WOLFSSL_OPENSSH OR
WOLFSSL_QT OR
WOLFSSL_OPENVPN OR
WOLFSSL_WPAS)
WOLFSSL_WPAS OR
WOLFSSL_ASIO)
override_cache(WOLFSSL_DES3 "yes")
endif()
@ -1083,6 +1187,21 @@ if(WOLFSSL_SHAKE256)
message(FATAL_ERROR "Must have SHA-3 enabled: --enable-sha3")
endif()
endif()
else()
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_NO_SHAKE256")
endif()
# SHAKE128
if(WOLFSSL_SHAKE128)
if(NOT WOLFSSL_32BIT)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHAKE128")
if(NOT WOLFSSL_SHA3)
message(FATAL_ERROR "Must have SHA-3 enabled: --enable-sha3")
endif()
endif()
else()
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_NO_SHAKE128")
endif()
# POLY1305
@ -1256,6 +1375,15 @@ if(WOLFSSL_SESSION_TICKET)
"-DHAVE_SESSION_TICKET")
endif()
add_option("WOLFSSL_TICKET_NONCE_MALLOC"
"Enable dynamic allocation of ticket nonces (default: disabled)"
"no" "yes;no")
if(WOLFSSL_TICKET_NONCE_MALLOC)
list(APPEND WOLFSSL_DEFINITIONS
"-DWOLFSSL_TICKET_NONCE_MALLOC")
endif()
# Extended master secret extension
add_option("WOLFSSL_EXTENDED_MASTER"
"Enable Extended Master Secret (default: enabled)"
@ -1405,24 +1533,9 @@ endif()
# - wolfCrypt only
# fastmath
set(FASTMATH_DEFAULT "no")
if(("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") OR
("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64"))
set(FASTMATH_DEFAULT "yes")
endif()
if(WOLFSSL_LINUXKM_DEFAULTS)
set(FASTMATH_DEFAULT "no")
endif()
if(WOLFSSL_SP_MATH)
set(FASTMATH_DEFAULT "no")
endif()
add_option("WOLFSSL_FAST_MATH"
"Enable fast math ops (default: enabled on x86_64/aarch64)"
${FASTMATH_DEFAULT} "yes;no")
"Enable fast math ops (default: disabled)"
"no" "yes;no")
if(WOLFSSL_FAST_MATH)
# turn off fastmath if leanpsk on or asn off (w/o DH and ECC)
@ -1440,7 +1553,7 @@ if(WOLFSSL_FAST_MATH)
set(WOLFSSL_SLOWMATH "no")
endif()
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|AMD64")
# Have settings.h set FP_MAX_BITS higher if user didn't set directly
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_X86_64_BUILD")
endif()
@ -1448,6 +1561,15 @@ endif()
# TODO: - Fast huge math
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|AMD64")
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_X86_64_BUILD")
endif()
# SP math all
add_option("WOLFSSL_SP_MATH_ALL"
"Enable Single Precision math implementation for full algorithm suite (default: enabled)"
"yes" "yes;no")
# Enable examples, used to disable examples
if(WOLFSSL_LINUX_KM)
set(EXAMPLES_DEFAULT "no")
@ -1480,6 +1602,10 @@ add_option("WOLFSSL_CRYPT_TESTS_LIBS"
"Build static libraries from the wolfCrypt test and benchmark sources (default: disabled)"
"no" "yes;no")
add_option("WOLFSSL_CRYPT_TESTS_HELP"
"Add help text to wolfCrypt test (default: disabled)"
"no" "yes;no")
# TODO: - LIBZ
# - PKCS#11
# - Cavium
@ -1561,10 +1687,48 @@ add_option("WOLFSSL_USER_SETTINGS"
"Use your own user_settings.h and do not add Makefile CFLAGS (default: disabled)"
"no" "yes;no")
add_option("WOLFSSL_USER_SETTINGS_ASM"
"Enable use of user_settings_asm.h in assembly files (default: disabled)"
"no" "yes;no")
add_option("WOLFSSL_OPTFLAGS"
"Enable default optimization CFLAGS for the compiler (default: enabled)"
"yes" "yes;no")
add_option("WOLFSSL_SYS_CA_CERTS"
"Enable ability to load CA certs from OS (default: enabled)"
"yes" "yes;no")
if(WOLFSSL_SYS_CA_CERTS)
if(NOT WOLFSSL_FILESYSTEM)
message("Can't enable system CA certs without a filesystem.")
override_cache(WOLFSSL_SYS_CA_CERTS "no")
elseif(APPLE)
check_include_file("Security/SecTrustSettings.h" HAVE_SECURITY_SECTRUSTSETTINGS_H)
if(NOT HAVE_SECURITY_SECTRUSTSETTINGS_H)
message("Can't enable system CA certs without Security/SecTrustSettings.h.")
override_cache(WOLFSSL_SYS_CA_CERTS "no")
else()
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
if(NOT CORE_FOUNDATION_FRAMEWORK)
message("Can't enable system CA certs without CoreFoundation framework.")
override_cache(WOLFSSL_SYS_CA_CERTS "no")
else()
find_library(SECURITY_FRAMEWORK Security)
if(NOT SECURITY_FRAMEWORK)
message("Can't enable system CA certs without Security framework.")
override_cache(WOLFSSL_SYS_CA_CERTS "no")
endif()
endif()
endif()
endif()
if(WOLFSSL_SYS_CA_CERTS)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SYS_CA_CERTS")
endif()
endif()
# FLAGS operations
if(WOLFSSL_AESCCM)
@ -1670,6 +1834,14 @@ if (WOLFSSL_TLSX)
endif()
add_option("WOLFSSL_CAAM"
"Enable use of CAAM with NXP (default: disabled)"
"no" "yes;no")
if (WOLFSSL_CAAM)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_CAAM")
endif()
# Generates the BUILD_* flags. These control what source files are included in
# the library. A series of AM_CONDITIONALs handle this in configure.ac.
generate_build_flags()
@ -1683,9 +1855,30 @@ if(WOLFSSL_USER_SETTINGS)
set(WOLFSSL_DEFINITIONS "-DWOLFSSL_USER_SETTINGS")
endif()
# TODO: Applying definitions to everything like this, rather than
# individual targets, is discouraged in CMake.
add_definitions(${WOLFSSL_DEFINITIONS})
if(WOLFSSL_USER_SETTINGS_ASM)
if(WOLFSSL_USER_SETTINGS)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_USER_SETTINGS_ASM")
# Create user_settings_asm.h for use in assembly files (e.g. .S files).
if(WIN32)
execute_process(COMMAND
$ENV{SHELL} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/user_settings_asm.sh
"${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}"
RESULT_VARIABLE USER_SETTINGS_ASM_RET)
else()
execute_process(COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/scripts/user_settings_asm.sh
"${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}"
RESULT_VARIABLE USER_SETTINGS_ASM_RET)
endif()
if (NOT USER_SETTINGS_ASM_RET EQUAL 0)
message(FATAL_ERROR
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/user_settings_asm.sh failed.")
endif()
else()
message(FATAL_ERROR
"Must have WOLFSSL_USER_SETTINGS to enable WOLFSSL_USER_SETTINGS_ASM.")
endif()
endif()
add_option("WOLFSSL_CONFIG_H"
"Enable generation of config.h and define HAVE_CONFIG_H (default: enabled)"
@ -1701,15 +1894,24 @@ if(WOLFSSL_CONFIG_H)
"${CMAKE_CURRENT_BINARY_DIR}/wolfcrypt/test/test_paths.h" )
endif()
# If config.h or wolfssl/options.h exists, delete it to avoid
# a mixup with build/wolfssl/options.h.
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/options.h")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/options.h")
endif()
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config.h")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/config.h")
endif()
# Suppress some warnings about separate compilation, inlining
add_definitions("-DWOLFSSL_IGNORE_FILE_WARN")
# Generate user options header
message("Generating user options header...")
if (${CMAKE_DISABLE_SOURCE_CHANGES})
set(WOLFSSL_BUILD_OUT_OF_TREE_DEFAULT "${CMAKE_DISABLE_SOURCE_CHANGES}")
else()
set(WOLFSSL_BUILD_OUT_OF_TREE_DEFAULT "no")
set(WOLFSSL_BUILD_OUT_OF_TREE_DEFAULT "yes")
endif()
add_option("WOLFSSL_BUILD_OUT_OF_TREE"
"Don't generate files in the source tree (default: ${WOLFSSL_BUILD_OUT_OF_TREE_DEFAULT})"
@ -1727,7 +1929,7 @@ file(REMOVE ${OPTION_FILE})
file(APPEND ${OPTION_FILE} "/* wolfssl options.h\n")
file(APPEND ${OPTION_FILE} " * generated from configure options\n")
file(APPEND ${OPTION_FILE} " *\n")
file(APPEND ${OPTION_FILE} " * Copyright (C) 2006-2020 wolfSSL Inc.\n")
file(APPEND ${OPTION_FILE} " * Copyright (C) 2006-2023 wolfSSL Inc.\n")
file(APPEND ${OPTION_FILE} " *\n")
file(APPEND ${OPTION_FILE} " * This file is part of wolfSSL. (formerly known as CyaSSL)\n")
file(APPEND ${OPTION_FILE} " *\n")
@ -1771,7 +1973,13 @@ set(LIB_SOURCES "")
# Corresponds to the instances of "src_libwolfssl_la_SOURCES += ..."
# in the *.am files.
generate_lib_src_list("${LIB_SOURCES}")
add_library(wolfssl ${LIB_SOURCES})
if(BUILD_SHARED_LIBS)
add_library(wolfssl SHARED ${LIB_SOURCES})
else()
add_library(wolfssl STATIC ${LIB_SOURCES})
endif()
add_library(wolfssl::wolfssl ALIAS wolfssl)
set_target_properties(wolfssl
PROPERTIES
@ -1783,6 +1991,7 @@ target_compile_definitions(wolfssl PRIVATE "BUILDING_WOLFSSL")
if(${BUILD_SHARED_LIBS})
target_compile_definitions(wolfssl PUBLIC "WOLFSSL_DLL")
endif()
target_compile_definitions(wolfssl PUBLIC ${WOLFSSL_DEFINITIONS})
####################################################
# Include Directories
@ -1793,6 +2002,7 @@ target_include_directories(wolfssl
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
${WOLFSSL_INCLUDE_DIRS}
)
####################################################
@ -1804,12 +2014,20 @@ target_link_libraries(wolfssl PUBLIC ${WOLFSSL_LINK_LIBS})
if(WIN32)
# For Windows link ws2_32
target_link_libraries(wolfssl PUBLIC
$<$<PLATFORM_ID:Windows>:ws2_32>)
$<$<PLATFORM_ID:Windows>:ws2_32 crypt32>)
elseif(APPLE)
if(WOLFSSL_SYS_CA_CERTS)
target_link_libraries(wolfssl PUBLIC
${CORE_FOUNDATION_FRAMEWORK}
${SECURITY_FRAMEWORK})
endif()
else()
# DH requires math (m) library
target_link_libraries(wolfssl
PUBLIC
m)
if(WOLFSSL_DH AND NOT WOLFSSL_DH_CONST)
# DH requires math (m) library
target_link_libraries(wolfssl
PUBLIC
m)
endif()
endif()
####################################################
@ -1870,6 +2088,7 @@ if(WOLFSSL_EXAMPLES)
tests/hash.c
tests/srp.c
tests/suites.c
tests/w64wrapper.c
tests/unit.c
examples/server/server.c
examples/client/client.c)
@ -1898,6 +2117,9 @@ if(WOLFSSL_CRYPT_TESTS)
set_target_properties(wolfcrypttest_lib PROPERTIES OUTPUT_NAME "wolfcrypttest")
target_link_libraries(wolfcrypttest_lib wolfssl)
target_compile_options(wolfcrypttest_lib PRIVATE "-DNO_MAIN_DRIVER")
if(WOLFSSL_CRYPT_TESTS_HELP)
target_compile_options(wolfcrypttest_lib PRIVATE "-DHAVE_WOLFCRYPT_TEST_OPTIONS")
endif()
# Make another library for the wolfCrypt benchmark code.
add_library(wolfcryptbench_lib
@ -1917,6 +2139,9 @@ if(WOLFSSL_CRYPT_TESTS)
set_property(TARGET wolfcrypttest
PROPERTY RUNTIME_OUTPUT_NAME
testwolfcrypt)
if(WOLFSSL_CRYPT_TESTS_HELP)
target_compile_options(wolfcrypttest PRIVATE "-DHAVE_WOLFCRYPT_TEST_OPTIONS")
endif()
# Build wolfCrypt benchmark executable.
add_executable(wolfcryptbench
@ -2033,7 +2258,11 @@ endif()
if(NOT BUILD_SP)
list(APPEND HEADER_EXCLUDE
"wolfssl/wolfcrypt/sp.h"
"wolfssl/wolfcrypt/sp.h")
endif()
if(NOT BUILD_SP_INT)
list(APPEND HEADER_EXCLUDE
"wolfssl/wolfcrypt/sp_int.h")
endif()
@ -2047,7 +2276,7 @@ if(NOT BUILD_FIPS OR BUILD_FIPS_V1)
"wolfssl/wolfcrypt/fips.h")
endif()
if(NOT BUILD_QNXCAAM)
if(NOT BUILD_QNXCAAM OR BUILD_CAAM)
list(APPEND HEADER_EXCLUDE
"wolfssl/wolfcrypt/port/caam"
)
@ -2106,7 +2335,8 @@ install(FILES
# Install the export set
install(EXPORT wolfssl-targets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl
FILE wolfssl-config.cmake)
FILE wolfssl-targets.cmake
NAMESPACE wolfssl::)
# TODO: Distro build + rules for what to include in the distro.
# See various include.am files.
@ -2120,3 +2350,28 @@ set(VERSION ${PROJECT_VERSION})
configure_file(support/wolfssl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
export(EXPORT wolfssl-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/wolfssl-targets.cmake"
NAMESPACE wolfssl::
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config-version.cmake"
VERSION "${wolfssl_VERSION_MAJOR}.${wolfssl_VERSION_MINOR}"
COMPATIBILITY AnyNewerVersion
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl
)

View File

@ -1,3 +1,781 @@
# wolfSSL Release 5.6.3 (Jun 16, 2023)
Release 5.6.3 of wolfSSL embedded TLS has 4 bug fixes:
* Fix for setting the atomic macro options introduced in release 5.6.2. This issue affects GNU gcc autoconf builds. The fix resolves a potential mismatch of the generated macros defined in options.h file and the macros used when the wolfSSL library is compiled. In version 5.6.2 this mismatch could result in unstable runtime behavior.
* Fix for invalid suffix error with Windows build using the macro GCM_TABLE_4BIT.
* Improvements to Encrypted Memory support (WC_PROTECT_ENCRYPTED_MEM) implementations for modular exponentiation in SP math-all (sp_int.c) and TFM (tfm.c).
* Improvements to SendAlert for getting output buffer.
# wolfSSL Release 5.6.2 (Jun 09, 2023)
Release 5.6.2 has been developed according to wolfSSL's development and QA process (see link below) and successfully passed the quality criteria.
https://www.wolfssl.com/about/wolfssl-software-development-process-quality-assurance
NOTE: * --enable-heapmath is being deprecated and will be removed by 2024
Release 5.6.2 of wolfSSL embedded TLS has bug fixes and new features including:
## Vulnerabilities
* [Low] In cases where a malicious agent could analyze cache timing at a very detailed level, information about the AES key used could be leaked during T/S Box lookups. One such case was shown on RISC-V hardware using the MicroWalk tool (https://github.com/microwalk-project/Microwalk). A hardened version of T/S Box lookups was added in wolfSSL to help mitigate this potential attack and is now on by default with RISC-V builds and can be enabled on other builds if desired by compiling wolfSSL with the macro WOLFSSL_AES_TOUCH_LINES. Thanks to Jan Wichelmann, Christopher Peredy, Florian Sieck, Anna Pätschke, Thomas Eisenbarth (University of Lübeck): MAMBO-V: Dynamic Side-Channel Leakage Analysis on RISC-V. Fixed in the following GitHub pull request https://github.com/wolfSSL/wolfssl/pull/6309
* [High] In previous versions of wolfSSL if a TLS 1.3 client gets neither a PSK (pre shared key) extension nor a KSE (key share extension) when connecting to a malicious server, a default predictable buffer gets used for the IKM value when generating the session master secret. Using a potentially known IKM value when generating the session master secret key compromises the key generated, allowing an eavesdropper to reconstruct it and potentially allowing surreptitious access to or meddling with message contents in the session. This issue does not affect client validation of connected servers, nor expose private key information, but could result in an insecure TLS 1.3 session when not controlling both sides of the connection. We recommend that TLS 1.3 client side users update the version of wolfSSL used. Thanks to Johannes from Sectra Communications and Linköping University for the report. Fixed in the following GitHub pull request https://github.com/wolfSSL/wolfssl/pull/6412
## New Feature Additions
### New Ports and Expansions
* Add support for STM32H5
* Add support for Renesas TSIP v1.17
* Add Renesas SCE RSA crypto-only support
* STARCORE DSP port and example builds added
* Add the function wc_PKCS7_SetDefaultSignedAttribs for setting PKCS7 signed attributes to use with PKCS7 bundle creation
* NXP IMX6Q CAAM port with QNX and performance optimizations for AES-CTR
### New Build Options
* ASN.1 print utility to decode ASN.1 syntax and print out human readable text --enable-asn-print. Utility app is located in the directory ./examples/asn1/
* Add introspection for math build, wc_GetMathInfo() to get information about the math library compiled into the linked wolfSSL library
* Implement TLS recommendations from RFC 9325 for hardening TLS/DTLS security. Enabled with the autoconf flag --enable-harden-tls.
* Add option to support disabling thread local storage, --disable-threadlocal
* Added wc_DsaSign_ex() and wc_DsaVerify_ex() for handling alternative digest algorithms with DSA Sign/Verify
* Implement atomic operations interface. Macros auto-detect if atomic operations are expected to be available, can be turned off with the macro WOLFSSL_NO_ATOMICS
* Added support for DTLS 1.3 Authentication and Integrity-Only Cipher Suites
* Expand crypto callback to have a device ID find callback function with wc_CryptoCb_SetDeviceFindCb. Enabled with the macro WOLF_CRYPTO_CB_FIND
## Enhancements and Optimizations
### Optimizations
* Increased performance with ChaCha20 C implementation and general XOR operations
* Added integer type to the ASN.1 sequencing with ASN.1 Integer sequence
* With wolfSSL_get_x509_next_altname reset alt name list to head once cycled through if compiling with the macro WOLFSSL_MULTICIRCULATE_ALTNAMELIST
* Additional key validity sanity checks on input to wolfSSL_EC_KEY_set_private_key
* adds support for TLSv1.3 stateful session tickets when using SSL_OP_NO_TICKET
### Memory Optimizations
* Improvements to stack usage and management with SP int math library
* Optimization to TLS 1.3 server to remove caching messages for Ed25519/Ed448
* Added a HAVE_CURL macro build for building a subset of the wolfSSL library when linking with cURL
* Memory usage improvement with reducing the size of alignment needed with AES
* Reduce run time memory used with ECC operations and ALT_ECC_SIZE
* Fixes and improvements for building edge cases such as crypto callback without hash-drbg with low footprint options
* Support HAVE_SESSION_TICKET build option without depending on realloc
### Documentation
* Instructions for GPDMA on STM32 configuration added
* Add in instructions for compiling with zephyr on STM32
* Documentation fixup for wolfSSL_get_chain_cert()
* Fix the file pointed to in the TI RTOS documentation that we maintain
* Documentation for wolfSSL_CertManagerFreeCRL
* Updates made to AES and Chacha documentation
* Update Japanese comments for Ed25519, AES, and other miscellaneous items
### Tests
* Add in an option for easily testing malloc failures when building with WOLFSSL_MEM_FAIL_COUNT macro
* Updated in process for using Expect vs Assert to facilitate more malloc failure tests
* Enhance wolfCrypt test for builds that do not have ECC SECP curves enabled
* ESP32 platform-specific VisualGDB test & benchmark projects
* Update to dependencies in docker container file used for tests
* Fix up for base 10 output with bundled benchmark application
### Port Updates
* Zephyr port update, compile time warning fixes, misc. fixes when used with TLS and update of includes
* Update RIOT-OS to not compile out use of writev by default
* Update Micrium port to enable use of STM32_RNG
* Micrium updates for XMEMOVE and XSTRTOK use
* Various Espressif HW crypto, SHA2, AES, MP updates
* Added in ASIO build option with CMake builds
### General Enhancements
* Global codebase cleanup for C89 compliance and wolfCrypt -Wconversion hygiene
* PKCS#11 enhancement adding a callback for RSA key size when using a hardware key, by default 2048 bit key is used
* Allow for unknown OIDs in extensions in wolfSSL_X509_set_ext()
* Allow user to override XSTAT by defining the macro XSTAT when compiling
* Support UPN and SID with x509 certificate extensions and custom OID build
* Write next IV in wolfSSL_DES_ede3_cbc_encrypt for better handling of inline encryption
* Adding NO_ASN_TIME_CHECK build option for compiling out certificate before/after checks
* Improve different peer recvfrom handling and error reporting with ipv4 vs ipv6
## Fixes
* Fix for STM32 ECC sign and verify out of bounds buffer write when the hash length passed in is larger than the key size. Thanks to Maximilian for the report.
* Fix to skip Async_DevCtxInit when using init rsa/ecc label/id api's
* Revert WOLFSSL_NO_ASN_STRICT macro guard around alternate names directory list
* In async mode, don't retry decrypting if a valid error is encountered on a packet parse attempt
* Add additional sanity check on PKCS7 index value in wc_PKCS7_DecryptKekri
* Fix for padding when using an AuthEnvelope PKCS7 type with GCM/CCM stream ciphers
* Fix siphash assembly so that no register is left behind
* Fix to not send a TLS 1.3 session ID resume response when resuming and downgrading to a protocol less than TLS 1.3
* Fix overwriting serialNumber by favouriteDrink when generating a certificate using Cert struct
* Fix for the default realloc used with EspressIf builds
* Track SetDigest usage to avoid invalid free under error conditions
* DTLS v1.3 fix for epoch 0 check on plaintext message
* Fix for session ticket memory leak in wolfSSL_Cleanup
* Fixes for propagating SendAlert errors when the peer disconnects
* Replace XMEMCPY with XMEMMOVE to fix valgrind-3.15.0 reports "Source and destination overlap in memcpy" when using --enable-aesgcm-stream
* Fix for potential out-of-bounds write edge case in fp_mod_2d with --enable-fastmath math library
* Fix getting ECC key size in stm32_ecc_sign_hash_ex
* Fix for case where wc_PeekErrorNodeLineData was not unlocking error queue on error
* Fix for async ECC shared secret state
* Fix for better error checking with sp_gcd with SP int math library
* Fix memory leak in TLSX_KeyShare_Setup when handling an error case
* Fix for double free edge case in InitOCSPRequest when handling a memory allocation failure
* X509 NAME Entry fix for leaking memory on error case
* Fix wolfssl_asn1_time_to_tm setting unexpected fields in tm struct
* Fix for FIPS ECC integrity check with crypto callback set
* BN_to_ASN1_INTEGER fix for handling leading zero byte padding when needed
* Fix a typo in PP macro and add a ceiling to guard against implementation bugs
* DTLS 1.3 fix for using the correct label when deriving the resumption key
* OCSP fix for GetDateInfo edge case with non ASN template builds
* Allow a user set certificate callback function to override the skipAddCA flag when parsing a certificate
* SP int: sp_radix_size when radix 10 fix temp size for handling edge case
* Fixes and improvements for handling failures with memory allocations
* Fix for DecodeECC_DSA_Sig to handle r and s being initialized
* Fix for wc_ecc_is_point to ensure that the x and y are in range [0, p-1] and z is one (affine ordinates)
### Build Fixes
* Fix for building on Windows with CMake and using USER_SETTINGS and fix for options.h creation with CMake when using USER_SETTINGS
* CMake fixes and improvements for use with mingw32
* Fix for building with wpas and x509 small options
* Check if colrm is available for options.h creation when using autoconf
* Clean up NO_BIG_INT build, removing WOLFSSL_SP_MATH macro and heapmath compile
* Fix PKCS#7 build with NO_PKCS7_STREAM
* Fix compilation error in CC-RX and remove unnecessary public key import
* SP Build fixes for ARM assembly with ARMv6 clz and ARM thumb debug build
* For to not advertise support for RSA in TLS extensions when compiled with NO_RSA
# wolfSSL Release 5.6.0 (Mar 24, 2023)
Release 5.6.0 has been developed according to wolfSSL's development and QA process (see link below) and successfully passed the quality criteria.
https://www.wolfssl.com/about/wolfssl-software-development-process-quality-assurance
NOTE: * --enable-heapmath is being deprecated and will be removed by 2024
* This release makes ASN Template the default with ./configure, the previous ASN parsing can be built with --enable-asn=original
Release 5.6.0 of wolfSSL embedded TLS has bug fixes and new features including:
## New Feature Additions
* ASN template is now the default ASN parsing implementation when compiling with configure
* Added in support for TLS v1.3 Encrypted Client Hello (ECH) and HPKE (Hybrid Public Key Encryption)
* DTLS 1.3 stateless server ClientHello parsing support added
### Ports
* Add RX64/RX71 SHA hardware support
* Port to RT1170 and expand NXP CAAM driver support
* Add NuttX integration files for ease of use
* Updated Stunnel support for version 5.67
Compatibility Layer
* Add in support for AES-CCM with EVP
* BN compatibility API refactoring and separate API created
* Expanding public key type cipher suite list strings support
### Misc.
* Support pthread_rwlock and add enable option
* Add wolfSSL_CertManagerLoadCABuffer_ex() that takes a user certificate chain flag and additional verify flag options
* Docker build additions for wolfSSL library and wolfCLU application
* Add favorite drink pilot attribute type to get it from the encoding
* Added in support for indefinite length BER parsing with PKCS12
* Add dynamic session cache which allocates sessions from the heap with macro SESSION_CACHE_DYNAMIC_MEM
## Improvements / Optimizations
### Tests
* Additional CI (continuous integration) testing and leveraging of GitHub workflows
* Add CI testing for wpa_supplicant, OpenWrt and OpenVPN using GitHub workflows
* Add compilation of Espressif to GitHub workflows tests
* Refactoring and improving error results with wolfCrypt unit test application
* Minor warning fixes from Coverity static analysis scan
* Add new SHA-512/224 and SHA-512/256 tests
* Used codespell and fixed some minor typos
### Ports
* Improve TLS1.2 client authentication to use TSIP
* Updated Kyber macro to be WOLFSSL_HAVE_KYBER and made changes that make Kyber work on STM32
* AES-GCM Windows assembly additions
* CRLF line endings, trailing spaces for C# Wrapper Projects
Compatibility Layer
* Update `PubKey` and `Key` PEM-to-DER APIs to support return of needed DER size
* Allow reading ENC EC PRIVATE KEY as well via wolfSSL_PEM_read_bio_ECPrivateKey
* Improve wolfSSL_EC_POINT_cmp to handle Jacobian ordinates
* Fix issue with BIO_reset() and add BIO_FLAGS_MEM_RDONLY flag support for read only BIOs
### SP
* In SP math library rework mod 3 and use count leading zero instruction
* Fix with SP ECC sign to reject the random k generated when r is 0
* With SP math add better detection of when add won't work and double is needed with point_add_qz1 internal function
* With SP int fail when buffer writing to is too small for number rather than discarding the extra values
### Builds
* Define WOLFSSL_SP_SMALL_STACK if wolfSSL is build with --enable-smallstack
* Fix CMake to exclude libm when DH is not enabled
* Allow building of SAKKE as external non-FIPS algorithm with wolfmikey product
* Add option to add library suffix, --with-libsuffix
* ASN template compile option WOLFSSL_ASN_INT_LEAD_0_ANY to allow leading zeros
* Add user_settings.h template for wolfTPM to examples/configs/user_settings_wolftpm.h
* Purge the AES variant of Dilithium
* Expand WOLFSSL_NO_ASN_STRICT to allow parsing of explicit ECC public key
* Remove relocatable text in ARMv7a AES assembly for use with FIPS builds
* Expand checking for hardware that supports ARMv7a neon with autotools configure
* Sanity check on allocation fails with DSA and FP_ECC build when zeroizing internal buffer
* Additional TLS alerts sent when compiling with WOLFSSL_EXTRA_ALERTS macro defined
### Benchmarking
* Update wolfCrypt benchmark Windows build files to support x64 Platform
* Add SHA512/224 and SHA512/256 benchmarks, fixed CVS macro and display sizes
* Separate AES-GCM streaming runs when benchmarked
* No longer call external implementation of Kyber from benchmark
* Fix for benchmarking shake with custom block size
* Fixes for benchmark help `-alg` list and block format
Documentation/Examples
* Document use of wc_AesFree() and update documentation of Ed25519 with Doxygen
* Move the wolfSSL Configuration section higher in QUIC.md
* Add Japanese Doxygen documentation for cmac.h, quic.h and remove incomplete Japanese doxygen in asn_public.h
* Espressif examples run with local wolfSSL now with no additional setup needed
* Added a fix for StartTLS use In the example client
* Add a base-line user_settings.h for use with FIPS 140-3 in XCode example app
### Optimizations
* AES-NI usage added for AES modes ECB/CTR/XTS
### Misc
* Update AES-GCM stream decryption to allow long IVs
* Internal refactor to use wolfSSL_Ref functions when incrementing or decrementing the structures reference count and fixes for static analysis reports
* Cleanup function logging making adjustments to the debug log print outs
* Remove realloc dependency in DtlsMsgCombineFragBuckets function
* Refactor to use WOLFSSL_CTXs cipher suite list when possible
* Update internal padding of 0s with DSA sign and additional tests with mp_to_unsigned_bin_len function
* With DTLS SRTP use wolfSSL_export_keying_material instead of wc_PRF_TLS
* Updated macro naming from HAVE_KYBER to be WOLFSSL_HAVE_KYBER
* Update AES XTS encrypt to handle in-place encryption properly
* With TLS 1.3 add option to require only PSK with DHE
## Fixes
### Ports
* Fix for AES use with CAAM on imx8qxp with SECO builds
* Fix for PIC32 crypto HW and unused `TLSX_SetResponse`
* Fix warning if ltime is unsigned seen with QNX build
* Updates and fix for Zephyr project support
* Include sys/time.h for WOLFSSL_RIOT_OS
* Move X509_V errors from enums to defines for use with HAProxy CLI
* Fix IAR compiler warnings resolved
* Fix for STM32 Hash peripherals (like on F437) with FIFO depth = 1
* ESP32 fix for SHA384 init with hardware acceleration
### Builds
* Add WOLFSSL_IP_ALT_NAME macro define to --enable-curl
* Fixes for building with C++17 and avoiding clashing with byte naming
* Fixes SP math all build issue with small-stack and no hardening
* Fix for building with ASN template with `NO_ASN_TIME` defined
* Fix building FIPSv2 with WOLFSSL_ECDSA_SET_K defined
* Don't allow aesgcm-stream option with kcapi
* Fix DTLS test case for when able to read peers close notify alert on FreeBSD systems
* Fix for "expression must have a constant value" in tls13.c with Green Hills compiler
* Fixes for building KCAPI with opensslextra enabled
* Fix warnings of shadows min and subscript with i486-netbsd-gcc compiler
* Fix issue with async and `WOLFSSL_CHECK_ALERT_ON_ERR`
* Fix for PKCS7 with asynchronous crypto enabled
### Math Library
* SP Aarch64 fix for conditional changed in asm needing "cc" and fix for ECC P256 mont reduce
* In SP builds add sanity check with DH exp. to check the output length for minimum size
* In SP math fix scalar length check with EC scalar multiply
* With SP int fix handling negative character properly with read radix
* Add error checks before setting variable err in SP int with the function sp_invmod_mont_ct
* Fix to add sanity check for malloc of zero size in fastmath builds
* In fastmath fix a possible overflow in fp_to_unsigned_bin_len length check
* Heapmath fast mod. reduce fix
### Compatibility Layer
* Fixes for encoding/decoding ecc public keys and ensure i2d public key functions do not include any private key information
* Fix for EVP_EncryptUpdate to update outl on empty input
* Fix SE050 RSA public key loading and RSA/ECC SE050 TLS Compatibility
* Rework EC API and validate point after setting it
* Fix for X509 RSA PSS with compatibility layer functions
* Fix size of structures used with SHA operations when built with opensslextra for Espressif hardware accelerated hashing
* Added sanity check on key length with wolfSSL_CMAC_Init function
* Fix for return value type conversion of bad mutex error in logging function
* Fix NID conflict NID_givenName and NID_md5WithRSAEncryption
* Fix unguarded XFPRINTF calls with opensslextra build
* Fix wolfSSL_ASN1_INTEGER_to_BN for negative values
* Fix for potential ASN1_STRING leak in wolfSSL_X509_NAME_ENTRY_create_by_txt and wolfSSL_X509_NAME_ENTRY_create_by_NID when memory allocation fails
### Misc.
* Add sanity check to prevent an out of bounds read with OCSP response decoding
* Sanity check to not allow 0 length with bit string and integer when parsing ASN1 syntax
* Adjust RNG sanity checks and remove error prone first byte comparison
* With PKCS7 add a fix for GetAsnTimeString() to correctly increment internal data pointer
* PKCS7 addition of sequence around algo parameters with authenvelop
* DSA fixes for clearing mp_int before re-reading data and avoid mp_clear without first calling mp_init
* Fix for SRTP setting bitfield when it is encoded for the TLS extension
* Fix for handling small http headers when doing CRL verification
* Fix for ECCSI hash function to validate the output size and curve size
* Fix for value of givenName and name being reversed with CSR generation
* Fix for error type returned (OCSP_CERT_UNKNOWN) with OCSP verification
* Fix for a potential memory leak with ProcessCSR when handling OCSP responses
* Fix for VERIFY_SKIP_DATE flag not ignoring date errors when set
* Fix for zlib decompression buffer issue with PKCS7
* Fix for DTLS message pool send size used and DTLS server saving of the handshake sequence
* Fix to propagate WOLFSSL_TICKET_RET_CREATE error return value from DoDecryptTicket()
* Fix for handling long session IDs with TLS 1.3 session tickets
* Fix for AES-GCM streaming when caching an IV
* Fix for test case with older selftest that returns bad padding instead of salt len error
* Add fix for siphash cache and added in additional tests
* Fix potential out of bounds memset to 0 in error case with session export function used with --enable-sessionexport builds
* Fix possible NULL dereference in TLSX_CSR_Parse with TLS 1.3
* Fix for sanity check on RSA pad length with no padding using the build macro WC_RSA_NO_PADDING
# wolfSSL Release 5.5.4 (Dec 21, 2022)
Release 5.5.4 of wolfSSL embedded TLS has bug fixes and new features including:
## New Feature Additions
* QUIC related changes for HAProxy integration and config option
* Support for Analog Devices MAXQ1080 and MAXQ1065
* Testing and build of wolfSSL with NuttX
* New software based entropy gatherer with configure option --enable-entropy-memuse
* NXP SE050 feature expansion and fixes, adding in RSA support and conditional compile of AES and CMAC
* Support for multi-threaded sniffer
## Improvements / Optimizations
### Benchmark and Tests
* Add alternate test case for unsupported static memory API when testing mutex allocations
* Additional unit test cases added for AES CCM 256-bit
* Initialize and free AES object with benchmarking AES-OFB
* Kyber with DTLS 1.3 tests added
* Tidy up Espressif ESP32 test and benchmark examples
* Rework to be able to run API tests individually and add display of time taken per test
### Build and Port Improvements
* Add check for 64-bit ABI on MIPS64 before declaring a 64-bit CPU
* Add support to detect SIZEOF_LONG in armclang and diab
* Added in a simple example working on Rx72n
* Update azsphere support to prevent compilation of file included inline
* --enable-brainpool configure option added and default to on when custom curves are also on
* Add RSA PSS salt defines to engine builds if not FIPS v2
### Post Quantum
* Remove kyber-90s and route all Kyber through wolfcrypt
* Purge older version of NTRU and SABER from wolfSSL
### SP Math
* Support static memory build with sp-math
* SP C, SP int: improve performance
* SP int: support mingw64 again
* SP int: enhancements to guess 64-bit type and check on NO_64BIT macro set before using long long
* SP int: check size required when using sp_int on stack
* SP: --enable-sp-asm now enables SP by default if not set
* SP: support aarch64 big endian
### DTLS
* Allow DTLS 1.3 to compile when FIPS is enabled
* Allow for stateless DTLS client hello parsing
### Misc.
* Easier detection of DRBG health when using Intels RDRAND by updating the structures status value
* Detection of duplicate known extensions with TLS
* PKCS#11 handle a user PIN that is a NULL_PTR, compile time check in finding keys, add initialization API
* Update max Cert Policy size based on RFC 5280
* Add Android CA certs path for wolfSSL_CTX_load_system_CA_certs()
* Improve logic for enabling system CA certs on Apple devices
* Stub functions to allow for cpuid public functions with non-intel builds
* Increase RNG_SECURITY_STRENGTH for FIPS
* Improvements in OpenSSL Compat ERR Queue handling
* Support ASN1/DER CRLs in LoadCertByIssuer
* Expose more ECC math functions and improve async shared secret
* Improvement for sniffer error messages
* Warning added that renegotiation in TLS 1.3 requires session ticket
* Adjustment for TLS 1.3 post auth support
* Rework DH API and improve PEM read/write
## Fixes
### Build Fixes
* Fix --enable-devcrypto build error for sys without u_int8_t type
* Fix casts in evp.c and build issue in ParseCRL
* Fixes for compatibility layer building with heap hint and OSSL callbacks
* fix compile error due to Werro=undef on gcc-4.8
* Fix mingw-w64 build issues on windows
* Xcode project fixes for different build settings
* Initialize variable causing failures with gcc-11 and gcc-12 with a unique wolfSSL build configuration
* Prevent WOLFSSL_NO_MALLOC from breaking RSA certificate verification
* Fixes for various tests that do not properly handle `WC_PENDING_E` with async. builds
* Fix for misc `HashObject` to be excluded for `WOLFCRYPT_ONLY`
### OCSP Fixes
* Correctly save next status with OCSP response verify
* When the OCSP responder returns an unknown exception, continue through to checking the CRL
### Math Fixes
* Fix for implicit conversion with 32-bit in SP math
* Fix for error checks when modulus is even with SP int build
* Fix for checking of err in _sp_exptmod_nct with SP int build
* ECC cofactor fix when checking scalar bits
* ARM32 ASM: don't use ldrd on user data
* SP int, fix when ECC specific size code included
### Port Fixes
* Fixes for STM32 PKA ECC (not 256-bit) and improvements for AES-GCM
* Fix for cryptocell signature verification with ECC
* Benchmark devid changes, CCM with SECO fix, set IV on AES import into SECO
### Compat. Layer Fixes
* Fix for handling DEFAULT:... cipher suite list
* Fix memory leak in wolfSSL_X509_NAME_ENTRY_get_object
* Set alt name type to V_ASN1_IA5STRING
* Update name hash functions wolfSSL_X509_subject_name_hash and wolfSSL_X509_issuer_name_hash to hash the canonical form of subject
* Fix wolfSSL_set_SSL_CTX() to be usable during handshake
* Fix X509_get1_ocsp to set num of elements in stack
* X509v3 EXT d2i: fix freeing of aia
* Fix to remove recreation of certificate with wolfSSL_PEM_write_bio_X509()
* Link newly created x509 store's certificate manager to self by default to assist with CRL verification
* Fix for compatibility `EC_KEY_new_by_curve_name` to not create a key if the curve is not found
### Misc.
* Free potential signer malloc in a fail case
* fix other name san parsing and add RID cert to test parsing
* WOLFSSL_OP_NO_TICKET fix for TLSv1.2
* fix ASN template parsing of X509 subject directory attribute
* Fix the wrong IV size with the cipher suite TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256
* Fix incorrect self signed error return when compiled with certreq and certgen.
* Fix wrong function name in debug comment with wolfSSL_X509_get_name_oneline()
* Fix for decryption after second handshake with async sniffer
* Allow session tickets to properly resume when using PQ KEMs
* Add sanity overflow check to DecodeAltNames input buffer access
# wolfSSL Release 5.5.3 (Nov 2, 2022)
Release 5.5.3 of wolfSSL embedded TLS has the following bug fix:
## Fixes
* Fix for possible buffer zeroization overrun introduced at the end of v5.5.2 release cycle in GitHub pull request 5743 (https://github.com/wolfSSL/wolfssl/pull/5743) and fixed in pull request 5757 (https://github.com/wolfSSL/wolfssl/pull/5757). In the case where a specific memory allocation failed or a hardware fault happened there was the potential for an overrun of 0s when masking the buffer used for (D)TLS 1.2 and lower operations. (D)TLS 1.3 only and crypto only users are not affected by the issue. This is not related in any way to recent issues reported in OpenSSL.
# wolfSSL Release 5.5.2 (Oct 28, 2022)
Release 5.5.2 of wolfSSL embedded TLS has bug fixes and new features including:
## Vulnerabilities
* [Med] In the case that the WOLFSSL_CALLBACKS macro is set when building wolfSSL, there is a potential heap over read of 5 bytes when handling TLS 1.3 client connections. This heap over read is limited to wolfSSL builds explicitly setting the macro WOLFSSL_CALLBACKS, the feature does not get turned on by any other build options. The macro WOLFSSL_CALLBACKS is intended for debug use only, but if having it enabled in production, users are recommended to disable WOLFSSL_CALLBACKS. Users enabling WOLFSSL_CALLBACKS are recommended to update their version of wolfSSL. Thanks to Lucca Hirschi and Steve Kremer from LORIA, Inria and Max Ammann from Trail of Bits for finding and reporting the bug with the tlspuffin tool developed partly at LORIA and Trail of Bits. CVE 2022-42905
Release 5.5.2 of wolfSSL embedded TLS has bug fixes and new features including:
## New Feature Additions
* Add function wolfSSL_CTX_load_system_CA_certs to load system CA certs into a WOLFSSL_CTX and --sys-ca-certs option to example client
* Add wolfSSL_set1_host to OpenSSL compatible API
* Added the function sk_X509_shift
* AES x86 ASM for AES-CBC and GCM performance enhancements
* Add assembly for AES for ARM32 without using crypto hardware instructions
* Xilinx Versal port and hardware acceleration tie in
* SP Cortex-M support for ICCARM
## Enhancements
* Add snifftest vcxproj file and documentation
* Nucleus Thread Types supported
* Handle certificates with RSA-PSS signature that have RSAk public keys
* Small stack build improvements
* DTLS 1.3 improvements for Alerts and unit tests
* Add a binary search for CRL
* Improvement of SSL/CTX_set_max_early_data() for client side
* Remove unused ASN1_GENERALIZEDTIME enum value from wolfssl/ssl.h
* Add user_settings.h for Intel/M1 FIPSv2 macOS C++ projects
* Add dtlscid.test to make check unit testing
* Generate an assembler-safe user_settings.h in configure.ac and CMakeLists.txt
* ForceZero enabled with USE_FAST_MATH
* Add TLS 1.3 support of ticketNonce sizes bigger than MAX_TICKET_NONCE_SZ
* FIPSv2 builds on win10 adjust for new fastmath default in settings.h
* Add IRQ install for Aruix example
## Fixes
* When looking up the session by ID on the server, check that the protocol version of the SSL and session match on TLS 1.3 or not
* Fix for potential EVP_PKEY_DH memory leak with OPENSSL_EXTRA
* Curve448 32-bit C code: handle corner case
* Fixup builds using WOLFSSL_LOG_PRINTF
* Correct DIST_POINT_NAME type value
* Do not perform IV Wrap test when using cert3389 inlined armasm
* Fix for Linux kernel module and stdio.h
* (D)TLS: send alert on version mismatch
* Fix PKCS#7 SignedData verification when signer cert is not first in SET
* Fix bug with wolfIO_TcpConnect not working with timeout on Windows
* Fix output length bug in SP non-blocking ECC shared secret gen
* Fix build with enable-fastmath and disable-rsa
* Correct wolfSSL_sk_X509_new in OpenSSL compatible API
* Fixes for SP and x86_64 with MSVC
* Fix wrong size using DTLSv1.3 in RestartHandshakeHashWithCookie
* Fix redundant file include with TI RTOS build
* Fix wolfCrypt only build with wincrypt.h
* DTLS 1.2: Reset state when sending HelloVerifyRequest
# wolfSSL Release 5.5.1 (Sep 28, 2022)
Release 5.5.1 of wolfSSL embedded TLS has bug fixes and new features including:
## Vulnerabilities
* [Med] Denial of service attack and buffer overflow against TLS 1.3 servers using session ticket resumption. When built with --enable-session-ticket and making use of TLS 1.3 server code in wolfSSL, there is the possibility of a malicious client to craft a malformed second ClientHello packet that causes the server to crash. This issue is limited to when using both --enable-session-ticket and TLS 1.3 on the server side. Users with TLS 1.3 servers, and having --enable-session-ticket, should update to the latest version of wolfSSL. Thanks to Max at Trail of Bits for the report, found by Lucca Hirschi from LORIA, Inria, France with the tlspuffin tool developed partly at LORIA and Trail of Bits. CVE-2022-39173
## New Feature Additions
* Add support for non-blocking ECC key gen and shared secret gen for P-256/384/521
* Add support for non-blocking ECDHE/ECDSA in TLS/DTLS layer.
* Port to NXP RT685 with FreeRTOS
* Add option to build post quantum Kyber API (--enable-kyber)
* Add post quantum algorithm sphincs to wolfCrypt
* Config. option to force no asm with SP build (--enable-sp=noasm)
* Allow post quantum keyshare for DTLS 1.3
## Enhancements
* DTLSv1.3: Do HRR Cookie exchange by default
* Add wolfSSL_EVP_PKEY_new_CMAC_key to OpenSSL compatible API
* Update ide win10 build files to add missing sp source files
* Improve Workbench docs
* Improve EVP support for CHACHA20_POLY1305
* Improve `wc_SetCustomExtension` documentation
* RSA-PSS with OCSP and add simple OCSP response DER verify test case
* Clean up some FIPS versioning logic in configure.ac and WIN10 user_settings.h
* Don't over-allocate memory for DTLS fragments
* Add WOLFSSL_ATECC_TFLXTLS for Atmel port
* SHA-3 performance improvements with x86_64 assembly
* Add code to fallback to S/W if TSIP cannot handle
* Improves entropy with VxWorks
* Make time in milliseconds 64-bits for longer session ticket lives
* Support for setting cipher list with bytes
* wolfSSL_set1_curves_list(), wolfSSL_CTX_set1_curves_list() improvements
* Add to RSAES-OAEP key parsing for pkcs7
* Add missing DN nid to work with PrintName()
* SP int: default to 16 bit word size when NO_64BIT defined
* Limit the amount of fragments we store per a DTLS connection and error out when max limit is reached
* Detect when certificate's RSA public key size is too big and fail on loading of certificate
## Fixes
* Fix for async with OCSP non-blocking in `ProcessPeerCerts`
* Fixes for building with 32-bit and socket size sign/unsigned mismatch
* Fix Windows CMakeList compiler options
* TLS 1.3 Middle-Box compat: fix missing brace
* Configuration consistency fixes for RSA keys and way to force disable of private keys
* Fix for Aarch64 Mac M1 SP use
* Fix build errors and warnings for MSVC with DTLS 1.3
* Fix HMAC compat layer function for SHA-1
* Fix DTLS 1.3 do not negotiate ConnectionID in HelloRetryRequest
* Check return from call to wc_Time
* SP math: fix build configuration with opensslall
* Fix for async session tickets
* SP int mp_init_size fixes when SP_WORD_SIZE == 8
* Ed. function to make public key now checks for if the private key flag is set
* Fix HashRaw WC_SHA256_DIGEST_SIZE for wc_Sha256GetHash
* Fix for building with PSK only
* Set correct types in wolfSSL_sk_*_new functions
* Sanity check that size passed to mp_init_size() is no more than SP_INT_DIGITS
# wolfSSL Release 5.5.0 (Aug 30, 2022)
Note:
** If not freeing FP_ECC caches per thread by calling wc_ecc_fp_free there is a possible memory leak during TLS 1.3 handshakes which use ECC. Users are urged to confirm they are freeing FP_ECC caches per thread if enabled to avoid this issue.
Release 5.5.0 of wolfSSL embedded TLS has bug fixes and new features including:
## Vulnerabilities
* [Low] Fault injection attack on RAM via Rowhammer leads to ECDSA key disclosure. Users doing operations with private ECC keys such as server side TLS connections and creating ECC signatures, who also have hardware that could be targeted with a sophisticated Rowhammer attack should update the version of wolfSSL and compile using the macro WOLFSSL_CHECK_SIG_FAULTS. Thanks to Yarkin Doroz, Berk Sunar, Koksal Must, Caner Tol, and Kristi Rahman all affiliated with the Vernam Applied Cryptography and Cybersecurity Lab at Worcester Polytechnic Institute for the report.
* [Low] In wolfSSL version 5.3.0 if compiled with --enable-session-ticket and the client has non-empty session cache, with TLS 1.2 there is the possibility of a man in the middle passing a large session ticket to the client and causing a crash due to an invalid free. There is also the potential for a malicious TLS 1.3 server to crash a client in a similar manner except in TLS 1.3 it is not susceptible to a man in the middle attack. Users on the client side with enable-session-ticket compiled in and using wolfSSL version 5.3.0 should update their version of wolfSSL. Thanks to Max at Trail of Bits for the report and "LORIA, INRIA, France" for research on tlspuffin.
* [Low] If using wolfSSL_clear to reset a WOLFSSL object (vs the normal wolfSSL_free/wolfSSL_new) it can result in runtime issues. This exists with builds using the wolfSSL compatibility layer (--enable-opnesslextra) and only when the application is making use of wolfSSL_clear instead of SSL_free/SSL_new. In the case of a TLS 1.3 resumption, after continuing to use the WOLFSSH object after having called wolfSSL_clear, an application could crash. It is suggested that users calling wolfSSL_clear update the version of wolfSSL used. Thanks to Max at Trail of Bits for the report and "LORIA, INRIA, France" for research on tlspuffin.
* Potential DoS attack on DTLS 1.2. In the case of receiving a malicious plaintext handshake message at epoch 0 the connection will enter an error state reporting a duplicate message. This affects both server and client side. Users that have DTLS enabled and in use should update their version of wolfSSL to mitigate the potential for a DoS attack.
## New Feature Additions
* QUIC support added, for using wolfSSL with QUIC implementations like ngtcp2
* SE050 port additions and fixes
* Added support for Dilithium post quantum algorithm use with TLS
* Support for RSA-PSS signed certificates
* Support for Infineon AURIX IDE
* Add Zephyr support for nRF5340 with CryptoCell-312
## Enhancements
* Expanded ABI support by 50 APIs to include wolfCrypt and Certificates making a total of 113 ABIs controlled and maintained
* DTLS 1.3 partial support for ConnectionID as described by RFC9146 and RFC9147
* Added support for X509_CRL_print function
* Remove deprecated algorithms in Renesas cs+ project
* Support more build options disable/enable with i.MX CAAM build
* wolfSSL_CTX_set_options and wolfSSL_CTX_get_options functions added to non compatibility layer builds
* TFM: change inline x86 asm code to compile with clang
* Improvements to error queue and fix for behavior of wolfSSL_ERR_get_error
* scripts/makedistsmall.sh script added for creating a small source/header only package
* TLS 1.3: restrict extension validity by message, Extensions ServerName, SupportedGroups and ALPN must not appear in server_hello
* Add liboqs integration to CMake build system
* Adds wolfSSL_PEM_read_RSAPrivateKey() to the OpenSSL compatible API
* Added support for P384 pre-share in bundled example server
* Replace clz assembly instruction in ARM 32 builds when not supported
* Integrate chacha20-poly1305 into the EVP interface
* Additional validation that extensions appear in correct messages
* Allow SAN to be critical with ASN template build
* Support wolfSSL_CTX_set1_curves_list being available when X25519 and/or X448 only defined
* Adds wolfSSL_PEM_read_RSA_PUBKEY() to the OpenSSL compatible API
* Match OpenSSL self signed error return with compatibility layer build
* Added wolfSSL_dtls_create_peer and wolfSSL_dtls_free_peer to help with Python and Go wrappers for DTLS
## Fixes
* DTLS 1.3 asynchronous use case fixes
* Fix handling of counter to support incrementing across all bytes in ARM crypto asm
* Fixes for ED25519/ED448 private key with public key export (RFC8410)
* Fix for build with NO_TLS macro
* Fix for write dup function to copy over TLS version
* Fix to handle path lengths of 0 when checking certificate CA path lengths
* Fix for CMake not installing sp_int.h for SP math all
* When WOLFSSL_VALIDATE_ECC_IMPORT is defined ECC import validates private key value is less than order
* PSA crypto fixes
* Fix for not having default pkcs7 signed attributes
* DTLS socket and timeout fixes
* SP int: exptmod ensure base is less than modulus
* Fix for AddPacketInfo with WOLFSSL_CALLBACKS to not pass encrypted TLS 1.3 handshake messages to callbacks
* Fix for sniffer to ensure the session was polled before trying to reprocess it
# wolfSSL Release 5.4.0 (July 11, 2022)
Note:
** Future releases of wolfSSL will turn off TLS 1.1 by default
** Release 5.4.0 made SP math the default math implementation. To make an equivalent build as disable-fastmath from previous versions of wolfSSL, now requires using the configure option enable-heapmath instead.
Release 5.4.0 of wolfSSL embedded TLS has bug fixes and new features including:
## Vulnerabilities
* [High] Potential for DTLS DoS attack. In wolfSSL versions before 5.4.0 the return-routability check is wrongly skipped in a specific edge case. The check on the return-routability is there for stopping attacks that either consume excessive resources on the server, or try to use the server as an amplifier sending an excessive amount of messages to a victim IP. If using DTLS 1.0/1.2 on the server side users should update to avoid the potential DoS attack. CVE-2022-34293
* [Medium] Ciphertext side channel attack on ECC and DH operations. Users on systems where rogue agents can monitor memory use should update the version of wolfSSL and change private ECC keys. Thanks to Sen Deng from Southern University of Science and Technology (SUSTech) for the report.
* [Medium] Public disclosure of a side channel vulnerability that has been fixed since wolfSSL version 5.1.0. When running on AMD there is the potential to leak private key information with ECDSA operations due to a ciphertext side channel attack. Users on AMD doing ECDSA operations with wolfSSL versions less than 5.1.0 should update their wolfSSL version used. Thanks to professor Yinqian Zhang from Southern University of Science and Technology (SUSTech), his Ph.D. student Mengyuan Li from The Ohio State University, and his M.S students Sen Deng and Yining Tang from SUStech along with other collaborators; Luca Wilke, Jan Wichelmann and Professor Thomas Eisenbarth from the University of Lubeck, Professor Shuai Wang from Hong Kong University of Science and Technology, Professor Radu Teodorescu from The Ohio State University, Huibo Wang, Kang Li and Yueqiang Cheng from Baidu Security and Shoumeng Yang from Ant Financial Services Group.
CVE-2020-12966 https://www.amd.com/en/corporate/product-security/bulletin/amd-sb-1013 CVE-2021-46744 https://www.amd.com/en/corporate/product-security/bulletin/amd-sb-1033
## New Feature Additions
### DTLS 1.3
* Support for using the new DTLSv1.3 protocol was added
* Enhancements to bundled examples for an event driven server with DTLS 1.3 was added
### Ports
* Update for the version of VxWorks supported, adding in support for version 6.x
* Support for new DPP and EAP-TEAP/EAP-FAST in wpa_supplicant
* Update for TSIP version support, adding support for version 1.15 for RX65N and RX72N
* Improved TSIP build to handle having the options WOLFSSL_AEAD_ONLY defined or NO_AES_CBC defined
* Added support for offloading TLS1.3 operations to Renesas RX boards with TSIP
### Misc.
* Constant time improvements due to development of new constant time tests
* Initial translation of API headers to Japanese and expansion of Japanese help message support in example applications
* Add support for some FPKI (Federal PKI) certificate cases, UUID, FASC-N, PIV extension for use with smart cards
* Add support for parsing additional CSR attributes such as unstructured name and content type
* Add support for Linux getrandom() when defining the macro WOLFSSL_GETRANDOM
* Add TLS 1.2 ciphersuite ECDHE_PSK_WITH_AES_128_GCM_SHA256 from RFC 8442
* Expand CAAM support with QNX to include i.MX8 boards and add AES-CTR support
* Enhanced glitching protection by hardening the TLS encrypt operations
## Math and Performance
### SP Math Additions
* Support for ARMv3, ARMv6 and ARMv7a
- Changes and improvements to get SP building for armv7-a
- Updated assembly for moving large immediate values on ARMv6
- Support for architectures with no ldrd/strd and clz
* Reworked generation using common asm ruby code for 32bit ARM
* Enable wolfSSL SP math all by default (sp_int.c)
* Update SP math all to not use sp_int_word when SQR_MUL_ASM is available
### SP Math Fixes
* Fixes for constant time with div function
* Fix casting warnings for Windows builds and assembly changes to support XMM6-15 being non-volatile
* Fix for div_word when not using div function
* Fixes for user settings with SP ASM and ED/Curve25519 small
* Additional Wycheproof tests ran and fixes
* Fix for SP math ECC non-blocking to always check `hashLen`
* Fix for SP math handling edge case with submod
## Improvements and Optimizations
### Compatibility Layer
* Provide access to "Finished" messages outside of compatibility layer builds
* Remove unneeded FIPS guard on wolfSSL_EVP_PKEY_derive
* Fix control command issues with AES-GCM, control command EVP_CTRL_GCM_IV_GEN
* Add support for importing private only EC key to a WOLFSSL_EVP_PKEY struct
* Add support for more extensions to wolfSSL_X509_print_ex
* Update for internal to DER (i2d) AIPs to move the buffer pointer when passed in and the operation is successful
* Return subject and issuer X509_NAME object even when not set
### Ports
* Renesas RA6M4 example update and fixes
* Support multi-threaded use cases with Renesas SCE protected mode and TSIP
* Add a global variable for heap-hint for use with TSIP
* Changes to support v5.3.0 cube pack for STM32
* Use the correct mutex type for embOS
* ESP-IDF build cleanup and enhancements, adding in note regarding ESP-IDF Version
* Support for SEGGER embOS and emNET
* Fix to handle WOLFSSL_DTLS macro in Micrium build
### Build Options
* Support for verify only and no-PSS builds updated
* Add the enable options wolfssh (mapped to the existing enable-ssh)
* Remove WOLFSSL_ALT_NAMES restriction on notBefore/notAfter use in Cert struct
* Move several more definitions outside the BUILDING_WOLFSSL gate with linux kernel module build
* Modify --enable-openssh to not enable non-FIPS algos for FIPS builds
* Remove the Python wrappers from wolfSSL source (use pip install instead of using wolfSSL with Python and our separate Python repository)
* Add --enable-openldap option to configure.ac for building the OpenLDAP port
* Resolve DTLS build to handle not having enable-hrrcookie when not needed
* Add an --enable-strongswan option to configure.ac for building the Strongswan port
* Improve defaults for 64-bit BSDs in configure
* Crypto only build can now be used openssl extra
* Update ASN template build to properly handle WOLFSSL_CERT_EXT and HAVE_OID_ENCODING
* Allow using 3DES and MD5 with FIPS 140-3, as they fall outside of the FIPS boundary
* Add the build option --enable-dh=const which replaces setting the macro WOLFSSL_DH_CONST and now conditionally link to -lm as needed
* Add the macro WOLFSSL_HOSTNAME_VERIFY_ALT_NAME_ONLY which is used to verify hostname/ip address using alternate name (SAN) only and does not use the common name
* WOLFSSL_DTLS_NO_HVR_ON_RESUME macro added (off by default to favor more security). If defined, a DTLS server will not do a cookie exchange on successful client resumption: the resumption will be faster (one RTT less) and will consume less bandwidth (one ClientHello and one HelloVerifyRequest less). On the other hand, if a valid SessionID is collected, forged clientHello messages will consume resources on the server.
* Misc.
* Refactoring of some internal TLS functions to reduce the memory usage
* Make old less secure TimingPadVerify implementation available
* Add support for aligned data with clang LLVM
* Remove subject/issuer email from the list of alt. Email names in the DecodedCerts struct
* Zeroizing of pre-master secret buffer in TLS 1.3
* Update to allow TLS 1.3 application server to send session ticket
* Improve the sniffer asynchronous test case to support multiple concurrent streams
* Clean up wolfSSL_clear() and add more logging
* Update to not error out on bad CRL next date if using NO_VERIFY when parsing
* Add an example C# PSK client
* Add ESP-IDF WOLFSSL_ESP8266 setting for ESP8266 devices
* Support longer sigalg list for post quantum use cases and inter-op with OQS's OpenSSL fork
* Improve AES-GCM word implementation of GMULT to be constant time
* Additional sanity check with Ed25519/Ed448, now defaults to assume public key is not trusted
* Support PSK ciphersuites in benchmark apps
* FIPS in core hash using SHA2-256 and SHA2-384
* Add ability to store issuer name components when parsing a certificate
* Make the critical extension flags in DecodedCert always available
* Updates to the default values for basic constraint with X509s
* Support using RSA OAEP with no malloc and add additional sanity checks
* Leverage async code paths to support WANT_WRITE while sending packet fragments
* New azsphere example for continuous integration testing
* Update RSA key generation function to handle pairwise consistency tests with static memory pools used
* Resolve build time warning by passing in and checking output length with internal SetCurve function
* Support DTLS bidirectional shutdown in the examples
* Improve DTLS version negotiation and downgrade capability
### General Fixes
* Fixes for STM32 Hash/PKA, add some missing mutex frees, and add an additional benchmark
* Fix missing return checks in KSDK ED25519 code
* Fix compilation warnings from IAR
* Fixes for STM32U5/H7 hash/crypto support
* Fix for using track memory feature with FreeRTOS
* Fixup XSTR processing for MICRIUM
* Update Zephyr fs.h path
* DTLS fixes with WANT_WRITE simulations
* Fixes for BER use with PKCS7 to have additional sanity checks and guards on edge cases
* Fix to handle exceptional edge case with TFM mp_exptmod_ex
* Fix for stack and heap measurements of a 32-bit build
* Fix to allow enabling AES key wrap (direct) with KCAPI
* Fix --enable-openssh FIPS detection syntax in configure.ac
* Fix to move wolfSSL_ERR_clear_error outside gate for OPENSSL_EXTRA
* Remove MCAPI project's dependency on zlib version
* Only use __builtin_offset on supported GCC versions (4+)
* Fix for c89 builds with using WOLF_C89
* Fix 64bit postfix for constants building with powerpc
* Fixed async Sniffer with TLS v1.3, async removal of `WC_HW_WAIT_E` and sanitize leak
* Fix for QAT ECC to gate use of HW based on marker
* Fix the supported version extension to always check minDowngrade
* Fix for TLS v1.1 length sanity check for large messages
* Fixes for loading a long DER/ASN.1 certificate chain
* Fix to expose the RSA public DER export functions with certgen
* Fixes for building with small version of SHA3
* Fix configure with WOLFSSL_WPAS_SMALL
* Fix to free PKCS7 recipient list in error cases
* Sanity check to confirm ssl->hsHashes is not NULL before attempting to dereference it
* Clear the leftover byte count in Aes struct when setting IV
# wolfSSL Release 5.3.0 (May 3rd, 2022)
Release 5.3.0 of wolfSSL embedded TLS has bug fixes and new features including:

25
Docker/Dockerfile Normal file
View File

@ -0,0 +1,25 @@
ARG DOCKER_BASE_IMAGE=ubuntu:22.04
FROM $DOCKER_BASE_IMAGE
USER root
ARG DEPS_WOLFSSL="build-essential autoconf libtool clang clang-tools zlib1g-dev libuv1-dev libpam0g-dev valgrind git linux-headers-generic gcc-multilib g++-multilib libpcap-dev bubblewrap gdb iputils-ping lldb bsdmainutils netcat binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu"
ARG DEPS_LIBOQS="astyle cmake gcc ninja-build libssl-dev python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml valgrind git"
ARG DEPS_TESTS="abi-dumper libcurl4-openssl-dev tcpdump"
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y apt-utils \
&& apt install -y ${DEPS_WOLFSSL} ${DEPS_LIBOQS} ${DEPS_TESTS} \
&& apt clean -y && rm -rf /var/lib/apt/lists/*
ARG USER=docker
ARG UID=1000
ARG GID=1000
RUN groupadd -f -g ${GID} docker && ( getent passwd ${UID} || useradd -ms /bin/bash ${USER} -u ${UID} -g ${GID} )
# install liboqs
RUN git clone --single-branch https://github.com/open-quantum-safe/liboqs.git && cd liboqs && git checkout af76ca3b1f2fbc1f4f0967595f3bb07692fb3d82 \
&& mkdir build && cd build && cmake -DOQS_DIST_BUILD=ON -DOQS_USE_CPUFEATURE_INSTRUCTIONS=OFF -DOQS_USE_OPENSSL=0 .. && make -j8 all && make install && cd ../.. && rm -rf liboqs
# Allow non-root to use tcpdump (will need NET_RAW and NET_ADMIN capability when running the container)
RUN setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/tcpdump
USER ${UID}:${GID}

12
Docker/OpenWrt/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
# This Dockerfile is used in conjunction with the docker-OpenWrt.yml GitHub Action.
ARG DOCKER_BASE_CONTAINER=openwrt/rootfs:x86-64-snapshot
FROM $DOCKER_BASE_CONTAINER
RUN mkdir -p /var/lock # Fix for parent container
COPY libwolfssl.so /tmp/libwolfssl.so
RUN export LIBWOLFSSL=$(ls /usr/lib/libwolfssl.so.* -1); \
rm ${LIBWOLFSSL} && ln -s /tmp/libwolfssl.so ${LIBWOLFSSL}
# for debugging purposes to make sure the correct library is tested
RUN ls -Ll /usr/lib/libwolfssl* && ldd /lib/libustream-ssl.so | grep wolfssl
COPY runTests.sh /tmp/.
RUN /tmp/runTests.sh

13
Docker/OpenWrt/README.md Normal file
View File

@ -0,0 +1,13 @@
This container is really only useful in conjunction with the GitHub Workflow
found in .github/workflows/docker-OpenWrt.yml. The idea is that we will
compile a new libwolfssl that gets placed in official OpenWrt containers to
run some tests ensuring the library is still compatible with existing
binaries.
To run the test locally, build libwolfssl.so (or download from the GitHub Action)
and put it in Docker/OpenWrt. Then switch to that folder and run:
docker build -t openwrt --build-args DOCKER_BASE_CONTAINER=<openwrtContainer> .
where 'openwrtContainer' => "openwrt/rootfs:x86-64-22.03-SNAPSHOT" or similar
This should run some sample tests. The resulting container then can be used to
evaluate OpenWrt with the latest wolfSSL library.

23
Docker/OpenWrt/runTests.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
runCMD() { # usage: runCMD "<command>" "<retVal>"
eval $1 >/dev/null 2>&1
RETVAL=$?
if [ "$RETVAL" != "$2" ]; then
echo "Command ($1) returned ${RETVAL}, but expected $2. Rerunning with output to terminal:"
eval $1
exit 1
fi
}
# Successful tests
runCMD "ldd /lib/libustream-ssl.so" 0
runCMD "opkg update" 0
runCMD "uclient-fetch -O /dev/null 'https://letsencrypt.org'" 0
# Negative tests
runCMD "uclient-fetch --ca-certificate=/dev/null -O /dev/null 'https://letsencrypt.org'" 5
runCMD "uclient-fetch -O /dev/null 'https://self-signed.badssl.com/'" 5
runCMD "uclient-fetch -O /dev/null 'https://untrusted-root.badssl.com/'" 5
runCMD "uclient-fetch -O /dev/null 'https://expired.badssl.com/'" 5
echo "All tests passed."

13
Docker/README.md Normal file
View File

@ -0,0 +1,13 @@
# Overview
This is a simple Docker environment for compiling and running WolfSSL. Use `run.sh` to build everything (Docker container, WolfSSL, etc.). This script takes in arguments that can be passed to `./configure`. For example: `run.sh --enable-all`
When the compilation and tests succeed, you will be dropped in to a shell environment within the container. This can be useful to build other things within the environment.
# FAQ
## permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
You need to be added to the `docker` group to run Docker containers. Run `sudo usermod -aG docker $USER`. You may need to restart the Docker daemon.
## Unable to access symlinked files outside of WolfSSL
The volume mounted in the Docker container needs to have all files that your compilation will need. To solve this, you have a couple options:
1. Change the `WOLFSSL_DIR` variable in the `run.sh` to one higher up (by adding `/..` to the path). Then update the `docker build` to include the correct path to the Dockerfile and the `docker run` argument to the working directory (`-w`) to the WolfSSL source directory
2. Move the external repository to within the WolfSSL directory. For example create an `external` folder which has your files. This route may have complications when stashing Git work.

11
Docker/include.am Normal file
View File

@ -0,0 +1,11 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= Docker/Dockerfile
EXTRA_DIST+= Docker/run.sh
EXTRA_DIST+= Docker/README.md
ignore_files+=Docker/OpenWRT/Dockerfile
ignore_files+=Docker/OpenWRT/runTests.sh
ignore_files+=Docker/OpenWRT/README.md

14
Docker/run.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
echo "Running with \"${*}\"..."
# Assume we're in wolfssl/Docker
WOLFSSL_DIR=$(builtin cd ${BASH_SOURCE%/*}/..; pwd)
docker build -t wolfssl --build-arg UID=$(id -u) --build-arg GID=$(id -g) "${WOLFSSL_DIR}/Docker" && \
docker run --rm -it -v ${HOME}/.gitconfig:/home/docker/.gitconfig:ro -v ${HOME}/.ssh:/home/docker/.ssh:ro -v "${WOLFSSL_DIR}:/tmp/wolfssl" -w /tmp/wolfssl wolfssl /bin/bash -c "./autogen.sh && ./configure ${*@Q} && make" && \
docker run --rm -it -v ${HOME}/.gitconfig:/home/docker/.gitconfig:ro -v ${HOME}/.ssh:/home/docker/.ssh:ro -v "${WOLFSSL_DIR}:/tmp/wolfssl" -w /tmp/wolfssl wolfssl /bin/bash
exitval=$?
echo "Exited with error code $exitval"
exit $exitval

26
Docker/wolfCLU/Dockerfile Normal file
View File

@ -0,0 +1,26 @@
ARG DOCKER_BASE_IMAGE=ubuntu
FROM ubuntu as BUILDER
ARG DEPS_WOLFSSL="build-essential autoconf libtool zlib1g-dev libuv1-dev libpam0g-dev git libpcap-dev libcurl4-openssl-dev bsdmainutils netcat iputils-ping bubblewrap"
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y apt-utils \
&& apt install -y ${DEPS_WOLFSSL} ${DEPS_LIBOQS} \
&& apt clean -y && rm -rf /var/lib/apt/lists/*
ARG NUM_CPU=16
# This arg is to force a rebuild starting from this line
ARG DUMMY=date
# install wolfssl
RUN DUMMY=${DUMMY} git clone --depth=1 --single-branch --branch=master http://github.com/wolfssl/wolfssl && cd wolfssl && ./autogen.sh && ./configure --enable-all && make -j $NUM_CPU && make install && ldconfig
# install wolfCLU
RUN git clone --depth=1 --single-branch --branch=main http://github.com/wolfssl/wolfCLU && cd wolfCLU && ./autogen.sh && ./configure && make -j $NUM_CPU && make install
FROM ${DOCKER_BASE_IMAGE}
USER root
COPY --from=BUILDER /usr/local/lib/libwolfssl.so /usr/local/lib/
COPY --from=BUILDER /usr/local/bin/wolfssl* /usr/local/bin/
RUN ldconfig
CMD ["/usr/local/bin/wolfssl"]
LABEL org.opencontainers.image.source=https://github.com/wolfssl/wolfssl
LABEL org.opencontainers.image.description="Simple wolfCLU in a container"

10
Docker/wolfCLU/README.md Normal file
View File

@ -0,0 +1,10 @@
This is a small container that has wolfCLU installed for quick access. To build your own run the following:
```
docker build --pull --build-arg DUMMY=$(date +%s) -t wolfclu .
```
To run the container, you can use:
```
docker run -it --rm -v $(pwd):/ws -w /ws wolfclu version
```
This command will allow you to use the certs/keys in your local directory.

View File

@ -1,6 +1,6 @@
/* wolfssl_client.ino
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wolfssl_server.ino
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

153
IDE/AURIX/Cpu0_Main.c Normal file
View File

@ -0,0 +1,153 @@
/* Cpu0_Main.c
*
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* Infineon includes */
#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "IfxAsclin_Asc.h"
#include "IfxCpu_Irq.h"
#include "IfxPort.h"
#include "SysSe/Bsp/Bsp.h"
/* For mapping stdio printf */
#include <stdio.h>
#include <string.h>
/* used to wait for CPU sync event */
IFX_ALIGN(4) IfxCpu_syncEvent g_cpuSyncEvent = 0;
#define SERIAL_BAUDRATE 115200 /* Baud rate in bit/s */
#define SERIAL_PIN_RX IfxAsclin0_RXA_P14_1_IN /* RX pin of the board */
#define SERIAL_PIN_TX IfxAsclin0_TX_P14_0_OUT /* TX pin of the board */
#define INTPRIO_ASCLIN0_TX 19 /* Priority of the ISR */
#define ASC_TX_BUFFER_SIZE 128 /* Definition of the buffer size */
/* Declaration of the ASC handle */
static IfxAsclin_Asc g_asc;
/* Declaration of the FIFOs parameters:
* The transfer buffers allocate memory for the data itself and for FIFO runtime
* variables. 8 more bytes have to be added to ensure a proper circular buffer
* handling independent from the address to which the buffers have been located.
*/
static uint8 g_ascTxBuffer[ASC_TX_BUFFER_SIZE + sizeof(Ifx_Fifo) + 8];
/******************************************************************************/
/*----Function Implementations------------------------------------------------*/
/******************************************************************************/
/* Re-target the C library printf function to the asc lin. */
int fputc(int ch, FILE *f)
{
Ifx_SizeT count;
/* convert to CRLF */
if (ch == (int)'\n') {
int chcr = (int)'\r';
count = 1;
IfxAsclin_Asc_write(&g_asc, &chcr, &count, TIME_INFINITE);
}
count = 1;
IfxAsclin_Asc_write(&g_asc, &ch, &count, TIME_INFINITE);
return ch;
}
/* Add the Interrupt Service Routine */
IFX_INTERRUPT(asclin0_Tx_ISR, 0, INTPRIO_ASCLIN0_TX);
void asclin0_Tx_ISR(void)
{
IfxAsclin_Asc_isrTransmit(&g_asc);
}
static void init_UART(void)
{
IfxAsclin_Asc_Config ascConfig;
IfxCpu_Irq_installInterruptHandler(asclin0_Tx_ISR, INTPRIO_ASCLIN0_TX);
/* Port pins configuration */
const IfxAsclin_Asc_Pins pins = {
NULL_PTR, IfxPort_InputMode_pullUp, /* CTS pin not used */
&SERIAL_PIN_RX, IfxPort_InputMode_pullUp, /* RX pin */
NULL_PTR, IfxPort_OutputMode_pushPull, /* RTS pin not used */
&SERIAL_PIN_TX, IfxPort_OutputMode_pushPull, /* TX pin */
IfxPort_PadDriver_cmosAutomotiveSpeed1
};
/* Initialize an instance of IfxAsclin_Asc_Config with default values */
IfxAsclin_Asc_initModuleConfig(&ascConfig, SERIAL_PIN_TX.module);
/* Set the desired baud rate */
ascConfig.baudrate.baudrate = SERIAL_BAUDRATE;
/* ISR priorities and interrupt target */
ascConfig.interrupt.txPriority = INTPRIO_ASCLIN0_TX;
ascConfig.interrupt.typeOfService = IfxCpu_Irq_getTos(IfxCpu_getCoreIndex());
/* FIFO configuration */
ascConfig.txBuffer = &g_ascTxBuffer;
ascConfig.txBufferSize = ASC_TX_BUFFER_SIZE;
ascConfig.pins = &pins;
/* Initialize module with above parameters */
IfxAsclin_Asc_initModule(&g_asc, &ascConfig);
/* Turn off buffers, so I/O occurs immediately */
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
}
int send_UART(const char* str)
{
Ifx_SizeT count = (Ifx_SizeT)strlen(str);
IfxAsclin_Asc_write(&g_asc, str, &count, TIME_INFINITE);
return (int)count;
}
void core0_main(void)
{
IfxCpu_enableInterrupts();
/* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
* Enable the watchdogs and service them periodically if it is required
*/
IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
/* Wait for CPU sync event */
IfxCpu_emitEvent(&g_cpuSyncEvent);
IfxCpu_waitEvent(&g_cpuSyncEvent, 1);
/* Initialize the UART to board VCOM */
init_UART();
/* bare metal loop */
while(1)
{
extern void run_wolf_tests(void);
run_wolf_tests();
/* wait 5 seconds */
waitTime(IfxStm_getTicksFromMilliseconds(BSP_DEFAULT_TIMER, 5 * 1000));
} /* while */
}

114
IDE/AURIX/README.md Normal file
View File

@ -0,0 +1,114 @@
# Infineon AURIX Development Studio
An Eclipse based IDE for developing software for the Infineon TriCore AURIX TX3XX.
Tested Platform:
* Infineon AURIX™ Development Studio 1.7.2 (Build 20220617-0730)
* Infineon TriBoard TC399 v2.0
* wolfSSL v5.4.0 (with PR 5419)
## Running wolfCrypt on TriCore
1) Add the wolfSSL source and headers to `Libraries/wolfssl`.
- Only the following folders are required: `src`, `wolfcrypt` and `wolfssl`.
- See script to help with producing bundle here: https://github.com/wolfSSL/wolfssl/blob/master/scripts/makedistsmall.sh
2) Add `WOLFSSL_USER_SETTINGS` to the Preprocessing symbols list. C/C++ Build -> Settings -> TASKING C/C++ Compiler -> Preprocessing.
3) Add `Libraries/wolfssl` to the include path. C/C++ General -> Paths and Symbols -> Includes -> GNU C
4) Add ignores for the following warnings. Unused static function (553) and switch missing break (536). C/C++ Build -> Settings -> TASKING C/C++ Compiler -> Diagnostics
5) Copy `Cpu0_Main.c`, `user_settings.h` and `wolf_main.c` into the project folder.
6) Increase the stack by modifying `Lcf_Tasking_Tricore_Tc.lsl` to adjusting the USTACK0-4 (`LCF_USTACK#_SIZE`) from 2k to 12k.
6) Build and run/debug.
### Example output from wolfCrypt test and benchmark
Benchmark Configuration:
* TriCore (TC1.6.2P) 32-bit super-scalar running at 300MHz:
* Release build: `-O2`
* SP Math SMALL: sp_c32.c for RSA/ECC/DH
* AES GCM SMALL
```
Running wolfCrypt Tests...
------------------------------------------------------------------------------
wolfSSL version 5.4.0
------------------------------------------------------------------------------
error test passed!
MEMORY test passed!
base64 test passed!
asn test passed!
RANDOM test passed!
SHA test passed!
SHA-256 test passed!
Hash test passed!
HMAC-SHA test passed!
HMAC-SHA256 test passed!
HMAC-KDF test passed!
TLSv1.3 KDF test passed!
GMAC test passed!
Chacha test passed!
POLY1305 test passed!
ChaCha20-Poly1305 AEAD test passed!
AES test passed!
AES192 test passed!
AES256 test passed!
AES-GCM test passed!
RSA test passed!
ECC test passed!
ECC buffer test passed!
CMAC test passed!
logging test passed!
time test passed!
mutex test passed!
memcb test passed!
Test complete
Crypt Test: Return code 0
Running wolfCrypt Benchmarks...
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG 725 KB took 1.023 seconds, 708.703 KB/s
AES-128-CBC-enc 2 MB took 1.002 seconds, 2.071 MB/s
AES-128-CBC-dec 2 MB took 1.005 seconds, 2.065 MB/s
AES-192-CBC-enc 2 MB took 1.002 seconds, 1.779 MB/s
AES-192-CBC-dec 2 MB took 1.013 seconds, 1.783 MB/s
AES-256-CBC-enc 2 MB took 1.003 seconds, 1.558 MB/s
AES-256-CBC-dec 2 MB took 1.009 seconds, 1.573 MB/s
AES-128-GCM-enc 225 KB took 1.013 seconds, 222.112 KB/s
AES-128-GCM-dec 225 KB took 1.014 seconds, 221.892 KB/s
AES-192-GCM-enc 225 KB took 1.046 seconds, 215.107 KB/s
AES-192-GCM-dec 225 KB took 1.046 seconds, 215.104 KB/s
AES-256-GCM-enc 225 KB took 1.070 seconds, 210.279 KB/s
AES-256-GCM-dec 225 KB took 1.069 seconds, 210.477 KB/s
GMAC Small 251 KB took 1.000 seconds, 251.000 KB/s
AES-128-ECB-enc 2 MB took 1.000 seconds, 2.000 MB/s
AES-128-ECB-dec 2 MB took 1.000 seconds, 2.049 MB/s
AES-192-ECB-enc 2 MB took 1.000 seconds, 1.727 MB/s
AES-192-ECB-dec 2 MB took 1.000 seconds, 1.772 MB/s
AES-256-ECB-enc 2 MB took 1.000 seconds, 1.518 MB/s
AES-256-ECB-dec 2 MB took 1.000 seconds, 1.563 MB/s
CHACHA 3 MB took 1.007 seconds, 3.322 MB/s
CHA-POLY 2 MB took 1.011 seconds, 2.028 MB/s
POLY1305 6 MB took 1.003 seconds, 6.012 MB/s
SHA 3 MB took 1.004 seconds, 3.380 MB/s
SHA-256 2 MB took 1.003 seconds, 1.558 MB/s
AES-128-CMAC 2 MB took 1.010 seconds, 2.055 MB/s
AES-256-CMAC 2 MB took 1.010 seconds, 1.547 MB/s
HMAC-SHA 3 MB took 1.004 seconds, 3.356 MB/s
HMAC-SHA256 2 MB took 1.010 seconds, 1.547 MB/s
RSA 2048 public 50 ops took 1.020 sec, avg 20.400 ms, 49.019 ops/sec
RSA 2048 private 2 ops took 2.377 sec, avg 1188.492 ms, 0.841 ops/sec
ECC [ SECP256R1] 256 key gen 16 ops took 1.061 sec, avg 66.313 ms, 15.080 ops/sec
ECDHE [ SECP256R1] 256 agree 16 ops took 1.059 sec, avg 66.187 ms, 15.109 ops/sec
ECDSA [ SECP256R1] 256 sign 14 ops took 1.058 sec, avg 75.570 ms, 13.233 ops/sec
ECDSA [ SECP256R1] 256 verify 8 ops took 1.080 sec, avg 135.002 ms, 7.407 ops/sec
Benchmark complete
Benchmark Test: Return code 0
```
## Running wolfCrypt on the HSM (Cortex M3)
Coming soon
## Support
For questions please email facts@wolfssl.com

8
IDE/AURIX/include.am Normal file
View File

@ -0,0 +1,8 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= IDE/AURIX/Cpu0_Main.c
EXTRA_DIST+= IDE/AURIX/README.md
EXTRA_DIST+= IDE/AURIX/user_settings.h
EXTRA_DIST+= IDE/AURIX/wolf_main.c

461
IDE/AURIX/user_settings.h Normal file
View File

@ -0,0 +1,461 @@
/* user_settings.h
*
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* Template for the Infineon AURIX Development Studio and TC3XX
* Example wolfSSL user settings with #if 0/1 gates to enable/disable algorithms and features.
* This file is included with wolfssl/wolfcrypt/settings.h when WOLFSSL_USER_SETTINGS is defined.
*/
#ifndef WOLFSSL_USER_SETTINGS_H
#define WOLFSSL_USER_SETTINGS_H
#ifdef __cplusplus
extern "C" {
#endif
/* ------------------------------------------------------------------------- */
/* Platform */
/* ------------------------------------------------------------------------- */
/* Alignment and sizeof 64-bit */
#define WOLFSSL_GENERAL_ALIGNMENT 4
#define SIZEOF_LONG_LONG 8
/* disable threading - mutex locking */
#define SINGLE_THREADED
/* ignore file include warnings */
#define WOLFSSL_IGNORE_FILE_WARN
/* disable the built-in socket support and use the IO callbacks.
* Set with wolfSSL_CTX_SetIORecv/wolfSSL_CTX_SetIOSend
*/
#define WOLFSSL_USER_IO
/* Disable file system */
#define NO_FILESYSTEM
/* ------------------------------------------------------------------------- */
/* Port */
/* ------------------------------------------------------------------------- */
/* Override Current Time */
/* Allows custom "custom_time()" function to be used for benchmark */
#define WOLFSSL_USER_CURRTIME
#define WOLFSSL_GMTIME
#define USER_TICKS
extern unsigned long my_time(unsigned long* timer);
#define XTIME my_time
/* Use built-in P-RNG (SHA256 based) with HW RNG */
#undef HAVE_HASHDRBG
#define HAVE_HASHDRBG
/* Custom Seed Source */
#define CUSTOM_RAND_TYPE unsigned int
extern unsigned int my_rng_seed_gen(void);
#undef CUSTOM_RAND_GENERATE
#define CUSTOM_RAND_GENERATE my_rng_seed_gen
/* Standard Lib - C89 */
#define XSTRCASECMP(s1,s2) strcmp((s1),(s2))
/* ------------------------------------------------------------------------- */
/* Math Configuration */
/* ------------------------------------------------------------------------- */
#undef USE_FAST_MATH
#undef WOLFSSL_SP
#if 1
/* Wolf Single Precision Math */
#define WOLFSSL_HAVE_SP_RSA
//#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_4096 /* Enable RSA/RH 4096-bit support */
#define WOLFSSL_SP_384 /* Enable ECC 384-bit SECP384R1 support */
#define WOLFSSL_SP_MATH /* only SP math - disables integer.c/tfm.c */
//#define WOLFSSL_SP_MATH_ALL /* use SP math for all key sizes and curves */
#define WOLFSSL_SP_NO_MALLOC
//#define WOLFSSL_SP_DIV_32 /* do not use 64-bit divides */
//#define WOLFSSL_SP_CACHE_RESISTANT
/* use smaller version of code */
#define WOLFSSL_SP_SMALL
/* SP Assembly Speedups - specific to chip type */
//#define WOLFSSL_SP_ASM
//#define WOLFSSL_SP_ARM32_ASM
//#define WOLFSSL_SP_ARM64_ASM
//#define WOLFSSL_SP_ARM_THUMB_ASM
//#define WOLFSSL_SP_ARM_CORTEX_M_ASM
#endif
#ifndef WOLFSSL_SP_MATH
#if 0
/* fast math (tfmc.) (stack based and timing resistant) */
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#else
/* normal heap based integer.c (not timing resistant) */
#define USE_INTEGER_HEAP_MATH
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Crypto */
/* ------------------------------------------------------------------------- */
/* RSA */
#undef NO_RSA
#if 1
#ifdef USE_FAST_MATH
/* Maximum math bits (Max RSA key bits * 2) */
#define FP_MAX_BITS 4096
#endif
/* half as much memory but twice as slow */
//#define RSA_LOW_MEM
/* Enables blinding mode, to prevent timing attacks */
#define WC_RSA_BLINDING
/* RSA PSS Support */
#define WC_RSA_PSS
#else
#define NO_RSA
#endif
/* DH */
#undef NO_DH
#if 0
/* Use table for DH instead of -lm (math) lib dependency */
#if 1
#define WOLFSSL_DH_CONST
#define HAVE_FFDHE_2048
//#define HAVE_FFDHE_4096
//#define HAVE_FFDHE_6144
//#define HAVE_FFDHE_8192
#endif
#else
#define NO_DH
#endif
/* ECC */
#undef HAVE_ECC
#if 1
#define HAVE_ECC
/* Manually define enabled curves */
#define ECC_USER_CURVES
#ifdef ECC_USER_CURVES
/* Manual Curve Selection */
//#define HAVE_ECC192
//#define HAVE_ECC224
#undef NO_ECC256
#define HAVE_ECC384
//#define HAVE_ECC521
#endif
/* Fixed point cache (speeds repeated operations against same private key) */
//#define FP_ECC
#ifdef FP_ECC
/* Bits / Entries */
#define FP_ENTRIES 2
#define FP_LUT 4
#endif
/* Optional ECC calculation method */
/* Note: doubles heap usage, but slightly faster */
#define ECC_SHAMIR
/* Reduces heap usage, but slower */
#define ECC_TIMING_RESISTANT
/* Compressed ECC Key Support */
//#define HAVE_COMP_KEY
/* Use alternate ECC size for ECC math */
#ifdef USE_FAST_MATH
/* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
#if defined(NO_RSA) && defined(NO_DH)
/* Custom fastmath size if not using RSA/DH */
#define FP_MAX_BITS (256 * 2)
#else
/* use heap allocation for ECC points */
#define ALT_ECC_SIZE
/* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overriden */
//#define FP_MAX_BITS_ECC (256 * 2)
#endif
/* Speedups specific to curve */
#ifndef NO_ECC256
#define TFM_ECC256
#endif
#endif
#endif
/* AES */
#undef NO_AES
#if 1
#define HAVE_AES_CBC
/* GCM Method: GCM_TABLE_4BIT, GCM_SMALL, GCM_WORD32 or GCM_TABLE */
#define HAVE_AESGCM
#define GCM_SMALL
#define WOLFSSL_AES_DIRECT
#define HAVE_AES_ECB
#else
#define NO_AES
#endif
/* DES3 */
#undef NO_DES3
#if 0
#else
#define NO_DES3
#endif
/* ChaCha20 / Poly1305 */
#undef HAVE_CHACHA
#undef HAVE_POLY1305
#if 1
#define HAVE_CHACHA
#define HAVE_POLY1305
/* Needed for Poly1305 */
#define HAVE_ONE_TIME_AUTH
#endif
/* Ed25519 / Curve25519 */
#undef HAVE_CURVE25519
#undef HAVE_ED25519
#if 0
#define HAVE_CURVE25519
#define HAVE_ED25519 /* ED25519 Requires SHA512 */
/* Optionally use small math (less flash usage, but much slower) */
#if 1
#define CURVED25519_SMALL
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Hashing */
/* ------------------------------------------------------------------------- */
/* Sha */
#undef NO_SHA
#if 1
/* on by default */
/* 1k smaller, but 25% slower */
//#define USE_SLOW_SHA
#else
#define NO_SHA
#endif
/* Sha256 */
#undef NO_SHA256
#if 1
/* not unrolled - ~2k smaller and ~25% slower */
//#define USE_SLOW_SHA256
/* Sha224 */
#if 0
#define WOLFSSL_SHA224
#endif
#else
#define NO_SHA256
#endif
/* Sha512 */
#undef WOLFSSL_SHA512
#if 0
#define WOLFSSL_SHA512
/* Sha384 */
#undef WOLFSSL_SHA384
#if 0
#define WOLFSSL_SHA384
#endif
/* over twice as small, but 50% slower */
//#define USE_SLOW_SHA512
#endif
/* Sha3 */
#undef WOLFSSL_SHA3
#if 0
#define WOLFSSL_SHA3
#endif
/* MD5 */
#undef NO_MD5
#if 0
/* on by default */
#else
#define NO_MD5
#endif
/* HKDF */
#undef HAVE_HKDF
#if 1
#define HAVE_HKDF
#endif
/* CMAC */
#undef WOLFSSL_CMAC
#if 1
#define WOLFSSL_CMAC
/* Note: requires WOLFSSL_AES_DIRECT */
#endif
/* HMAC - on by default */
#undef NO_HMAC
#if 1
/* on by default */
#else
#define NO_HMAC
#endif
/* ------------------------------------------------------------------------- */
/* ASN */
/* ------------------------------------------------------------------------- */
#if 0
/* Use the newer ASN template code */
#define WOLFSSL_ASN_TEMPLATE
//#define WOLFSSL_CUSTOM_OID
//#define HAVE_OID_ENCODING
//#define HAVE_OID_DECODING
#else
/* Use the original custom ASN code */
#endif
/* Optionally disable time checking for ASN */
//#define NO_ASN_TIME
/* ------------------------------------------------------------------------- */
/* Benchmark / Test */
/* ------------------------------------------------------------------------- */
/* Use reduced benchmark / test sizes */
#define BENCH_EMBEDDED
/* Use test buffers from array (not filesystem) */
#ifndef NO_FILESYSTEM
#define USE_CERT_BUFFERS_256
#define USE_CERT_BUFFERS_2048
#endif
/* ------------------------------------------------------------------------- */
/* Debugging */
/* ------------------------------------------------------------------------- */
#undef DEBUG_WOLFSSL
#undef NO_ERROR_STRINGS
#if 0
#define DEBUG_WOLFSSL
#define WOLFSSL_LOG_PRINTF
#else
#if 0
#define NO_ERROR_STRINGS
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Memory */
/* ------------------------------------------------------------------------- */
#if 0
/* Static memory requires fast math or SP math with no malloc */
#define WOLFSSL_STATIC_MEMORY
/* Disable fallback malloc/free */
#define WOLFSSL_NO_MALLOC
#if 1
#define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Enable Features */
/* ------------------------------------------------------------------------- */
#define WOLFSSL_TLS13
#define WOLFSSL_OLD_PRIME_CHECK /* Use faster DH prime checking */
#define HAVE_TLS_EXTENSIONS
#define HAVE_SUPPORTED_CURVES
#define WOLFSSL_BASE64_ENCODE
//#define WOLFSSL_KEY_GEN /* For RSA Key gen only */
//#define KEEP_PEER_CERT
//#define HAVE_COMP_KEY
/* TLS Session Cache */
#if 0
#define SMALL_SESSION_CACHE
#else
#define NO_SESSION_CACHE
#endif
/* ------------------------------------------------------------------------- */
/* Disable Features */
/* ------------------------------------------------------------------------- */
//#define NO_WOLFSSL_SERVER
//#define NO_WOLFSSL_CLIENT
//#define NO_CRYPT_TEST
//#define NO_CRYPT_BENCHMARK
//#define WOLFCRYPT_ONLY
/* In-lining of misc.c functions */
/* If defined, must include wolfcrypt/src/misc.c in build */
/* Slower, but about 1k smaller */
//#define NO_INLINE
#define NO_WRITEV
#define NO_MAIN_DRIVER
//#define NO_DEV_RANDOM
#define NO_OLD_TLS
#define NO_PSK
#define NO_DSA
#define NO_RC4
#define NO_MD4
#define NO_PWDBASED
//#define NO_CODING
//#define NO_CERTS
//#define NO_SIG_WRAPPER
#ifdef __cplusplus
}
#endif
#endif /* WOLFSSL_USER_SETTINGS_H */

150
IDE/AURIX/wolf_main.c Normal file
View File

@ -0,0 +1,150 @@
/* wolf_main.c
*
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* wolfSSL includes */
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/random.h> /* for CUSTOM_RAND_TYPE */
#include <wolfcrypt/test/test.h>
#include <wolfcrypt/benchmark/benchmark.h>
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
/* Infineon Includes */
#include "Ifx_Types.h"
#include "IfxStm.h"
extern int send_UART(const char* str);
static void my_logging_cb(const int logLevel, const char *const logMessage)
{
send_UART(logMessage);
send_UART("\r\n");
(void)logLevel; /* not used */
}
/* TIME CODE */
/* Optionally you can define NO_ASN_TIME to disable all cert time checks */
static int hw_get_time_sec(void)
{
/* get time in seconds */
return IfxStm_get(&MODULE_STM0) / IfxStm_getFrequency(&MODULE_STM0);
}
/* This is used by wolfCrypt asn.c for cert time checking */
unsigned long my_time(unsigned long* timer)
{
(void)timer;
return hw_get_time_sec();
}
#ifndef WOLFCRYPT_ONLY
/* This is used by TLS only */
unsigned int LowResTimer(void)
{
return hw_get_time_sec();
}
#endif
#ifndef NO_CRYPT_BENCHMARK
/* This is used by wolfCrypt benchmark tool only */
double current_time(int reset)
{
double timeNow;
uint64_t timeMs, ticks = IfxStm_get(&MODULE_STM0);
(void)reset;
timeMs = ticks / (IfxStm_getFrequency(&MODULE_STM0) / 1000);
timeNow = (timeMs / 1000); // sec
timeNow += (double)(timeMs % 1000) / 1000; // ms
return timeNow;
}
#endif
/* RNG CODE */
/* TODO: Implement real RNG */
static unsigned int gCounter;
unsigned int hw_rand(void)
{
//#warning Must implement your own random source
return ++gCounter;
}
unsigned int my_rng_seed_gen(void)
{
return hw_rand();
}
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
void run_wolf_tests(void)
{
func_args args;
#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif
wolfSSL_SetLoggingCb(my_logging_cb);
/* initialize wolfSSL */
#ifdef WOLFCRYPT_ONLY
wolfCrypt_Init();
#else
wolfSSL_Init();
#endif
memset(&args, 0, sizeof(args));
args.return_code = NOT_COMPILED_IN; /* default */
printf("Running wolfCrypt Tests...\n");
#ifndef NO_CRYPT_TEST
args.return_code = 0;
wolfcrypt_test(&args);
printf("Crypt Test: Return code %d\n", args.return_code);
#else
args.return_code = NOT_COMPILED_IN;
#endif
printf("Running wolfCrypt Benchmarks...\n");
#ifndef NO_CRYPT_BENCHMARK
args.return_code = 0;
benchmark_test(&args);
#else
args.return_code = NOT_COMPILED_IN;
#endif
printf("Benchmark Test: Return code %d\n", args.return_code);
#ifdef WOLFCRYPT_ONLY
wolfCrypt_Cleanup();
#else
wolfSSL_Cleanup();
#endif
}

View File

@ -11,7 +11,7 @@
#ifdef __aarch64__
#if !defined(__clang__) || \
(defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 5)
/* older clang v4 has issue with inline assembly contraints */
/* older clang v4 has issue with inline assembly constraints */
#define WOLFSSL_ARMASM
#endif
#endif
@ -58,7 +58,7 @@
#define HAVE_PK_CALLBACKS
/* crypto callback support is not in FIPS 3389 */
#ifndef HAVE_FIPS
#define WOLF_CRYPTO_CB
#define WOLF_CRYPTO_CB
#endif
#define KEEP_OUR_CERT

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfcrypt/test/test.h>
#include <wolfcrypt/benchmark/benchmark.h>

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* deos_malloc.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* tls_wolfssl.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -31,19 +31,19 @@ int setupTransport(clientConnectionHandleType* connectionHandle,
char* connectionId) {
int ret, error;
void * sendBuffer;
DWORD bufferSizeInBytes;
size_t bufferSizeInBytes;
if ((ret = socketTransportInitialize("mailbox-transport.config",
"transportConfigurationId",
(DWORD)waitIndefinitely,&error)) != transportSuccess)
waitIndefinitely,&error)) != transportSuccess)
printf("Initialize 0x%x, error=%d\n", ret, error);
else if ((ret = socketTransportClientInitialize((DWORD)waitIndefinitely,
else if ((ret = socketTransportClientInitialize(waitIndefinitely,
&error)) != transportSuccess)
printf("ClientInitialize 0x%x, error=%d\n", ret, error);
else if ((ret = socketTransportCreateConnection(connectionId,
(DWORD)waitIndefinitely,
waitIndefinitely,
COMPATIBILITY_ID_2,
connectionHandle,
&sendBuffer,
@ -53,7 +53,7 @@ int setupTransport(clientConnectionHandleType* connectionHandle,
else if ((ret = socketTransportSetConnectionForThread(currentThreadHandle(),
*connectionHandle,
(DWORD)waitIndefinitely,
waitIndefinitely,
&error)) != transportSuccess)
printf("SetConnectionForThread 0x%x, error=%d\n", ret, error);
@ -162,7 +162,7 @@ void wolfssl_client_test(uintData_t statusPtr) {
TCP_SERVER_IP_ADDR, TCP_SERVER_PORT);
server_addr.sin_family = AF_INET;
server_addr.sin_addr = inet_addr(TCP_SERVER_IP_ADDR);
server_addr.sin_addr.s_addr = inet_addr(TCP_SERVER_IP_ADDR);
server_addr.sin_port = htons(TCP_SERVER_PORT);
printf("Calling connect on socket\n");
@ -407,7 +407,7 @@ void wolfssl_server_test(uintData_t statusPtr)
printf("Setting up server_addr struct\n");
server_addr.sin_family = AF_INET;
server_addr.sin_addr = INADDR_ANY;
server_addr.sin_addr.s_addr = INADDR_ANY;
server_addr.sin_port = htons(TLS_SERVER_PORT);
bindStatus = bind(sock_listen, (sockaddr *) &server_addr, sizeof(server_addr));
@ -510,7 +510,7 @@ void wolfssl_server_test(uintData_t statusPtr)
wolfSSL_CTX_free(ctx);
return;
}
/* goToSleep() for 500 milli sec*/
/* goToSleep() for 500 milliseconds */
}
} while ((ret != SSL_SUCCESS) && (error == SSL_ERROR_WANT_READ));
@ -580,14 +580,14 @@ int wolfsslRunTests (void)
ts = createThread("TCPclient", "TCPThreadTemplate", wolfssl_client_test,
0, &TCPhandle );
if (ts != threadSuccess) {
printf("Unable to create TCP client thread, %i ", (DWORD)ts);
printf("Unable to create TCP client thread, %i ", (size_t)ts);
}
#endif
#if !defined(NO_WOLFSSL_SERVER)
ts = createThread("TCPserver", "TCPThreadTemplate", wolfssl_server_test,
0, &TCPhandle );
if (ts != threadSuccess) {
printf("Unable to create TCP server thread, %i ", (DWORD)ts);
printf("Unable to create TCP server thread, %i ", (size_t)ts);
}
#endif

View File

@ -1,6 +1,6 @@
/* tls_wolfssl.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_setting.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -26,75 +26,141 @@
extern "C" {
#endif
#define WOLFSSL_DEOS
#if 0
/* RTEMS */
#define WOLFSSL_DEOS_RTEMS
/* You can select none or all of the following tests
using #define instead of #undef.
By default, all four tests run*/
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <pthread.h>
#include <stdint.h>
#include <stddef.h> /* for size_t */
#include <stdlib.h> /* for malloc/free */
#undef NO_CRYPT_TEST
#undef NO_CRYPT_BENCHMARK
#undef NO_WOLFSSL_CLIENT
#undef NO_WOLFSSL_SERVER
#if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#define BIG_ENDIAN_ORDER
#else
#undef BIG_ENDIAN_ORDER
#define LITTLE_ENDIAN_ORDER
#endif
#else
/* DEOS Native */
#define WOLFSSL_DEOS
#include <deos.h>
#include <timeout.h>
#include <socketapi.h>
#include <lwip-socket.h>
#include <mem.h>
#include <string.h>
#include <stdlib.h> /* for rand_r: pseudo-random number generator */
#include <stdio.h> /* for snprintf */
#endif
/* Porting */
/* adjust CURRENT_UNIX_TIMESTAMP to seconds since Jan 01 1970. (UTC)
You can get the current time from https://www.unixtimestamp.com/
*/
#define CURRENT_UNIX_TIMESTAMP 1545864916
You can get the current time from https://www.unixtimestamp.com/ */
#define CURRENT_UNIX_TIMESTAMP 1663020069
#define NO_FILESYSTEM
#define BENCH_EMBEDDED /* use kB instead of mB for embedded benchmarking */
#define WOLFSSL_IGNORE_FILE_WARN /* ignore warning for include of files not required */
/* Math */
#define USE_FAST_MATH
#define FP_MAX_BITS (4096*2)
#define SIZEOF_LONG_LONG 8
#define TFM_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#define WC_RSA_BLINDING
/* prevents from including multiple definition of main() */
#define NO_MAIN_DRIVER
#define NO_TESTSUITE_MAIN_DRIVER
/* Wolf Single Precision Math */
#undef WOLFSSL_SP
#if 1
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_4096 /* Enable RSA/RH 4096-bit support */
#define WOLFSSL_SP_384 /* Enable ECC 384-bit SECP384R1 support */
/* includes certificate test buffers via header files */
#define USE_CERT_BUFFERS_2048
//#define WOLFSSL_SP_CACHE_RESISTANT
#define WOLFSSL_SP_MATH /* only SP math - disables integer.c/tfm.c */
//#define WOLFSSL_SP_MATH_ALL /* use SP math for all key sizes and curves */
/*use kB instead of mB for embedded benchmarking*/
#define BENCH_EMBEDDED
#define WOLFSSL_SP_NO_MALLOC
//#define WOLFSSL_SP_DIV_32 /* do not use 64-bit divides */
#define NO_WRITE_TEMP_FILES
/* use smaller version of code */
#define WOLFSSL_SP_SMALL
#endif
#define HAVE_AESGCM
#define WOLFSSL_SHA512
/* Algorithms */
#undef NO_RSA
#undef NO_DH
#define WOLFSSL_DH_CONST
#define HAVE_ECC
#define HAVE_CURVE25519
#define CURVE25519_SMALL
#define HAVE_ED25519
#define ED25519_SMALL
#define ECC_USER_CURVES
#define HAVE_ECC384
#define WOLFSSL_DTLS
#if 1
#define HAVE_CURVE25519
#define HAVE_ED25519
#define CURVED25519_SMALL
#endif
#undef NO_SHA
#undef NO_MD5
#undef NO_SHA256
#define HAVE_AESGCM
#define WOLFSSL_SHA384
#define WOLFSSL_SHA512
/* TLS */
#define HAVE_TLS_EXTENSIONS
#define HAVE_SUPPORTED_CURVES
#define HAVE_EXTENDED_MASTER
#define HAVE_ENCRYPT_THEN_MAC
//#define WOLFSSL_DTLS
//#define WOLFSSL_DTLS13
//#define WOLFSSL_NO_TLS12
/* TLS 1.3 */
#if 0
/* TLS 1.3 */
#define WOLFSSL_TLS13
#define WC_RSA_PSS
#define HAVE_HKDF
#define HAVE_FFDHE_2048
#define HAVE_AEAD
#define HAVE_FFDHE_3072
#define HAVE_FFDHE_4096
#endif
/* wolfSentry */
#if 0
/* You can use your own custom random generator function with
no input parameters and a `CUSTOM_RAND_TYPE` return type*/
#ifndef CUSTOM_RAND_GENERATE
#define CUSTOM_RAND_TYPE int
#define CUSTOM_RAND_GENERATE yourRandGenFunc
#endif
#define WOLFSSL_WOLFSENTRY_HOOKS
#define HAVE_EX_DATA
#define HAVE_EX_DATA_CLEANUP_HOOKS
#endif
#if 1
#undef XMALLOC_OVERRIDE
/* compatibility layer */
#if 0
#define OPENSSL_EXTRA
#endif
/* Random */
#ifdef WOLFSSL_DEOS_RTEMS
extern int rtems_wolf_seed(unsigned char* output, unsigned int sz);
#define CUSTOM_RAND_GENERATE_SEED rtems_wolf_seed
#endif
/* custom heap handling */
#ifdef WOLFSSL_DEOS
#define WOLFSSL_NO_MALLOC
#define XMALLOC_OVERRIDE
/* prototypes for user heap override functions */
#include <stddef.h> /* for size_t */
extern void *malloc_deos(size_t size);
extern void free_deos(void *ptr);
extern void *realloc_deos(void *ptr, size_t size);
@ -102,9 +168,40 @@ You can get the current time from https://www.unixtimestamp.com/
#define XMALLOC(n, h, t) malloc_deos(n)
#define XFREE(p, h, t) free_deos(p)
#define XREALLOC(p, n, h, t) realloc_deos(p, n)
#endif
#if 0
#define DEBUG_WOLFSSL
#endif
/* You can select none or all of the following tests
* using #define instead of #undef.
* By default, all four tests run*/
#define NO_CRYPT_TEST
#define NO_CRYPT_BENCHMARK
#undef NO_WOLFSSL_CLIENT
#undef NO_WOLFSSL_SERVER
/* file system has not been ported since it is a separate product */
#define NO_FILESYSTEM
#define NO_WOLFSSL_DIR
#define NO_WRITEV
#define NO_WRITE_TEMP_FILES
/* disable old protocols and algorithms */
#define NO_OLD_TLS
#define NO_PSK
#define NO_DSA
#define NO_RC4
#define NO_MD4
#define NO_PWDBASED
/* prevents from including multiple definition of main() */
#define NO_MAIN_DRIVER
#define NO_TESTSUITE_MAIN_DRIVER
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@ -40,7 +40,7 @@ The folder hierarchy is the same as the wolfSSL folders with an exception of the
4. Right click on each folders, add or link all the source code in the corresponding folder in wolfSSL.
5. Remove non-C platform dependent files from your build. At the moment, only aes_asm.asm and aes_asm.s must be removed from your wolfssl/wolfcrypt/src folder.
5. Remove non-C platform dependent files from your build. At the moment, only aes_asm.asm, aes_gcm_asm.asm and aes_asm.s must be removed from your wolfssl/wolfcrypt/src folder.
6. In your C/C++ compiler preprocessor settings, add the wolfSSL directories to your include paths.
Here's an example of the paths that must be added.

View File

@ -1,6 +1,6 @@
/* client_wolfssl.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* client_wolfssl.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* server_wolfssl.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* server_wolfssl.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_setting.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wolfsslRunTests.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_setting.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wolfsslRunTests.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -0,0 +1,23 @@
# Espressif Updates
See [#5795]()
## Changes in November 2022
Updates to Espressif ESP-IDF wolfssl_benchmark and wolfssl_test examples:
- Benchmark example no longer runs tests.
- Fixed Test example that was missing code files. (no longer installed locally)
- Rename `benchmark/main` and `test/main` filenames from `helper.c` to `main.c`, cleaned up.
- Added `main.h`
- Revised `main/CMakeLists.txt` to use only `main.c`
- Set components `main` and `wolfssl` for project `CMakeLists.txt`
- Update wolfcrypt esp32_sha.c and sha256.c to now report unexpected reentry as verbose log rather than error message.
- `wolfcrypt/test.c` now returns `args.return_code` when `WOLFSSL_ESPIDF` is defined.
- `wolfcrypt/test.h` now declares `int wolf_test_task(void)` when `WOLFSSL_ESPIDF` is defined.
- `setup.sh` no longer copies benchmark.c(.h) to local project directory.
- Added `libs/Tigard.cfg` file for Tigard JTAG debugger.
- Update `sdkconfig.defaults` with compiler optimizations and stack check.
- Added VisualGDB Project file & Visual Studio solution file.
- Added optional `time_helper` for wolfssl_test
- Exclude `ssl_misc.c` in component cmake to fix warning: #warning ssl_misc.c does not need to be compiled separately from ssl.c

View File

@ -0,0 +1,111 @@
#!/bin/bash
#
# testing script: compileAllExamples
#
# This script will compile all the local examples, optionally installing wolfSSL in the ESP-IDF components directory.
#
# Example usage:
# cd wolfssl && docker run --rm -v $PWD:/project -w /project espressif/idf:latest IDE/Espressif/ESP-IDF/compileAllExamples.sh
#
# Parameter option to also run the ./setup.sh to install the wolfSSL component in ESP-IDF and test for multiple installs:
#
# --run-setup
#
# Note that once installed, the wolfSSL component will need to be manually removed to successfully run this script.
#
if [[ "$IDF_PATH" == "" ]]; then
echo "Error: $IDF_PATH not found; run Espressif export.sh"
exit 1
fi
SCRIPT_DIR=$(builtin cd ${BASH_SOURCE%/*}; pwd)
RUN_SETUP=$1
THIS_ERR=0
echo "Found IDF_PATH = $IDF_PATH"
# Regular tests of wolfSSL in local component directories of each project:
#
# Note these tests should FAIL if wolfSSL is already installed in ESP-IDF
#
for file in "benchmark" "client" "server" "test"; do
pushd ${SCRIPT_DIR}/examples/wolfssl_${file}/ && idf.py fullclean build;
THIS_ERR=$?
popd
if [ $THIS_ERR -ne 0 ]; then
echo "Failed in ${file}"
exit 1
fi
done
# Check for option to also install wolfSSL.
#
# When doing so, we'll run a check that multiple installs should cause build failure.
if [[ "$RUN_SETUP" == "--run-setup" ]]; then
echo "Running wolfSSL setup.sh"
# install wolfSSL into EDP-IDF shared components directory.
./setup.sh --verbose
THIS_ERR=$?
if [ $? -ne 0 ]; then
echo "Failed running setup.sh"
exit 1
fi
# Check ESP-IDF install:
#
# The wolfssl_test_idf should NOT have a local components/wolfssl when testing!
# This test is to confirm the ESP-IDF component build properly after setup.
#
echo ""
echo "Testing a build of wolfSSL in ESP-IDF components directory"
echo ""
for file in "test_idf"; do
pushd ${SCRIPT_DIR}/examples/wolfssl_${file}/ && idf.py fullclean build;
THIS_ERR=$?
popd
if [ $? -ne 0 ]; then
echo "Failed in ${file}"
exit 1
fi
done
# Check multiple installs: the wolfSSL component in ESP-IDF and local directory:
#
# The wolfssl_test project already has a local wolfSSL component directory.
#
# Once wolfssl has been installed to ESP-IDF components, the local
# component build SHOULD fail:
echo ""
echo "Testing a build of wolfSSL in both local and ESP-IDF components directory"
echo ""
for file in "test"; do
pushd ${SCRIPT_DIR}/examples/wolfssl_${file}/ && idf.py fullclean build;
THIS_ERR=$?
popd
if [ $THIS_ERR -ne 0 ]; then
echo ""
echo "Success: Confirmed build fails when wolfSSL found in ESP-IDF and local project."
echo ""
else
echo "Error: build should have failed when wolfSSL found in ESP-IDF and local project."
exit 1
fi
done
else
echo "Skipping ESP-IDF install tests. For these tests, use parameter: --run-setup"
fi
# Show a reminder that wolfSSL was installed as a shared component.
if [[ "$RUN_SETUP" == "--run-setup" ]]; then
echo ""
echo "wolfSSL was installed as an ESP-IDF component. This will be in conflict with any project that has a local component."
echo ""
echo "Delete the installed component before re-running this test."
echo ""
fi
# Done
echo "Completed compileAllExamples in $SCRIPT_DIR"

View File

@ -1,6 +1,6 @@
/* config.h - dummy
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wolfcrypt/test/test_paths.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -3,4 +3,10 @@
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(COMPONENTS
main
wolfssl
) # set components
project(wolfssl_benchmark)

View File

@ -14,3 +14,177 @@ When you want to run the benchmark program
2. `idf.py monitor` to see the message
See the README.md file in the upper level 'examples' directory for more information about examples.
## Performance
Reminder than when building on WSL in `/mnt/c` there will be a noticeable performance degradation at compile time. Using `~/` will be faster at the cost of shared filesystems.
Example build on WSL:
```
Optionally install wolfSSL component
# cd /mnt/c/workspace/wolfssl/IDE/Espressif/ESP-IDF
./setup.sh
cd /mnt/c/workspace/wolfssl/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark
# Pick ESP-IDF install directory, this one for v4.4.2 in VisualGDB
. /mnt/c/SysGCC/esp32/esp-idf/v4.4.2/export.sh
idf.py build flash -p /dev/ttyS20 -b 921600 monitor
```
## Example Output
Note the default wolfSSL `user_settings.h` is configured by default to be the most
compatible across the widest ranges of targets. Contact wolfSSL at support@wolfssl.com
for help in optimizing for your particular application, or see the
[docs](https://www.wolfssl.com/documentation/manuals/wolfssl/index.html).
Compiled and flashed with `idf.py build flash -p /dev/ttyS7 -b 921600 monitor`:
```
--- idf_monitor on /dev/ttyS7 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
(377) cpu_start: Starting scheduler ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6664
load:0x40078000,len:14848
load:0x40080400,len:3792
0x40080400: _init at ??:?
entry 0x40080694
I (27) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (27) boot: compile time 13:41:41
I (27) boot: chip revision: 1
I (30) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (37) boot.esp32: SPI Speed : 40MHz
I (42) boot.esp32: SPI Mode : DIO
I (46) boot.esp32: SPI Flash Size : 2MB
I (51) boot: Enabling RNG early entropy source...
I (56) boot: Partition Table:
I (60) boot: ## Label Usage Type ST Offset Length
I (67) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (75) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (82) boot: 2 factory factory app 00 00 00010000 00100000
I (90) boot: End of partition table
I (94) boot_comm: chip revision: 1, min. application chip revision: 0
I (101) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=12bf4h ( 76788) map
I (137) esp_image: segment 1: paddr=00022c1c vaddr=3ffb0000 size=02420h ( 9248) load
I (141) esp_image: segment 2: paddr=00025044 vaddr=40080000 size=0afd4h ( 45012) load
I (161) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=33148h (209224) map
I (237) esp_image: segment 4: paddr=00063170 vaddr=4008afd4 size=00550h ( 1360) load
I (238) esp_image: segment 5: paddr=000636c8 vaddr=50000000 size=00010h ( 16) load
I (249) boot: Loaded app from partition at offset 0x10000
I (249) boot: Disabling RNG early entropy source...
I (266) cpu_start: Pro cpu up.
I (266) cpu_start: Starting app cpu, entry point is 0x40081098
0x40081098: call_start_cpu1 at /mnt/c/SysGCC/esp32/esp-idf/v4.4.2/components/esp_system/port/cpu_start.c:160
I (0) cpu_start: App cpu up.
I (280) cpu_start: Pro cpu start user code
I (280) cpu_start: cpu freq: 240000000
I (280) cpu_start: Application information:
I (285) cpu_start: Project name: wolfssl_benchmark
I (291) cpu_start: App version: v5.5.3-stable-108-gbd7b442df-di
I (298) cpu_start: Compile time: Nov 17 2022 14:10:03
I (304) cpu_start: ELF file SHA256: fbb520f5bbf963a0...
I (310) cpu_start: ESP-IDF: v4.4.2-dirty
I (316) heap_init: Initializing. RAM available for dynamic allocation:
I (323) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (329) heap_init: At 3FFB3DE8 len 0002C218 (176 KiB): DRAM
I (335) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (341) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (348) heap_init: At 4008B524 len 00014ADC (82 KiB): IRAM
I (355) spi_flash: detected chip: generic
I (359) spi_flash: flash io: dio
W (362) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (377) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (391) wolfssl_benchmark: app_main CONFIG_BENCH_ARGV = -lng 0
I (397) wolfssl_benchmark: construct_argv arg:-lng 0
------------------------------------------------------------------------------
wolfSSL version 5.5.3
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG 1 MiB took 1.017 seconds, 1.320 MiB/s
AES-128-CBC-enc 6 MiB took 1.002 seconds, 5.726 MiB/s
AES-128-CBC-dec 5 MiB took 1.000 seconds, 5.347 MiB/s
AES-192-CBC-enc 6 MiB took 1.004 seconds, 5.714 MiB/s
AES-192-CBC-dec 5 MiB took 1.001 seconds, 5.341 MiB/s
AES-256-CBC-enc 6 MiB took 1.000 seconds, 5.713 MiB/s
AES-256-CBC-dec 5 MiB took 1.002 seconds, 5.336 MiB/s
AES-128-GCM-enc 300 KiB took 1.004 seconds, 298.805 KiB/s
AES-128-GCM-dec 300 KiB took 1.004 seconds, 298.805 KiB/s
AES-192-GCM-enc 300 KiB took 1.007 seconds, 297.915 KiB/s
AES-192-GCM-dec 300 KiB took 1.008 seconds, 297.619 KiB/s
AES-256-GCM-enc 300 KiB took 1.011 seconds, 296.736 KiB/s
AES-256-GCM-dec 300 KiB took 1.011 seconds, 296.736 KiB/s
GMAC Default 403 KiB took 1.002 seconds, 402.196 KiB/s
3DES 450 KiB took 1.028 seconds, 437.743 KiB/s
MD5 14 MiB took 1.001 seconds, 13.756 MiB/s
SHA 14 MiB took 1.001 seconds, 14.463 MiB/s
SHA-256 14 MiB took 1.000 seconds, 14.233 MiB/s
SHA-512 17 MiB took 1.000 seconds, 16.626 MiB/s
HMAC-MD5 14 MiB took 1.000 seconds, 13.599 MiB/s
HMAC-SHA 14 MiB took 1.000 seconds, 13.989 MiB/s
HMAC-SHA256 14 MiB took 1.000 seconds, 13.940 MiB/s
HMAC-SHA512 16 MiB took 1.000 seconds, 16.064 MiB/s
PBKDF2 640 bytes took 1.009 seconds, 634.291 bytes/s
RSA 2048 public 52 ops took 1.022 sec, avg 19.654 ms, 50.881 ops/sec
RSA 2048 private 4 ops took 1.056 sec, avg 264.000 ms, 3.788 ops/sec
ECC [ SECP256R1] 256 key gen 4 ops took 1.216 sec, avg 304.000 ms, 3.289 ops/sec
ECDHE [ SECP256R1] 256 agree 4 ops took 1.215 sec, avg 303.750 ms, 3.292 ops/sec
ECDSA [ SECP256R1] 256 sign 4 ops took 1.226 sec, avg 306.500 ms, 3.263 ops/sec
ECDSA [ SECP256R1] 256 verify 2 ops took 1.172 sec, avg 586.000 ms, 1.706 ops/sec
CURVE 25519 key gen 3 ops took 1.279 sec, avg 426.333 ms, 2.346 ops/sec
CURVE 25519 agree 4 ops took 1.701 sec, avg 425.250 ms, 2.352 ops/sec
ED 25519 key gen 46 ops took 1.008 sec, avg 21.913 ms, 45.635 ops/sec
ED 25519 sign 42 ops took 1.038 sec, avg 24.714 ms, 40.462 ops/sec
ED 25519 verify 26 ops took 1.009 sec, avg 38.808 ms, 25.768 ops/sec
Benchmark complete
```
## Known Issues and Common Issues
### Permission denied
Delete project directory `build`, `.visualgdb` and `.vs` directories. Ensure no other build
process is using the same files in Windows, WSL, Visual Studio, VSCode, etc.
Example message:
```
-- Building ESP-IDF components for target esp32
CMake Error at /mnt/c/SysGCC/esp32/esp-idf/v4.4.2/tools/cmake/component.cmake:131 (file):
file failed to open for writing (Permission denied):
/mnt/c/workspace-pr/wolfssl/IDE/Espressif/ESP-IDF/examples/wolfssl_test/build/bootloader/component_properties.temp.cmake
```
### user_settings.h: No such file or directory
Ensure wolfSSL is installed in the ESP-IDF or local project `components` directory.
Example message:
```
esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj -c ../main/main.c
../main/main.c:27:10: fatal error: user_settings.h: No such file or directory
#include <user_settings.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
```
A 'clean` may be needed after freshly installing a new component:
```
idf.py clean build flash -p /dev/ttyS7 -b 921600 monitor
```

View File

@ -0,0 +1,58 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33027.164
MinimumVisualStudioVersion = 10.0.40219.1
Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "wolfssl_benchmark", "wolfssl_benchmark_IDF_v4.4_ESP32.vgdbproj", "{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{51FEFEA9-C2BA-43A1-8B36-9140367E5AAF}"
ProjectSection(SolutionItems) = preProject
..\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c = ..\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c
..\..\..\..\..\..\wolfcrypt\benchmark\benchmark.h = ..\..\..\..\..\..\wolfcrypt\benchmark\benchmark.h
..\sdkconfig.defaults = ..\sdkconfig.defaults
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wolfssl", "wolfssl", "{E0C1A3C6-D2E2-4E10-890C-3468B1B8834C}"
ProjectSection(SolutionItems) = preProject
..\components\wolfssl\CMakeLists.txt = ..\components\wolfssl\CMakeLists.txt
..\components\wolfssl\component.mk = ..\components\wolfssl\component.mk
..\..\..\..\..\..\wolfcrypt\src\sha.c = ..\..\..\..\..\..\wolfcrypt\src\sha.c
..\..\..\..\..\..\wolfcrypt\src\sha256.c = ..\..\..\..\..\..\wolfcrypt\src\sha256.c
..\..\..\..\..\..\wolfcrypt\src\sha3.c = ..\..\..\..\..\..\wolfcrypt\src\sha3.c
..\..\..\..\..\..\wolfcrypt\src\sha512.c = ..\..\..\..\..\..\wolfcrypt\src\sha512.c
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "include", "include", "{530960D7-4FAB-4683-9C83-35ADE6C00358}"
ProjectSection(SolutionItems) = preProject
..\components\wolfssl\include\config.h = ..\components\wolfssl\include\config.h
..\components\wolfssl\include\user_settings.h = ..\components\wolfssl\include\user_settings.h
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|VisualGDB = Debug|VisualGDB
Release|VisualGDB = Release|VisualGDB
Tests (Debug)|VisualGDB = Tests (Debug)|VisualGDB
Tests (Release)|VisualGDB = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.Build.0 = Release|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.ActiveCfg = Tests (Debug)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.Build.0 = Tests (Debug)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.ActiveCfg = Tests (Release)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.Build.0 = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E0C1A3C6-D2E2-4E10-890C-3468B1B8834C} = {51FEFEA9-C2BA-43A1-8B36-9140367E5AAF}
{530960D7-4FAB-4683-9C83-35ADE6C00358} = {E0C1A3C6-D2E2-4E10-890C-3468B1B8834C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {668EEFC0-010C-4688-916F-A628190717D4}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,269 @@
<?xml version="1.0"?>
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Project xsi:type="com.visualgdb.project.external.esp-idf">
<CustomSourceDirectories>
<Directories />
<PathStyle>Unknown</PathStyle>
</CustomSourceDirectories>
<AutoProgramSPIFFSPartition>true</AutoProgramSPIFFSPartition>
<ProjectModeSettings>
<ProjectGUID>7bbd1486-d457-4e49-92ba-0cfc9d80849e</ProjectGUID>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<HeaderScanMode>SourceDirs</HeaderScanMode>
</ProjectModeSettings>
</Project>
<Build xsi:type="com.visualgdb.build.cmake">
<BuildLogMode xsi:nil="true" />
<ToolchainID>
<ID>com.visualgdb.xtensa-esp32-elf</ID>
<Version>
<GCC>8.4.0</GCC>
<GDB>8.1.0</GDB>
<Revision>9</Revision>
</Version>
</ToolchainID>
<RelativeSourceDirectory>..</RelativeSourceDirectory>
<ConfigurationType>DEBUG</ConfigurationType>
<BinaryDirectory>build/$(PlatformName)/$(ConfigurationName)</BinaryDirectory>
<MakeCommandTemplate>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(ToolchainNinja)</Command>
<WorkingDirectory>$(BuildDir)</WorkingDirectory>
<BackgroundMode xsi:nil="true" />
</MakeCommandTemplate>
<CMakeCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(SYSPROGS_CMAKE_PATH)</Command>
<BackgroundMode xsi:nil="true" />
</CMakeCommand>
<UpdateSourcesInCMakeFile>true</UpdateSourcesInCMakeFile>
<ExportCompileCommands>false</ExportCompileCommands>
<DisableToolchainFile>false</DisableToolchainFile>
<CMakeMakefileType>Ninja</CMakeMakefileType>
<DeployAsRoot>false</DeployAsRoot>
<CMakeCleanMode>RemoveBuildDirectory</CMakeCleanMode>
<UseCCache>false</UseCCache>
<ProjectModeSettings>
<ProjectItemSettings>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<GroupTargetsByPaths>true</GroupTargetsByPaths>
<FollowCMakeSourceGroups>false</FollowCMakeSourceGroups>
<AutoRefreshProject>true</AutoRefreshProject>
<AlwaysConsiderOutdated>false</AlwaysConsiderOutdated>
<SortTargetsByName>true</SortTargetsByName>
<RedundantTargetMode>HideOuterProjectTargets</RedundantTargetMode>
<SortSourcesByName>true</SortSourcesByName>
<BuildAllTargetsInSubdir>false</BuildAllTargetsInSubdir>
<FoldSingleItemPathLevels>true</FoldSingleItemPathLevels>
</ProjectItemSettings>
<TargetSpecificSettings />
<SetLDLibraryPathFromDependentArtifacts>true</SetLDLibraryPathFromDependentArtifacts>
<ProjectGUID>eadcc9ab-72b3-4b51-a838-593e5d80ddf7</ProjectGUID>
<VirtualFolders />
<ConfigurationNameCase>Upper</ConfigurationNameCase>
<DefaultHeaderDiscoveryMode>HeaderDirectoryAndSubdirectories</DefaultHeaderDiscoveryMode>
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
<ESPIDFExtension>
<IDFCheckout>
<Version>v4.4.1</Version>
<Subdirectory>esp-idf/v4.4.1</Subdirectory>
<Type>ESPIDF</Type>
</IDFCheckout>
<COMPort>COM20</COMPort>
<SuppressTestPrerequisiteChecks>false</SuppressTestPrerequisiteChecks>
<UseCCache>false</UseCCache>
<DeviceID>ESP32</DeviceID>
</ESPIDFExtension>
</ProjectModeSettings>
</Build>
<CustomBuild>
<PreSyncActions />
<PreBuildActions />
<PostBuildActions />
<PreCleanActions />
<PostCleanActions />
</CustomBuild>
<CustomDebug>
<PreDebugActions />
<PostDebugActions />
<DebugStopActions />
<BreakMode>Default</BreakMode>
</CustomDebug>
<DeviceTerminalSettings>
<Connection xsi:type="com.sysprogs.terminal.connection.serial">
<ComPortName>COM20</ComPortName>
<AdvancedSettings>
<BaudRate>115200</BaudRate>
<DataBits>8</DataBits>
<Parity>None</Parity>
<StopBits>One</StopBits>
<FlowControl>None</FlowControl>
</AdvancedSettings>
</Connection>
<LastConnectionTime>0</LastConnectionTime>
<EchoTypedCharacters>false</EchoTypedCharacters>
<ClearContentsWhenReconnecting>false</ClearContentsWhenReconnecting>
<ReconnectAutomatically>false</ReconnectAutomatically>
<DisplayMode>ASCII</DisplayMode>
<Colors>
<Background>
<Alpha>255</Alpha>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Background>
<Disconnected>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Disconnected>
<Text>
<Alpha>255</Alpha>
<Red>211</Red>
<Green>211</Green>
<Blue>211</Blue>
</Text>
<Echo>
<Alpha>255</Alpha>
<Red>144</Red>
<Green>238</Green>
<Blue>144</Blue>
</Echo>
<Inactive>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Inactive>
</Colors>
<HexSettings>
<MaximumBytesPerLine>16</MaximumBytesPerLine>
<ShowTextView>true</ShowTextView>
<BreaksAroundEcho>true</BreaksAroundEcho>
<AutoSend>true</AutoSend>
<SendAsHex>true</SendAsHex>
<TimeoutForAutoBreak>0</TimeoutForAutoBreak>
</HexSettings>
<LineEnding>LF</LineEnding>
<TreatLFAsCRLF>false</TreatLFAsCRLF>
<KeepOpenAfterExit>false</KeepOpenAfterExit>
<ShowAfterProgramming>false</ShowAfterProgramming>
</DeviceTerminalSettings>
<CustomShortcuts>
<Shortcuts />
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
</CustomShortcuts>
<UserDefinedVariables />
<ImportedPropertySheets />
<CodeSense>
<Enabled>Unknown</Enabled>
<ExtraSettings>
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
<FormattingEngine xsi:nil="true" />
</ExtraSettings>
<CodeAnalyzerSettings>
<Enabled>false</Enabled>
</CodeAnalyzerSettings>
</CodeSense>
<Configurations>
<VisualGDBConfiguration>
<Name>Debug</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
<VisualGDBConfiguration>
<Name>Release</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
</Configurations>
<ProgramArgumentsSuggestions />
<Debug xsi:type="com.visualgdb.debug.embedded">
<AdditionalStartupCommands />
<AdditionalGDBSettings>
<Features>
<DisableAutoDetection>false</DisableAutoDetection>
<UseFrameParameter>false</UseFrameParameter>
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
<ListLocalsSupported>false</ListLocalsSupported>
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
<ThreadInfoSupported>false</ThreadInfoSupported>
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
<SupportTargetCommand>false</SupportTargetCommand>
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
</Features>
<EnableSmartStepping>false</EnableSmartStepping>
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
<UseAppleExtensions>false</UseAppleExtensions>
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
<MakeLogFile>false</MakeLogFile>
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
<UseRelativePathsOnly>false</UseRelativePathsOnly>
<ExitAction>None</ExitAction>
<DisableDisassembly>false</DisableDisassembly>
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
<StepIntoNewInstanceEntry>app_main</StepIntoNewInstanceEntry>
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
<DisableSignals>false</DisableSignals>
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
<AsyncModeSupportsBreakpoints>true</AsyncModeSupportsBreakpoints>
<TemporaryBreakConsolidationTimeout>0</TemporaryBreakConsolidationTimeout>
<EnableNonStopMode>false</EnableNonStopMode>
<MaxBreakpointLimit>0</MaxBreakpointLimit>
<EnableVerboseMode>true</EnableVerboseMode>
<EnablePrettyPrinters>false</EnablePrettyPrinters>
</AdditionalGDBSettings>
<DebugMethod>
<ID>openocd</ID>
<Configuration xsi:type="com.visualgdb.edp.openocd.settings.esp32">
<CommandLine>-f interface/tigard.cfg -c "adapter_khz 15000" -f target/esp32.cfg</CommandLine>
<ExtraParameters>
<Frequency xsi:nil="true" />
<BoostedFrequency xsi:nil="true" />
<ConnectUnderReset>false</ConnectUnderReset>
</ExtraParameters>
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
<ProgramMode>Enabled</ProgramMode>
<StartupCommands>
<string>set remotetimeout 60</string>
<string>target remote :$$SYS:GDB_PORT$$</string>
<string>mon gdb_breakpoint_override hard</string>
<string>mon reset halt</string>
<string>load</string>
</StartupCommands>
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
<PreferredGDBPort>0</PreferredGDBPort>
<PreferredTelnetPort>0</PreferredTelnetPort>
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
<SelectedCoreIndex xsi:nil="true" />
<LiveMemoryTimeout>5000</LiveMemoryTimeout>
<SuggestionLogicRevision>1</SuggestionLogicRevision>
<CheckFLASHSize>true</CheckFLASHSize>
<FLASHSettings>
<Size>size2MB</Size>
<Frequency>freq40M</Frequency>
<Mode>DIO</Mode>
</FLASHSettings>
<PatchBootloader>true</PatchBootloader>
</Configuration>
</DebugMethod>
<AutoDetectRTOS>true</AutoDetectRTOS>
<SemihostingSupport>Disabled</SemihostingSupport>
<SemihostingPollingDelay>0</SemihostingPollingDelay>
<StepIntoEntryPoint>false</StepIntoEntryPoint>
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
<StopAtEntryPoint>false</StopAtEntryPoint>
<EnableVirtualHalts>false</EnableVirtualHalts>
<DynamicAnalysisSettings />
<EndOfStackSymbol>_estack</EndOfStackSymbol>
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
<UnusedStackFillPattern xsi:nil="true" />
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
</Debug>
</VisualGDBProjectSettings2>

View File

@ -0,0 +1,59 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33516.290
MinimumVisualStudioVersion = 10.0.40219.1
Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "wolfssl_benchmark_IDF_v5_ESP32", "wolfssl_benchmark_IDF_v5_ESP32.vgdbproj", "{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wolfssl", "wolfssl", "{BDD063E3-67C1-437F-9F9B-7175E36EE6EE}"
ProjectSection(SolutionItems) = preProject
..\components\wolfssl\CMakeLists.txt = ..\components\wolfssl\CMakeLists.txt
..\components\wolfssl\include\config.h = ..\components\wolfssl\include\config.h
..\components\wolfssl\Kconfig = ..\components\wolfssl\Kconfig
..\components\wolfssl\include\user_settings.h = ..\components\wolfssl\include\user_settings.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E25A35EF-64B9-48AA-939B-49340C2A4B03}"
ProjectSection(SolutionItems) = preProject
..\sdkconfig = ..\sdkconfig
..\build\VisualGDB\Debug\config\sdkconfig.h = ..\build\VisualGDB\Debug\config\sdkconfig.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wolfcrypt", "wolfcrypt", "{68571B42-6509-475F-A79D-FB5F6188753B}"
ProjectSection(SolutionItems) = preProject
..\..\..\..\..\..\wolfssl\wolfcrypt\port\Espressif\esp32-crypt.h = ..\..\..\..\..\..\wolfssl\wolfcrypt\port\Espressif\esp32-crypt.h
..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_aes.c = ..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_aes.c
..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_mp.c = ..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_mp.c
..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_sha.c = ..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_sha.c
..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_util.c = ..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_util.c
..\..\..\..\..\..\wolfcrypt\src\port\Espressif\README.md = ..\..\..\..\..\..\wolfcrypt\src\port\Espressif\README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|VisualGDB = Debug|VisualGDB
Release|VisualGDB = Release|VisualGDB
Tests (Debug)|VisualGDB = Tests (Debug)|VisualGDB
Tests (Release)|VisualGDB = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.Build.0 = Release|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.ActiveCfg = Tests (Debug)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.Build.0 = Tests (Debug)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.ActiveCfg = Tests (Release)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.Build.0 = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BDD063E3-67C1-437F-9F9B-7175E36EE6EE} = {E25A35EF-64B9-48AA-939B-49340C2A4B03}
{68571B42-6509-475F-A79D-FB5F6188753B} = {E25A35EF-64B9-48AA-939B-49340C2A4B03}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DED328BF-3A3C-47F4-A536-4554945B865B}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,269 @@
<?xml version="1.0"?>
<VisualGDBProjectSettings2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Project xsi:type="com.visualgdb.project.external.esp-idf">
<CustomSourceDirectories>
<Directories />
<PathStyle>Unknown</PathStyle>
</CustomSourceDirectories>
<AutoProgramSPIFFSPartition>true</AutoProgramSPIFFSPartition>
<ProjectModeSettings>
<ProjectGUID>7bbd1486-d457-4e49-92ba-0cfc9d80849e</ProjectGUID>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<HeaderScanMode>SourceDirs</HeaderScanMode>
</ProjectModeSettings>
</Project>
<Build xsi:type="com.visualgdb.build.cmake">
<BuildLogMode xsi:nil="true" />
<ToolchainID>
<ID>com.visualgdb.xtensa-esp32-elf</ID>
<Version>
<GCC>11.2.0</GCC>
<GDB>9.2.90</GDB>
<Revision>2</Revision>
</Version>
</ToolchainID>
<RelativeSourceDirectory>..</RelativeSourceDirectory>
<ConfigurationType>DEBUG</ConfigurationType>
<BinaryDirectory>build/$(PlatformName)/$(ConfigurationName)</BinaryDirectory>
<MakeCommandTemplate>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(ToolchainNinja)</Command>
<WorkingDirectory>$(BuildDir)</WorkingDirectory>
<BackgroundMode xsi:nil="true" />
</MakeCommandTemplate>
<CMakeCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(SYSPROGS_CMAKE_PATH)</Command>
<BackgroundMode xsi:nil="true" />
</CMakeCommand>
<UpdateSourcesInCMakeFile>true</UpdateSourcesInCMakeFile>
<ExportCompileCommands>false</ExportCompileCommands>
<DisableToolchainFile>false</DisableToolchainFile>
<CMakeMakefileType>Ninja</CMakeMakefileType>
<DeployAsRoot>false</DeployAsRoot>
<CMakeCleanMode>RemoveBuildDirectory</CMakeCleanMode>
<UseCCache>false</UseCCache>
<ProjectModeSettings>
<ProjectItemSettings>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<GroupTargetsByPaths>true</GroupTargetsByPaths>
<FollowCMakeSourceGroups>false</FollowCMakeSourceGroups>
<AutoRefreshProject>true</AutoRefreshProject>
<AlwaysConsiderOutdated>false</AlwaysConsiderOutdated>
<SortTargetsByName>true</SortTargetsByName>
<RedundantTargetMode>HideOuterProjectTargets</RedundantTargetMode>
<SortSourcesByName>true</SortSourcesByName>
<BuildAllTargetsInSubdir>false</BuildAllTargetsInSubdir>
<FoldSingleItemPathLevels>true</FoldSingleItemPathLevels>
</ProjectItemSettings>
<TargetSpecificSettings />
<SetLDLibraryPathFromDependentArtifacts>true</SetLDLibraryPathFromDependentArtifacts>
<ProjectGUID>eadcc9ab-72b3-4b51-a838-593e5d80ddf7</ProjectGUID>
<VirtualFolders />
<ConfigurationNameCase>Upper</ConfigurationNameCase>
<DefaultHeaderDiscoveryMode>HeaderDirectoryAndSubdirectories</DefaultHeaderDiscoveryMode>
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
<ESPIDFExtension>
<IDFCheckout>
<Version>release/v5.0</Version>
<Subdirectory>esp-idf/v5.0</Subdirectory>
<Type>ESPIDF</Type>
</IDFCheckout>
<COMPort>COM20</COMPort>
<SuppressTestPrerequisiteChecks>false</SuppressTestPrerequisiteChecks>
<UseCCache>false</UseCCache>
<DeviceID>ESP32</DeviceID>
</ESPIDFExtension>
</ProjectModeSettings>
</Build>
<CustomBuild>
<PreSyncActions />
<PreBuildActions />
<PostBuildActions />
<PreCleanActions />
<PostCleanActions />
</CustomBuild>
<CustomDebug>
<PreDebugActions />
<PostDebugActions />
<DebugStopActions />
<BreakMode>Default</BreakMode>
</CustomDebug>
<DeviceTerminalSettings>
<Connection xsi:type="com.sysprogs.terminal.connection.serial">
<ComPortName>COM9</ComPortName>
<AdvancedSettings>
<BaudRate>115200</BaudRate>
<DataBits>8</DataBits>
<Parity>None</Parity>
<StopBits>One</StopBits>
<FlowControl>None</FlowControl>
</AdvancedSettings>
</Connection>
<LastConnectionTime>0</LastConnectionTime>
<EchoTypedCharacters>false</EchoTypedCharacters>
<ClearContentsWhenReconnecting>false</ClearContentsWhenReconnecting>
<ReconnectAutomatically>false</ReconnectAutomatically>
<DisplayMode>ASCII</DisplayMode>
<Colors>
<Background>
<Alpha>255</Alpha>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Background>
<Disconnected>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Disconnected>
<Text>
<Alpha>255</Alpha>
<Red>211</Red>
<Green>211</Green>
<Blue>211</Blue>
</Text>
<Echo>
<Alpha>255</Alpha>
<Red>144</Red>
<Green>238</Green>
<Blue>144</Blue>
</Echo>
<Inactive>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Inactive>
</Colors>
<HexSettings>
<MaximumBytesPerLine>16</MaximumBytesPerLine>
<ShowTextView>true</ShowTextView>
<BreaksAroundEcho>true</BreaksAroundEcho>
<AutoSend>true</AutoSend>
<SendAsHex>true</SendAsHex>
<TimeoutForAutoBreak>0</TimeoutForAutoBreak>
</HexSettings>
<LineEnding>LF</LineEnding>
<TreatLFAsCRLF>false</TreatLFAsCRLF>
<KeepOpenAfterExit>false</KeepOpenAfterExit>
<ShowAfterProgramming>false</ShowAfterProgramming>
</DeviceTerminalSettings>
<CustomShortcuts>
<Shortcuts />
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
</CustomShortcuts>
<UserDefinedVariables />
<ImportedPropertySheets />
<CodeSense>
<Enabled>Unknown</Enabled>
<ExtraSettings>
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
<FormattingEngine xsi:nil="true" />
</ExtraSettings>
<CodeAnalyzerSettings>
<Enabled>false</Enabled>
</CodeAnalyzerSettings>
</CodeSense>
<Configurations>
<VisualGDBConfiguration>
<Name>Debug</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
<VisualGDBConfiguration>
<Name>Release</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
</Configurations>
<ProgramArgumentsSuggestions />
<Debug xsi:type="com.visualgdb.debug.embedded">
<AdditionalStartupCommands />
<AdditionalGDBSettings>
<Features>
<DisableAutoDetection>false</DisableAutoDetection>
<UseFrameParameter>false</UseFrameParameter>
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
<ListLocalsSupported>false</ListLocalsSupported>
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
<ThreadInfoSupported>false</ThreadInfoSupported>
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
<SupportTargetCommand>false</SupportTargetCommand>
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
</Features>
<EnableSmartStepping>false</EnableSmartStepping>
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
<UseAppleExtensions>false</UseAppleExtensions>
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
<MakeLogFile>false</MakeLogFile>
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
<UseRelativePathsOnly>false</UseRelativePathsOnly>
<ExitAction>None</ExitAction>
<DisableDisassembly>false</DisableDisassembly>
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
<StepIntoNewInstanceEntry>app_main</StepIntoNewInstanceEntry>
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
<DisableSignals>false</DisableSignals>
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
<AsyncModeSupportsBreakpoints>true</AsyncModeSupportsBreakpoints>
<TemporaryBreakConsolidationTimeout>0</TemporaryBreakConsolidationTimeout>
<EnableNonStopMode>false</EnableNonStopMode>
<MaxBreakpointLimit>0</MaxBreakpointLimit>
<EnableVerboseMode>true</EnableVerboseMode>
<EnablePrettyPrinters>false</EnablePrettyPrinters>
</AdditionalGDBSettings>
<DebugMethod>
<ID>openocd</ID>
<Configuration xsi:type="com.visualgdb.edp.openocd.settings.esp32">
<CommandLine>-f interface/ftdi/tigard.cfg -c "adapter_khz 15000" -f target/esp32.cfg</CommandLine>
<ExtraParameters>
<Frequency xsi:nil="true" />
<BoostedFrequency xsi:nil="true" />
<ConnectUnderReset>false</ConnectUnderReset>
</ExtraParameters>
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
<ProgramMode>Enabled</ProgramMode>
<StartupCommands>
<string>set remotetimeout 60</string>
<string>target remote :$$SYS:GDB_PORT$$</string>
<string>mon gdb_breakpoint_override hard</string>
<string>mon reset halt</string>
<string>load</string>
</StartupCommands>
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
<PreferredGDBPort>0</PreferredGDBPort>
<PreferredTelnetPort>0</PreferredTelnetPort>
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
<SelectedCoreIndex xsi:nil="true" />
<LiveMemoryTimeout>5000</LiveMemoryTimeout>
<SuggestionLogicRevision>1</SuggestionLogicRevision>
<CheckFLASHSize>true</CheckFLASHSize>
<FLASHSettings>
<Size>size2MB</Size>
<Frequency>freq40M</Frequency>
<Mode>DIO</Mode>
</FLASHSettings>
<PatchBootloader>true</PatchBootloader>
</Configuration>
</DebugMethod>
<AutoDetectRTOS>true</AutoDetectRTOS>
<SemihostingSupport>Disabled</SemihostingSupport>
<SemihostingPollingDelay>0</SemihostingPollingDelay>
<StepIntoEntryPoint>false</StepIntoEntryPoint>
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
<StopAtEntryPoint>false</StopAtEntryPoint>
<EnableVirtualHalts>false</EnableVirtualHalts>
<DynamicAnalysisSettings />
<EndOfStackSymbol>_estack</EndOfStackSymbol>
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
<UnusedStackFillPattern xsi:nil="true" />
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
</Debug>
</VisualGDBProjectSettings2>

View File

@ -0,0 +1,63 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33027.164
MinimumVisualStudioVersion = 10.0.40219.1
Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "wolfssl_benchmark_IDF_v5_ESP32C3", "wolfssl_benchmark_IDF_v5_ESP32C3.vgdbproj", "{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{68202294-86F7-471F-BBBF-47F6B3E3137C}"
ProjectSection(SolutionItems) = preProject
..\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c = ..\..\..\..\..\..\wolfcrypt\benchmark\benchmark.c
..\..\..\..\..\..\wolfcrypt\benchmark\benchmark.h = ..\..\..\..\..\..\wolfcrypt\benchmark\benchmark.h
..\components\wolfssl\include\config.h = ..\components\wolfssl\include\config.h
..\components\wolfssl\include\user_settings.h = ..\components\wolfssl\include\user_settings.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wolfcrypt", "wolfcrypt", "{35897992-1F28-4AB1-B432-7F7D76D61162}"
ProjectSection(SolutionItems) = preProject
..\..\..\..\..\..\wolfcrypt\src\sha.c = ..\..\..\..\..\..\wolfcrypt\src\sha.c
..\..\..\..\..\..\wolfssl\openssl\sha.h = ..\..\..\..\..\..\wolfssl\openssl\sha.h
..\..\..\..\..\..\wolfssl\wolfcrypt\sha.h = ..\..\..\..\..\..\wolfssl\wolfcrypt\sha.h
..\..\..\..\..\..\wolfcrypt\src\sha256.c = ..\..\..\..\..\..\wolfcrypt\src\sha256.c
..\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h = ..\..\..\..\..\..\wolfssl\wolfcrypt\sha256.h
..\..\..\..\..\..\wolfcrypt\src\sha512.c = ..\..\..\..\..\..\wolfcrypt\src\sha512.c
..\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h = ..\..\..\..\..\..\wolfssl\wolfcrypt\sha512.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Espressif Port", "Espressif Port", "{66DEEB01-9378-4714-9EF7-23A0CA65A996}"
ProjectSection(SolutionItems) = preProject
..\..\..\..\..\..\wolfssl\wolfcrypt\port\Espressif\esp32-crypt.h = ..\..\..\..\..\..\wolfssl\wolfcrypt\port\Espressif\esp32-crypt.h
..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_sha.c = ..\..\..\..\..\..\wolfcrypt\src\port\Espressif\esp32_sha.c
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{3BA29EA8-68C5-4144-B471-33BA380C323E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|VisualGDB = Debug|VisualGDB
Release|VisualGDB = Release|VisualGDB
Tests (Debug)|VisualGDB = Tests (Debug)|VisualGDB
Tests (Release)|VisualGDB = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.Build.0 = Release|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.ActiveCfg = Tests (Debug)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.Build.0 = Tests (Debug)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.ActiveCfg = Tests (Release)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.Build.0 = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{35897992-1F28-4AB1-B432-7F7D76D61162} = {68202294-86F7-471F-BBBF-47F6B3E3137C}
{66DEEB01-9378-4714-9EF7-23A0CA65A996} = {68202294-86F7-471F-BBBF-47F6B3E3137C}
{3BA29EA8-68C5-4144-B471-33BA380C323E} = {68202294-86F7-471F-BBBF-47F6B3E3137C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8F3E87F6-73E7-446B-A5B7-ADB94756C9D4}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,271 @@
<?xml version="1.0"?>
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Project xsi:type="com.visualgdb.project.external.esp-idf">
<CustomSourceDirectories>
<Directories />
<PathStyle>Unknown</PathStyle>
</CustomSourceDirectories>
<AutoProgramSPIFFSPartition>true</AutoProgramSPIFFSPartition>
<ProjectModeSettings>
<ProjectGUID>7bbd1486-d457-4e49-92ba-0cfc9d80849e</ProjectGUID>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<HeaderScanMode>SourceDirs</HeaderScanMode>
</ProjectModeSettings>
</Project>
<Build xsi:type="com.visualgdb.build.cmake">
<BuildLogMode xsi:nil="true" />
<ToolchainID>
<ID>com.visualgdb.xtensa-esp32-elf</ID>
<Version>
<GCC>11.2.0</GCC>
<GDB>9.2.90</GDB>
<Revision>2</Revision>
</Version>
</ToolchainID>
<RelativeSourceDirectory>..</RelativeSourceDirectory>
<ConfigurationType>DEBUG</ConfigurationType>
<BinaryDirectory>build/$(PlatformName)/$(ConfigurationName)</BinaryDirectory>
<MakeCommandTemplate>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(ToolchainNinja)</Command>
<WorkingDirectory>$(BuildDir)</WorkingDirectory>
<BackgroundMode xsi:nil="true" />
</MakeCommandTemplate>
<CMakeCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(SYSPROGS_CMAKE_PATH)</Command>
<BackgroundMode xsi:nil="true" />
</CMakeCommand>
<UpdateSourcesInCMakeFile>true</UpdateSourcesInCMakeFile>
<ExportCompileCommands>false</ExportCompileCommands>
<DisableToolchainFile>false</DisableToolchainFile>
<CMakeMakefileType>Ninja</CMakeMakefileType>
<DeployAsRoot>false</DeployAsRoot>
<CMakeCleanMode>RemoveBuildDirectory</CMakeCleanMode>
<UseCCache>false</UseCCache>
<ProjectModeSettings>
<ProjectItemSettings>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<GroupTargetsByPaths>true</GroupTargetsByPaths>
<FollowCMakeSourceGroups>false</FollowCMakeSourceGroups>
<AutoRefreshProject>true</AutoRefreshProject>
<AlwaysConsiderOutdated>false</AlwaysConsiderOutdated>
<SortTargetsByName>true</SortTargetsByName>
<RedundantTargetMode>HideOuterProjectTargets</RedundantTargetMode>
<SortSourcesByName>true</SortSourcesByName>
<BuildAllTargetsInSubdir>false</BuildAllTargetsInSubdir>
<FoldSingleItemPathLevels>true</FoldSingleItemPathLevels>
</ProjectItemSettings>
<TargetSpecificSettings />
<SetLDLibraryPathFromDependentArtifacts>true</SetLDLibraryPathFromDependentArtifacts>
<ProjectGUID>eadcc9ab-72b3-4b51-a838-593e5d80ddf7</ProjectGUID>
<VirtualFolders />
<ConfigurationNameCase>Upper</ConfigurationNameCase>
<DefaultHeaderDiscoveryMode>HeaderDirectoryAndSubdirectories</DefaultHeaderDiscoveryMode>
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
<ESPIDFExtension>
<IDFCheckout>
<Version>release/v5.0</Version>
<Subdirectory>esp-idf/v5.0</Subdirectory>
<Type>ESPIDF</Type>
</IDFCheckout>
<COMPort>COM23</COMPort>
<SuppressTestPrerequisiteChecks>false</SuppressTestPrerequisiteChecks>
<UseCCache>false</UseCCache>
<DeviceID>ESP32C3</DeviceID>
</ESPIDFExtension>
</ProjectModeSettings>
</Build>
<CustomBuild>
<PreSyncActions />
<PreBuildActions />
<PostBuildActions />
<PreCleanActions />
<PostCleanActions />
</CustomBuild>
<CustomDebug>
<PreDebugActions />
<PostDebugActions />
<DebugStopActions />
<BreakMode>Default</BreakMode>
</CustomDebug>
<DeviceTerminalSettings>
<Connection xsi:type="com.sysprogs.terminal.connection.serial">
<ComPortName>COM24</ComPortName>
<AdvancedSettings>
<BaudRate>115200</BaudRate>
<DataBits>8</DataBits>
<Parity>None</Parity>
<StopBits>One</StopBits>
<FlowControl>None</FlowControl>
</AdvancedSettings>
</Connection>
<LastConnectionTime>0</LastConnectionTime>
<EchoTypedCharacters>false</EchoTypedCharacters>
<ClearContentsWhenReconnecting>false</ClearContentsWhenReconnecting>
<ReconnectAutomatically>false</ReconnectAutomatically>
<DisplayMode>ASCII</DisplayMode>
<Colors>
<Background>
<Alpha>255</Alpha>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Background>
<Disconnected>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Disconnected>
<Text>
<Alpha>255</Alpha>
<Red>211</Red>
<Green>211</Green>
<Blue>211</Blue>
</Text>
<Echo>
<Alpha>255</Alpha>
<Red>144</Red>
<Green>238</Green>
<Blue>144</Blue>
</Echo>
<Inactive>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Inactive>
</Colors>
<HexSettings>
<MaximumBytesPerLine>16</MaximumBytesPerLine>
<ShowTextView>true</ShowTextView>
<BreaksAroundEcho>true</BreaksAroundEcho>
<AutoSend>true</AutoSend>
<SendAsHex>true</SendAsHex>
<TimeoutForAutoBreak>0</TimeoutForAutoBreak>
</HexSettings>
<LineEnding>LF</LineEnding>
<TreatLFAsCRLF>false</TreatLFAsCRLF>
<KeepOpenAfterExit>false</KeepOpenAfterExit>
<ShowAfterProgramming>false</ShowAfterProgramming>
</DeviceTerminalSettings>
<CustomShortcuts>
<Shortcuts />
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
</CustomShortcuts>
<UserDefinedVariables />
<ImportedPropertySheets />
<CodeSense>
<Enabled>Unknown</Enabled>
<ExtraSettings>
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
<FormattingEngine xsi:nil="true" />
</ExtraSettings>
<CodeAnalyzerSettings>
<Enabled>false</Enabled>
</CodeAnalyzerSettings>
</CodeSense>
<Configurations>
<VisualGDBConfiguration>
<Name>Debug</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
<VisualGDBConfiguration>
<Name>Release</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
</Configurations>
<ProgramArgumentsSuggestions />
<Debug xsi:type="com.visualgdb.debug.embedded">
<AdditionalStartupCommands />
<AdditionalGDBSettings>
<Features>
<DisableAutoDetection>false</DisableAutoDetection>
<UseFrameParameter>true</UseFrameParameter>
<SimpleValuesFlagSupported>true</SimpleValuesFlagSupported>
<ListLocalsSupported>true</ListLocalsSupported>
<ByteLevelMemoryCommandsAvailable>true</ByteLevelMemoryCommandsAvailable>
<ThreadInfoSupported>true</ThreadInfoSupported>
<PendingBreakpointsSupported>true</PendingBreakpointsSupported>
<SupportTargetCommand>true</SupportTargetCommand>
<ReliableBreakpointNotifications>true</ReliableBreakpointNotifications>
</Features>
<EnableSmartStepping>false</EnableSmartStepping>
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
<UseAppleExtensions>false</UseAppleExtensions>
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
<MakeLogFile>false</MakeLogFile>
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
<UseRelativePathsOnly>false</UseRelativePathsOnly>
<ExitAction>Disconnect</ExitAction>
<DisableDisassembly>false</DisableDisassembly>
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
<StepIntoNewInstanceEntry>app_main</StepIntoNewInstanceEntry>
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
<DisableSignals>false</DisableSignals>
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
<AsyncModeSupportsBreakpoints>true</AsyncModeSupportsBreakpoints>
<TemporaryBreakConsolidationTimeout>0</TemporaryBreakConsolidationTimeout>
<EnableNonStopMode>false</EnableNonStopMode>
<MaxBreakpointLimit>0</MaxBreakpointLimit>
<EnableVerboseMode>true</EnableVerboseMode>
<EnablePrettyPrinters>false</EnablePrettyPrinters>
</AdditionalGDBSettings>
<DebugMethod>
<ID>openocd</ID>
<InterfaceID>esp_usb_jtag</InterfaceID>
<InterfaceSerialNumber>60:55:F9:BC:29:94</InterfaceSerialNumber>
<Configuration xsi:type="com.visualgdb.edp.openocd.settings.esp32">
<CommandLine>-f interface/esp_usb_jtag.cfg -c "adapter_khz 3000" -f target/esp32c3.cfg</CommandLine>
<ExtraParameters>
<Frequency xsi:nil="true" />
<BoostedFrequency xsi:nil="true" />
<ConnectUnderReset>false</ConnectUnderReset>
</ExtraParameters>
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
<ProgramMode>Enabled</ProgramMode>
<StartupCommands>
<string>set remotetimeout 60</string>
<string>target remote :$$SYS:GDB_PORT$$</string>
<string>mon gdb_breakpoint_override hard</string>
<string>mon reset halt</string>
<string>load</string>
</StartupCommands>
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
<PreferredGDBPort>0</PreferredGDBPort>
<PreferredTelnetPort>0</PreferredTelnetPort>
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
<SelectedCoreIndex xsi:nil="true" />
<LiveMemoryTimeout>5000</LiveMemoryTimeout>
<SuggestionLogicRevision>1</SuggestionLogicRevision>
<CheckFLASHSize>true</CheckFLASHSize>
<FLASHSettings>
<Size>size2MB</Size>
<Frequency>freq40M</Frequency>
<Mode>DIO</Mode>
</FLASHSettings>
<PatchBootloader>true</PatchBootloader>
</Configuration>
</DebugMethod>
<AutoDetectRTOS>true</AutoDetectRTOS>
<SemihostingSupport>Disabled</SemihostingSupport>
<SemihostingPollingDelay>0</SemihostingPollingDelay>
<StepIntoEntryPoint>false</StepIntoEntryPoint>
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
<StopAtEntryPoint>false</StopAtEntryPoint>
<EnableVirtualHalts>false</EnableVirtualHalts>
<DynamicAnalysisSettings />
<EndOfStackSymbol>_estack</EndOfStackSymbol>
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
<UnusedStackFillPattern xsi:nil="true" />
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
</Debug>
</VisualGDBProjectSettings2>

View File

@ -0,0 +1,54 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33027.164
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CD9E73EC-27FB-49E4-B3A3-B0502C20A818}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wolfSSL", "wolfSSL", "{20662F9E-D386-4839-B855-857D7F922C99}"
ProjectSection(SolutionItems) = preProject
..\components\wolfssl\CMakeLists.txt = ..\components\wolfssl\CMakeLists.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "include", "include", "{89279333-68BD-4E6A-B970-E645967CE5FA}"
ProjectSection(SolutionItems) = preProject
..\components\wolfssl\include\config.h = ..\components\wolfssl\include\config.h
..\components\wolfssl\include\user_settings.h = ..\components\wolfssl\include\user_settings.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lib", "lib", "{E9586E44-7821-4956-9F72-A79B988B3211}"
ProjectSection(SolutionItems) = preProject
..\..\..\user_settings.h = ..\..\..\user_settings.h
EndProjectSection
EndProject
Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "wolfssl_benchmark_IDF_v5_ESP32S3", "wolfssl_benchmark_IDF_v5_ESP32S3.vgdbproj", "{870D7357-61DA-432A-806F-041A23BC8532}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|VisualGDB = Debug|VisualGDB
Release|VisualGDB = Release|VisualGDB
Tests (Debug)|VisualGDB = Tests (Debug)|VisualGDB
Tests (Release)|VisualGDB = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{870D7357-61DA-432A-806F-041A23BC8532}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
{870D7357-61DA-432A-806F-041A23BC8532}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
{870D7357-61DA-432A-806F-041A23BC8532}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
{870D7357-61DA-432A-806F-041A23BC8532}.Release|VisualGDB.Build.0 = Release|VisualGDB
{870D7357-61DA-432A-806F-041A23BC8532}.Tests (Debug)|VisualGDB.ActiveCfg = Tests (Debug)|VisualGDB
{870D7357-61DA-432A-806F-041A23BC8532}.Tests (Debug)|VisualGDB.Build.0 = Tests (Debug)|VisualGDB
{870D7357-61DA-432A-806F-041A23BC8532}.Tests (Release)|VisualGDB.ActiveCfg = Tests (Release)|VisualGDB
{870D7357-61DA-432A-806F-041A23BC8532}.Tests (Release)|VisualGDB.Build.0 = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{20662F9E-D386-4839-B855-857D7F922C99} = {CD9E73EC-27FB-49E4-B3A3-B0502C20A818}
{89279333-68BD-4E6A-B970-E645967CE5FA} = {20662F9E-D386-4839-B855-857D7F922C99}
{E9586E44-7821-4956-9F72-A79B988B3211} = {CD9E73EC-27FB-49E4-B3A3-B0502C20A818}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7F8E1DC0-55AD-4DF8-B65A-CD65B60E17F9}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,271 @@
<?xml version="1.0"?>
<VisualGDBProjectSettings2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Project xsi:type="com.visualgdb.project.external.esp-idf">
<CustomSourceDirectories>
<Directories />
<PathStyle>Unknown</PathStyle>
</CustomSourceDirectories>
<AutoProgramSPIFFSPartition>true</AutoProgramSPIFFSPartition>
<ProjectModeSettings>
<ProjectGUID>35e5525f-318a-466e-a8c7-36548547d801</ProjectGUID>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<HeaderScanMode>SourceDirs</HeaderScanMode>
</ProjectModeSettings>
</Project>
<Build xsi:type="com.visualgdb.build.cmake">
<BuildLogMode xsi:nil="true" />
<ToolchainID>
<ID>com.visualgdb.xtensa-esp32-elf</ID>
<Version>
<GCC>11.2.0</GCC>
<GDB>9.2.90</GDB>
<Revision>2</Revision>
</Version>
</ToolchainID>
<RelativeSourceDirectory>..</RelativeSourceDirectory>
<ConfigurationType>DEBUG</ConfigurationType>
<BinaryDirectory>build/$(PlatformName)/$(ConfigurationName)</BinaryDirectory>
<MakeCommandTemplate>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(ToolchainNinja)</Command>
<WorkingDirectory>$(BuildDir)</WorkingDirectory>
<BackgroundMode xsi:nil="true" />
</MakeCommandTemplate>
<CMakeCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(SYSPROGS_CMAKE_PATH)</Command>
<BackgroundMode xsi:nil="true" />
</CMakeCommand>
<UpdateSourcesInCMakeFile>true</UpdateSourcesInCMakeFile>
<ExportCompileCommands>false</ExportCompileCommands>
<DisableToolchainFile>false</DisableToolchainFile>
<CMakeMakefileType>Ninja</CMakeMakefileType>
<DeployAsRoot>false</DeployAsRoot>
<CMakeCleanMode>RemoveBuildDirectory</CMakeCleanMode>
<UseCCache>false</UseCCache>
<ProjectModeSettings>
<ProjectItemSettings>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<GroupTargetsByPaths>true</GroupTargetsByPaths>
<FollowCMakeSourceGroups>false</FollowCMakeSourceGroups>
<AutoRefreshProject>true</AutoRefreshProject>
<AlwaysConsiderOutdated>false</AlwaysConsiderOutdated>
<SortTargetsByName>true</SortTargetsByName>
<RedundantTargetMode>HideOuterProjectTargets</RedundantTargetMode>
<SortSourcesByName>true</SortSourcesByName>
<BuildAllTargetsInSubdir>false</BuildAllTargetsInSubdir>
<FoldSingleItemPathLevels>true</FoldSingleItemPathLevels>
</ProjectItemSettings>
<TargetSpecificSettings />
<SetLDLibraryPathFromDependentArtifacts>true</SetLDLibraryPathFromDependentArtifacts>
<ProjectGUID>eadcc9ab-72b3-4b51-a838-593e5d80ddf7</ProjectGUID>
<VirtualFolders />
<ConfigurationNameCase>Upper</ConfigurationNameCase>
<DefaultHeaderDiscoveryMode>HeaderDirectoryAndSubdirectories</DefaultHeaderDiscoveryMode>
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
<ESPIDFExtension>
<IDFCheckout>
<Version>release/v5.0</Version>
<Subdirectory>esp-idf/v5.0</Subdirectory>
<Type>ESPIDF</Type>
</IDFCheckout>
<COMPort>COM17</COMPort>
<SuppressTestPrerequisiteChecks>false</SuppressTestPrerequisiteChecks>
<UseCCache>false</UseCCache>
<DeviceID>ESP32S3</DeviceID>
</ESPIDFExtension>
</ProjectModeSettings>
</Build>
<CustomBuild>
<PreSyncActions />
<PreBuildActions />
<PostBuildActions />
<PreCleanActions />
<PostCleanActions />
</CustomBuild>
<CustomDebug>
<PreDebugActions />
<PostDebugActions />
<DebugStopActions />
<BreakMode>Default</BreakMode>
</CustomDebug>
<DeviceTerminalSettings>
<Connection xsi:type="com.sysprogs.terminal.connection.serial">
<ComPortName>COM17</ComPortName>
<AdvancedSettings>
<BaudRate>115200</BaudRate>
<DataBits>8</DataBits>
<Parity>None</Parity>
<StopBits>One</StopBits>
<FlowControl>None</FlowControl>
</AdvancedSettings>
</Connection>
<LastConnectionTime>0</LastConnectionTime>
<EchoTypedCharacters>false</EchoTypedCharacters>
<ClearContentsWhenReconnecting>true</ClearContentsWhenReconnecting>
<ReconnectAutomatically>false</ReconnectAutomatically>
<DisplayMode>ASCII</DisplayMode>
<Colors>
<Background>
<Alpha>255</Alpha>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Background>
<Disconnected>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Disconnected>
<Text>
<Alpha>255</Alpha>
<Red>211</Red>
<Green>211</Green>
<Blue>211</Blue>
</Text>
<Echo>
<Alpha>255</Alpha>
<Red>144</Red>
<Green>238</Green>
<Blue>144</Blue>
</Echo>
<Inactive>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Inactive>
</Colors>
<HexSettings>
<MaximumBytesPerLine>16</MaximumBytesPerLine>
<ShowTextView>true</ShowTextView>
<BreaksAroundEcho>true</BreaksAroundEcho>
<AutoSend>true</AutoSend>
<SendAsHex>true</SendAsHex>
<TimeoutForAutoBreak>0</TimeoutForAutoBreak>
</HexSettings>
<LineEnding>LF</LineEnding>
<TreatLFAsCRLF>false</TreatLFAsCRLF>
<KeepOpenAfterExit>false</KeepOpenAfterExit>
<ShowAfterProgramming>false</ShowAfterProgramming>
</DeviceTerminalSettings>
<CustomShortcuts>
<Shortcuts />
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
</CustomShortcuts>
<UserDefinedVariables />
<ImportedPropertySheets />
<CodeSense>
<Enabled>Unknown</Enabled>
<ExtraSettings>
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
<FormattingEngine xsi:nil="true" />
</ExtraSettings>
<CodeAnalyzerSettings>
<Enabled>false</Enabled>
</CodeAnalyzerSettings>
</CodeSense>
<Configurations>
<VisualGDBConfiguration>
<Name>Debug</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
<VisualGDBConfiguration>
<Name>Release</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
</Configurations>
<ProgramArgumentsSuggestions />
<Debug xsi:type="com.visualgdb.debug.embedded">
<AdditionalStartupCommands />
<AdditionalGDBSettings>
<Features>
<DisableAutoDetection>false</DisableAutoDetection>
<UseFrameParameter>false</UseFrameParameter>
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
<ListLocalsSupported>false</ListLocalsSupported>
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
<ThreadInfoSupported>false</ThreadInfoSupported>
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
<SupportTargetCommand>false</SupportTargetCommand>
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
</Features>
<EnableSmartStepping>false</EnableSmartStepping>
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
<UseAppleExtensions>false</UseAppleExtensions>
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
<MakeLogFile>false</MakeLogFile>
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
<UseRelativePathsOnly>false</UseRelativePathsOnly>
<ExitAction>None</ExitAction>
<DisableDisassembly>false</DisableDisassembly>
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
<StepIntoNewInstanceEntry>app_main</StepIntoNewInstanceEntry>
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
<DisableSignals>false</DisableSignals>
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
<AsyncModeSupportsBreakpoints>true</AsyncModeSupportsBreakpoints>
<TemporaryBreakConsolidationTimeout>0</TemporaryBreakConsolidationTimeout>
<EnableNonStopMode>false</EnableNonStopMode>
<MaxBreakpointLimit>0</MaxBreakpointLimit>
<EnableVerboseMode>true</EnableVerboseMode>
<EnablePrettyPrinters>false</EnablePrettyPrinters>
</AdditionalGDBSettings>
<DebugMethod>
<ID>openocd</ID>
<InterfaceID>esp_usb_jtag</InterfaceID>
<InterfaceSerialNumber>7C:00:00:00:00:00</InterfaceSerialNumber>
<Configuration xsi:type="com.visualgdb.edp.openocd.settings.esp32">
<CommandLine>-f interface/esp_usb_jtag.cfg -f target/esp32s3.cfg</CommandLine>
<ExtraParameters>
<Frequency xsi:nil="true" />
<BoostedFrequency xsi:nil="true" />
<ConnectUnderReset>false</ConnectUnderReset>
</ExtraParameters>
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
<ProgramMode>Enabled</ProgramMode>
<StartupCommands>
<string>set remotetimeout 60</string>
<string>target remote :$$SYS:GDB_PORT$$</string>
<string>mon gdb_breakpoint_override hard</string>
<string>mon reset halt</string>
<string>load</string>
</StartupCommands>
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
<PreferredGDBPort>0</PreferredGDBPort>
<PreferredTelnetPort>0</PreferredTelnetPort>
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
<SelectedCoreIndex xsi:nil="true" />
<LiveMemoryTimeout>5000</LiveMemoryTimeout>
<SuggestionLogicRevision>1</SuggestionLogicRevision>
<CheckFLASHSize>true</CheckFLASHSize>
<FLASHSettings>
<Size>size2MB</Size>
<Frequency>freq40M</Frequency>
<Mode>DIO</Mode>
</FLASHSettings>
<PatchBootloader>true</PatchBootloader>
</Configuration>
</DebugMethod>
<AutoDetectRTOS>true</AutoDetectRTOS>
<SemihostingSupport>Auto</SemihostingSupport>
<SemihostingPollingDelay>0</SemihostingPollingDelay>
<StepIntoEntryPoint>false</StepIntoEntryPoint>
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
<StopAtEntryPoint>false</StopAtEntryPoint>
<EnableVirtualHalts>false</EnableVirtualHalts>
<DynamicAnalysisSettings />
<EndOfStackSymbol>_estack</EndOfStackSymbol>
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
<UnusedStackFillPattern xsi:nil="true" />
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
</Debug>
</VisualGDBProjectSettings2>

View File

@ -0,0 +1,232 @@
#
# Copyright (C) 2006-2023 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#
# cmake for wolfssl
#
cmake_minimum_required(VERSION 3.5)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(CMAKE_CURRENT_SOURCE_DIR ".")
# We are currently in [root]/IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl
# The root of wolfSSL is 7 directories up from here:
get_filename_component(WOLFSSL_ROOT "../../../../../../../" ABSOLUTE)
# Espressif may take several passes through this makefile. Check to see if we found IDF
string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "" WOLFSSL_FOUND_IDF)
if($WOLFSSL_FOUND_IDF)
message(STATUS "IDF_PATH = $ENV{IDF_PATH}")
message(STATUS "WOLFSSL_ROOT = ${WOLFSSL_ROOT}")
message(STATUS "PROJECT_SOURCE_DIR = ${PROJECT_SOURCE_DIR}")
endif()
# get a list of all wolfcrypt assembly files; we'll exclude them as they don't target Xtensa
FILE(GLOB EXCLUDE_ASM *.S)
file(GLOB_RECURSE EXCLUDE_ASM ${CMAKE_SOURCE_DIR} "${WOLFSSL_ROOT}/wolfcrypt/src/*.S")
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
message(STATUS "EXCLUDE_ASM = ${EXCLUDE_ASM}")
endif()
set(INCLUDE_PATH ${WOLFSSL_ROOT})
set(COMPONENT_SRCDIRS "${WOLFSSL_ROOT}/src/"
"${WOLFSSL_ROOT}/wolfcrypt/src/"
"${WOLFSSL_ROOT}/wolfcrypt/src/port/Espressif/"
"${WOLFSSL_ROOT}/wolfcrypt/src/port/atmel/"
"${WOLFSSL_ROOT}/wolfcrypt/benchmark/"
"${WOLFSSL_ROOT}/wolfcrypt/test/"
)
set(COMPONENT_REQUIRES lwip)
# check to see if there's both a local copy and EDP-IDF copy of the wolfssl and/or wolfssh components
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in both ESP-IDF and local project - needs to be resolved by user
#
message(STATUS "")
message(STATUS "**************************************************************************************")
message(STATUS "")
message(STATUS "Error: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "")
message(STATUS "To proceed: ")
message(STATUS "")
message(STATUS "Remove either the local project component: ${CMAKE_HOME_DIRECTORY}/components/wolfssl/ ")
message(STATUS "or the Espressif shared component installed at: $ENV{IDF_PATH}/components/wolfssl/ ")
message(STATUS "")
message(FATAL_ERROR "Please use wolfSSL in either local project or Espressif components, but not both.")
message(STATUS "")
message(STATUS "**************************************************************************************")
message(STATUS "")
# Optional: if you change the above FATAL_ERROR to STATUS you can warn at runtime with this macro definition:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_MULTI_INSTALL_WARNING")
else()
if( EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in ESP-IDF components and is assumed to be already configured in user_settings.h via setup.
#
message(STATUS "")
message(STATUS "Using components/wolfssl in IDF_PATH = $ENV{IDF_PATH}")
message(STATUS "")
else()
#
# wolfSSL is not an ESP-IDF component. We need to now determine if it is local and if so if it is part of the wolfSSL repo
# or if wolfSSL is simply installed as a local component.
#
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" )
#
# wolfSSL found in local project.
#
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/include/" )
message(STATUS "")
message(STATUS "Using installed project ./components/wolfssl in CMAKE_HOME_DIRECTORY = $ENV{CMAKE_HOME_DIRECTORY}")
message(STATUS "")
#
# Note we already checked above and confirmed there's not another wolfSSL installed in the ESP-IDF components.
#
# We won't do anything else here, as it will be assumed the original install completed successfully.
#
else()
#
# This is the developer repo mode. wolfSSL will be assume to be not installed to ESP-IDF nor local project
# In this configuration, we are likely running a wolfSSL example found directly in the repo.
#
message(STATUS "")
message(STATUS "Using developer repo ./components/wolfssl in CMAKE_HOME_DIRECTORY = $ENV{CMAKE_HOME_DIRECTORY}")
message(STATUS "")
message(STATUS "************************************************************************************************")
# When in developer mode, we are typically running wolfSSL examples such as benchmark or test directories.
# However, the as-cloned or distributed wolfSSL does not have the ./include/ directory, so we'll add it as needed.
#
# first check if there's a [root]/include/user_settings.h
if( EXISTS "${WOLFSSL_ROOT}/include/user_settings.h" )
# we won't overwrite an existing user settings file, just note that we already have one:
message(STATUS "Found wolfSSL user_settings.h in ${WOLFSSL_ROOT}/include/user_settings.h")
else()
message(STATUS "Installing wolfSSL user_settings.h to ${WOLFSSL_ROOT}/include/user_settings.h")
file(COPY "${WOLFSSL_ROOT}/IDE/Espressif/ESP-IDF/user_settings.h" DESTINATION "${WOLFSSL_ROOT}/include/")
endif() # user_settings.h
# next check if there's a [root]/include/config.h
if( EXISTS "${WOLFSSL_ROOT}/include/config.h" )
message(STATUS "Found wolfSSL config.h in ${WOLFSSL_ROOT}/include/config.h")
else()
message(STATUS "Installing wolfSSL config.h to ${WOLFSSL_ROOT}/include/config.h")
file(COPY "${WOLFSSL_ROOT}/IDE/Espressif/ESP-IDF/dummy_config_h" DESTINATION "${WOLFSSL_ROOT}/include/")
file(RENAME "${WOLFSSL_ROOT}/include/dummy_config_h" "${WOLFSSL_ROOT}/include/config.h")
endif() # config.h
message(STATUS "************************************************************************************************")
message(STATUS "")
endif()
else()
# we did not find a ./components/wolfssl/include/ directory from this pass of cmake.
if($WOLFSSL_FOUND_IDF)
message(STATUS "")
message(STATUS "WARNING: wolfSSL not found.")
message(STATUS "")
else()
# probably needs to be re-parsed by Espressif
message(STATUS "wolfSSL found IDF. Project Source:${PROJECT_SOURCE_DIR}")
endif() # else we have not found ESP-IDF yet
endif() # else not a local wolfSSL component
endif() #else not an ESP-IDF component
endif() # else not local copy and EDP-IDF wolfSSL
# RTOS_IDF_PATH is typically:
# "/Users/{username}/Desktop/esp-idf/components/freertos/include/freertos"
# depending on the environment, we may need to swap backslashes with forward slashes
string(REPLACE "\\" "/" RTOS_IDF_PATH "$ENV{IDF_PATH}/components/freertos/include/freertos")
# ESP-IDF after version 4.4x has a different RTOS directory structure
string(REPLACE "\\" "/" RTOS_IDF_PATH5 "$ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos")
if(IS_DIRECTORY ${IDF_PATH}/components/freertos/FreeRTOS-Kernel/)
set(COMPONENT_ADD_INCLUDEDIRS
"."
"${WOLFSSL_ROOT}/include"
"${RTOS_IDF_PATH5}"
"${WOLFSSL_ROOT}"
)
else()
set(COMPONENT_ADD_INCLUDEDIRS
"."
"${WOLFSSL_ROOT}/include"
"${RTOS_IDF_PATH}"
"${WOLFSSL_ROOT}"
)
endif()
if(IS_DIRECTORY ${IDF_PATH}/components/cryptoauthlib)
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../cryptoauthlib/lib")
endif()
set(COMPONENT_SRCEXCLUDE
"${WOLFSSL_ROOT}/src/bio.c"
"${WOLFSSL_ROOT}/src/conf.c"
"${WOLFSSL_ROOT}/src/misc.c"
"${WOLFSSL_ROOT}/src/pk.c"
"${WOLFSSL_ROOT}/src/ssl_asn1.c" # included by ssl.c
"${WOLFSSL_ROOT}/src/ssl_bn.c" # included by ssl.c
"${WOLFSSL_ROOT}/src/ssl_misc.c" # included by ssl.c
"${WOLFSSL_ROOT}/src/x509.c"
"${WOLFSSL_ROOT}/src/x509_str.c"
"${WOLFSSL_ROOT}/wolfcrypt/src/evp.c"
"${WOLFSSL_ROOT}/wolfcrypt/src/misc.c"
"${EXCLUDE_ASM}"
)
set(COMPONENT_PRIV_INCLUDEDIRS ${IDF_PATH}/components/driver/include)
register_component()
# some optional diagnostics
if (0)
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
message(STATUS "")
message(STATUS "ALL VARIABLES BEGIN")
message(STATUS "")
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
message(STATUS "")
message(STATUS "ALL VARIABLES END")
message(STATUS "")
endif()
# check to see if there's both a local copy and EDP-IDF copy of the wolfssl components
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
message(STATUS "")
message(STATUS "")
message(STATUS "********************************************************************")
message(STATUS "WARNING: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "********************************************************************")
message(STATUS "")
endif()
# end multiple component check

View File

@ -0,0 +1,40 @@
#
# Copyright (C) 2006-2023 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#
#
# Component Makefile
#
COMPONENT_ADD_INCLUDEDIRS := . ./include
COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/components/freertos/include/freertos"
# COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/soc/esp32s3/include/soc"
COMPONENT_SRCDIRS := src wolfcrypt/src
COMPONENT_SRCDIRS += wolfcrypt/src/port/Espressif
COMPONENT_SRCDIRS += wolfcrypt/src/port/atmel
COMPONENT_SRCDIRS += wolfcrypt/benchmark
COMPONENT_SRCDIRS += wolfcrypt/test
CFLAGS +=-DWOLFSSL_USER_SETTINGS
COMPONENT_OBJEXCLUDE := wolfcrypt/src/aes_asm.o
COMPONENT_OBJEXCLUDE += wolfcrypt/src/evp.o
COMPONENT_OBJEXCLUDE += wolfcrypt/src/misc.o
COMPONENT_OBJEXCLUDE += src/bio.o

View File

@ -4,7 +4,72 @@
#
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCS "benchmark.c" "helper.c")
set(COMPONENT_SRCS main.c)
set(COMPONENT_ADD_INCLUDEDIRS ".")
set (git_cmd "git")
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in both ESP-IDF and local project - needs to be resolved by user
#
message(STATUS "")
message(STATUS "WARNING: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_MULTI_INSTALL_WARNING")
endif()
register_component()
#
# LIBWOLFSSL_SAVE_INFO(VAR_OUPUT THIS_VAR VAR_RESULT)
#
# Save the THIS_VAR as a string in a macro called VAR_OUPUT
#
# VAR_OUPUT: the name of the macro to define
# THIS_VAR: the OUTPUT_VARIABLE result from a execute_process()
# VAR_RESULT: the RESULT_VARIABLE from a execute_process(); "0" if successful.
#
function ( LIBWOLFSSL_SAVE_INFO VAR_OUPUT THIS_VAR VAR_RESULT )
# is the RESULT_VARIABLE output value 0? If so, IS_VALID_VALUE is true.
string(COMPARE EQUAL "${VAR_RESULT}" "0" IS_VALID_VALUE)
# if we had a successful operation, save the THIS_VAR in VAR_OUPUT
if(${IS_VALID_VALUE})
# strip newline chars in THIS_VAR parameter and save in VAR_VALUE
string(REPLACE "\n" "" VAR_VALUE ${THIS_VAR})
# we'll could percolate the value to the parent for possible later use
# set(${VAR_OUPUT} ${VAR_VALUE} PARENT_SCOPE)
# but we're only using it here in this function
set(${VAR_OUPUT} ${VAR_VALUE})
# we'll print what we found to the console
message(STATUS "Found ${VAR_OUPUT}=${VAR_VALUE}")
# the interesting part is defining the VAR_OUPUT name a value to use in the app
add_definitions(-D${VAR_OUPUT}=\"${VAR_VALUE}\")
else()
# if we get here, check the execute_process command and parameters.
message(STATUS "LIBWOLFSSL_SAVE_INFO encountered a non-zero VAR_RESULT")
set(${VAR_OUPUT} "Unknown")
endif()
endfunction() # LIBWOLFSSL_SAVE_INFO
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
# LIBWOLFSSL_VERSION_GIT_HASH
execute_process(COMMAND ${git_cmd} "rev-parse" "HEAD" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES ERROR_QUIET )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_HASH "${TMP_OUT}" "${TMP_RES}")
# LIBWOLFSSL_VERSION_GIT_SHORT_HASH
execute_process(COMMAND ${git_cmd} "rev-parse" "--short" "HEAD" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES ERROR_QUIET )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_SHORT_HASH "${TMP_OUT}" "${TMP_RES}")
# LIBWOLFSSL_VERSION_GIT_HASH_DATE
execute_process(COMMAND ${git_cmd} "show" "--no-patch" "--no-notes" "--pretty=\'\%cd\'" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_HASH_DATE "${TMP_OUT}" "${TMP_RES}")
endif()
message(STATUS "")

View File

@ -1,173 +0,0 @@
/* helper.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/types.h>
#include <wolfcrypt/benchmark/benchmark.h>
#include "sdkconfig.h"
#include "esp_log.h"
#define WOLFSSL_BENCH_ARGV CONFIG_BENCH_ARGV
/* proto-type */
extern void wolf_benchmark_task();
static const char* const TAG = "wolfbenchmark";
char* __argv[22];
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
/* when you need to use a custom slot allocation, */
/* enable the definition CUSTOM_SLOT_ALLOCAION. */
#if defined(CUSTOM_SLOT_ALLOCATION)
static byte mSlotList[ATECC_MAX_SLOT];
/* initialize slot array */
void my_atmel_slotInit()
{
int i;
for(i = 0;i < ATECC_MAX_SLOT;i++) {
mSlotList[i] = ATECC_INVALID_SLOT;
}
}
/* allocate slot depending on slotType */
int my_atmel_alloc(int slotType)
{
int i, slot = -1;
switch(slotType){
case ATMEL_SLOT_ENCKEY:
slot = 4;
break;
case ATMEL_SLOT_DEVICE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE_ENC:
slot = 4;
break;
case ATMEL_SLOT_ANY:
for(i = 0;i < ATECC_MAX_SLOT;i++){
if(mSlotList[i] == ATECC_INVALID_SLOT){
slot = i;
break;
}
}
}
return slot;
}
/* free slot array */
void my_atmel_free(int slotId)
{
if(slotId >= 0 && slotId < ATECC_MAX_SLOT){
mSlotList[slotId] = ATECC_INVALID_SLOT;
}
}
#endif /* CUSTOM_SLOT_ALLOCATION */
#endif /* WOLFSSL_ESPWROOM32SE && HAVE_PK_CALLBACK && WOLFSSL_ATECC508A */
int construct_argv()
{
int cnt = 0;
int i = 0;
int len = 0;
char *_argv; /* buffer for copying the string */
char *ch; /* char pointer to trace the string */
char buff[16] = { 0 }; /* buffer for a argument copy */
printf("arg:%s\n", CONFIG_BENCH_ARGV);
len = strlen(CONFIG_BENCH_ARGV);
_argv = (char*)malloc(len + 1);
if (!_argv) {
return -1;
}
memset(_argv, 0, len+1);
memcpy(_argv, CONFIG_BENCH_ARGV, len);
_argv[len] = '\0';
ch = _argv;
__argv[cnt] = malloc(10);
sprintf(__argv[cnt], "benchmark");
__argv[cnt][9] = '\0';
cnt = 1;
while (*ch != '\0')
{
/* skip white-space */
while (*ch == ' ') { ++ch; }
memset(buff, 0, sizeof(buff));
/* copy each args into buffer */
i = 0;
while ((*ch != ' ') && (*ch != '\0') && (i < 16)) {
buff[i] = *ch;
++i;
++ch;
}
/* copy the string into argv */
__argv[cnt] = (char*)malloc(i + 1);
memset(__argv[cnt], 0, i + 1);
memcpy(__argv[cnt], buff, i + 1);
/* next args */
++cnt;
}
free(_argv);
return (cnt);
}
/* entry point */
void app_main(void)
{
(void) TAG;
#ifndef NO_CRYPT_BENCHMARK
/* when using atecc608a on esp32-wroom-32se */
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#if defined(CUSTOM_SLOT_ALLOCATION)
my_atmel_slotInit();
/* to register the callback, it needs to be initialized. */
if ((wolfCrypt_Init()) != 0) {
ESP_LOGE(TAG, "wolfCrypt_Init failed");
return;
}
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
#endif
#endif
wolf_benchmark_task();
#else
#endif /* NO_CRYPT_BENCHMARK */
}

View File

@ -0,0 +1,266 @@
/* benchmark main.c
*
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* ESP-IDF */
#include <esp_log.h>
#include "sdkconfig.h"
/* wolfSSL */
#include <wolfssl/wolfcrypt/settings.h>
#include <user_settings.h>
#include <wolfssl/version.h>
#ifndef WOLFSSL_ESPIDF
#warning "problem with wolfSSL user_settings. Check components/wolfssl/include"
#endif
#include <wolfssl/wolfcrypt/types.h>
#include <wolfcrypt/benchmark/benchmark.h>
/* check BENCH_ARGV in sdkconfig to determine need to set WOLFSSL_BENCH_ARGV */
#ifdef CONFIG_BENCH_ARGV
#define WOLFSSL_BENCH_ARGV CONFIG_BENCH_ARGV
#define WOLFSSL_BENCH_ARGV_MAX_ARGUMENTS 22 /* arbitrary number of max args */
#endif
/*
** the wolfssl component can be installed in either:
**
** - the ESP-IDF component directory
**
** ** OR **
**
** - the local project component directory
**
** it is not recommended to install in both.
**
*/
#include "main.h"
static const char* const TAG = "wolfssl_benchmark";
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
/* when you need to use a custom slot allocation, */
/* enable the definition CUSTOM_SLOT_ALLOCAION. */
#if defined(CUSTOM_SLOT_ALLOCATION)
static byte mSlotList[ATECC_MAX_SLOT];
/* initialize slot array */
void my_atmel_slotInit()
{
int i;
for(i = 0;i < ATECC_MAX_SLOT;i++) {
mSlotList[i] = ATECC_INVALID_SLOT;
}
}
/* allocate slot depending on slotType */
int my_atmel_alloc(int slotType)
{
int i, slot = -1;
switch(slotType){
case ATMEL_SLOT_ENCKEY:
slot = 4;
break;
case ATMEL_SLOT_DEVICE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE_ENC:
slot = 4;
break;
case ATMEL_SLOT_ANY:
for(i = 0;i < ATECC_MAX_SLOT;i++){
if(mSlotList[i] == ATECC_INVALID_SLOT){
slot = i;
break;
}
}
}
return slot;
}
/* free slot array */
void my_atmel_free(int slotId)
{
if(slotId >= 0 && slotId < ATECC_MAX_SLOT){
mSlotList[slotId] = ATECC_INVALID_SLOT;
}
}
#endif /* CUSTOM_SLOT_ALLOCATION */
#endif /* WOLFSSL_ESPWROOM32SE && HAVE_PK_CALLBACK && WOLFSSL_ATECC508A */
/* the following are needed by benchmark.c with args */
#ifdef WOLFSSL_BENCH_ARGV
char* __argv[WOLFSSL_BENCH_ARGV_MAX_ARGUMENTS];
int construct_argv()
{
int cnt = 0;
int i = 0;
int len = 0;
char *_argv; /* buffer for copying the string */
char *ch; /* char pointer to trace the string */
char buff[16] = { 0 }; /* buffer for a argument copy */
ESP_LOGI(TAG, "construct_argv arg:%s\n", CONFIG_BENCH_ARGV);
len = strlen(CONFIG_BENCH_ARGV);
_argv = (char*)malloc(len + 1);
if (!_argv) {
return -1;
}
memset(_argv, 0, len + 1);
memcpy(_argv, CONFIG_BENCH_ARGV, len);
_argv[len] = '\0';
ch = _argv;
__argv[cnt] = malloc(10);
sprintf(__argv[cnt], "benchmark");
__argv[cnt][9] = '\0';
cnt = 1;
while (*ch != '\0') {
/* check that we don't overflow manual arg assembly */
if (cnt >= (WOLFSSL_BENCH_ARGV_MAX_ARGUMENTS)) {
ESP_LOGE(TAG, "Abort construct_argv;"
"Reached maximum defined arguments = %d",
WOLFSSL_BENCH_ARGV_MAX_ARGUMENTS);
break;
}
/* skip white-space */
while (*ch == ' ') { ++ch; }
memset(buff, 0, sizeof(buff));
/* copy each args into buffer */
i = 0;
while ((*ch != ' ') && (*ch != '\0') && (i < 16)) {
buff[i] = *ch;
++i;
++ch;
}
/* copy the string into argv */
__argv[cnt] = (char*)malloc(i + 1);
memset(__argv[cnt], 0, i + 1);
memcpy(__argv[cnt], buff, i + 1);
/* next args */
++cnt;
}
free(_argv);
return (cnt);
}
#endif
/* entry point */
void app_main(void)
{
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "---------------------- BEGIN MAIN ----------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "CONFIG_IDF_TARGET = %s", CONFIG_IDF_TARGET);
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_STRING = %s", LIBWOLFSSL_VERSION_STRING);
#if defined(WOLFSSL_MULTI_INSTALL_WARNING)
ESP_LOGI(TAG, "");
ESP_LOGI(TAG, "WARNING: Multiple wolfSSL installs found.");
ESP_LOGI(TAG, "Check ESP-IDF and local project [components] directory.");
ESP_LOGI(TAG, "");
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_HASH)
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_HASH = %s", LIBWOLFSSL_VERSION_GIT_HASH);
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_SHORT_HASH )
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_SHORT_HASH = %s", LIBWOLFSSL_VERSION_GIT_SHORT_HASH);
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_HASH_DATE)
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_HASH_DATE = %s", LIBWOLFSSL_VERSION_GIT_HASH_DATE);
#endif
/* some interesting settings are target specific (ESP32, -C3, -S3, etc */
#if defined(CONFIG_IDF_TARGET_ESP32C3)
/* not available for C3 at this time */
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
ESP_LOGI(TAG, "CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ = %u MHz",
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ
);
ESP_LOGI(TAG, "Xthal_have_ccount = %u", Xthal_have_ccount);
#else
ESP_LOGI(TAG, "CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ = %u MHz",
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ
);
ESP_LOGI(TAG, "Xthal_have_ccount = %u", Xthal_have_ccount);
#endif
/* all platforms: stack high water mark check */
ESP_LOGI(TAG, "Stack HWM: %d\n", uxTaskGetStackHighWaterMark(NULL));
ESP_LOGI(TAG, "app_main CONFIG_BENCH_ARGV = %s", WOLFSSL_BENCH_ARGV);
/* when using atecc608a on esp32-wroom-32se */
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#if defined(CUSTOM_SLOT_ALLOCATION)
my_atmel_slotInit();
/* to register the callback, it needs to be initialized. */
if ((wolfCrypt_Init()) != 0) {
ESP_LOGE(TAG, "wolfCrypt_Init failed");
return;
}
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
#endif
#endif
#ifdef NO_CRYPT_BENCHMARK
ESP_LOGI(TAG, "NO_CRYPT_BENCHMARK defined, skipping wolf_benchmark_task")
#else
/* although wolfCrypt_Init() may be explicitly called above,
** note it is still always called in wolf_benchmark_task.
*/
wolf_benchmark_task();
/* wolfCrypt_Cleanup should always be called at completion,
** and is called in wolf_benchmark_task().
*/
ESP_LOGI(TAG, "Stack HWM: %d\n", uxTaskGetStackHighWaterMark(NULL));
/* after the test, we'll just wait */
while (1) {
/* nothing */
}
#endif /* NO_CRYPT_BENCHMARK */
} /* main */

View File

@ -0,0 +1,29 @@
#pragma once
/* benchmark main.h
*
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
void app_main(void);
/* see wolfssl/wolfcrypt/benchmark/benchmark.h */
extern void wolf_benchmark_task();

View File

@ -1,6 +1,44 @@
CONFIG_BENCH_ARGV="-lng 0"
CONFIG_MAIN_TASK_STACK_SIZE=7500
CONFIG_FREERTOS_HZ=1000
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
170 CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
#
# Default main stack size
#
# This is typically way bigger than needed for stack size. See user_settings.h
#
CONFIG_ESP_MAIN_TASK_STACK_SIZE=55500
# Legacy stack size for older ESP-IDF versions
CONFIG_MAIN_TASK_STACK_SIZE=55500
#
# Watchdog Timers
#
# We don't want to have the watchdog timeout during tests
#
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=n
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=n
#
# Compiler options
#
CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
CONFIG_COMPILER_HIDE_PATHS_MACROS=y
CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y
CONFIG_COMPILER_STACK_CHECK=y
#
# Partition Table
#
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
# CONFIG_PARTITION_TABLE_CUSTOM is not set
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp_large.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table

View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33027.164
MinimumVisualStudioVersion = 10.0.40219.1
Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "VisualGDB_wolfssl_client", "VisualGDB_wolfssl_client.vgdbproj", "{E903E9CC-1A23-4B00-8914-7E45EC21E351}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|VisualGDB = Debug|VisualGDB
Release|VisualGDB = Release|VisualGDB
Tests (Debug)|VisualGDB = Tests (Debug)|VisualGDB
Tests (Release)|VisualGDB = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E903E9CC-1A23-4B00-8914-7E45EC21E351}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
{E903E9CC-1A23-4B00-8914-7E45EC21E351}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
{E903E9CC-1A23-4B00-8914-7E45EC21E351}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
{E903E9CC-1A23-4B00-8914-7E45EC21E351}.Release|VisualGDB.Build.0 = Release|VisualGDB
{E903E9CC-1A23-4B00-8914-7E45EC21E351}.Tests (Debug)|VisualGDB.ActiveCfg = Tests (Debug)|VisualGDB
{E903E9CC-1A23-4B00-8914-7E45EC21E351}.Tests (Debug)|VisualGDB.Build.0 = Tests (Debug)|VisualGDB
{E903E9CC-1A23-4B00-8914-7E45EC21E351}.Tests (Release)|VisualGDB.ActiveCfg = Tests (Release)|VisualGDB
{E903E9CC-1A23-4B00-8914-7E45EC21E351}.Tests (Release)|VisualGDB.Build.0 = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D510376F-F313-4EF6-8EF5-248D1949DFEB}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,269 @@
<?xml version="1.0"?>
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Project xsi:type="com.visualgdb.project.external.esp-idf">
<CustomSourceDirectories>
<Directories />
<PathStyle>Unknown</PathStyle>
</CustomSourceDirectories>
<AutoProgramSPIFFSPartition>true</AutoProgramSPIFFSPartition>
<ProjectModeSettings>
<ProjectGUID>bdbba681-1213-45f8-a44e-4652fe489fe3</ProjectGUID>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<HeaderScanMode>SourceDirs</HeaderScanMode>
</ProjectModeSettings>
</Project>
<Build xsi:type="com.visualgdb.build.cmake">
<BuildLogMode xsi:nil="true" />
<ToolchainID>
<ID>com.visualgdb.xtensa-esp32-elf</ID>
<Version>
<GCC>11.2.0</GCC>
<GDB>9.2.90</GDB>
<Revision>2</Revision>
</Version>
</ToolchainID>
<RelativeSourceDirectory>..</RelativeSourceDirectory>
<ConfigurationType>DEBUG</ConfigurationType>
<BinaryDirectory>build/$(PlatformName)/$(ConfigurationName)</BinaryDirectory>
<MakeCommandTemplate>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(ToolchainNinja)</Command>
<WorkingDirectory>$(BuildDir)</WorkingDirectory>
<BackgroundMode xsi:nil="true" />
</MakeCommandTemplate>
<CMakeCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(SYSPROGS_CMAKE_PATH)</Command>
<BackgroundMode xsi:nil="true" />
</CMakeCommand>
<UpdateSourcesInCMakeFile>true</UpdateSourcesInCMakeFile>
<ExportCompileCommands>false</ExportCompileCommands>
<DisableToolchainFile>false</DisableToolchainFile>
<CMakeMakefileType>Ninja</CMakeMakefileType>
<DeployAsRoot>false</DeployAsRoot>
<CMakeCleanMode>RemoveBuildDirectory</CMakeCleanMode>
<UseCCache>false</UseCCache>
<ProjectModeSettings>
<ProjectItemSettings>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<GroupTargetsByPaths>true</GroupTargetsByPaths>
<FollowCMakeSourceGroups>false</FollowCMakeSourceGroups>
<AutoRefreshProject>true</AutoRefreshProject>
<AlwaysConsiderOutdated>false</AlwaysConsiderOutdated>
<SortTargetsByName>true</SortTargetsByName>
<RedundantTargetMode>HideOuterProjectTargets</RedundantTargetMode>
<SortSourcesByName>true</SortSourcesByName>
<BuildAllTargetsInSubdir>false</BuildAllTargetsInSubdir>
<FoldSingleItemPathLevels>true</FoldSingleItemPathLevels>
</ProjectItemSettings>
<TargetSpecificSettings />
<SetLDLibraryPathFromDependentArtifacts>true</SetLDLibraryPathFromDependentArtifacts>
<ProjectGUID>e903e9cc-1a23-4b00-8914-7e45ec21e351</ProjectGUID>
<VirtualFolders />
<ConfigurationNameCase>Upper</ConfigurationNameCase>
<DefaultHeaderDiscoveryMode>HeaderDirectoryAndSubdirectories</DefaultHeaderDiscoveryMode>
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
<ESPIDFExtension>
<IDFCheckout>
<Version>release/v5.0</Version>
<Subdirectory>esp-idf/v5.0</Subdirectory>
<Type>ESPIDF</Type>
</IDFCheckout>
<COMPort>COM20</COMPort>
<SuppressTestPrerequisiteChecks>false</SuppressTestPrerequisiteChecks>
<UseCCache>false</UseCCache>
<DeviceID>ESP32</DeviceID>
</ESPIDFExtension>
</ProjectModeSettings>
</Build>
<CustomBuild>
<PreSyncActions />
<PreBuildActions />
<PostBuildActions />
<PreCleanActions />
<PostCleanActions />
</CustomBuild>
<CustomDebug>
<PreDebugActions />
<PostDebugActions />
<DebugStopActions />
<BreakMode>Default</BreakMode>
</CustomDebug>
<DeviceTerminalSettings>
<Connection xsi:type="com.sysprogs.terminal.connection.serial">
<ComPortName>COM20</ComPortName>
<AdvancedSettings>
<BaudRate>115200</BaudRate>
<DataBits>8</DataBits>
<Parity>None</Parity>
<StopBits>One</StopBits>
<FlowControl>None</FlowControl>
</AdvancedSettings>
</Connection>
<LastConnectionTime>0</LastConnectionTime>
<EchoTypedCharacters>false</EchoTypedCharacters>
<ClearContentsWhenReconnecting>false</ClearContentsWhenReconnecting>
<ReconnectAutomatically>false</ReconnectAutomatically>
<DisplayMode>ASCII</DisplayMode>
<Colors>
<Background>
<Alpha>255</Alpha>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Background>
<Disconnected>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Disconnected>
<Text>
<Alpha>255</Alpha>
<Red>211</Red>
<Green>211</Green>
<Blue>211</Blue>
</Text>
<Echo>
<Alpha>255</Alpha>
<Red>144</Red>
<Green>238</Green>
<Blue>144</Blue>
</Echo>
<Inactive>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Inactive>
</Colors>
<HexSettings>
<MaximumBytesPerLine>16</MaximumBytesPerLine>
<ShowTextView>true</ShowTextView>
<BreaksAroundEcho>true</BreaksAroundEcho>
<AutoSend>true</AutoSend>
<SendAsHex>true</SendAsHex>
<TimeoutForAutoBreak>0</TimeoutForAutoBreak>
</HexSettings>
<LineEnding>LF</LineEnding>
<TreatLFAsCRLF>false</TreatLFAsCRLF>
<KeepOpenAfterExit>false</KeepOpenAfterExit>
<ShowAfterProgramming>false</ShowAfterProgramming>
</DeviceTerminalSettings>
<CustomShortcuts>
<Shortcuts />
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
</CustomShortcuts>
<UserDefinedVariables />
<ImportedPropertySheets />
<CodeSense>
<Enabled>Unknown</Enabled>
<ExtraSettings>
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
<FormattingEngine xsi:nil="true" />
</ExtraSettings>
<CodeAnalyzerSettings>
<Enabled>false</Enabled>
</CodeAnalyzerSettings>
</CodeSense>
<Configurations>
<VisualGDBConfiguration>
<Name>Debug</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
<VisualGDBConfiguration>
<Name>Release</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
</Configurations>
<ProgramArgumentsSuggestions />
<Debug xsi:type="com.visualgdb.debug.embedded">
<AdditionalStartupCommands />
<AdditionalGDBSettings>
<Features>
<DisableAutoDetection>false</DisableAutoDetection>
<UseFrameParameter>false</UseFrameParameter>
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
<ListLocalsSupported>false</ListLocalsSupported>
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
<ThreadInfoSupported>false</ThreadInfoSupported>
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
<SupportTargetCommand>false</SupportTargetCommand>
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
</Features>
<EnableSmartStepping>false</EnableSmartStepping>
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
<UseAppleExtensions>false</UseAppleExtensions>
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
<MakeLogFile>false</MakeLogFile>
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
<UseRelativePathsOnly>false</UseRelativePathsOnly>
<ExitAction>None</ExitAction>
<DisableDisassembly>false</DisableDisassembly>
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
<StepIntoNewInstanceEntry>app_main</StepIntoNewInstanceEntry>
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
<DisableSignals>false</DisableSignals>
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
<AsyncModeSupportsBreakpoints>true</AsyncModeSupportsBreakpoints>
<TemporaryBreakConsolidationTimeout>0</TemporaryBreakConsolidationTimeout>
<EnableNonStopMode>false</EnableNonStopMode>
<MaxBreakpointLimit>0</MaxBreakpointLimit>
<EnableVerboseMode>true</EnableVerboseMode>
<EnablePrettyPrinters>false</EnablePrettyPrinters>
</AdditionalGDBSettings>
<DebugMethod>
<ID>openocd</ID>
<Configuration xsi:type="com.visualgdb.edp.openocd.settings.esp32">
<CommandLine>-f interface/tigard.cfg -c "adapter_khz 3000" -f target/esp32.cfg</CommandLine>
<ExtraParameters>
<Frequency xsi:nil="true" />
<BoostedFrequency xsi:nil="true" />
<ConnectUnderReset>false</ConnectUnderReset>
</ExtraParameters>
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
<ProgramMode>Enabled</ProgramMode>
<StartupCommands>
<string>set remotetimeout 60</string>
<string>target remote :$$SYS:GDB_PORT$$</string>
<string>mon gdb_breakpoint_override hard</string>
<string>mon reset halt</string>
<string>load</string>
</StartupCommands>
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
<PreferredGDBPort>0</PreferredGDBPort>
<PreferredTelnetPort>0</PreferredTelnetPort>
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
<SelectedCoreIndex xsi:nil="true" />
<LiveMemoryTimeout>5000</LiveMemoryTimeout>
<SuggestionLogicRevision>1</SuggestionLogicRevision>
<CheckFLASHSize>true</CheckFLASHSize>
<FLASHSettings>
<Size>size2MB</Size>
<Frequency>freq40M</Frequency>
<Mode>DIO</Mode>
</FLASHSettings>
<PatchBootloader>true</PatchBootloader>
</Configuration>
</DebugMethod>
<AutoDetectRTOS>true</AutoDetectRTOS>
<SemihostingSupport>Auto</SemihostingSupport>
<SemihostingPollingDelay>0</SemihostingPollingDelay>
<StepIntoEntryPoint>false</StepIntoEntryPoint>
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
<StopAtEntryPoint>false</StopAtEntryPoint>
<EnableVirtualHalts>false</EnableVirtualHalts>
<DynamicAnalysisSettings />
<EndOfStackSymbol>_estack</EndOfStackSymbol>
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
<UnusedStackFillPattern xsi:nil="true" />
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
</Debug>
</VisualGDBProjectSettings2>

View File

@ -0,0 +1,229 @@
#
# Copyright (C) 2006-2023 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#
# cmake for wolfssl
#
cmake_minimum_required(VERSION 3.5)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(CMAKE_CURRENT_SOURCE_DIR ".")
# We are currently in [root]/IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl
# The root of wolfSSL is 7 directories up from here:
get_filename_component(WOLFSSL_ROOT "../../../../../../../" ABSOLUTE)
# Espressif may take several passes through this makefile. Check to see if we found IDF
string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "" WOLFSSL_FOUND_IDF)
if($WOLFSSL_FOUND_IDF)
message(STATUS "IDF_PATH = $ENV{IDF_PATH}")
message(STATUS "WOLFSSL_ROOT = ${WOLFSSL_ROOT}")
message(STATUS "PROJECT_SOURCE_DIR = ${PROJECT_SOURCE_DIR}")
endif()
# get a list of all wolfcrypt assembly files; we'll exclude them as they don't target Xtensa
FILE(GLOB EXCLUDE_ASM *.S)
file(GLOB_RECURSE EXCLUDE_ASM ${CMAKE_SOURCE_DIR} "${WOLFSSL_ROOT}/wolfcrypt/src/*.S")
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
message(STATUS "EXCLUDE_ASM = ${EXCLUDE_ASM}")
endif()
set(INCLUDE_PATH ${WOLFSSL_ROOT})
set(COMPONENT_SRCDIRS "${WOLFSSL_ROOT}/src/"
"${WOLFSSL_ROOT}/wolfcrypt/src/"
"${WOLFSSL_ROOT}/wolfcrypt/src/port/Espressif/"
"${WOLFSSL_ROOT}/wolfcrypt/src/port/atmel/"
"${WOLFSSL_ROOT}/wolfcrypt/benchmark/"
"${WOLFSSL_ROOT}/wolfcrypt/test/"
)
set(COMPONENT_REQUIRES lwip)
# check to see if there's both a local copy and EDP-IDF copy of the wolfssl and/or wolfssh components
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in both ESP-IDF and local project - needs to be resolved by user
#
message(STATUS "")
message(STATUS "**************************************************************************************")
message(STATUS "")
message(STATUS "Error: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "")
message(STATUS "To proceed: ")
message(STATUS "")
message(STATUS "Remove either the local project component: ${CMAKE_HOME_DIRECTORY}/components/wolfssl/ ")
message(STATUS "or the Espressif shared component installed at: $ENV{IDF_PATH}/components/wolfssl/ ")
message(STATUS "")
message(FATAL_ERROR "Please use wolfSSL in either local project or Espressif components, but not both.")
message(STATUS "")
message(STATUS "**************************************************************************************")
message(STATUS "")
# Optional: if you change the above FATAL_ERROR to STATUS you can warn at runtime with this macro definition:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_MULTI_INSTALL_WARNING")
else()
if( EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in ESP-IDF components and is assumed to be already configured in user_settings.h via setup.
#
message(STATUS "")
message(STATUS "Using components/wolfssl in IDF_PATH = $ENV{IDF_PATH}")
message(STATUS "")
else()
#
# wolfSSL is not an ESP-IDF component. We need to now determine if it is local and if so if it is part of the wolfSSL repo
# or if wolfSSL is simply installed as a local component.
#
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" )
#
# wolfSSL found in local project.
#
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/include/" )
message(STATUS "")
message(STATUS "Using installed project ./components/wolfssl in CMAKE_HOME_DIRECTORY = $ENV{CMAKE_HOME_DIRECTORY}")
message(STATUS "")
#
# Note we already checked above and confirmed there's not another wolfSSL installed in the ESP-IDF components.
#
# We won't do anything else here, as it will be assumed the original install completed successfully.
#
else()
#
# This is the developer repo mode. wolfSSL will be assume to be not installed to ESP-IDF nor local project
# In this configuration, we are likely running a wolfSSL example found directly in the repo.
#
message(STATUS "")
message(STATUS "Using developer repo ./components/wolfssl in CMAKE_HOME_DIRECTORY = $ENV{CMAKE_HOME_DIRECTORY}")
message(STATUS "")
message(STATUS "************************************************************************************************")
# When in developer mode, we are typically running wolfSSL examples such as benchmark or test directories.
# However, the as-cloned or distributed wolfSSL does not have the ./include/ directory, so we'll add it as needed.
#
# first check if there's a [root]/include/user_settings.h
if( EXISTS "${WOLFSSL_ROOT}/include/user_settings.h" )
# we won't overwrite an existing user settings file, just note that we already have one:
message(STATUS "Found wolfSSL user_settings.h in ${WOLFSSL_ROOT}/include/user_settings.h")
else()
message(STATUS "Installing wolfSSL user_settings.h to ${WOLFSSL_ROOT}/include/user_settings.h")
file(COPY "${WOLFSSL_ROOT}/IDE/Espressif/ESP-IDF/user_settings.h" DESTINATION "${WOLFSSL_ROOT}/include/")
endif() # user_settings.h
# next check if there's a [root]/include/config.h
if( EXISTS "${WOLFSSL_ROOT}/include/config.h" )
message(STATUS "Found wolfSSL config.h in ${WOLFSSL_ROOT}/include/config.h")
else()
message(STATUS "Installing wolfSSL config.h to ${WOLFSSL_ROOT}/include/config.h")
file(COPY "${WOLFSSL_ROOT}/IDE/Espressif/ESP-IDF/dummy_config_h" DESTINATION "${WOLFSSL_ROOT}/include/")
file(RENAME "${WOLFSSL_ROOT}/include/dummy_config_h" "${WOLFSSL_ROOT}/include/config.h")
endif() # config.h
message(STATUS "************************************************************************************************")
message(STATUS "")
endif()
else()
# we did not find a ./components/wolfssl/include/ directory from this pass of cmake.
if($WOLFSSL_FOUND_IDF)
message(STATUS "")
message(STATUS "WARNING: wolfSSL not found.")
message(STATUS "")
else()
# probably needs to be re-parsed by Espressif
message(STATUS "wolfSSL found IDF. Project Source:${PROJECT_SOURCE_DIR}")
endif() # else we have not found ESP-IDF yet
endif() # else not a local wolfSSL component
endif() #else not an ESP-IDF component
endif() # else not local copy and EDP-IDF wolfSSL
# RTOS_IDF_PATH is typically:
# "/Users/{username}/Desktop/esp-idf/components/freertos/include/freertos"
# depending on the environment, we may need to swap backslashes with forward slashes
string(REPLACE "\\" "/" RTOS_IDF_PATH "$ENV{IDF_PATH}/components/freertos/include/freertos")
# ESP-IDF after version 4.4x has a different RTOS directory structure
string(REPLACE "\\" "/" RTOS_IDF_PATH5 "$ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos")
if(IS_DIRECTORY ${IDF_PATH}/components/freertos/FreeRTOS-Kernel/)
set(COMPONENT_ADD_INCLUDEDIRS
"."
"${WOLFSSL_ROOT}/include"
"${RTOS_IDF_PATH5}"
"${WOLFSSL_ROOT}"
)
else()
set(COMPONENT_ADD_INCLUDEDIRS
"."
"${WOLFSSL_ROOT}/include"
"${RTOS_IDF_PATH}"
"${WOLFSSL_ROOT}"
)
endif()
if(IS_DIRECTORY ${IDF_PATH}/components/cryptoauthlib)
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../cryptoauthlib/lib")
endif()
set(COMPONENT_SRCEXCLUDE
"${WOLFSSL_ROOT}/src/bio.c"
"${WOLFSSL_ROOT}/src/conf.c"
"${WOLFSSL_ROOT}/src/misc.c"
"${WOLFSSL_ROOT}/src/pk.c"
"${WOLFSSL_ROOT}/src/ssl_misc.c" # included by ssl.c
"${WOLFSSL_ROOT}/src/x509.c"
"${WOLFSSL_ROOT}/src/x509_str.c"
"${WOLFSSL_ROOT}/wolfcrypt/src/evp.c"
"${WOLFSSL_ROOT}/wolfcrypt/src/misc.c"
"${EXCLUDE_ASM}"
)
register_component()
# some optional diagnostics
if (0)
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
message(STATUS "")
message(STATUS "ALL VARIABLES BEGIN")
message(STATUS "")
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
message(STATUS "")
message(STATUS "ALL VARIABLES END")
message(STATUS "")
endif()
# check to see if there's both a local copy and EDP-IDF copy of the wolfssl components
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
message(STATUS "")
message(STATUS "")
message(STATUS "********************************************************************")
message(STATUS "WARNING: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "********************************************************************")
message(STATUS "")
endif()
# end multiple component check

View File

@ -0,0 +1,40 @@
#
# Copyright (C) 2006-2023 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#
#
# Component Makefile
#
COMPONENT_ADD_INCLUDEDIRS := . ./include
COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/components/freertos/include/freertos"
# COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/soc/esp32s3/include/soc"
COMPONENT_SRCDIRS := src wolfcrypt/src
COMPONENT_SRCDIRS += wolfcrypt/src/port/Espressif
COMPONENT_SRCDIRS += wolfcrypt/src/port/atmel
COMPONENT_SRCDIRS += wolfcrypt/benchmark
COMPONENT_SRCDIRS += wolfcrypt/test
CFLAGS +=-DWOLFSSL_USER_SETTINGS
COMPONENT_OBJEXCLUDE := wolfcrypt/src/aes_asm.o
COMPONENT_OBJEXCLUDE += wolfcrypt/src/evp.o
COMPONENT_OBJEXCLUDE += wolfcrypt/src/misc.o
COMPONENT_OBJEXCLUDE += src/bio.o

View File

@ -7,4 +7,69 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCS "client-tls.c" "wifi_connect.c")
set(COMPONENT_ADD_INCLUDEDIRS "." "./include")
set (git_cmd "git")
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in both ESP-IDF and local project - needs to be resolved by user
#
message(STATUS "")
message(STATUS "WARNING: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_MULTI_INSTALL_WARNING")
endif()
register_component()
#
# LIBWOLFSSL_SAVE_INFO(VAR_OUPUT THIS_VAR VAR_RESULT)
#
# Save the THIS_VAR as a string in a macro called VAR_OUPUT
#
# VAR_OUPUT: the name of the macro to define
# THIS_VAR: the OUTPUT_VARIABLE result from a execute_process()
# VAR_RESULT: the RESULT_VARIABLE from a execute_process(); "0" if successful.
#
function ( LIBWOLFSSL_SAVE_INFO VAR_OUPUT THIS_VAR VAR_RESULT )
# is the RESULT_VARIABLE output value 0? If so, IS_VALID_VALUE is true.
string(COMPARE EQUAL "${VAR_RESULT}" "0" IS_VALID_VALUE)
# if we had a successful operation, save the THIS_VAR in VAR_OUPUT
if(${IS_VALID_VALUE})
# strip newline chars in THIS_VAR parameter and save in VAR_VALUE
string(REPLACE "\n" "" VAR_VALUE ${THIS_VAR})
# we'll could percolate the value to the parent for possible later use
# set(${VAR_OUPUT} ${VAR_VALUE} PARENT_SCOPE)
# but we're only using it here in this function
set(${VAR_OUPUT} ${VAR_VALUE})
# we'll print what we found to the console
message(STATUS "Found ${VAR_OUPUT}=${VAR_VALUE}")
# the interesting part is defining the VAR_OUPUT name a value to use in the app
add_definitions(-D${VAR_OUPUT}=\"${VAR_VALUE}\")
else()
# if we get here, check the execute_process command and parameters.
message(STATUS "LIBWOLFSSL_SAVE_INFO encountered a non-zero VAR_RESULT")
set(${VAR_OUPUT} "Unknown")
endif()
endfunction() # LIBWOLFSSL_SAVE_INFO
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
# LIBWOLFSSL_VERSION_GIT_HASH
execute_process(COMMAND ${git_cmd} "rev-parse" "HEAD" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES ERROR_QUIET )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_HASH "${TMP_OUT}" "${TMP_RES}")
# LIBWOLFSSL_VERSION_GIT_SHORT_HASH
execute_process(COMMAND ${git_cmd} "rev-parse" "--short" "HEAD" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES ERROR_QUIET )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_SHORT_HASH "${TMP_OUT}" "${TMP_RES}")
# LIBWOLFSSL_VERSION_GIT_HASH_DATE
execute_process(COMMAND ${git_cmd} "show" "--no-patch" "--no-notes" "--pretty=\'\%cd\'" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_HASH_DATE "${TMP_OUT}" "${TMP_RES}")
endif()
message(STATUS "")

View File

@ -1,6 +1,6 @@
/* client-tls-callback.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -25,9 +25,9 @@
#include "esp_log.h"
#include "esp_wifi.h"
#if ESP_IDF_VERSION_MAJOR >= 4
#include "esp_event.h"
#include "esp_event.h"
#else
#include "esp_event_loop.h"
#include "esp_event_loop.h"
#endif
#define DEFAULT_PORT 11111

View File

@ -1,6 +1,6 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -27,21 +27,28 @@
#include "lwip/netdb.h"
#include "lwip/apps/sntp.h"
#include "nvs_flash.h"
#if ESP_IDF_VERSION_MAJOR >= 4
#include "protocol_examples_common.h"
/* wolfSSL */
#include <wolfssl/wolfcrypt/settings.h>
#include <user_settings.h>
#include <wolfssl/version.h>
#ifndef WOLFSSL_ESPIDF
#warning "problem with wolfSSL user_settings. Check components/wolfssl/include"
#endif
#if ESP_IDF_VERSION_MAJOR >= 4
#include "protocol_examples_common.h"
#else
const static int CONNECTED_BIT = BIT0;
static EventGroupHandle_t wifi_event_group;
#endif
const static int CONNECTED_BIT = BIT0;
static EventGroupHandle_t wifi_event_group;
/* proto-type */
extern void tls_smp_client_task();
static void tls_smp_client_init();
const static char *TAG = "tls_client";
static EventGroupHandle_t wifi_event_group;
extern void tls_smp_client_task();
static void set_time()
{
/* set dummy wallclock time. */
@ -80,7 +87,11 @@ static void set_time()
static void tls_smp_client_init(void)
{
int ret;
xTaskHandle _handle;
#if ESP_IDF_VERSION_MAJOR >= 4
TaskHandle_t _handle;
#else
xTaskHandle _handle;
#endif
/* http://esp32.info/docs/esp_idf/html/dd/d3c/group__xTaskCreate.html */
ret = xTaskCreate(tls_smp_client_task,
TLS_SMP_CLIENT_TASK_NAME,
@ -93,6 +104,7 @@ static void tls_smp_client_init(void)
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_CLIENT_TASK_NAME);
}
}
#if ESP_IDF_VERSION_MAJOR < 4
/* event handler for wifi events */
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{
@ -121,15 +133,63 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
}
return ESP_OK;
}
#endif
/* entry point */
void app_main(void)
{
ESP_LOGI(TAG, "Start app_main...");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "---------------------- BEGIN MAIN ----------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "CONFIG_IDF_TARGET = %s", CONFIG_IDF_TARGET);
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_STRING = %s", LIBWOLFSSL_VERSION_STRING);
#if defined(WOLFSSL_MULTI_INSTALL_WARNING)
ESP_LOGI(TAG, "");
ESP_LOGI(TAG, "WARNING: Multiple wolfSSL installs found.");
ESP_LOGI(TAG, "Check ESP-IDF and local project [components] directory.");
ESP_LOGI(TAG, "");
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_HASH)
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_HASH = %s", LIBWOLFSSL_VERSION_GIT_HASH);
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_SHORT_HASH )
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_SHORT_HASH = %s", LIBWOLFSSL_VERSION_GIT_SHORT_HASH);
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_HASH_DATE)
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_HASH_DATE = %s", LIBWOLFSSL_VERSION_GIT_HASH_DATE);
#endif
/* some interesting settings are target specific (ESP32, -C3, -S3, etc */
#if defined(CONFIG_IDF_TARGET_ESP32C3)
/* not available for C3 at this time */
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
ESP_LOGI(TAG, "CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ = %u MHz",
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ
);
ESP_LOGI(TAG, "Xthal_have_ccount = %u", Xthal_have_ccount);
#else
ESP_LOGI(TAG, "CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ = %u MHz",
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ
);
ESP_LOGI(TAG, "Xthal_have_ccount = %u", Xthal_have_ccount);
#endif
/* all platforms: stack high water mark check */
ESP_LOGI(TAG, "Stack HWM: %d\n", uxTaskGetStackHighWaterMark(NULL));
ESP_ERROR_CHECK(nvs_flash_init());
ESP_LOGI(TAG, "Initialize wifi");
#if (ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1) || \
(ESP_IDF_VERSION_MAJOR > 5)
#if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION_MINOR >= 1) || \
(ESP_IDF_VERSION_MAJOR >= 5)
esp_netif_init();
#else
tcpip_adapter_init();
@ -137,7 +197,6 @@ void app_main(void)
/* */
#if ESP_IDF_VERSION_MAJOR >= 4
(void) wifi_event_handler;
ESP_ERROR_CHECK(esp_event_loop_create_default());
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in

View File

@ -0,0 +1,35 @@
CONFIG_FREERTOS_HZ=1000
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
#
# Default main stack size
#
# This is typically way bigger than needed for stack size. See user_settings.h
#
CONFIG_ESP_MAIN_TASK_STACK_SIZE=55500
# Legacy stack size for older ESP-IDF versions
CONFIG_MAIN_TASK_STACK_SIZE=55500
#
# Compiler options
#
CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
CONFIG_COMPILER_HIDE_PATHS_MACROS=y
CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y
CONFIG_COMPILER_STACK_CHECK=y
#
# Partition Table
#
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
# CONFIG_PARTITION_TABLE_CUSTOM is not set
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp_large.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table

View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33027.164
MinimumVisualStudioVersion = 10.0.40219.1
Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "VisualGDB_wolfssl_server", "VisualGDB_wolfssl_server.vgdbproj", "{CD5A90CA-2D40-461A-A0C3-27654371BB00}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|VisualGDB = Debug|VisualGDB
Release|VisualGDB = Release|VisualGDB
Tests (Debug)|VisualGDB = Tests (Debug)|VisualGDB
Tests (Release)|VisualGDB = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CD5A90CA-2D40-461A-A0C3-27654371BB00}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
{CD5A90CA-2D40-461A-A0C3-27654371BB00}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
{CD5A90CA-2D40-461A-A0C3-27654371BB00}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
{CD5A90CA-2D40-461A-A0C3-27654371BB00}.Release|VisualGDB.Build.0 = Release|VisualGDB
{CD5A90CA-2D40-461A-A0C3-27654371BB00}.Tests (Debug)|VisualGDB.ActiveCfg = Tests (Debug)|VisualGDB
{CD5A90CA-2D40-461A-A0C3-27654371BB00}.Tests (Debug)|VisualGDB.Build.0 = Tests (Debug)|VisualGDB
{CD5A90CA-2D40-461A-A0C3-27654371BB00}.Tests (Release)|VisualGDB.ActiveCfg = Tests (Release)|VisualGDB
{CD5A90CA-2D40-461A-A0C3-27654371BB00}.Tests (Release)|VisualGDB.Build.0 = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {719A8CBE-E881-4B20-89F3-9910520E1067}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,269 @@
<?xml version="1.0"?>
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Project xsi:type="com.visualgdb.project.external.esp-idf">
<CustomSourceDirectories>
<Directories />
<PathStyle>Unknown</PathStyle>
</CustomSourceDirectories>
<AutoProgramSPIFFSPartition>true</AutoProgramSPIFFSPartition>
<ProjectModeSettings>
<ProjectGUID>63883b8e-8fa2-4e2f-807c-31c07f619c51</ProjectGUID>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<HeaderScanMode>SourceDirs</HeaderScanMode>
</ProjectModeSettings>
</Project>
<Build xsi:type="com.visualgdb.build.cmake">
<BuildLogMode xsi:nil="true" />
<ToolchainID>
<ID>com.visualgdb.xtensa-esp32-elf</ID>
<Version>
<GCC>8.4.0</GCC>
<GDB>8.1.0</GDB>
<Revision>9</Revision>
</Version>
</ToolchainID>
<RelativeSourceDirectory>..</RelativeSourceDirectory>
<ConfigurationType>DEBUG</ConfigurationType>
<BinaryDirectory>build/$(PlatformName)/$(ConfigurationName)</BinaryDirectory>
<MakeCommandTemplate>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(ToolchainNinja)</Command>
<WorkingDirectory>$(BuildDir)</WorkingDirectory>
<BackgroundMode xsi:nil="true" />
</MakeCommandTemplate>
<CMakeCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
<Command>$(SYSPROGS_CMAKE_PATH)</Command>
<BackgroundMode xsi:nil="true" />
</CMakeCommand>
<UpdateSourcesInCMakeFile>true</UpdateSourcesInCMakeFile>
<ExportCompileCommands>false</ExportCompileCommands>
<DisableToolchainFile>false</DisableToolchainFile>
<CMakeMakefileType>Ninja</CMakeMakefileType>
<DeployAsRoot>false</DeployAsRoot>
<CMakeCleanMode>RemoveBuildDirectory</CMakeCleanMode>
<UseCCache>false</UseCCache>
<ProjectModeSettings>
<ProjectItemSettings>
<GroupSourcesByTypes>true</GroupSourcesByTypes>
<GroupSourcesByPaths>true</GroupSourcesByPaths>
<GroupTargetsByPaths>true</GroupTargetsByPaths>
<FollowCMakeSourceGroups>false</FollowCMakeSourceGroups>
<AutoRefreshProject>true</AutoRefreshProject>
<AlwaysConsiderOutdated>false</AlwaysConsiderOutdated>
<SortTargetsByName>true</SortTargetsByName>
<RedundantTargetMode>HideOuterProjectTargets</RedundantTargetMode>
<SortSourcesByName>true</SortSourcesByName>
<BuildAllTargetsInSubdir>false</BuildAllTargetsInSubdir>
<FoldSingleItemPathLevels>true</FoldSingleItemPathLevels>
</ProjectItemSettings>
<TargetSpecificSettings />
<SetLDLibraryPathFromDependentArtifacts>true</SetLDLibraryPathFromDependentArtifacts>
<ProjectGUID>cd5a90ca-2d40-461a-a0c3-27654371bb00</ProjectGUID>
<VirtualFolders />
<ConfigurationNameCase>Upper</ConfigurationNameCase>
<DefaultHeaderDiscoveryMode>HeaderDirectoryAndSubdirectories</DefaultHeaderDiscoveryMode>
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
<ESPIDFExtension>
<IDFCheckout>
<Version>v4.4.1</Version>
<Subdirectory>esp-idf/v4.4.1</Subdirectory>
<Type>ESPIDF</Type>
</IDFCheckout>
<COMPort>COM20</COMPort>
<SuppressTestPrerequisiteChecks>false</SuppressTestPrerequisiteChecks>
<UseCCache>false</UseCCache>
<DeviceID>ESP32</DeviceID>
</ESPIDFExtension>
</ProjectModeSettings>
</Build>
<CustomBuild>
<PreSyncActions />
<PreBuildActions />
<PostBuildActions />
<PreCleanActions />
<PostCleanActions />
</CustomBuild>
<CustomDebug>
<PreDebugActions />
<PostDebugActions />
<DebugStopActions />
<BreakMode>Default</BreakMode>
</CustomDebug>
<DeviceTerminalSettings>
<Connection xsi:type="com.sysprogs.terminal.connection.serial">
<ComPortName>COM20</ComPortName>
<AdvancedSettings>
<BaudRate>115200</BaudRate>
<DataBits>8</DataBits>
<Parity>None</Parity>
<StopBits>One</StopBits>
<FlowControl>None</FlowControl>
</AdvancedSettings>
</Connection>
<LastConnectionTime>0</LastConnectionTime>
<EchoTypedCharacters>false</EchoTypedCharacters>
<ClearContentsWhenReconnecting>false</ClearContentsWhenReconnecting>
<ReconnectAutomatically>false</ReconnectAutomatically>
<DisplayMode>ASCII</DisplayMode>
<Colors>
<Background>
<Alpha>255</Alpha>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Background>
<Disconnected>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Disconnected>
<Text>
<Alpha>255</Alpha>
<Red>211</Red>
<Green>211</Green>
<Blue>211</Blue>
</Text>
<Echo>
<Alpha>255</Alpha>
<Red>144</Red>
<Green>238</Green>
<Blue>144</Blue>
</Echo>
<Inactive>
<Alpha>255</Alpha>
<Red>169</Red>
<Green>169</Green>
<Blue>169</Blue>
</Inactive>
</Colors>
<HexSettings>
<MaximumBytesPerLine>16</MaximumBytesPerLine>
<ShowTextView>true</ShowTextView>
<BreaksAroundEcho>true</BreaksAroundEcho>
<AutoSend>true</AutoSend>
<SendAsHex>true</SendAsHex>
<TimeoutForAutoBreak>0</TimeoutForAutoBreak>
</HexSettings>
<LineEnding>LF</LineEnding>
<TreatLFAsCRLF>false</TreatLFAsCRLF>
<KeepOpenAfterExit>false</KeepOpenAfterExit>
<ShowAfterProgramming>false</ShowAfterProgramming>
</DeviceTerminalSettings>
<CustomShortcuts>
<Shortcuts />
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
</CustomShortcuts>
<UserDefinedVariables />
<ImportedPropertySheets />
<CodeSense>
<Enabled>Unknown</Enabled>
<ExtraSettings>
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
<FormattingEngine xsi:nil="true" />
</ExtraSettings>
<CodeAnalyzerSettings>
<Enabled>false</Enabled>
</CodeAnalyzerSettings>
</CodeSense>
<Configurations>
<VisualGDBConfiguration>
<Name>Debug</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
<VisualGDBConfiguration>
<Name>Release</Name>
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.cmake.extension" />
</VisualGDBConfiguration>
</Configurations>
<ProgramArgumentsSuggestions />
<Debug xsi:type="com.visualgdb.debug.embedded">
<AdditionalStartupCommands />
<AdditionalGDBSettings>
<Features>
<DisableAutoDetection>false</DisableAutoDetection>
<UseFrameParameter>false</UseFrameParameter>
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
<ListLocalsSupported>false</ListLocalsSupported>
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
<ThreadInfoSupported>false</ThreadInfoSupported>
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
<SupportTargetCommand>false</SupportTargetCommand>
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
</Features>
<EnableSmartStepping>false</EnableSmartStepping>
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
<UseAppleExtensions>false</UseAppleExtensions>
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
<MakeLogFile>false</MakeLogFile>
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
<UseRelativePathsOnly>false</UseRelativePathsOnly>
<ExitAction>None</ExitAction>
<DisableDisassembly>false</DisableDisassembly>
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
<StepIntoNewInstanceEntry>app_main</StepIntoNewInstanceEntry>
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
<DisableSignals>false</DisableSignals>
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
<AsyncModeSupportsBreakpoints>true</AsyncModeSupportsBreakpoints>
<TemporaryBreakConsolidationTimeout>0</TemporaryBreakConsolidationTimeout>
<EnableNonStopMode>false</EnableNonStopMode>
<MaxBreakpointLimit>0</MaxBreakpointLimit>
<EnableVerboseMode>true</EnableVerboseMode>
<EnablePrettyPrinters>false</EnablePrettyPrinters>
</AdditionalGDBSettings>
<DebugMethod>
<ID>openocd</ID>
<Configuration xsi:type="com.visualgdb.edp.openocd.settings.esp32">
<CommandLine>-f interface/tigard.cfg -c "adapter_khz 3000" -f target/esp32.cfg</CommandLine>
<ExtraParameters>
<Frequency xsi:nil="true" />
<BoostedFrequency xsi:nil="true" />
<ConnectUnderReset>false</ConnectUnderReset>
</ExtraParameters>
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
<ProgramMode>Enabled</ProgramMode>
<StartupCommands>
<string>set remotetimeout 60</string>
<string>target remote :$$SYS:GDB_PORT$$</string>
<string>mon gdb_breakpoint_override hard</string>
<string>mon reset halt</string>
<string>load</string>
</StartupCommands>
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
<PreferredGDBPort>0</PreferredGDBPort>
<PreferredTelnetPort>0</PreferredTelnetPort>
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
<SelectedCoreIndex xsi:nil="true" />
<LiveMemoryTimeout>5000</LiveMemoryTimeout>
<SuggestionLogicRevision>1</SuggestionLogicRevision>
<CheckFLASHSize>true</CheckFLASHSize>
<FLASHSettings>
<Size>size2MB</Size>
<Frequency>freq40M</Frequency>
<Mode>DIO</Mode>
</FLASHSettings>
<PatchBootloader>true</PatchBootloader>
</Configuration>
</DebugMethod>
<AutoDetectRTOS>true</AutoDetectRTOS>
<SemihostingSupport>Auto</SemihostingSupport>
<SemihostingPollingDelay>0</SemihostingPollingDelay>
<StepIntoEntryPoint>false</StepIntoEntryPoint>
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
<StopAtEntryPoint>false</StopAtEntryPoint>
<EnableVirtualHalts>false</EnableVirtualHalts>
<DynamicAnalysisSettings />
<EndOfStackSymbol>_estack</EndOfStackSymbol>
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
<UnusedStackFillPattern xsi:nil="true" />
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
</Debug>
</VisualGDBProjectSettings2>

View File

@ -0,0 +1,229 @@
#
# Copyright (C) 2006-2023 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#
# cmake for wolfssl
#
cmake_minimum_required(VERSION 3.5)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(CMAKE_CURRENT_SOURCE_DIR ".")
# We are currently in [root]/IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl
# The root of wolfSSL is 7 directories up from here:
get_filename_component(WOLFSSL_ROOT "../../../../../../../" ABSOLUTE)
# Espressif may take several passes through this makefile. Check to see if we found IDF
string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "" WOLFSSL_FOUND_IDF)
if($WOLFSSL_FOUND_IDF)
message(STATUS "IDF_PATH = $ENV{IDF_PATH}")
message(STATUS "WOLFSSL_ROOT = ${WOLFSSL_ROOT}")
message(STATUS "PROJECT_SOURCE_DIR = ${PROJECT_SOURCE_DIR}")
endif()
# get a list of all wolfcrypt assembly files; we'll exclude them as they don't target Xtensa
FILE(GLOB EXCLUDE_ASM *.S)
file(GLOB_RECURSE EXCLUDE_ASM ${CMAKE_SOURCE_DIR} "${WOLFSSL_ROOT}/wolfcrypt/src/*.S")
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
message(STATUS "EXCLUDE_ASM = ${EXCLUDE_ASM}")
endif()
set(INCLUDE_PATH ${WOLFSSL_ROOT})
set(COMPONENT_SRCDIRS "${WOLFSSL_ROOT}/src/"
"${WOLFSSL_ROOT}/wolfcrypt/src/"
"${WOLFSSL_ROOT}/wolfcrypt/src/port/Espressif/"
"${WOLFSSL_ROOT}/wolfcrypt/src/port/atmel/"
"${WOLFSSL_ROOT}/wolfcrypt/benchmark/"
"${WOLFSSL_ROOT}/wolfcrypt/test/"
)
set(COMPONENT_REQUIRES lwip)
# check to see if there's both a local copy and EDP-IDF copy of the wolfssl and/or wolfssh components
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in both ESP-IDF and local project - needs to be resolved by user
#
message(STATUS "")
message(STATUS "**************************************************************************************")
message(STATUS "")
message(STATUS "Error: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "")
message(STATUS "To proceed: ")
message(STATUS "")
message(STATUS "Remove either the local project component: ${CMAKE_HOME_DIRECTORY}/components/wolfssl/ ")
message(STATUS "or the Espressif shared component installed at: $ENV{IDF_PATH}/components/wolfssl/ ")
message(STATUS "")
message(FATAL_ERROR "Please use wolfSSL in either local project or Espressif components, but not both.")
message(STATUS "")
message(STATUS "**************************************************************************************")
message(STATUS "")
# Optional: if you change the above FATAL_ERROR to STATUS you can warn at runtime with this macro definition:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_MULTI_INSTALL_WARNING")
else()
if( EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in ESP-IDF components and is assumed to be already configured in user_settings.h via setup.
#
message(STATUS "")
message(STATUS "Using components/wolfssl in IDF_PATH = $ENV{IDF_PATH}")
message(STATUS "")
else()
#
# wolfSSL is not an ESP-IDF component. We need to now determine if it is local and if so if it is part of the wolfSSL repo
# or if wolfSSL is simply installed as a local component.
#
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" )
#
# wolfSSL found in local project.
#
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/include/" )
message(STATUS "")
message(STATUS "Using installed project ./components/wolfssl in CMAKE_HOME_DIRECTORY = $ENV{CMAKE_HOME_DIRECTORY}")
message(STATUS "")
#
# Note we already checked above and confirmed there's not another wolfSSL installed in the ESP-IDF components.
#
# We won't do anything else here, as it will be assumed the original install completed successfully.
#
else()
#
# This is the developer repo mode. wolfSSL will be assume to be not installed to ESP-IDF nor local project
# In this configuration, we are likely running a wolfSSL example found directly in the repo.
#
message(STATUS "")
message(STATUS "Using developer repo ./components/wolfssl in CMAKE_HOME_DIRECTORY = $ENV{CMAKE_HOME_DIRECTORY}")
message(STATUS "")
message(STATUS "************************************************************************************************")
# When in developer mode, we are typically running wolfSSL examples such as benchmark or test directories.
# However, the as-cloned or distributed wolfSSL does not have the ./include/ directory, so we'll add it as needed.
#
# first check if there's a [root]/include/user_settings.h
if( EXISTS "${WOLFSSL_ROOT}/include/user_settings.h" )
# we won't overwrite an existing user settings file, just note that we already have one:
message(STATUS "Found wolfSSL user_settings.h in ${WOLFSSL_ROOT}/include/user_settings.h")
else()
message(STATUS "Installing wolfSSL user_settings.h to ${WOLFSSL_ROOT}/include/user_settings.h")
file(COPY "${WOLFSSL_ROOT}/IDE/Espressif/ESP-IDF/user_settings.h" DESTINATION "${WOLFSSL_ROOT}/include/")
endif() # user_settings.h
# next check if there's a [root]/include/config.h
if( EXISTS "${WOLFSSL_ROOT}/include/config.h" )
message(STATUS "Found wolfSSL config.h in ${WOLFSSL_ROOT}/include/config.h")
else()
message(STATUS "Installing wolfSSL config.h to ${WOLFSSL_ROOT}/include/config.h")
file(COPY "${WOLFSSL_ROOT}/IDE/Espressif/ESP-IDF/dummy_config_h" DESTINATION "${WOLFSSL_ROOT}/include/")
file(RENAME "${WOLFSSL_ROOT}/include/dummy_config_h" "${WOLFSSL_ROOT}/include/config.h")
endif() # config.h
message(STATUS "************************************************************************************************")
message(STATUS "")
endif()
else()
# we did not find a ./components/wolfssl/include/ directory from this pass of cmake.
if($WOLFSSL_FOUND_IDF)
message(STATUS "")
message(STATUS "WARNING: wolfSSL not found.")
message(STATUS "")
else()
# probably needs to be re-parsed by Espressif
message(STATUS "wolfSSL found IDF. Project Source:${PROJECT_SOURCE_DIR}")
endif() # else we have not found ESP-IDF yet
endif() # else not a local wolfSSL component
endif() #else not an ESP-IDF component
endif() # else not local copy and EDP-IDF wolfSSL
# RTOS_IDF_PATH is typically:
# "/Users/{username}/Desktop/esp-idf/components/freertos/include/freertos"
# depending on the environment, we may need to swap backslashes with forward slashes
string(REPLACE "\\" "/" RTOS_IDF_PATH "$ENV{IDF_PATH}/components/freertos/include/freertos")
# ESP-IDF after version 4.4x has a different RTOS directory structure
string(REPLACE "\\" "/" RTOS_IDF_PATH5 "$ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos")
if(IS_DIRECTORY ${IDF_PATH}/components/freertos/FreeRTOS-Kernel/)
set(COMPONENT_ADD_INCLUDEDIRS
"."
"${WOLFSSL_ROOT}/include"
"${RTOS_IDF_PATH5}"
"${WOLFSSL_ROOT}"
)
else()
set(COMPONENT_ADD_INCLUDEDIRS
"."
"${WOLFSSL_ROOT}/include"
"${RTOS_IDF_PATH}"
"${WOLFSSL_ROOT}"
)
endif()
if(IS_DIRECTORY ${IDF_PATH}/components/cryptoauthlib)
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../cryptoauthlib/lib")
endif()
set(COMPONENT_SRCEXCLUDE
"${WOLFSSL_ROOT}/src/bio.c"
"${WOLFSSL_ROOT}/src/conf.c"
"${WOLFSSL_ROOT}/src/misc.c"
"${WOLFSSL_ROOT}/src/pk.c"
"${WOLFSSL_ROOT}/src/ssl_misc.c" # included by ssl.c
"${WOLFSSL_ROOT}/src/x509.c"
"${WOLFSSL_ROOT}/src/x509_str.c"
"${WOLFSSL_ROOT}/wolfcrypt/src/evp.c"
"${WOLFSSL_ROOT}/wolfcrypt/src/misc.c"
"${EXCLUDE_ASM}"
)
register_component()
# some optional diagnostics
if (0)
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
message(STATUS "")
message(STATUS "ALL VARIABLES BEGIN")
message(STATUS "")
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
message(STATUS "")
message(STATUS "ALL VARIABLES END")
message(STATUS "")
endif()
# check to see if there's both a local copy and EDP-IDF copy of the wolfssl components
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
message(STATUS "")
message(STATUS "")
message(STATUS "********************************************************************")
message(STATUS "WARNING: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "********************************************************************")
message(STATUS "")
endif()
# end multiple component check

View File

@ -0,0 +1,40 @@
#
# Copyright (C) 2006-2023 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#
#
# Component Makefile
#
COMPONENT_ADD_INCLUDEDIRS := . ./include
COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/components/freertos/include/freertos"
# COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/soc/esp32s3/include/soc"
COMPONENT_SRCDIRS := src wolfcrypt/src
COMPONENT_SRCDIRS += wolfcrypt/src/port/Espressif
COMPONENT_SRCDIRS += wolfcrypt/src/port/atmel
COMPONENT_SRCDIRS += wolfcrypt/benchmark
COMPONENT_SRCDIRS += wolfcrypt/test
CFLAGS +=-DWOLFSSL_USER_SETTINGS
COMPONENT_OBJEXCLUDE := wolfcrypt/src/aes_asm.o
COMPONENT_OBJEXCLUDE += wolfcrypt/src/evp.o
COMPONENT_OBJEXCLUDE += wolfcrypt/src/misc.o
COMPONENT_OBJEXCLUDE += src/bio.o

View File

@ -7,4 +7,69 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCS "server-tls.c" "wifi_connect.c")
set(COMPONENT_ADD_INCLUDEDIRS "." "./include")
set (git_cmd "git")
if( EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl/" AND EXISTS "$ENV{IDF_PATH}/components/wolfssl/" )
#
# wolfSSL found in both ESP-IDF and local project - needs to be resolved by user
#
message(STATUS "")
message(STATUS "WARNING: Found components/wolfssl in both local project and IDF_PATH")
message(STATUS "")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_MULTI_INSTALL_WARNING")
endif()
register_component()
#
# LIBWOLFSSL_SAVE_INFO(VAR_OUPUT THIS_VAR VAR_RESULT)
#
# Save the THIS_VAR as a string in a macro called VAR_OUPUT
#
# VAR_OUPUT: the name of the macro to define
# THIS_VAR: the OUTPUT_VARIABLE result from a execute_process()
# VAR_RESULT: the RESULT_VARIABLE from a execute_process(); "0" if successful.
#
function ( LIBWOLFSSL_SAVE_INFO VAR_OUPUT THIS_VAR VAR_RESULT )
# is the RESULT_VARIABLE output value 0? If so, IS_VALID_VALUE is true.
string(COMPARE EQUAL "${VAR_RESULT}" "0" IS_VALID_VALUE)
# if we had a successful operation, save the THIS_VAR in VAR_OUPUT
if(${IS_VALID_VALUE})
# strip newline chars in THIS_VAR parameter and save in VAR_VALUE
string(REPLACE "\n" "" VAR_VALUE ${THIS_VAR})
# we'll could percolate the value to the parent for possible later use
# set(${VAR_OUPUT} ${VAR_VALUE} PARENT_SCOPE)
# but we're only using it here in this function
set(${VAR_OUPUT} ${VAR_VALUE})
# we'll print what we found to the console
message(STATUS "Found ${VAR_OUPUT}=${VAR_VALUE}")
# the interesting part is defining the VAR_OUPUT name a value to use in the app
add_definitions(-D${VAR_OUPUT}=\"${VAR_VALUE}\")
else()
# if we get here, check the execute_process command and parameters.
message(STATUS "LIBWOLFSSL_SAVE_INFO encountered a non-zero VAR_RESULT")
set(${VAR_OUPUT} "Unknown")
endif()
endfunction() # LIBWOLFSSL_SAVE_INFO
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
# LIBWOLFSSL_VERSION_GIT_HASH
execute_process(COMMAND ${git_cmd} "rev-parse" "HEAD" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES ERROR_QUIET )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_HASH "${TMP_OUT}" "${TMP_RES}")
# LIBWOLFSSL_VERSION_GIT_SHORT_HASH
execute_process(COMMAND ${git_cmd} "rev-parse" "--short" "HEAD" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES ERROR_QUIET )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_SHORT_HASH "${TMP_OUT}" "${TMP_RES}")
# LIBWOLFSSL_VERSION_GIT_HASH_DATE
execute_process(COMMAND ${git_cmd} "show" "--no-patch" "--no-notes" "--pretty=\'\%cd\'" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES )
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_HASH_DATE "${TMP_OUT}" "${TMP_RES}")
endif()
message(STATUS "")

View File

@ -1,6 +1,6 @@
/* wifi_connect.h
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* server-tls-callback.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wifi_connect.c
/* wifi_connect.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -27,12 +27,22 @@
#include "lwip/netdb.h"
#include "lwip/apps/sntp.h"
#include "nvs_flash.h"
#if ESP_IDF_VERSION_MAJOR >= 4
#include "protocol_examples_common.h"
/* wolfSSL */
#include <wolfssl/wolfcrypt/settings.h>
#include <user_settings.h>
#include <wolfssl/version.h>
#ifndef WOLFSSL_ESPIDF
#warning "problem with wolfSSL user_settings. Check components/wolfssl/include"
#endif
#if ESP_IDF_VERSION_MAJOR >= 4
#include "protocol_examples_common.h"
#else
const static int CONNECTED_BIT = BIT0;
static EventGroupHandle_t wifi_event_group;
#endif
const static int CONNECTED_BIT = BIT0;
static EventGroupHandle_t wifi_event_group;
/* prefix for logging */
const static char *TAG = "tls_server";
/* proto-type definition */
@ -55,7 +65,7 @@ static void set_time()
utctime.tv_usec = 0;
tz.tz_minuteswest = 0;
tz.tz_dsttime = 0;
settimeofday(&utctime, &tz);
time(&now);
@ -77,7 +87,11 @@ static void set_time()
static void tls_smp_server_init(void)
{
int ret;
xTaskHandle _handle;
#if ESP_IDF_VERSION_MAJOR >= 4
TaskHandle_t _handle;
#else
xTaskHandle _handle;
#endif
/* http://esp32.info/docs/esp_idf/html/dd/d3c/group__xTaskCreate.html */
ret = xTaskCreate(tls_smp_server_task,
TLS_SMP_SERVER_TASK_NAME,
@ -90,6 +104,7 @@ static void tls_smp_server_init(void)
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_SERVER_TASK_NAME);
}
}
#if ESP_IDF_VERSION_MAJOR < 4
/* event handler for wifi events */
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{
@ -118,23 +133,68 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
}
return ESP_OK;
}
#endif
/* entry point */
void app_main(void)
{
ESP_LOGI(TAG, "Start app_main...");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "---------------------- BEGIN MAIN ----------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "--------------------------------------------------------");
ESP_LOGI(TAG, "CONFIG_IDF_TARGET = %s", CONFIG_IDF_TARGET);
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_STRING = %s", LIBWOLFSSL_VERSION_STRING);
#if defined(WOLFSSL_MULTI_INSTALL_WARNING)
ESP_LOGI(TAG, "");
ESP_LOGI(TAG, "WARNING: Multiple wolfSSL installs found.");
ESP_LOGI(TAG, "Check ESP-IDF and local project [components] directory.");
ESP_LOGI(TAG, "");
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_HASH)
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_HASH = %s", LIBWOLFSSL_VERSION_GIT_HASH);
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_SHORT_HASH )
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_SHORT_HASH = %s", LIBWOLFSSL_VERSION_GIT_SHORT_HASH);
#endif
#if defined(LIBWOLFSSL_VERSION_GIT_HASH_DATE)
ESP_LOGI(TAG, "LIBWOLFSSL_VERSION_GIT_HASH_DATE = %s", LIBWOLFSSL_VERSION_GIT_HASH_DATE);
#endif
/* some interesting settings are target specific (ESP32, -C3, -S3, etc */
#if defined(CONFIG_IDF_TARGET_ESP32C3)
/* not available for C3 at this time */
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
ESP_LOGI(TAG, "CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ = %u MHz",
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ
);
ESP_LOGI(TAG, "Xthal_have_ccount = %u", Xthal_have_ccount);
#else
ESP_LOGI(TAG, "CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ = %u MHz",
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ
);
ESP_LOGI(TAG, "Xthal_have_ccount = %u", Xthal_have_ccount);
#endif
/* all platforms: stack high water mark check */
ESP_LOGI(TAG, "Stack HWM: %d\n", uxTaskGetStackHighWaterMark(NULL));
ESP_ERROR_CHECK(nvs_flash_init());
ESP_LOGI(TAG, "Initialize wifi");
/* TCP/IP adapter initialization */
#if (ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1) || \
(ESP_IDF_VERSION_MAJOR > 5)
#if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION_MINOR >= 1) || \
(ESP_IDF_VERSION_MAJOR >= 5)
esp_netif_init();
#else
tcpip_adapter_init();
#endif
/* */
#if ESP_IDF_VERSION_MAJOR >= 4
(void) wifi_event_handler;
ESP_ERROR_CHECK(esp_event_loop_create_default());
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in
@ -155,7 +215,7 @@ void app_main(void)
};
/* WiFi station mode */
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
/* Wifi Set the configuration of the ESP32 STA or AP */
/* Wifi Set the configuration of the ESP32 STA or AP */
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
/* Start Wifi */
ESP_ERROR_CHECK(esp_wifi_start() );

View File

@ -0,0 +1,35 @@
CONFIG_FREERTOS_HZ=1000
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
#
# Default main stack size
#
# This is typically way bigger than needed for stack size. See user_settings.h
#
CONFIG_ESP_MAIN_TASK_STACK_SIZE=55500
# Legacy stack size for older ESP-IDF versions
CONFIG_MAIN_TASK_STACK_SIZE=55500
#
# Compiler options
#
CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
CONFIG_COMPILER_HIDE_PATHS_MACROS=y
CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y
CONFIG_COMPILER_STACK_CHECK=y
#
# Partition Table
#
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
# CONFIG_PARTITION_TABLE_CUSTOM is not set
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp_large.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table

View File

@ -1,6 +1,12 @@
# The following five lines of boilerplate have to be in your project's
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(COMPONENTS
main
wolfssl
) # set components
project(wolfssl_test)

View File

@ -2,9 +2,141 @@
The Example contains of wolfSSL test program.
When you want to run the benchmark program
1. `idf.py menuconfig` to configure the program,first
2. `idf.py build` to compile and `idf.py -p <PORT> flash` to load the firmware
3. `idf.py monitor` to see the message
1. `idf.py menuconfig` to configure the program.
1-1. Example Configuration ->
TEST_ARG : argument that you want to use. Default is "-lng 0"
The list of argument can be find in help.
When you want to run the test program
1. `idf.py -p <PORT> flash` to compile and load the firmware
2. `idf.py monitor` to see the message
See the README.md file in the upper level 'examples' directory for more information about examples.
Reminder than when building on WSL in `/mnt/c` there will be a noticeable performance degradation at compile time. Using `~/` will be faster at the cost of shared filesystems.
Example build on WSL, assuming `git clone` from `c:\workspace`:
```
# Optionally install wolfSSL component
# cd /mnt/c/workspace/wolfssl/IDE/Espressif/ESP-IDF
./setup.sh
# switch to test example
cd /mnt/c/workspace/wolfssl/IDE/Espressif/ESP-IDF/examples/wolfssl_test
# Pick ESP-IDF install directory, this one for v4.4.2 in VisualGDB
. /mnt/c/SysGCC/esp32/esp-idf/v4.4.2/export.sh
# build and flash, in this example to COM20
idf.py build flash -p /dev/ttyS20 -b 921600 monitor
```
## Example Output
Note the default wolfSSL `user_settings.h` is configured by default to be the most
compatible across the widest ranges of targets. Contact wolfSSL at support@wolfssl.com
for help in optimizing for your particular application, or see the
[docs](https://www.wolfssl.com/documentation/manuals/wolfssl/index.html).
Compiled and flashed with `idf.py build flash -p /dev/ttyS7 -b 921600 monitor`:
```
ets Jun 8 2016 00:22:57
rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6612
load:0x40078000,len:14788
load:0x40080400,len:3792
entry 0x40080694
I (26) boot: ESP-IDF v4.4.1-dirty 2nd stage bootloader
I (26) boot: compile time 15:25:38
I (26) boot: chip revision: 1
I (29) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (37) boot.esp32: SPI Speed : 40MHz
I (41) boot.esp32: SPI Mode : DIO
I (46) boot.esp32: SPI Flash Size : 2MB
I (50) boot: Enabling RNG early entropy source...
I (56) boot: Partition Table:
I (59) boot: ## Label Usage Type ST Offset Length
I (67) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (74) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (81) boot: 2 factory factory app 00 00 00010000 00100000
I (89) boot: End of partition table
I (93) boot_comm: chip revision: 1, min. application chip revision: 0
I (100) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=16ca4h ( 93348) map
I (143) esp_image: segment 1: paddr=00026ccc vaddr=3ffb0000 size=024d4h ( 9428) load
I (147) esp_image: segment 2: paddr=000291a8 vaddr=40080000 size=06e70h ( 28272) load
I (160) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=412d8h (266968) map
I (257) esp_image: segment 4: paddr=00071300 vaddr=40086e70 size=045a8h ( 17832) load
I (265) esp_image: segment 5: paddr=000758b0 vaddr=50000000 size=00010h ( 16) load
I (270) boot: Loaded app from partition at offset 0x10000
I (270) boot: Disabling RNG early entropy source...
I (285) cpu_start: Pro cpu up.
I (286) cpu_start: Starting app cpu, entry point is 0x40081088
I (273) cpu_start: App cpu up.
I (300) cpu_start: Pro cpu start user code
I (300) cpu_start: cpu freq: 160000000
I (300) cpu_start: Application information:
I (305) cpu_start: Project name: wolfssl_test
I (310) cpu_start: App version: v5.5.3-stable-108-gbd7b442df-di
I (317) cpu_start: Compile time: Nov 17 2022 15:24:40
I (323) cpu_start: ELF file SHA256: 90957eeb4f0d2246...
I (329) cpu_start: ESP-IDF: v4.4.1-dirty
I (335) heap_init: Initializing. RAM available for dynamic allocation:
I (342) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (348) heap_init: At 3FFB2DF0 len 0002D210 (180 KiB): DRAM
I (354) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (360) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (367) heap_init: At 4008B418 len 00014BE8 (82 KiB): IRAM
I (374) spi_flash: detected chip: generic
I (378) spi_flash: flash io: dio
W (382) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (396) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
------------------------------------------------------------------------------
wolfSSL version 5.5.3
------------------------------------------------------------------------------
error test passed!
MEMORY test passed!
base64 test passed!
asn test passed!
RANDOM test passed!
MD5 test passed!
MD4 test passed!
SHA test passed!
SHA-256 test passed!
SHA-512 test passed!
Hash test passed!
HMAC-MD5 test passed!
HMAC-SHA test passed!
HMAC-SHA256 test passed!
HMAC-SHA512 test passed!
HMAC-KDF test passed!
TLSv1.3 KDF test passed!
GMAC test passed!
DES test passed!
DES3 test passed!
AES test passed!
AES192 test passed!
AES256 test passed!
AES-GCM test passed!
RSA test passed!
PWDBASED test passed!
ECC test passed!
ECC buffer test passed!
CURVE25519 test passed!
ED25519 test passed!
logging test passed!
time test passed!
mutex test passed!
Test complete
I (136548) wolfcrypt_test: Exiting main with return code: 0
I (136548) wolfssl_test: wolf_test_task complete success result code = 0
```

View File

@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33027.164
MinimumVisualStudioVersion = 10.0.40219.1
Project("{803FD0C6-D64E-4E16-9DC3-1DAEC859A3D2}") = "wolfssl_test-IDF_v5_ESP32", "wolfssl_test-IDF_v5_ESP32.vgdbproj", "{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{760F4DFF-595E-4725-BB3A-EFA5966D0B70}"
ProjectSection(SolutionItems) = preProject
..\..\..\..\..\..\wolfcrypt\test\test.c = ..\..\..\..\..\..\wolfcrypt\test\test.c
..\..\..\..\..\..\include\user_settings.h = ..\..\..\..\..\..\include\user_settings.h
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|VisualGDB = Debug|VisualGDB
Release|VisualGDB = Release|VisualGDB
Tests (Debug)|VisualGDB = Tests (Debug)|VisualGDB
Tests (Release)|VisualGDB = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Release|VisualGDB.Build.0 = Release|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.ActiveCfg = Tests (Debug)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Debug)|VisualGDB.Build.0 = Tests (Debug)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.ActiveCfg = Tests (Release)|VisualGDB
{EADCC9AB-72B3-4B51-A838-593E5D80DDF7}.Tests (Release)|VisualGDB.Build.0 = Tests (Release)|VisualGDB
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {34551780-699D-4BB5-8D19-CB42BE06F361}
EndGlobalSection
EndGlobal

Some files were not shown because too many files have changed in this diff Show More