299 Commits

Author SHA1 Message Date
Sean Parkinson
a39a04fc88 PEM example: new example for convert between PEM and DER
PEM example converts PEM to DER and DER to PEM.
Supports encrypting DER and writing out as PEM.

Added better support for 40-bit RC2-CBC PBE.
Added AES-128-CBC encryption support with PKCS#5v2.
Fixed handling of iterations to support writing 24-bit values.
Declared enum types for pass to PKCS#8 encryption APIs.

Add more DER and PEM files to certs directory.
Add testing of 'pem' with pem.test script.
2023-07-03 17:20:35 +10:00
Tesfa Mael
fd17fa3e9c Implement the option to disable CRL check
Do leaf CRL check by default
Correct wolfSSL_sk_X509_NAME_push return check
Update OpenSSL compatibility errors for HAProxy
Change X509_V to literal constant values
Fix the compat layer with TLS session ticket reuse
Fix for tls1_2 session resume and cache miss
Save intitial wolfSSL ctx
Check for OpenSSL CRL error code 23
2023-06-27 08:26:02 -07:00
David Garske
255aa774f2 Updated Keil MDK documentation to note RTOS and TCP default dependency. Fix for inline error due to tracking code being available too broadly. Use current branch for makedistsmall.sh. 2023-06-22 16:48:17 -06:00
Sean Parkinson
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
JacobBarthelmeh
f1aa43dc48
Merge pull request #6230 from bandi13/zd15855
Fix for variable server startup time
2023-03-28 09:13:52 -06:00
Lealem Amedie
591089664d Fixes for sniffer with enable all 2023-03-27 16:37:14 -06:00
Andras Fekete
d57d6d2b78 Fix for variable server startup time 2023-03-23 15:03:26 -04:00
Andras Fekete
c56c4ef7ce Hacky workaround to be able to put/remove files in certs folder 2023-03-13 10:37:21 -04:00
Andras Fekete
e2a1ab9e49 Fix possible timing issue with other tests copying the certs folder 2023-03-10 15:35:03 -05:00
David Garske
24fd561bf8
Merge pull request #6099 from bandi13/ocsp-cleanup
Be more aggressive in killing processes
2023-02-17 09:28:14 -08:00
Andras Fekete
fdb0338473 Be more aggressive in killing processes 2023-02-16 09:55:52 -05:00
David Garske
100ec1e7e6 Fix ./scripts/makedistsmall.sh for Docker and RTOS. 2023-02-14 14:25:40 -08:00
David Garske
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
Daniel Pouzzner
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
Juliusz Sosinowicz
b45ab0ae15 Add dtlscid.test to make check testing 2022-10-07 10:44:42 +02:00
Hayden Roche
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
Daniel Pouzzner
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
David Garske
5524500e85
Merge pull request #5166 from sjaeckel/versal-bringup
Versal bringup
2022-09-29 13:27:13 -07:00
David Garske
a5a9ab96e6
Merge pull request #5524 from rizlik/protocol_version_alerts
Dtls13: improvements
2022-09-29 10:59:06 -07:00
Steffen Jaeckel
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
Juliusz Sosinowicz
145086f776 DTLS 1.3: Clear ssl->dtls13SendingAckOrRtx in ssl.c 2022-09-28 18:42:38 +02:00
Juliusz Sosinowicz
f9b2ef47c9 dtls13.test: Allow setting UDP_PROXY_PATH in env 2022-09-21 16:49:53 +02:00
kaleb-himes
9a193a3e02 Address Issue pointed out in (now deleted) comment on an old merge 2022-09-18 08:45:18 -06:00
Marco Oliverio
f3262005e4 add basic ConnectionID DTLS tests 2022-08-23 16:58:24 +02:00
kaleb-himes
77dec16b3b Supplemental fix in addition to #5470 2022-08-22 08:00:40 -06:00
kaleb-himes
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
kaleb-himes
8efc8b0819 Fix up other test scripts using the same logic 2022-08-11 06:26:43 -06:00
kaleb-himes
a0e1c2567e Fix a very frequent stuck scenario with the openssl.test script 2022-08-10 17:41:54 -06:00
David Garske
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
David Garske
9e213cab19 Fixes for the script (from Douzzer). 2022-07-26 08:50:27 -07:00
David Garske
48016adf52 Script to produce a small source/header only package (with CMake support) 2022-07-25 17:08:13 -07:00
Lealem Amedie
40d9473e6a Display SKIP instead of PASS when tests skipped for make check 2022-06-21 13:11:08 -07:00
Marco Oliverio
3a9176bcc9 scripts: test for dtls13 retransmission
Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-06-15 10:46:43 -07:00
kaleb-himes
f5bbad185f Supplement to @julek-wolfssl's fantastic find, just allow for proper expansion 2022-05-27 13:52:26 -06:00
Daniel Pouzzner
c3e4c6b6bc
Merge pull request #5174 from julek-wolfssl/ocsp-typo
Typo in testing script
2022-05-25 08:16:58 -05:00
Juliusz Sosinowicz
b664cea735 Typo in testing script 2022-05-25 12:10:27 +02:00
Daniel Pouzzner
5c14bef6a8 global fixes for shellcheck warnings SC2027, SC2069, SC2154, SC2141, SC3014, SC3037 (all true positives). note, does not fix SC2057 in ocsp-stapling.test, which is addressed by PR #5174 . 2022-05-24 12:13:14 -05:00
Daniel Pouzzner
6984cf83b2 scripts/ocsp-stapling.test: fix whitespace. 2022-05-19 16:45:50 -05:00
Daniel Pouzzner
368854b243 scripts/: refactor TLS version support tests to use -V, rather than -v (which makes frivolous connection attempts). 2022-05-19 11:18:34 -05:00
Daniel Pouzzner
4d4145e6a0 add support for $NETWORK_UNSHARE_HELPER to the relevant scripts/. 2022-05-05 15:59:11 -05:00
David Garske
cb1dbb75f8 Fixes for sniffer-gen.sh. 2022-04-22 08:25:00 -07:00
David Garske
2fa1e19fe7 Fix for ./configure --enable-sniffer --enable-session-ticket --disable-ecc && make. 2022-04-21 13:28:38 -07:00
David Garske
659d33fdaf Fixes for minor sniffer and async issues:
* Sniffer: Remove old restrictions for max strength, encrypt-then-mac and forcing openssl-extra.
* Fix bound warning with strncpy in sniffer.c.
* Fix for async DH issue.
* Fix for SP math all not initializing raw big int.
* Fix for array bounds warning with "-O3" on SetEccPublicKey.
* Fix a sniffer async edge case with TLS v1.2 static RSA and extended master.
* Improved the sniffer test script detection of features.
* Disable ECC custom curve test with Intel QuickAssist.
2022-04-18 11:46:40 -07:00
Daniel Pouzzner
12776b3772 fixups for warnings from gcc-12:
src/internal.c: use XMEMCMP(), not ==, to compare array elements (fixes conflict of 74408e3ee3 vs 617eda9d44);

