mbedtls/library
Gilles Peskine 945b23c46f Include platform.h unconditionally: automatic part
We used to include platform.h only when MBEDTLS_PLATFORM_C was enabled, and
to define ad hoc replacements for mbedtls_xxx functions on a case-by-case
basis when MBEDTLS_PLATFORM_C was disabled. The only reason for this
complication was to allow building individual source modules without copying
platform.h. This is not something we support or recommend anymore, so get
rid of the complication: include platform.h unconditionally.

There should be no change in behavior since just including the header should
not change the behavior of a program.

This commit replaces most occurrences of conditional inclusion of
platform.h, using the following code:

```
perl -i -0777 -pe 's!#if.*\n#include "mbedtls/platform.h"\n(#else.*\n(#define (mbedtls|MBEDTLS)_.*\n|#include <(stdarg|stddef|stdio|stdlib|string|time)\.h>\n)*)?#endif.*!#include "mbedtls/platform.h"!mg' $(git grep -l '#include "mbedtls/platform.h"')
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-09-15 20:33:07 +02:00
..
.gitignore Add psa_crypto_driver_wrappers.c to .gitignore 2021-12-18 13:29:10 +05:30
aes.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
aesni.c Refactor AES context to be shallow-copyable 2022-06-29 16:17:50 +01:00
aesni.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
aria.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
asn1parse.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
asn1write.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
base64.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
bignum_core.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
bignum_core.h Remove confusing const qualifier 2022-08-22 11:19:10 +01:00
bignum_internal.h Fix Doxygen for mbedtls_mpi_core_mla() 2022-04-11 13:44:15 +01:00
bignum_mod_raw.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
bignum_mod_raw.h Fix typos 2022-08-22 09:08:04 +01:00
bignum_mod.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
bignum_mod.h Improve documentation 2022-08-19 13:11:22 +01:00
bignum.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
bn_mul.h Merge pull request #6090 from hanno-arm/fix_bnmul_arm_v7a 2022-08-18 08:48:03 +01:00
camellia.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ccm.c Fix typos in documentation and constants with typo finding tool 2022-05-18 14:15:33 -04:00
chacha20.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
chachapoly.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
check_crypto_config.h Style & formatting fixes 2022-08-23 05:26:02 -04:00
cipher_wrap.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
cipher_wrap.h Make KEY_ID_ENCODES_OWNER compatible with USE_PSA_CRYPTO 2022-01-03 12:53:24 +01:00
cipher.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
cmac.c Allow skipping 3DES in CMAC self-test when ALT implemented 2021-03-02 10:18:08 +01:00
CMakeLists.txt Fix alphabetic order in makefiles 2022-08-15 11:38:30 +01:00
common.h fix wrong para name in doxygen comments 2021-10-28 10:26:13 +08:00
constant_time_internal.h Fix typos 2022-08-22 09:08:04 +01:00
constant_time_invasive.h Add documentation for the functions 2021-11-26 17:25:14 +01:00
constant_time.c Merge pull request #6095 from gabor-mezei-arm/6016_add_new_modulus_and_residue_structures 2022-08-23 09:02:43 +01:00
ctr_drbg.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
debug.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
des.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
dhm.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ecdh.c Reintroduce enum validation ecdh.c 2022-07-27 14:43:38 +01:00
ecdsa.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ecjpake.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ecp_curves.c Since the group is unloaded for all curves, it is better to initialize the group also for all curves. 2022-05-06 18:43:58 +02:00
ecp_internal_alt.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
ecp_invasive.h Move mbedtls_mpi_random to the bignum module 2021-06-03 18:10:04 +02:00
ecp.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
entropy_poll.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
entropy_poll.h Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
entropy.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
gcm.c Add missing local variable initialization 2022-05-13 18:08:11 +01:00
hash_info.c Fix include file path 2022-08-11 12:50:06 +02:00
hash_info.h hash_info.h: add MBEDTLS_MAX_HASH_SIZE macro 2022-09-06 14:18:39 +02:00
hkdf.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
hmac_drbg.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
legacy_or_psa.h Include psa/crypto.h in legacy_or_psa.h 2022-08-19 10:15:56 +02:00
Makefile Merge pull request #6095 from gabor-mezei-arm/6016_add_new_modulus_and_residue_structures 2022-08-23 09:02:43 +01:00
md5.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
md_wrap.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
md.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
memory_buffer_alloc.c Redo of PR#5345. Fixed spelling and typographical errors found by CodeSpell. 2022-05-11 21:25:51 +01:00
mps_common.h Fix typos in documentation and constants with typo finding tool 2022-05-18 14:15:33 -04:00
mps_error.h Fix Doxygen headers for MPS files 2021-03-29 14:20:18 +01:00
mps_reader.c Rename MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL to MBEDTLS_SSL_PROTO_TLS1_3 2021-12-10 13:47:55 +01:00
mps_reader.h Fix Doxygen headers for MPS files 2021-03-29 14:20:18 +01:00
mps_trace.c Rename MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL to MBEDTLS_SSL_PROTO_TLS1_3 2021-12-10 13:47:55 +01:00
mps_trace.h Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
net_sockets.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
nist_kw.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
oid.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
padlock.c Add fallback when rk unaligned with padlock 2022-07-05 11:55:15 +01:00
padlock.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
pem.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
pk_wrap.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
pk_wrap.h Guard pk_opaque_rsa_decrypt() with PSA_WANT_KEY_TYPE_RSA_KEY_PAIR 2022-05-04 11:02:37 +02:00
pk.c Migrate from old inline to new actual function. 2022-07-18 21:28:38 +02:00
pkcs5.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
pkcs12.c Make use of MBEDTLS_MAX_HASH_SIZE macro 2022-09-06 14:18:45 +02:00
pkparse.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
pkwrite.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
pkwrite.h Rename max sizes of RSA & EC DER keys defines 2022-03-01 10:03:21 +01:00
platform_util.c Add comment 2022-05-12 09:45:03 +01:00
platform.c Fix code formatting 2022-07-01 16:43:25 +01:00
poly1305.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
psa_crypto_aead.c Merge pull request #5047 from paul-elliott-arm/psa-m-aead-ccm 2021-12-09 14:49:42 +01:00
psa_crypto_aead.h Redo of PR#5345. Fixed spelling and typographical errors found by CodeSpell. 2022-05-11 21:25:51 +01:00
psa_crypto_cipher.c Use double quotes to include private header file psa_crypto_cipher.h 2022-08-02 12:44:35 +02:00
psa_crypto_cipher.h Merge branch 'development-restricted' into mbedtls-3.1.0rc-pr 2021-12-14 10:58:18 +01:00
psa_crypto_client.c Move the inclusion of crypto_spe.h to psa/crypto_platform.h 2021-06-17 11:43:58 +02:00
psa_crypto_core.h Code style improvements 2021-09-08 22:04:13 +05:30
psa_crypto_driver_wrappers.h Merge pull request #5292 from mprse/asym_encrypt 2022-03-10 20:07:38 +01:00
psa_crypto_ecp.c Rm now-duplicate helper function 2022-07-18 21:28:38 +02:00
psa_crypto_ecp.h psa: test driver: Move driver test entry points prototypes 2021-12-06 07:50:27 +01:00
psa_crypto_hash.c Rm now-duplicate helper function 2022-07-18 21:28:38 +02:00
psa_crypto_hash.h Rm now-duplicate helper function 2022-07-18 21:28:38 +02:00
psa_crypto_invasive.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
psa_crypto_its.h Update documentation 2020-11-25 13:10:50 +01:00
psa_crypto_mac.c psa: Fix and improve comments 2021-12-06 07:50:27 +01:00
psa_crypto_mac.h psa: test driver: Move driver test entry points prototypes 2021-12-06 07:50:27 +01:00
psa_crypto_random_impl.h Work around MSVC bug with duplicate static declarations 2021-02-16 18:55:05 +01:00
psa_crypto_rsa.c Rm now-duplicate helper function 2022-07-18 21:28:38 +02:00
psa_crypto_rsa.h psa_asymmetric_decrypt: move build-in impl to mbedtls_psa_asymmetric_decrypt 2022-01-10 12:55:06 +01:00
psa_crypto_se.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
psa_crypto_se.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
psa_crypto_slot_management.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
psa_crypto_slot_management.h psa: Fix error code when creating/registering a key with invalid id 2021-04-01 14:05:41 +02:00
psa_crypto_storage.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
psa_crypto_storage.h Rename PSA_KEY_SLOT_COUNT to MBEDTLS_PSA_KEY_SLOT_COUNT 2021-02-15 14:26:44 +01:00
psa_crypto.c Merge pull request #5834 from mprse/HKDF_1 2022-06-20 15:27:46 +02:00
psa_its_file.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ripemd160.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
rsa_alt_helpers.c Rename rsa_internal.* to rsa_alt_helpers.* 2021-03-10 12:52:37 +00:00
rsa_alt_helpers.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
rsa.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
sha1.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
sha256.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
sha512.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_cache.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_ciphersuites.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_client.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_client.h Mark internal int SSL functions CHECK_RETURN_CRITICAL 2022-06-20 21:12:55 +02:00
ssl_cookie.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_debug_helpers.h add named group debug helper 2022-05-09 15:49:00 +08:00
ssl_misc.h Style & formatting fixes 2022-08-23 05:26:02 -04:00
ssl_msg.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_ticket.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_tls12_client.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_tls12_server.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_tls13_client.c Replace hard-coded zeroes for constant 2022-07-26 16:13:23 +01:00
ssl_tls13_generic.c Rename the sha384 checksum context to reflect its purpose 2022-08-22 17:02:04 -04:00
ssl_tls13_invasive.h Merge remote-tracking branch 'mbedtls-restricted/development-restricted' into mbedtls-3.2.0rc0-pr 2022-07-11 10:22:37 +02:00
ssl_tls13_keys.c fix various issues 2022-08-25 11:09:35 +08:00
ssl_tls13_keys.h fix various issues. 2022-08-23 17:53:43 +08:00
ssl_tls13_server.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
ssl_tls.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
threading.c Fix typo "phtreads" to "pthreads" 2022-03-29 17:43:56 +02:00
timing.c Remove the dependency on MBEDTLS_HAVE_TIME from MBEDTLS_TIMING_C 2022-04-08 04:41:42 -04:00
version.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
x509_create.c Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
x509_crl.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
x509_crt.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
x509_csr.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
x509.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00
x509write_crt.c Make use of MBEDTLS_MAX_HASH_SIZE macro 2022-09-06 14:18:45 +02:00
x509write_csr.c Include platform.h unconditionally: automatic part 2022-09-15 20:33:07 +02:00