Commit graph

27291 commits

Author SHA1 Message Date
Minos Galanakis
7afebccf69 ChangeLog.d: Added mininum required Windows version.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:22 +01:00
Minos Galanakis
4952f705ee Removed unsupported Visual Studio related code in entropy_poll.c and x509_crt.c.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:22 +01:00
Minos Galanakis
e960365957 ChangeLog.d: Reworded updated_windows_apis.txt.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:22 +01:00
Minos Galanakis
8792717309 Changelog: Removed entry from root file
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:21 +01:00
Minos Galanakis
12b493f4dc entropy_poll/x509_crt: Added MBEDTLS_POP_TARGET_PRAGMA define guards.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:21 +01:00
Minos Galanakis
24a1c16fac library Makefile: Moved -lbcrypt to LOCAL_LDFLAGS
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:21 +01:00
Minos Galanakis
e13775dedb fuzzer Makefile: Added -lbcrypt linkage
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:21 +01:00
Minos Galanakis
a277b210ff Code style fixes
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:21 +01:00
Minos Galanakis
b8d6b82df4 programs: Cleaned up bcrypt linking refererences.
bcrypt is added to the cmake `libs` dependency at library\CMakeLists.txt

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-09-25 14:12:21 +01:00
Simon Butcher
769ee65f99 Fix Visual Studio Release|x64 builds
The shipped Visual Studio project files were misconfigured for build
combinations of 64 bit Release builds.

Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:21 +01:00
Simon Butcher
de573f56e5 Fix coding style of length_as_int var in x509_crt.c
Variable had the very Windows name of lengthAsInt, which is fine for C# but
doesn't match the Mbed TLS coding standards.

Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:21 +01:00
Simon Butcher
949aa8fa3a Remove redundant Visual Studio 6 data files
Visual Studio 6 is no longer supported by the library.

Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:21 +01:00
Simon Butcher
35e5dad865 Add clarifying comment on use of MultiByteToWideChar() and CP_ACP
Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:21 +01:00
Simon Butcher
bcb6cfb13d Fix the tests build with mingw for the new Win32 APIs
Add missing library dependency of bcrypt to the tests Makefile

Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:20 +01:00
Simon Butcher
def90f4966 Fix formatting and detail of comments in PR #730
Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:20 +01:00
Simon Butcher
1c0c5d2a62 Fix for building programs with mingw
mingw build files were missing the dependency on the bcrypt library

Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:20 +01:00
Simon Butcher
33425de128 Correct check for WIN32 in cmake files for programs
Condition was checking for Visual Studio, not use of WIN32

Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:20 +01:00
Simon Butcher
34b8d83a22 Update ChangeLog for PR #730 for Win32 API fixes
Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:20 +01:00
Simon Butcher
e068aa7ad5 Fix the build for mingw and CMake + VStudio
Changes to the build to add the new Win32 Crypto API's inadvertently broke
the build for mingw and Visual Studio builds when generated by CMake.

Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2023-09-25 14:12:20 +01:00
Kevin Kane
0ec1e68548 Replace Windows APIs that are banned in Windows Store apps
CryptGenRandom and lstrlenW are not permitted in Windows Store apps,
meaning apps that use mbedTLS can't ship in the Windows Store.
Instead, use BCryptGenRandom and wcslen, respectively, which are
permitted.

Also make sure conversions between size_t, ULONG, and int are
always done safely; on a 64-bit platform, these types are different
sizes.

Also suppress macro redefinition warning for intsafe.h:

Visual Studio 2010 and earlier generates C4005 when including both
<intsafe.h> and <stdint.h> because a number of <TYPE>_MAX constants
are redefined. This is fixed in later versions of Visual Studio.
The constants are guaranteed to be the same between both files,
however, so we can safely suppress the warning when including
intsafe.h.

Signed-off-by: Kevin Kane <kkane@microsoft.com>
2023-09-25 14:12:20 +01:00
Gilles Peskine
87fe99627f
Merge pull request #8249 from bensze01/fixed-typing-package-versions
Set explicit version for the typing packages (fix CI failure)
2023-09-25 14:35:01 +02:00
Dave Rodgman
68dca1ed6f
Merge pull request #8247 from mpg/sha3-fixup
Fix SHA-3 dependencies in test_suite_md
2023-09-25 12:02:21 +01:00
Dave Rodgman
5a3add2c67
Merge pull request #8234 from kouzhudong/development
Fix MSVC error C4703 about possibly uninitialized variable in pkwrite.c
2023-09-25 10:51:46 +01:00
Bence Szépkúti
d06e70c6b8 Set explicit version for the typing packages
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2023-09-25 10:25:18 +02:00
Manuel Pégourié-Gonnard
4fe1e8762d Fix SHA-3 dependencies in test_suite_md
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-25 10:05:23 +02:00
Dave Rodgman
f6f76c5a25
Merge pull request #8240 from mpg/doc-driver-only-hashes
Document driver only hashes (overdue)
2023-09-24 13:41:45 +01:00
Manuel Pégourié-Gonnard
030f11b0b1 Type fixes and wording improvements
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-24 09:48:47 +02:00
Manuel Pégourié-Gonnard
e47c53eeab Fix SHA-3 in accel tests that need it
Components that accelerate an algorithm that uses hashing internally
(such as deterministic ECDSA and RSA-PSS) need the hash algorithms
available in libtestdriver1.

