mbedtls/library
Gilles Peskine 46f1fd7afd Handle null pointers safely when used as buffers of size 0
When the size of a buffer is 0, the corresponding pointer argument may
be null. In such cases, library functions must not perform arithmetic
on the pointer or call standard library functions such as memset and
memcpy, since that would be undefined behavior in C. Protect such
cases.

Refactor the storage of a 0-sized raw data object to make it store a
null pointer, rather than depending on the behavior of calloc(1,0).
2018-09-12 16:41:11 +03:00
..
.gitignore Split libs with make + general make cleanups 2015-06-25 10:59:56 +02:00
aes.c Merge remote-tracking branch 'public/pr/1736' into development 2018-06-17 17:34:55 +01:00
aesni.c Warn if using a memory sanitizer on AESNI 2018-04-05 15:37:38 +02:00
arc4.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
aria.c Use mbedtls_printf instead of printf 2018-08-13 13:49:52 +03:00
asn1parse.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
asn1write.c Treat warnings as errors for IAR 2018-05-25 14:54:14 +01:00
base64.c Add comment to integer overflow fix in base64.c 2017-02-15 23:31:07 +02:00
bignum.c Merge remote-tracking branch 'upstream-restricted/pr/421' into development-proposed 2018-05-04 14:39:24 +01:00
blowfish.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
camellia.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
ccm.c enforce input and output of ccm selftest on stack 2018-07-30 11:29:26 +03:00
certs.c Undo API change from SHA1 deprecation 2017-07-27 21:44:33 +01:00
chacha20.c Fix usage of inline with for some compilers 2018-06-07 11:54:17 +02:00
chachapoly.c Fix a few typos 2018-06-18 10:30:30 +02:00
cipher.c Move definition of MBEDTLS_CIPHER_MODE_STREAM 2018-07-01 10:20:43 +03:00
cipher_wrap.c Define specific mode for ChachaPoly 2018-06-19 11:32:48 +02:00
cmac.c Merge remote-tracking branch 'public/pr/1390' into development 2018-06-27 10:51:47 +01:00
CMakeLists.txt Add PSA crypto module 2018-09-05 10:59:00 +03:00
ctr_drbg.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
debug.c Fix compilation error with Mingw32 2017-09-06 17:51:14 +03:00
des.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
dhm.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
ecdh.c Address PR cpomments reviews 2017-10-10 19:04:27 +03:00
ecdsa.c Clarify the use of MBEDTLS_ERR_PK_SIG_LEN_MISMATCH 2018-03-30 18:43:16 +02:00
ecjpake.c Fix minor code style issues 2018-05-15 09:21:57 +01:00
ecp.c Remove redundant else statement 2018-08-20 10:39:27 +03:00
ecp_curves.c Merge branch 'pr_348' into development-proposed 2018-04-04 09:18:27 +02:00
entropy.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
entropy_poll.c Merge remote-tracking branch 'public/pr/1198' into development 2018-07-24 17:20:17 +01:00
error.c Update error codes 2018-08-17 16:52:08 +01:00
gcm.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
havege.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
hkdf.c Fix issue if salt = NULL and salt_len !=0 in mbedtls_hkdf_extract() 2018-07-23 10:34:47 -07:00
hmac_drbg.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
Makefile Add PSA crypto module 2018-09-05 10:59:00 +03:00
md.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
md2.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
md4.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
md5.c Fix Lucky 13 cache attack on MD/SHA padding 2018-07-05 10:47:00 +02:00
md_wrap.c New MD API: rename functions from _ext to _ret 2018-01-22 11:54:42 +01:00
memory_buffer_alloc.c Fix braces in mbedtls_memory_buffer_alloc_status() 2018-06-12 16:56:04 +01:00
net_sockets.c Merge remote-tracking branch 'public/pr/1198' into development 2018-07-24 17:20:17 +01:00
nist_kw.c Add selftests 2018-07-24 16:43:20 +01:00
oid.c pkcs5v2: add support for additional hmacSHA algorithms 2018-02-08 17:18:15 +08:00
padlock.c Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
pem.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
pk.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
pk_wrap.c New function mbedtls_rsa_get_bitlen 2018-09-05 11:53:24 +03:00
pkcs5.c Treat warnings as errors for IAR 2018-05-25 14:54:14 +01:00
pkcs11.c Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
pkcs12.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
pkparse.c Remove unnecessary mark as unused #1098 2018-07-11 15:16:53 +02:00
pkwrite.c Adapt PK test suite to use new interface 2017-08-23 16:17:27 +01:00
platform.c Convert mbedtls_free and mbedtls_calloc into functions 2018-06-13 09:17:59 +01:00
platform_util.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
poly1305.c Fix usage of inline with for some compilers 2018-06-07 11:54:17 +02:00
psa_crypto.c Handle null pointers safely when used as buffers of size 0 2018-09-12 16:41:11 +03:00
ripemd160.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
rsa.c New function mbedtls_rsa_get_bitlen 2018-09-05 11:53:24 +03:00
rsa_internal.c Add explicit type cast to avoid truncation warning 2018-01-03 09:27:40 +00:00
sha1.c Fix Lucky 13 cache attack on MD/SHA padding 2018-07-05 10:47:00 +02:00
sha256.c Fix Lucky 13 cache attack on MD/SHA padding 2018-07-05 10:47:00 +02:00
sha512.c Fix Lucky 13 cache attack on MD/SHA padding 2018-07-05 10:47:00 +02:00
ssl_cache.c Address PR review comments 2017-10-29 17:53:52 +02:00
ssl_ciphersuites.c Merge remote-tracking branch 'upstream-public/pr/1378' into development 2018-08-10 10:59:53 +01:00
ssl_cli.c Merge remote-tracking branch 'public/pr/1988' into development 2018-08-30 00:57:28 +01:00
ssl_cookie.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
ssl_srv.c Style: Add numerous comments indicating condition guarded by #endif 2018-08-28 10:13:29 +01:00
ssl_ticket.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
ssl_tls.c Merge branch 'development' into development 2018-08-30 01:11:35 +01:00
threading.c Use gmtime_r to fix thread-safety issue, and use mbedtls_time on Windows 2018-06-25 11:59:54 +01:00
timing.c library: Port to Haiku. 2018-04-11 20:27:32 -04:00
version.c Fix missing void argument declarations #678 2016-11-04 23:05:56 +01:00
version_features.c Add PSA crypto module 2018-09-05 10:59:00 +03:00
x509.c Merge remote-tracking branch 'public/pr/1198' into development 2018-07-24 17:20:17 +01:00
x509_create.c Fix other occurrences of same bounds check issue 2015-10-21 12:50:45 +02:00
x509_crl.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
x509_crt.c Merge remote-tracking branch 'restricted/pr/470' into development-restricted 2018-08-28 15:26:11 +01:00
x509_csr.c Merge remote-tracking branch 'public/pr/1621' into development 2018-06-28 12:09:15 +01:00
x509write_crt.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
x509write_csr.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00
xtea.c Rename mbedtls_zeroize to mbedtls_platform_zeroize 2018-04-17 10:00:21 -05:00