1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-06-03 13:22:02 +03:00

7362 Commits

Author SHA1 Message Date
Tom Cosgrove
2bda812130
Merge pull request #8085 from gilles-peskine-arm/mpi_exp_mod-remove_initial_copy-2.28
Backport 2.28: mbedtls_mpi_exp_mod: remove spurious copy of the output variable
2023-08-21 15:50:30 +00:00
Tom Cosgrove
f9f183c107
Merge pull request #8089 from ivq/8017-backport
Backport 2.28: Fix a few unchecked return values
2023-08-21 13:03:01 +00:00
Antonio de Angelis
431e5c4199 Remove workaround for non-zero shared_secret array
PSA_KEY_AGREEMENT_MAX_SHARED_SECRET_SIZE is always greater
than 1 so no need for the workaround on the original patch

Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
2023-08-17 15:36:21 +01:00
Chien Wong
0118a1d712
Fix a few unchecked return values
Signed-off-by: Chien Wong <m@xv97.com>
2023-08-17 22:13:11 +08:00
Gilles Peskine
20d54e3115 mbedtls_mpi_exp_mod: remove spurious copy of the output variable
Clear some confusion between `X` as the output variable and "X" as a name
given to the accumulator. Previous iterations of the code used the variable
`X` as the accumulator, but now that the accumulator is `W[x_index]`, some
of the comments didn't make sense.

Remove the copy of the initial value of `X` into `W[x_index]`, which was
meaningless: the initial value of an output variable should not, and did
not, matter. `W[x_index]` is later overridden unconditionally to take the
value `RR`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-17 14:39:25 +02:00
Antonio de Angelis
1505d3232d Fix error strings without quotes
Some of the error strings that should be printed with the
error preprocessor directive are missing quotes

Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
2023-08-16 16:28:42 +01:00
TTornblom
ac9e3402ab BUILD: Update For IAR support
Applied the same change as in mbed-crypto for using this as a sub
project with the IAR toolchain. Use __asm generic ,and avoid empty
enum. Avoid declaration of array with null size. This is a porting
of the original patch contributed to trusted-firmware-m.

Signed-off-by: TTornblom <thomas.tornblom@iar.com>
Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
2023-08-16 16:25:47 +01:00
Gilles Peskine
64a81357c3
Merge pull request #8037 from tom-cosgrove-arm/fix-rijndael-and-drbg-pdf-links-2.28
Backport 2.28: Update links to Rijndael paper and NIST SP 800-90 DRBGs
2023-08-07 19:16:01 +00:00
Gilles Peskine
b438348774
Merge pull request #8010 from marekjansta/fix-x509-ec-algorithm-identifier-2.28
Backport 2.28: Fixed x509 certificate generation to conform to RFCs when using ECC key
2023-08-07 19:14:52 +00:00
Tom Cosgrove
aaec13793a Update links to Rijndael paper and NIST SP 800-90 DRBGs
The link to the DRBG paper points to the March 2007 version, the same as the
original link (rather than the latest version).

The amended Rijndael paper has a two-page "Note on naming" prefix.