Previously, the omission of SHA-3 in
tests/include/test/drivers/crypto_config_test_driver_extension.h meant
it was enabled in libtestdriver1 when not requesting its acceleration,
and disabled when requesting it. Adding it in a previous commit fixed
the components that asked it accelerated, but broke the component that
didn't ask for it but still needed it.

Fix those components by explicitly requesting SHA-3 as we already do for
the other hash algorithms that are require for the same reason.

Note: this broke test_suite_psa_crypto_storage_format.v0 which is
apparently the only place exercising signatures with SHA-3.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-24 09:48:47 +02:00
Manuel Pégourié-Gonnard
f4ceb16813 Fix dependencies for SHA-3 MD dispatch tests
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-24 09:48:46 +02:00
Manuel Pégourié-Gonnard
1f61b7b8ea Document driver-only hashes
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-24 09:48:46 +02:00
Manuel Pégourié-Gonnard
cc21ad441a Add SHA-3 support to libtestdriver1
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-24 09:48:45 +02:00
Gilles Peskine
10304d8329
Merge pull request #8244 from paul-elliott-arm/remove_travis_ci
Remove all travis builds except for coverity_scan
2023-09-22 21:53:33 +00:00
Dave Rodgman
27b7e2f350
Merge pull request #8243 from daverodgman/update-tfm-config
Update TF-M config
2023-09-22 18:52:29 +00:00
Gilles Peskine
6809f231a6
Merge pull request #8210 from yanrayw/aes_128bit_improvement
AES 128bit only: add guards in cipher_wrap.c
2023-09-22 18:15:03 +00:00
Gilles Peskine
ae3cda9541
Merge pull request #8092 from silabs-Kusumit/PBKDF2_output_key
PBKDF2: test output_key
2023-09-22 18:01:06 +00:00
Paul Elliott
645a541747 Remove all travis builds except for coverity_scan
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-09-22 17:50:44 +01:00
Dave Rodgman
739d815b7f Remove PK options
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-09-22 17:40:24 +01:00
Dave Rodgman
84e8f1d618 Set MBEDTLS_MD_C
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-09-22 17:40:18 +01:00
Dave Rodgman
4f53520f54
Merge pull request #8241 from daverodgman/cast_warning
fix cast warning
2023-09-22 14:23:05 +00:00
Dave Rodgman
38c3228f3e fix cast warning
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-09-22 10:51:37 +01:00
Tom Cosgrove
41434d043c
Merge pull request #8237 from tom-cosgrove-arm/mbedtls_pk_write_key_der-unused-len-and-unreachable-ret
Remove unused variable and unreachable return from mbedtls_pk_write_key_der()
2023-09-22 08:45:48 +00:00
Dave Rodgman
aaebc9be51
Merge pull request #8235 from daverodgman/misc-size 2023-09-21 18:42:37 +01:00
Tom Cosgrove
8d276fbc23 Remove unused variable and unreachable return from mbedtls_pk_write_key_der()
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-09-21 17:19:36 +01:00
Gilles Peskine
af3b6fe12d
Merge pull request #8232 from gilles-peskine-arm/rename-p256m-config
Rename p256m configuration option
2023-09-21 12:52:44 +00:00
correy
a15b4851d4 Fix MSVC error C4703 about possibly uninitialized variable in pkwrite.c
Signed-off-by: correy <112426112@qq.com>
2023-09-21 20:18:52 +08:00
Dave Rodgman
ef6795d2a9 Reduce size of mbedtls_asn1_get_len
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-09-21 10:35:33 +01:00
Dave Rodgman
d3450da98d Re-order mbedtls_ccm_context
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-09-21 10:34:45 +01:00
Gilles Peskine
67cf66b427 Add a note about the code size benefits
We don't normally make promises related to code size, but this one is vague
enough (just "to benefit"), and it's what a lot of users of this option
care about.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-20 23:19:46 +02:00
Gilles Peskine
29d0bfba0d Rename option where concatenated with -D
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-20 23:11:33 +02:00
Gilles Peskine
3aa79691fc Add a note about p256m near the option to enable secp256r1
Only document it with the PSA configuration, not for
MBEDTLS_ECP_DP_SECP256R1_ENABLED, since p256m can't be used with the classic
API.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-20 20:54:50 +02:00