Commit graph

22910 commits

Author SHA1 Message Date
Bence Szépkúti
12269e27b1 Add changelog for PKCS7 parser
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2022-11-25 05:51:40 +01:00
Bence Szépkúti
ae79fb2c2e Merge branch 'development' into pr3431 2022-11-25 03:12:43 +01:00
Gilles Peskine
187db00399 Update the Travis "full" build to use modern Clang
Don't use an all.sh component because there isn't one that does what we
want (modern Clang with ASan, and test everything).

* We need to set CC explicitly or tweak PATH, because clang in $PATH on
  Travis focal instances is Clang 7 which is too old (we want Clang 10).
* Travis lacks the array of versions of openssl and gnutls that we normally
  use for testing, so we need to exclude some tests (or build our
  own multiple versions of openssl and gnutls).

The SSL test exclusions are ad hoc and based on what currently works.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-24 22:41:55 +01:00
Gilles Peskine
4bdb9fbfa2 Enable all ciphers in OpenSSL >=1.1.0
OpenSSL may be configured to support features such as cipher suites or
protocol versions that are disabled by default. Enable them all: we're
testing, we don't care about enabling insecure stuff. This is not needed
with the builds of OpenSSL that we're currently using on the Jenkins CI, but
it's needed with more recent versions such as typically found on developer
machines, and with future CI additions.

The syntax to do that was only introduced in OpenSSL 1.1.0; fortunately we
don't need to do anything special with earlier versions.

With OpenSSL 1.1.1f on Ubuntu 20.04, this allows SHA-1 in certificates,
which is still needed for a few test cases in ssl-opt.sh. Curiously, this is
also needed for the cipher suite TLS-DHE-PSK-WITH-ARIA-128-GCM-SHA256 (and
no other, including other DHE-PSK or ARIA cipher suites).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-24 22:41:55 +01:00
Tom Cosgrove
50fc127a4e Change order of test arguments for bignum_mod_raw to simplify Python script
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-24 21:29:23 +00:00
Dave Rodgman
b8c4a0d940 Minor formatting tweaks
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 21:18:55 +00:00
Dave Rodgman
7a910a8be0 Minor formatting tweaks
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 21:17:40 +00:00
Dave Rodgman
875d2383d0 Improve documentation
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 20:43:15 +00:00
Dave Rodgman
aaf69fd682 Fix missing newline
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 20:40:28 +00:00
Dave Rodgman
c58858865b Fix off-by-one error
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 20:35:04 +00:00
Dave Rodgman
66433444fc Fix static inline linker issues
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 20:07:39 +00:00
Dave Rodgman
4b910c1ed1 Fix whitespace
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 19:44:52 +00:00
Dave Rodgman
069e7f462a Correct mixed up comments
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 19:37:26 +00:00
Dave Rodgman
96d61d14d8 Use memcpy for unaligned accesses
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 19:33:22 +00:00
Dave Rodgman
fbc23225d6 Tidy up alignment-related code into separate header
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 18:07:37 +00:00
Tom Cosgrove
1923009cdb Add test generation for mbedtls_mpi_mod_raw_add()
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-24 16:22:43 +00:00
Tom Cosgrove
abddad4af8 Add note about aliasing of operands for mbedtls_mpi_mod_raw_add()
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-24 16:22:43 +00:00
Tom Cosgrove
54d87bf5c2 Take limb count from the modulus in mod_raw_add tests
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-24 16:22:38 +00:00
Werner Lewis
e4c0a6c3ba Change cast to correct type
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-11-24 16:18:06 +00:00
Werner Lewis
f907576245 Pass correct arguments in test
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-11-24 16:18:06 +00:00
Werner Lewis
1a277d9ad6 Replace comparison with XOR
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-11-24 16:18:06 +00:00
Werner Lewis
d391b8ce61 Change types and move const before type
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-11-24 16:18:06 +00:00
Werner Lewis
baa34b6248 Add test function for mpi_mod_raw_add
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-11-24 16:18:06 +00:00
Werner Lewis
9fa91ebcb9 Use modulus structure in mbedtls_mpi_mod_raw_add
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-11-24 16:18:06 +00:00
Werner Lewis
0eea827cbd Rename MPI_CORE(add_mod) to mbedtls_mpi_mod_raw_add
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-11-24 16:18:06 +00:00
Hanno Becker
a45b6fee91 Extract MPI_CORE(add_mod) from the prototype
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-24 16:17:49 +00:00
Gabor Mezei
cbcbf4e434
Remove hand-written tests got raw_mod_sub
The generated tests cover all off the hand-written tests.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2022-11-24 11:48:59 +01:00
Pengyu Lv
3bb0e43b41 fix review comment
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2022-11-24 17:30:29 +08:00
Dave Rodgman
6921959b83 Remove unused variable
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-24 09:27:15 +00:00
Ronald Cron
4cf77e99ab
Merge pull request #6621 from ronald-cron-arm/tls13-early-data-write
TLS 1.3: Add definition of mbedtls_ssl_{write,read}_early_data
2022-11-24 09:58:07 +01:00
Manuel Pégourié-Gonnard
fecc6b2fe4 Minor tune-up to ChangeLog & documentation
- fix a recurring typo
- use clearer names

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-11-24 09:40:12 +01:00
Dave Rodgman
358c7d6eb0 Fix naming inconsistency
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 20:29:03 +00:00
Dave Rodgman
dd3103e9e7 Tidy up UNALIGNED_UINT32_T macro
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 19:42:13 +00:00
Dave Rodgman
3172e4e1c9 Fix typo in test_suite_common
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 19:38:13 +00:00
Dave Rodgman
e7cd137606 Define UNALIGNED_UINT32_PTR for unaligned access
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 19:14:26 +00:00
Dave Rodgman
a6778013b4 Tidy up UBSan detection
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 17:17:30 +00:00
Dave Rodgman
468df317bf Fix MSVC support for inline keyword
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 16:56:35 +00:00
Dave Rodgman
1bab27f983 Prevent unaligned access under ASan builds
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 16:51:59 +00:00
Dave Rodgman
15531bc6d2 Test for all alignment combinations
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 16:51:12 +00:00
Gabor Mezei
6b3c0c5943
Update the test case generator
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2022-11-23 16:45:05 +01:00
Gilles Peskine
6157fee306 Unify defintions of inline for MSVC (and old armcc?)
Having multiple definitions was cumbersome, and meant we might forget the
definition when adding an inline definition to a file that didn't have one
before (as I did when I added an inline definition in common.h).

Resolves #6649.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-23 16:15:21 +01:00
Dave Rodgman
3c8eb7e990 Provide external definition of mbedtls_xor
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 14:50:03 +00:00
Dave Rodgman
63d114305f Whitespace cleanup
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 14:03:30 +00:00
Dave Rodgman
f9a1c37bc8 Whitespace cleanup
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-23 14:02:00 +00:00
Gabor Mezei
b3b3466657
Test subtraction if the parameters are aliased to each other
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2022-11-23 14:44:14 +01:00
Gabor Mezei
4d3f3c5430
Fix the checking of the used limbs
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2022-11-23 14:44:14 +01:00
Gabor Mezei
68a45e0aaf
Fix potential not initialized warning
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2022-11-23 14:44:14 +01:00
Gabor Mezei
02d2313829
Fix documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2022-11-23 14:44:14 +01:00
Gabor Mezei
3411e949cd
Cas variable to proper type
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2022-11-23 14:44:13 +01:00
Gabor Mezei
c426d9b6cc
Add generated test for low level subtraction with modulus
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2022-11-23 14:44:13 +01:00