Fixes #7193

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-08-04 15:08:48 +01:00
Dave Rodgman
f97832a5ec
Merge pull request #8015 from AgathiyanB/fix-unnecessary-type-quantifier
Fix IAR warning about unnecessary type quantifier
2023-08-03 15:57:01 +00:00
Dave Rodgman
403ce0a6cc Bump version numbers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-02 15:35:45 +01:00
Agathiyan Bragadeesh
06d5e10989 Fix IAR warning about unnecessary type quantifier
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-08-01 14:23:01 +01:00
Marek Jansta
0a6743b2de Fixed AlgorithmIdentifier parameters when used with ECDSA signature algorithm in x509 certificate
Signed-off-by: Marek Jansta <jansta@2n.cz>
2023-07-31 17:33:23 +02:00
Marek Jansta
f5257c06d1 Cherry picked required prerequisites from dev branch, git hash 0167244b
Signed-off-by: Marek Jansta <jansta@2n.cz>
2023-07-31 17:33:16 +02:00
Agathiyan Bragadeesh
e7eb8052be Seperate declarations from function body
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-07-31 16:20:27 +01:00
Agathiyan Bragadeesh
5521b4ce37 Assign have_rng in declaration of ecp_mul_mxz
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-07-31 16:15:56 +01:00
Agathiyan Bragadeesh
7b0ee1e655 Fix control bypass warnings
Declarations have been moved to the top of functions to fix this

Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-07-27 15:51:46 +01:00
Gilles Peskine
9a9d5eea53 Fix a build error when MBEDTLS_PSA_INJECT_ENTROPY is enabled
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-20 18:07:47 +02:00
Paul Elliott
dc1244d135
Merge pull request #6974 from davidhorstmann-arm/2.28-cmake-pass-through-config-defines
[Backport 2.28] Pass `MBEDTLS_CONFIG_FILE` defines through cmake
2023-07-07 17:01:24 +01:00
Tom Cosgrove
f788a45d47
Merge pull request #7213 from sergio-nsk/patch-5
mbedtls-2.28: Fix error: comparison of integers of different signs: 'SOCKET' and 'int'
2023-07-07 16:46:03 +01:00
David Horstmann
58dda6713c Use emptiness-checks rather than DEFINED checks
For the MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE variables,
check that they are non-empty and defined. This means they can be
unconditionally created in the cache, simplifying the CMakeLists.txt

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-07-05 18:12:09 +01:00
David Horstmann
1a30cf70cc Pass config file options to mbedtls_test(_helpers)
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-07-05 14:35:08 +01:00
David Horstmann
e31e287109 Pass MBEDTLS_CONFIG_FILE defines through cmake
When -DMBEDTLS_CONFIG_FILE or -DMBEDTLS_USER_CONFIG_FILE are passed to
cmake, pass them through as compile definitions. This allows different
mbedtls configs to be passed at configure time without modifying any
cmake files.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-07-05 14:33:11 +01:00
Dave Rodgman
08efc3d768
Merge pull request #7854 from daverodgman/fix-unused-aes-2.28
Fix AES dependencies - build TF-M config cleanly - backport 2.28
2023-07-03 16:48:39 +01:00
Dave Rodgman
a3fc295559
Merge pull request #7823 from SlugFiller/mbedtls-2.28
Support compilation using CLang on Windows
2023-07-03 09:52:03 +01:00
Dave Rodgman
f72b8375d0 Fix order of endif comments
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 16:33:03 +01:00
Dave Rodgman
1d0033e1ac Improve #endif comments
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:13:26 +01:00
Dave Rodgman
1ce92e4887 Correct #endif comments
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:13:15 +01:00
Dave Rodgman
a4a337360d Correct comments on #endif's
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:13:08 +01:00
Dave Rodgman
94210b13eb Compile fixes
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 14:08:07 +01:00
Dave Rodgman
bae79fa16e Add missing sha header includes to entropy.c
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:54:53 +01:00
Dave Rodgman
1262315a1a Fix warnings re: unused variables in pkparse and pkwrite
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:54:25 +01:00
Dave Rodgman
f488c2ca79 Add missing include for INT_MAX definition
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:35:25 +01:00
Dave Rodgman
584b62f89e code style
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:31:29 +01:00
Dave Rodgman
9d3b63396b Fix comment
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:31:29 +01:00
Dave Rodgman
5c047d9672 More dependency fixes
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:31:29 +01:00
Dave Rodgman
36c8e581d6 Fix unused variable
Fix when MBEDTLS_AES_SETKEY_ENC_ALT, MBEDTLS_AES_DECRYPT_ALT and
MBEDTLS_AES_ROM_TABLE set.

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:31:29 +01:00
Dave Rodgman
dbae184ceb Fix unused variable if MBEDTLS_AES_SETKEY_ENC_ALT and MBEDTLS_AES_DECRYPT_ALT set
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:31:29 +01:00
Dave Rodgman
9b20aeaa17 Fix unused fn when MBEDTLS_AES_SETKEY_DEC_ALT and MBEDTLS_AES_SETKEY_ENC_ALT set
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:31:29 +01:00
Dave Rodgman
1e6f7708f2 Fix unused function when MBEDTLS_AES_SETKEY_ENC_ALT set
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-28 11:31:29 +01:00
David Horstmann
abaea614d2 Return an error when no name is parsed
When less than 1 RDN is successfully parsed in
mbedtls_x509_string_to_names(), return an error. Previously this
returned success when a string containing neither '=' or ',' was
supplied.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-06-27 17:34:58 +01:00
SlugFiller
e2d0614571 Support compilation using CLang on Windows
Signed-off-by: SlugFiller <5435495+SlugFiller@users.noreply.github.com>
2023-06-26 19:19:56 +03:00
Gilles Peskine
63b50b56cd
Merge pull request #7753 from lpy4105/backport-2.28/issue/renew_cert_2024-01-01
Backport 2.28: Updating crt/crl files due to expiry before 2024-01-01
2023-06-21 12:29:12 +02:00
Demi Marie Obenour
0e2074133a Add a do-while loop around macros
This is good practice in C.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-20 11:45:26 -04:00
Pengyu Lv
41bb446d12 Update TEST_CA_CRT_EC_PEM and TEST_CA_CRT_EC_DER
To retain the ABI compatibility, we need the DER
data to be in the exact size of 520 bytes. So,
these data are regenerated by unsetting the
'critical' flag of 'basic_constraints' extension,
though the extension should be critical for this
CA according to RFC5280 section 4.2.1.9.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-15 15:41:30 +08:00
Pengyu Lv
04da85f0f4 Update TEST_SRV_CRT_EC_PEM and TEST_SRV_CRT_EC_DER
Regenerate server5.crt[.der] until we got the
DER data in the size of 547 bytes to maintain
the ABI compatibility.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-15 13:01:35 +08:00
Pengyu Lv
14f59bfca8 Update cert macros in library/certs.c
This commit manually updates:
  - TEST_CA_CRT_EC_PEM
  - TEST_CA_CRT_EC_DER
  - TEST_SRV_CRT_EC_PEM
  - TEST_SRV_CRT_EC_DER

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-06-14 09:55:41 +08:00
Sergey
20003ca1ab Fix error: comparison of integers of different signs: 'SOCKET' and 'int'
Signed-off-by: Sergey <sergio_nsk@yahoo.de>
2023-06-09 09:25:28 -07:00
Dave Rodgman
247e6f088d
Merge pull request #7608 from daverodgman/pr6511-2.28
Fix: no newline when debug msg over DEBUG_BUF_SIZE - backport 2.28
2023-05-17 17:59:54 +01:00