fix spelling of NAMEDGROUP_LEN (was NAMEDGREOUP_LEN);

src/ssl.c: in CheckcipherList() and wolfSSL_parse_cipher_list(), use XMEMCPY(), not XSTRNCPY(), to avoid (benign) -Wstringop-truncation;

scripts/sniffer-tls13-gen.sh: fix for shellcheck SC2242 (exit 1, not -1).
2022-03-24 16:33:36 -05:00
David Garske
f129c32273 Fixes for whitespace, script bug and bit-field type. 2022-03-23 09:31:04 -07:00
David Garske
29c120356e Sniffer asynchronous support.
* Adds stateful handling of DH shared secret computation in `SetupKeys`.
* Improved the decrypt handling to use internal functions and avoid generating alerts on failures.
* Fix for sniffer resume due to missing `sessionIDSz` broken in #4807.
* Fix sniffer test cases to split resume (session_ticket) tests.
* Add `snifftest` list of build features so test script can gate running resume test.
2022-03-21 12:05:08 -07:00
Sean Parkinson
2c1ecacbfc TLS 1.3 script test: wait for server to write file
Also fixes for:
./configure --enable-psk --disable-rsa --disable-ecc --disable-dh
C_EXTRA_FLAGS=-DWOLFSSL_STATIC_PSK
./configure --disable-shared --enable-curve448 --enable-ed448
--disable-rsa --disable-dh --enable-tls13 --disable-ecc --enable-certgen
--enable-keygen
2022-03-14 14:42:47 +10:00
Daniel Pouzzner
830431ccdf scripts/tls13.test: fix whitespace. 2022-03-11 13:54:50 -06:00
Daniel Pouzzner
64953299cf scripts/tls13.test: retries (up to 10) for early data scenarios, to mitigate race noted in #4918 . 2022-03-11 08:18:14 -06:00
Daniel Pouzzner
c78bfa4db8 scripts/tls13.test: when $early_data = yes, print the matching line counts. 2022-03-10 11:56:20 -06:00