Demi Marie Obenour 6b8e8ff079 Fix segfault in mbedtls_oid_get_numeric_string
When passed an empty OID, mbedtls_oid_get_numeric_string would read one
byte from the zero-sized buffer and return an error code that depends on
its value.  This is demonstrated by the test suite changes, which
check that an OID with length zero and an invalid buffer pointer does
not cause Mbed TLS to segfault.

Also check that second and subsequent subidentifiers are terminated, and
add a test case for that.  Furthermore, stop relying on integer division
by 40, use the same loop for both the first and subsequent
subidentifiers, and add additional tests.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-03-16 01:07:35 -04:00
..
.gitignore Split libs with make + general make cleanups 2015-06-25 10:59:56 +02:00
aes.c Switch to the new code style 2023-01-11 14:52:35 +01:00
aesni.c Switch to the new code style 2023-01-11 14:52:35 +01:00
arc4.c Switch to the new code style 2023-01-11 14:52:35 +01:00
aria.c Switch to the new code style 2023-01-11 14:52:35 +01:00
asn1parse.c Switch to the new code style 2023-01-11 14:52:35 +01:00
asn1write.c Switch to the new code style 2023-01-11 14:52:35 +01:00
base64.c Switch to the new code style 2023-01-11 14:52:35 +01:00
bignum.c Silence a warning from Clang >=15 about an unused local variable 2023-02-24 12:08:57 +01:00
blowfish.c Switch to the new code style 2023-01-11 14:52:35 +01:00
camellia.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ccm.c Fix use of sizeof without brackets 2023-02-02 12:46:39 +00:00
certs.c Switch to the new code style 2023-01-11 14:52:35 +01:00
chacha20.c Switch to the new code style 2023-01-11 14:52:35 +01:00
chachapoly.c Switch to the new code style 2023-01-11 14:52:35 +01:00
check_crypto_config.h Switch to the new code style 2023-01-11 14:52:35 +01:00
cipher_wrap.c Switch to the new code style 2023-01-11 14:52:35 +01:00
cipher.c Switch to the new code style 2023-01-11 14:52:35 +01:00
cmac.c Switch to the new code style 2023-01-11 14:52:35 +01:00
CMakeLists.txt Bump LTS version to 2.28.2 2022-12-08 11:05:11 +00:00
common.h Switch to the new code style 2023-01-11 14:52:35 +01:00
constant_time_internal.h Switch to the new code style 2023-01-11 14:52:35 +01:00
constant_time_invasive.h Switch to the new code style 2023-01-11 14:52:35 +01:00
constant_time.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ctr_drbg.c Switch to the new code style 2023-01-11 14:52:35 +01:00
debug.c Switch to the new code style 2023-01-11 14:52:35 +01:00
des.c Switch to the new code style 2023-01-11 14:52:35 +01:00
dhm.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ecdh.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ecdsa.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ecjpake.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ecp_curves.c Address missed instances of sizeof 2023-02-02 15:34:23 +00:00
ecp_invasive.h Switch to the new code style 2023-01-11 14:52:35 +01:00
ecp.c Fix IAR warnings 2023-02-13 15:07:44 +00:00
entropy_poll.c Switch to the new code style 2023-01-11 14:52:35 +01:00
entropy.c Fix use of sizeof without brackets 2023-02-02 12:46:39 +00:00
error.c Update generated files 2023-01-11 14:52:37 +01:00
gcm.c Switch to the new code style 2023-01-11 14:52:35 +01:00
havege.c Switch to the new code style 2023-01-11 14:52:35 +01:00
hkdf.c Switch to the new code style 2023-01-11 14:52:35 +01:00
hmac_drbg.c Switch to the new code style 2023-01-11 14:52:35 +01:00
Makefile Add a selftest run for the TIMING_ALT test 2023-01-26 04:33:59 -05:00
md2.c Switch to the new code style 2023-01-11 14:52:35 +01:00
md4.c Switch to the new code style 2023-01-11 14:52:35 +01:00
md5.c Switch to the new code style 2023-01-11 14:52:35 +01:00
md.c Switch to the new code style 2023-01-11 14:52:35 +01:00
memory_buffer_alloc.c Switch to the new code style 2023-01-11 14:52:35 +01:00
mps_common.h Switch to the new code style 2023-01-11 14:52:35 +01:00
mps_error.h Switch to the new code style 2023-01-11 14:52:35 +01:00
mps_reader.c Switch to the new code style 2023-01-11 14:52:35 +01:00
mps_reader.h Switch to the new code style 2023-01-11 14:52:35 +01:00
mps_trace.c Switch to the new code style 2023-01-11 14:52:35 +01:00
mps_trace.h Switch to the new code style 2023-01-11 14:52:35 +01:00
net_sockets.c Switch to the new code style 2023-01-11 14:52:35 +01:00
nist_kw.c Switch to the new code style 2023-01-11 14:52:35 +01:00
oid.c Fix segfault in mbedtls_oid_get_numeric_string 2023-03-16 01:07:35 -04:00
padlock.c Switch to the new code style 2023-01-11 14:52:35 +01:00
pem.c Switch to the new code style 2023-01-11 14:52:35 +01:00
pk_wrap.c Switch to the new code style 2023-01-11 14:52:35 +01:00
pk.c Switch to the new code style 2023-01-11 14:52:35 +01:00
pkcs5.c Switch to the new code style 2023-01-11 14:52:35 +01:00
pkcs11.c Switch to the new code style 2023-01-11 14:52:35 +01:00
pkcs12.c Switch to the new code style 2023-01-11 14:52:35 +01:00
pkparse.c Switch to the new code style 2023-01-11 14:52:35 +01:00
pkwrite.c Switch to the new code style 2023-01-11 14:52:35 +01:00
platform_util.c Switch to the new code style 2023-01-11 14:52:35 +01:00
platform.c Switch to the new code style 2023-01-11 14:52:35 +01:00
poly1305.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_aead.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_aead.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_cipher.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_cipher.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_client.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_core.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_driver_wrappers.c Fix compiler warning: unreachable code 2023-02-11 18:20:20 -07:00
psa_crypto_driver_wrappers.h Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_ecp.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_ecp.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_hash.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_hash.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_invasive.h Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_its.h Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_mac.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_mac.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_random_impl.h Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_rsa.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_rsa.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_se.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_se.h Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_slot_management.c Switch to the new code style 2023-01-11 14:52:35 +01:00
psa_crypto_slot_management.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_storage.c Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto_storage.h Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_crypto.c Make \retval commands non-empty 2023-02-24 11:41:45 +01:00
psa_its_file.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ripemd160.c Fix use of sizeof without brackets 2023-02-02 12:46:39 +00:00
rsa_internal.c Switch to the new code style 2023-01-11 14:52:35 +01:00
rsa.c Switch to the new code style 2023-01-11 14:52:35 +01:00
sha1.c Switch to the new code style 2023-01-11 14:52:35 +01:00
sha256.c Switch to the new code style 2023-01-11 14:52:35 +01:00
sha512.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_cache.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_ciphersuites.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_cli.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_cookie.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_msg.c Add corresponding fix for mbedtls_ssl_write 2023-02-24 16:02:26 +00:00
ssl_srv.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_ticket.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_tls13_keys.c Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_tls13_keys.h Switch to the new code style 2023-01-11 14:52:35 +01:00
ssl_tls.c Switch to the new code style 2023-01-11 14:52:35 +01:00
threading.c Switch to the new code style 2023-01-11 14:52:35 +01:00
timing.c Enable the timing.c selftest with MBEDTLS_TIMING_ALT 2023-01-13 19:01:51 -05:00
version_features.c Update generated files 2023-01-11 14:52:37 +01:00
version.c Switch to the new code style 2023-01-11 14:52:35 +01:00
x509_create.c Switch to the new code style 2023-01-11 14:52:35 +01:00
x509_crl.c Switch to the new code style 2023-01-11 14:52:35 +01:00
x509_crt.c Don't use lstrlenW() on Windows 2023-02-10 21:48:33 +00:00
x509_csr.c Switch to the new code style 2023-01-11 14:52:35 +01:00
x509.c Switch to the new code style 2023-01-11 14:52:35 +01:00
x509write_crt.c x509write_crt: reject serial longer than X509_RFC5280_MAX_SERIAL_LEN 2023-01-13 08:39:36 +01:00
x509write_csr.c Switch to the new code style 2023-01-11 14:52:35 +01:00
xtea.c Switch to the new code style 2023-01-11 14:52:35 +01:00