dd2a09a22b
Introduce demo script for PSA hash program
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com >
2023-11-16 18:45:55 +00:00
70595f7983
Explicitly indicating when private fields are accessed in benchmark.c.
...
Signed-off-by: Matthias Schulz <mschulz@hilscher.com >
2023-11-16 17:43:58 +01:00
3b9240bbd0
Alternative Timing compatible benchmark.c
...
Signed-off-by: Matthias Schulz <mschulz@hilscher.com >
2023-11-16 17:39:43 +01:00
aa7dffa24a
Add benchmark for RSA 3072.
...
Signed-off-by: Matthias Schulz <mschulz@hilscher.com >
2023-11-16 15:31:32 +01:00
2f40cc05f0
Improve explanations of what bad thing a metatest does
...
Especially clarify the situation with respect to mutex usage.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-16 15:13:38 +01:00
ad2a17eb60
Uniformly use MBEDTLS_THREADING_C guards
...
Since the code compiles with MBEDTLS_THREADING_C, not just with
MBEDTLS_THREADING_PTHREAD, use MBEDTLS_THREADING_C as the guard. The runtime
behavior is only as desired under certain conditions that imply
MBEDTLS_THREADING_PTHREAD, but that's fine: no metatest is expected to pass
in all scenarios, only under specific build- and run-time conditions.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-16 15:09:48 +01:00
752dd39a69
Merge pull request #8508 from valeriosetti/issue6323
...
[G3] Driver-only cipher+aead: TLS: ssl-opt.sh
2023-11-14 11:39:06 +00:00
cce0012463
Add documentation
...
Explain the goals of metatests, how to write them, and how to read their
output.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-10 15:36:15 +01:00
ccb121500d
Uninitialized read: make the pointer non-volatile rather than the buffer
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-10 11:35:36 +01:00
da6e7a2ac2
More consistent usage of volatile
...
Fix MSVC warning C4090.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-10 10:09:27 +01:00
38e75fb1a7
ssl_server2: remove usage of mbedtls_cipher_info_from_string()
...
This removes the dependency from cipher module and legacy key/modes
symbols which are used in cipher_wrap.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-11-10 08:27:39 +01:00
d2fa698155
Strengthen against possible compiler optimizations
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-09 21:46:24 +01:00
0751761b49
max_early_data_size: rename configuration function
...
Rename mbedtls_ssl_tls13_conf_max_early_data_size as
mbedtls_ssl_conf_max_early_data_size since in the future
this may not be specific to TLS 1.3.
Signed-off-by: Yanray Wang <yanray.wang@arm.com >
2023-11-07 11:49:34 +08:00
d5ed36ff24
early data: rename configuration function
...
Rename mbedtls_ssl_tls13_conf_early_data as
mbedtls_ssl_conf_early_data since in the future this may not be
specific to TLS 1.3.
Signed-off-by: Yanray Wang <yanray.wang@arm.com >
2023-11-07 11:49:24 +08:00
a1023e2bd6
programs/test/metatest indirectly includes library/common.h
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
4bc873f0a1
Add missing program to .gitignore
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
102aea2ba8
Add metatests for mutex usage
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
f0d5cf9a0c
Don't use %llx in printf
...
We still do MinGW builds on our CI whose printf doesn't support it!
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
a1dfa14c06
Fix cast from pointer to integer of different size
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
ee8109541a
Don't cast a function pointer to a data pointer
...
That's nonstandard. Instead, convert to an integer.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
6aa9f32124
Use casts when doing nonstandard pointer conversions
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
69e8db0366
Strengthen against Clang optimizations
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
b0f0a64de0
Metatests for basic Asan and Msan features
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:19 +01:00
80ba832be6
Metatests for null pointer dereference
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:09 +01:00
f309fbf0d5
Validate that test_fail causes a test failure
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:09 +01:00
33406b645d
Add a metatest program
...
This program can be used to validate that things that should be detected as
test failures are indeed caught, either by setting the test result to
MBEDTLS_TEST_RESULT_FAILED or by aborting the program.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-11-06 20:33:09 +01:00
f24bbd987a
dh_client.c: modify prompt message
...
Signed-off-by: Yanray Wang <yanray.wang@arm.com >
2023-11-06 10:02:10 +08:00
8b6b41f6cd
Merge pull request #8434 from valeriosetti/issue8407
...
[G2] Make TLS work without Cipher
2023-11-04 15:05:00 +00:00
f8be5f6ade
Fix overlooked files
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-11-02 20:43:00 +00:00
16799db69a
update headers
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-11-02 19:47:20 +00:00
74d48c89fa
ssl_server2: small improvement of code readability
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-11-02 16:43:55 +01:00
b67b47425e
Rename MBEDTLS_CIPHER_ENCRYPT_ONLY as MBEDTLS_BLOCK_CIPHER_NO_DECRYPT
...
Signed-off-by: Yanray Wang <yanray.wang@arm.com >
2023-10-31 17:22:06 +08:00
afc6a992c5
Merge pull request #8381 from gilles-peskine-arm/20231017-misc-cleanup
...
Cleanups in test code
2023-10-30 18:08:01 +00:00
dc55470341
ssl_context_info: add guards for CIPHER_C
...
mbedtls_cipher_info_from_type() is only available when CIPHER_C is
defined. So when it is not we just print the cipher type decimal
value on the output instead of the cipher's name.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-10-30 11:36:32 +01:00
bdf04e840a
ssl_server2: support ticket_aead only when CIPHER_C is defined
...
Cipher parsing requires mbedtls_cipher_info_from_string() which
depends on CIPHER_C.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-10-30 11:36:32 +01:00
5d055f8206
Merge pull request #7844 from mpg/ssl-progs-usage
...
Fix usage & error reporting in SSL programs
2023-10-26 08:19:25 +00:00
0ea1b8fe8c
Merge pull request #7982 from gilles-peskine-arm/sample_program_demo_scripts-3.4
...
Run sample program demo scripts in all.sh
2023-10-18 10:03:52 +00:00
62418dd20b
Merge pull request #8350 from waleed-elmelegy-arm/fix-null-dereference-in-x509-cert-write
...
Fix possible NULL dereference issue in X509 cert_write program
2023-10-18 10:03:36 +00:00
d44ee9e6d1
Merge pull request #8351 from waleed-elmelegy-arm/fix-null-dereference-in-x509-cert-req
...
Fix possible NULL dereference issue in X509 cert_req program
2023-10-18 09:01:31 +00:00
a0e810de4b
Convey that it's ok for mbedtls_ssl_session_save to fail
...
mbedtls_ssl_session_save() always outputs the output length, even on error.
Here, we're only calling it to get the needed output length, so it's ok to
ignore the return value. Convey this to linters.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-10-17 16:04:27 +02:00
9534dfd15b
Reword error message on format of SAN arguments
...
Signed-off-by: David Horstmann <david.horstmann@arm.com >
2023-10-17 14:59:31 +01:00
4a493b267f
Reword error message on format of SAN arguments
...
Signed-off-by: David Horstmann <david.horstmann@arm.com >
2023-10-17 14:57:23 +01:00
aa01ee303a
Merge remote-tracking branch 'origin/development' into support_cipher_encrypt_only
2023-10-16 17:38:32 +08:00
28b56335bb
Merge pull request #7942 from tom-daubney-arm/psa_crypto_example_hash
...
Add example program for PSA hash
2023-10-13 15:22:58 +00:00
5867465e90
Fix code style issue in cert_write program
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com >
2023-10-13 10:03:12 +01:00
eade3fedb2
Fix code style issue in cert_req program
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com >
2023-10-13 09:59:19 +01:00
ac97af223e
Fix possible NULL dereference issue in X509 cert_req program
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com >
2023-10-12 15:46:06 +01:00
1444c0eb20
Add changelog entry for x509 cert_write null dereference fix
...
Also fix a typo in cert_write.c
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com >
2023-10-12 14:31:06 +01:00
476c1198e8
Fix possible NULL dereference issue in X509 cert_write program
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com >
2023-10-12 14:19:25 +01:00
2e67781e93
Alter program layout for better clarity
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com >
2023-10-12 10:46:43 +01:00