6cec41c3bb
use CT interface in add_zeros_and_len_padding()
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 18:34:06 +01:00
6b7e2a5809
Use CT interface in get_pkcs_padding
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 18:34:06 +01:00
b4e6b41aa0
Use const-time interface throughout mbedtls_rsa_rsaes_oaep_decrypt
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 18:34:06 +01:00
986006e567
Make TEST_CALLOC_NONNULL more robust
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 18:30:25 +01:00
6568f60358
Simplify mbedtls_ct_memcmp_partial test
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 17:48:24 +01:00
2c9f86b3b6
Add docs for mbedtls_ct_memcmp_partial test
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 17:48:13 +01:00
28bc1ab923
Use exact bounds for allocations in mbedtls_ct_memcmp_partial test
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 17:34:57 +01:00
a328635305
Introduce TEST_CALLOC_NONNULL
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 17:34:39 +01:00
ba600b2fd9
Remove expected param from mbedtls_ct_memcmp_partial test
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 17:26:13 +01:00
51c15309f2
Make padlen check const-time
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 17:22:18 +01:00
c2630fac52
Simplify mbedtls_ct_memcmp_partial
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 17:21:50 +01:00
071b69f47b
Add correct dependency to DES3 test
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com >
2023-09-19 11:24:49 +01:00
66d6ac92e6
Use mbedtls_ct_memcmp in mbedtls_rsa_rsaes_oaep_decrypt
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 09:10:59 +01:00
d337bd9bfe
Improve const-timeness of mbedtls_nist_kw_unwrap
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 09:10:59 +01:00
771ac65b0c
Add tests for mbedtls_ct_memcmp_partial
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 09:10:59 +01:00
9c14007ac3
Add mbedtls_ct_memcmp_partial
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-19 09:10:59 +01:00
d26a3d6da7
Eliminate duplicate ct memcmp
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-18 19:09:45 +01:00
faf0b8604a
mbedtls_ssl_decrypt_buf(): fix buffer overread with stream cipher
...
With stream ciphers, add a check that there's enough room to read a MAC in
the record. Without this check, subtracting the MAC length from the data
length resulted in an integer underflow, causing the MAC calculation to try
reading (SIZE_MAX + 1 - maclen) bytes of input, which is a buffer overread.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-09-18 19:07:50 +02:00
d2e004e401
Test mbedtls_ssl_decrypt_buf(): stream cipher, negative cases
...
Test mbedtls_ssl_decrypt_buf() with a null cipher (the only type of stream
cipher we support). Test the good case (to make sure the test code
constructs the input correctly), test with an invalid MAC, and test with a
shortened input.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-09-18 19:07:50 +02:00
6d2c5d5f5c
Adjust cipher tests to new requirement of specifying padding mode
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com >
2023-09-18 17:41:25 +01:00
9099d3fd76
Refactoring: create mbedtls_test_ssl_prepare_record_mac()
...
No semantic change.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-09-18 17:21:15 +02:00
bd50d5baec
Merge pull request #8177 from gilles-peskine-arm/generated-files-off-in-release
...
Generated files off in release
2023-09-18 14:11:58 +00:00
68ec3ccc7c
Add missing cleanup
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-09-18 14:35:52 +02:00
ac5fabed25
Refactoring: prepare to create mbedtls_test_ssl_prepare_record_mac()
...
No semantic change.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-09-18 14:35:42 +02:00
a3237efefb
Move testing of mbedtls_ssl_decrypt_buf to a new test suite
...
test_suite_ssl is huge and needs splitting.
Create a new test suite focused on mbedtls_ssl_decrypt_buf(), which is a
complicated function that needs more thorough testing with malformed inputs.
At this point, we are only doing negative testing with CBC-non-ETM test
suites. This needs to grow.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2023-09-18 14:23:13 +02:00
25c271a035
Merge pull request #8182 from daverodgman/asn1write-size
...
Reduce code size in mbedtls_asn1_write_len
2023-09-18 10:27:23 +00:00
97bb726e2d
Add clarifying comment
...
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com >
2023-09-18 11:28:32 +02:00
275afe187f
Fix preset shared between 1.2 and 1.3
...
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com >
2023-09-18 11:19:20 +02:00
f299efdb96
Improve a comment
...
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com >
2023-09-18 11:19:04 +02:00
67c86e626b
Merge pull request #7961 from gilles-peskine-arm/psa_crypto_config-in-full
...
Enable MBEDTLS_PSA_CRYPTO_CONFIG in the full config
2023-09-18 08:13:12 +00:00
8fbef064a6
Merge pull request #8217 from paul-elliott-arm/remove_unused_values_programs
...
Remove unneeded setting of ret from ssl programs
2023-09-18 08:13:00 +00:00
5083a5b85e
Merge pull request #8220 from jnmeurisse/development
...
Fix issue #8215 : add missing requires documentation in mbedtls_config.h
2023-09-18 10:06:14 +02:00
4f119b8f21
Remove extra copies of a block of comment/define
...
Not sure how it happened, but this block was not just duplicated, but
triplicated. Keep only the first copy: the one before the code that uses
the macro being defined.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com >
2023-09-18 09:57:04 +02:00
f7298cd397
Fix some issues in comments
...
Ranging from typos to outdated comment contradicting the code.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com >
2023-09-18 09:55:24 +02:00
83f0a65d71
Fix issue #8215 : add missing requires documentation in mbedtls_config.h
...
Add missing requirements MBEDTLS_SSL_PROTO_TLS1_2 to option MBEDTLS_SSL_RENEGOTIATION documentation.
Signed-off-by: jnmeurisse <88129653+jnmeurisse@users.noreply.github.com >
2023-09-16 18:12:18 +02:00
0c9516ea89
code style
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-15 18:30:09 +01:00
127f35d5e5
Merge remote-tracking branch 'origin/development' into asn1write-size
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-15 18:02:59 +01:00
ecdfc1c94f
Fix poorly named function
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-15 18:00:37 +01:00
8a7fb2d799
Merge pull request #1055 from waleed-elmelegy-arm/add-new-pkcs12-pbe2-ext-fun
...
Add new pkcs12 pbe2 ext fun
2023-09-15 18:43:03 +02:00
fd3360ebf4
Remove unneeded setting of ret from ssl programs
...
Remove coverity warnings on unused values.
Signed-off-by: Paul Elliott <paul.elliott@arm.com >
2023-09-15 17:41:25 +01:00
170be457bd
Merge pull request #8207 from mcagriaksoy/branch_old_try
...
Fixes log level for got supported group message
2023-09-15 05:53:00 +00:00
865730ec67
Merge pull request #8212 from tom-cosgrove-arm/mbedtls_ssl_max_early_data_size-default-value
...
MBEDTLS_SSL_MAX_EARLY_DATA_SIZE: default value should be commented out in config
2023-09-15 05:51:59 +00:00
7f84471a60
Adding changelog for log level message fix
...
Signed-off-by: mcagriaksoy <mcagriaksoy@yandex.com >
2023-09-14 22:43:08 +02:00
50888643f4
Reduce line size in new pkcs function changelog
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com >
2023-09-14 18:27:17 +01:00
6fda82cdc7
Merge pull request #8214 from daverodgman/clang18-fix
...
Fix some clang-18 warnings
2023-09-14 17:12:23 +00:00
a11eac4292
code style
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-14 16:16:04 +01:00
e99b24dd9f
Fix some clang-18 warnings
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-09-14 15:52:02 +01:00
a63775b168
Move MBEDTLS_SSL_MAX_EARLY_DATA_SIZE to the correct section
...
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2023-09-14 13:31:19 +01:00
3b4471ef87
MBEDTLS_SSL_MAX_EARLY_DATA_SIZE: default value should be commented out in config
...
Numeric options should be commented out with their default values in the config
file, and a separate header file should set the default value if necessary.
This was done for most other options in #8161 ; do it here for
MBEDTLS_SSL_MAX_EARLY_DATA_SIZE.
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2023-09-14 13:18:50 +01:00
b95e92cd41
Merge pull request #8076 from valeriosetti/issue8005
...
Test with ECC and FFDH accelerated and no bignum
2023-09-14 09:12:35 +00:00