18352 Commits

Author SHA1 Message Date
Marco Oliverio
32eca32c97 fix: tls13: fix wrong heap hint argument of XFREE 2022-09-29 17:56:59 +02: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
Steffen Jaeckel
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
Steffen Jaeckel
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
tim-weller-wolfssl
14b776c9a4 Adding C library support furnction to write a buffer (always to UART) 2022-09-29 10:34:16 -05:00
Sean Parkinson
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
Sean Parkinson
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
Sean Parkinson
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
Marco Oliverio
ae4228f928 tests: add WOLFSSL_TICKE_NONCE_MALLOC tests 2022-09-28 19:54:14 +02:00
Marco Oliverio
c508ff3da9 internal.h: allow customization of MAX_TICKET_NONCE_STATIC_SZ 2022-09-28 19:54:14 +02:00
Marco Oliverio
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
Marco Oliverio
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
Juliusz Sosinowicz
d8e10d8ef4 DTLS 1.3: Always reset state on HRR 2022-09-28 18:42:39 +02:00
Juliusz Sosinowicz
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
Juliusz Sosinowicz
145086f776 DTLS 1.3: Clear ssl->dtls13SendingAckOrRtx in ssl.c 2022-09-28 18:42:38 +02:00
Marco Oliverio
3c60926bfa tests: silently dropping bad records after handshake in DTLS 2022-09-28 18:42:38 +02:00
Marco Oliverio
6e4a3ecdbd tests: add negative version negotation tests 2022-09-28 18:42:38 +02:00
Marco Oliverio
b3ecdd2ecb dtls13: support stateless cookie exchange on blocking socket 2022-09-28 18:42:38 +02:00
Marco Oliverio
0b525a52c4 tls13: send protocol_version alert on failed version negotiation 2022-09-28 18:42:38 +02:00
Marco Oliverio
88ec118e89 dtls13: drop unencrypted messages after epoch 1 2022-09-28 18:42:38 +02:00
Marco Oliverio
400671dc7c dtls: drop non-handshake messages before cookie exchange 2022-09-28 18:42:38 +02:00
Hayden Roche
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
David Garske
2d1f22c35a
Merge pull request #5639 from Anthony-Tatowicz/master
Add Irq install for Aruix example
2022-09-28 06:55:56 -04:00
kaleb-himes
d61656d5e7 Do not perform IV Wrap test when using cert3389 inlined armasm 2022-09-27 17:15:19 -06:00
Hayden Roche
f1e2165c59
Merge pull request #5638 from JacobBarthelmeh/release v5.5.1-stable 2022-09-27 14:21:19 -07:00
Jacob Barthelmeh
eb5076bb89 update changelog for release 5.5.1 2022-09-27 13:40:00 -06:00
JacobBarthelmeh
ffe052e845
Merge pull request #5634 from douzzer/20220926-fixes
20220926-fixes
2022-09-27 11:49:20 -06:00
Anthony Tatowicz
13d53b5297 Add Irq install for Aruix example 2022-09-27 12:04:27 -05:00
JacobBarthelmeh
dde5ef558b
Merge pull request #5633 from SparkiDev/sp_mod_fix
SP int all: sp_mod
2022-09-27 10:23:03 -06:00
Daniel Pouzzner
cc03e3fdab wolfcrypt/src/misc.c ByteReverseWords(): mollify MSVC re C4311. 2022-09-27 10:05:07 -05:00
Daniel Pouzzner
cfe0278d35 wolfcrypt/src/misc.c ByteReverseWords(): fix misaligned word accesses under armv7a-asm. 2022-09-27 02:02:31 -05:00
Daniel Pouzzner
1ffe4275ae fix whitespace 2022-09-26 23:32:59 -05:00
Sean Parkinson
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
Sean Parkinson
8617de86c1
Merge pull request #5632 from JacobBarthelmeh/Testing
Misc. testing items
2022-09-27 08:25:18 +10:00
JacobBarthelmeh
1e348eb7bd sanity check on return value 2022-09-26 10:40:41 -07:00
JacobBarthelmeh
cc4e8df56d cast to fix warning in test case 2022-09-26 10:13:06 -07:00
John Safranek
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
John Safranek
b4077d80c9
Merge pull request #5620 from JacobBarthelmeh/Certs
fix for return value of x509 print
2022-09-25 19:32:52 -07:00
Sean Parkinson
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
David Garske
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
Daniel Pouzzner
f80fb7f1aa
Merge pull request #5625 from dgarske/esp32_cleanups
Fixes for various build configurations
2022-09-23 20:46:44 -05:00
David Garske
221fd275fd Fixes for building without SHAKE. 2022-09-23 14:50:16 -07:00
David Garske
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
David Garske
606f58a851 Spelling and whitespace cleanups. 2022-09-23 13:58:58 -07:00
David Garske
b42631c721 Fix for ESP32 wolfcrypt_test entry point. 2022-09-23 13:58:49 -07:00
David Garske
792eac9484 Fixes for building the API unit test without filesystem NO_FILESYSTEM. 2022-09-23 13:58:17 -07:00
David Garske
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
David Garske
c29e602ea5 Fix for building with WOLFSSL_ASN_TEMPLATE and IGNORE_NAME_CONSTRAINTS. 2022-09-23 13:52:55 -07:00
David Garske
7970d5d794
Merge pull request #5152 from SparkiDev/armv7a_neon_asm
ARM ASM: ARMv7a with NEON instructions
2022-09-23 08:46:03 -07:00
John Safranek
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