229 Commits

Author SHA1 Message Date
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
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
Daniel Pouzzner
abfc788389 script cleanup: use #!/bin/bash on all scripts that use "echo -e" (/bin/sh is sometimes a non-Bourne/non-POSIX shell, e.g. dash/ash, with no support for "echo -e"); fix whitespace. 2022-03-09 12:28:22 -06:00
Daniel Pouzzner
c9a7393923 fixes for shell script errors detected by shellcheck --severity=error. 2022-03-08 12:51:48 -06:00
Daniel Pouzzner
0231304607 fixes for make check with --enable-all (now including --enable-earlydata) with fips or asynccrypt:
in scripts/tls13.test, use fips-compatible server-side cipher suite for "TLS v1.3 cipher suite mismatch" test, and modernize some syntax;

in configure.ac, omit earlydata from enable-all when asynccrypt, pending fix;

also in configure.ac, fix AC_CHECK_DECLS()-overriding-AC_CHECK_FUNCS() kludge, to fix CPPFLAGS=-std=c99 builds.
2022-03-07 17:19:31 -06:00
Hideki Miyazaki
90355df4b0
disable early data for --enable-distro
addressed jenkins failure
2022-03-04 17:00:29 +09:00
Daniel Pouzzner
c581e13380 bwrap tweaks:
in scripts/ocsp.test, don't call ping.test when $AM_BWRAPPED = yes (ping is setuid, so fails under bwrap);

in scripts/unit.test.in, don't bwrap if $AM_BWRAPPED = yes (double-bwrapping always fails);

in testsuite/testsuite.c testsuite_test(), build tempName using tempDir, and try to assign tempDir from XGETENV("TMPDIR"), fallback to hardcoded "/tmp".
2022-02-10 15:54:39 -06:00
Anthony Hu
b957a6e872 Purge Rabbit cipher 2022-01-28 13:13:53 -05:00
Marco Oliverio
38558d7fd1 dtls-srtp: don't run openssl_srtp.test on make check 2022-01-25 21:51:56 +01:00
Sean Parkinson
848f5eeb0c
Merge pull request #4755 from dgarske/dtls_srtp
DTLS SRTP (RFC5764) support (adds `--enable-srtp`)
2022-01-21 10:43:47 +10:00
Marco Oliverio
46c0809f5a dtls-srtp: add script to test interop with OpenSSL 2022-01-20 16:55:44 +01:00
Anthony Hu
c2860cb311 Get rid of HC-128 2022-01-17 18:11:54 -05:00
David Garske
d8b58b8b05 Put both DigiCert Global Root CA and GlobalSign Root CA into the Google CA list. Fixes --enable-dtls --enable-ocsp ./scripts/ocsp.test`. 2021-12-20 11:47:34 -08:00
Sean Parkinson
72486333c3 Get host name: add code to use popen and the command 'host'
When compiling for QEMU, the gethostbyname call doesn't have access to
the OS DNS.
Implemented a lookup of hostname that uses the system command host.

Fix for QEMU Aarch64 where 'char' is unsigned and the -1 return is being
converted to 255 in wolfSSL_OPENSSL_hexchar2int().

Test TLSv1.3 with www.google.com if wolfSSL supports it.

CMAC: cannot cast size_t* to word32* when big-endian.

SP math all: Random prime - munge bits before moving them around for
big-endian.

BIO, no filesystem: Allow BIO_prinf to be used with mem BIO.
2021-09-09 18:32:19 +10:00
David Garske
9b6cf56a6e
Expanded support for Curve25519/Curve448 and TLS v1.3 sniffer (#4335)
* Fixes for building with Ed/Curve25519 only. Fix for IoT safe demo to exit after running once. Added `WOLFSSL_DH_EXTRA` to `--enable-all` and `--enable-sniffer`. Cleanup uses of `==` in configure.ac. Various spelling fixes.

* Fix for sniffer with TLS v1.3 session tickets.

* Fix for ASN Template Ed25519 key export (missing version / not setting OID correctly).

* Add key import/export support for Curve25519/Curve448. Refactor of the 25519/448 ASN code to combine duplicate code.

* Refactor of Curve25519 code. Improved public key export to handle generation when only private is set. Improved private scalar buffer sizing.

* Fix for static ephemeral loading of file buffer.

* Added sniffer Curve25519 support and test case.

* Fix for sniffer to not use ECC for X25519 if both are set.

* Fix Curve448 public export when only private is set.

* Fix for `dh_generate_test` for small stack size.

* Reduce stack size use on new asymmetric DER import/export functions. Cleanup pub length calc.

* Fix invalid comment.
2021-09-01 09:28:24 +10:00
Elms
9ae021d2cb tests: server example doesn't like empty string params
But it's ok with them at the end
2021-06-14 12:01:09 -07:00
Elms
21db484f50 tests: fix test scripts for paths with spaces 2021-06-13 21:37:07 -07:00
Sean Parkinson
ed14e593c7 ED25119 and SHAKE-256: fixes
SHAKE-256 is off by default now. Make sure WOLFSSL_SHAKE256 doesn't make
it into options.h.
Fix openssl.test usage of ed25519 certificates.
Add scripts that regenerate certificates
2021-06-11 10:13:31 +10:00
Sean Parkinson
ed5b134161 TLS 1.3 PSK EarlyData testing
Fix test to expect 3 or 5 lines with "Early Data" (release or debug
build).
2021-05-18 15:25:12 +10:00
JacobBarthelmeh
d44549fd77 only update OPENSSL_ENGINE_ID if already set 2021-04-12 01:47:01 -06:00
JacobBarthelmeh
ee22d27cf8 add sanity check that engine can be loaded 2021-04-11 20:48:18 +07:00
JacobBarthelmeh
c34025b186 add option to use an engine with openssl test script 2021-04-11 20:06:13 +07:00