mbedtls/library
Doru Gucea 2957b35157 Avoid stack-allocation of large memory buffers
Using a stack-buffer with a size > 2K could easily produce a stack
overflow for an embedded device which has a limited stack size.
This commit dynamically allocates the large CSR buffer.

This commit avoids using a temporary buffer for storing the OIDs.
A single buffer is used:
a) OIDs are written backwards starting with the end of the buffer;
b) OIDs are memmove'd to the beginning of the buffer;
c) signature over this OIDs is computed and written backwards from the
end of the buffer;
d) the two memory regions are compacted.

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
2020-07-08 18:32:02 +00:00
..
.gitignore Split libs with make + general make cleanups 2015-06-25 10:59:56 +02:00
aes.c Fix GCC format-signedness warnings 2020-04-22 16:01:48 +02:00
aesni.c Remove crypto C files 2019-08-15 15:44:50 +01:00
arc4.c Remove crypto C files 2019-08-15 15:44:50 +01:00
aria.c Remove crypto C files 2019-08-15 15:44:50 +01:00
asn1parse.c Replace use of uint8_t by unsigned char in ASN.1 seq traversal API 2020-02-03 10:39:55 +00:00
asn1write.c Merge pull request #323 from yanesca/iotcrypt-942-initialise-return-values 2019-12-19 10:24:22 +00:00
base64.c Remove crypto C files 2019-08-15 15:44:50 +01:00
bignum.c Clean up some comments 2020-06-09 10:39:38 +02:00
blowfish.c Remove crypto C files 2019-08-15 15:44:50 +01:00
camellia.c Remove crypto C files 2019-08-15 15:44:50 +01:00
ccm.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
certs.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
chacha20.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
chachapoly.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
cipher.c Remove redundant block_size validity check 2020-01-21 15:02:14 +01:00
cipher_wrap.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
cmac.c Fix GCC format-signedness warnings 2020-04-22 16:01:48 +02:00
CMakeLists.txt cmake: Limit scope of 3rd party definitions 2020-06-22 13:44:03 +02:00
common.h New header common.h; define MBEDTLS_STATIC_TESTABLE 2020-03-24 22:57:11 +01:00
ctr_drbg.c Merge branch 'development' into development-restricted 2020-01-15 15:55:11 +00:00
debug.c Fix GCC format-signedness warnings 2020-04-22 16:01:48 +02:00
des.c des: Reduce number of self-test iterations 2019-09-04 10:11:45 +01:00
dhm.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
ecdh.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
ecdsa.c Fix incrementing pointer instead of value 2020-01-24 12:11:56 +01:00
ecjpake.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
ecp.c Fix Changelag PR number and uniformize code when prng fails 2020-05-28 20:02:40 +09:00
ecp_curves.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
entropy.c Merge pull request #323 from yanesca/iotcrypt-942-initialise-return-values 2019-12-19 10:24:22 +00:00
entropy_poll.c entropy: Adjust parameter type of internal function to avoid a cast 2020-06-24 17:16:33 +01:00
error.c Merge pull request #873 from hanno-arm/ssl_write_client_hello 2020-06-15 10:57:51 +02:00
gcm.c Merge branch 'development' into development-restricted 2020-01-15 15:55:11 +00:00
havege.c Remove crypto C files 2019-08-15 15:44:50 +01:00
hkdf.c hkdf_expand: explicitly initialize t 2020-04-02 19:54:51 +02:00
hmac_drbg.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
Makefile Sort lists in Makefiles and have one item per line 2020-04-17 11:57:50 +02:00
md.c Fix "same actions in two cases of a switch statement" warning 2020-04-20 13:56:09 +03:00
md2.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
md4.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
md5.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
memory_buffer_alloc.c Remove crypto C files 2019-08-15 15:44:50 +01:00
net_sockets.c net_sockets: Fix building on NetBSD 9.0 2020-06-11 14:05:25 +01:00
nist_kw.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
oid.c Fix GCC format-signedness warnings 2020-04-22 16:01:48 +02:00
padlock.c Remove crypto C files 2019-08-15 15:44:50 +01:00
pem.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
pk.c pk: USE_PSA_CRYPTO: don't translate via the TLS ID 2020-01-31 10:15:32 +01:00
pk_wrap.c Remove mbedtls_psa_translate_ecc_group 2020-01-31 10:15:32 +01:00
pkcs5.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
pkcs11.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
pkcs12.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
pkparse.c Fix pkparse bug wrt MBEDTLS_RSA_ALT 2020-02-18 10:31:29 +01:00
pkwrite.c Change key types to a 16-bit encoding 2020-01-31 10:24:21 +01:00
platform.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
platform_util.c Check for zero length and NULL buffer pointer. 2019-09-04 11:31:35 +01:00
poly1305.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
psa_crypto.c Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_core.h Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_invasive.h Add a facility to configure entropy sources 2018-11-23 22:58:38 +01:00
psa_crypto_its.h Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_se.c Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_se.h Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_service_integration.h Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_slot_management.c Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_slot_management.h Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_storage.c Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
psa_crypto_storage.h Switch storage functions over to psa_core_key_attributes_t 2019-07-31 14:15:27 +02:00
psa_its_file.c Add Apache-2.0 headers to all source files 2020-06-16 17:38:44 +02:00
ripemd160.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
rsa.c Final review comments 2020-01-28 14:43:52 -05:00
rsa_internal.c Remove crypto C files 2019-08-15 15:44:50 +01:00
sha1.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
sha256.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
sha512.c Fix some whitespace issues 2020-01-29 09:46:49 +01:00
ssl_cache.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
ssl_ciphersuites.c Rename identifiers containing double-underscore 2020-03-23 17:55:32 +01:00
ssl_cli.c ssl_client: Align line breaking with MBEDTLS_SSL_DEBUG_* 2020-06-11 09:34:06 +02:00
ssl_cookie.c Uniformize bounds checks using new macro 2020-05-29 15:07:00 +02:00
ssl_msg.c Document precondition of nonce-generating function in ssl_msg.c 2020-06-04 13:33:08 +01:00
ssl_srv.c Merge pull request #3150 from irwir/fix_ssl_srv 2020-04-22 09:31:00 +02:00
ssl_ticket.c Uniformize bounds checks using new macro 2020-05-29 15:07:00 +02:00
ssl_tls.c Merge pull request #3405 from AndrzejKurek/variable-buffers-cid-serialization 2020-06-17 12:26:24 +01:00
threading.c Remove crypto C files 2019-08-15 15:44:50 +01:00
timing.c Add support for midipix, a POSIX layer for Microsoft Windows 2020-05-20 18:14:45 +00:00
version.c Fix missing void argument declarations #678 2016-11-04 23:05:56 +01:00
version_features.c Merge pull request #3315 from hanno-arm/tls13-experimental-macro 2020-06-04 15:51:54 +01:00
x509.c fix mbedtls_x509_dn_gets to escape non-ASCII characters 2020-05-21 01:56:55 +09:00
x509_create.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509_crl.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509_crt.c Pass "certificate policies" extension to callback 2020-06-17 17:55:29 +02:00
x509_csr.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509write_crt.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509write_csr.c Avoid stack-allocation of large memory buffers 2020-07-08 18:32:02 +00:00
xtea.c Remove crypto C files 2019-08-15 15:44:50 +01:00