From 1beeb7a829a0fd4c1b437f51aeb785c984dd6cd5 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 15 Jun 2021 20:18:59 -0700 Subject: [PATCH] Flatten Mbed TLS directory structure --- examples/tls.c | 20 ++-- third_party/mbedtls/{library => }/aes.c | 23 +++-- .../mbedtls/{include/mbedtls => }/aes.h | 4 +- third_party/mbedtls/{library => }/aesni.c | 9 +- .../mbedtls/{include/mbedtls => }/aesni.h | 4 +- third_party/mbedtls/{library => }/arc4.c | 14 ++- .../mbedtls/{include/mbedtls => }/arc4.h | 4 +- third_party/mbedtls/{library => }/aria.c | 13 ++- .../mbedtls/{include/mbedtls => }/aria.h | 6 +- .../mbedtls/{include/mbedtls => }/asn1.h | 4 +- third_party/mbedtls/{library => }/asn1parse.c | 17 ++-- third_party/mbedtls/{library => }/asn1write.c | 13 ++- .../mbedtls/{include/mbedtls => }/asn1write.h | 4 +- third_party/mbedtls/{library => }/base64.c | 11 ++- .../mbedtls/{include/mbedtls => }/base64.h | 2 +- third_party/mbedtls/{library => }/bignum.c | 12 +-- .../mbedtls/{include/mbedtls => }/bignum.h | 2 +- third_party/mbedtls/{library => }/blowfish.c | 11 ++- .../mbedtls/{include/mbedtls => }/blowfish.h | 6 +- .../mbedtls/{include/mbedtls => }/bn_mul.h | 4 +- third_party/mbedtls/{library => }/camellia.c | 13 ++- .../mbedtls/{include/mbedtls => }/camellia.h | 6 +- third_party/mbedtls/{library => }/ccm.c | 15 ++- .../mbedtls/{include/mbedtls => }/ccm.h | 6 +- third_party/mbedtls/{library => }/certs.c | 9 +- .../mbedtls/{include/mbedtls => }/certs.h | 2 +- third_party/mbedtls/{library => }/chacha20.c | 15 ++- .../mbedtls/{include/mbedtls => }/chacha20.h | 4 +- .../mbedtls/{library => }/chachapoly.c | 10 +- .../{include/mbedtls => }/chachapoly.h | 8 +- .../{include/mbedtls => }/check_config.h | 0 .../{library => }/check_crypto_config.h | 0 third_party/mbedtls/{library => }/cipher.c | 35 ++++--- .../mbedtls/{include/mbedtls => }/cipher.h | 4 +- .../{include/mbedtls => }/cipher_internal.h | 6 +- .../mbedtls/{library => }/cipher_wrap.c | 30 +++--- third_party/mbedtls/{library => }/cmac.c | 15 ++- .../mbedtls/{include/mbedtls => }/cmac.h | 6 +- third_party/mbedtls/{library => }/common.h | 2 +- .../{include/mbedtls => }/compat-1.3.h | 2 +- .../mbedtls/{include/mbedtls => }/config.h | 4 +- .../{include/mbedtls => }/config_psa.h | 2 +- .../mbedtls/{include/psa => }/crypto.h | 12 +-- .../mbedtls/{include/psa => }/crypto_compat.h | 4 +- .../mbedtls/{include/psa => }/crypto_config.h | 0 .../{include/psa => }/crypto_driver_common.h | 4 +- .../mbedtls/{include/psa => }/crypto_extra.h | 10 +- .../{include/psa => }/crypto_platform.h | 4 +- .../{include/psa => }/crypto_se_driver.h | 2 +- .../mbedtls/{include/psa => }/crypto_sizes.h | 2 +- .../mbedtls/{include/psa => }/crypto_struct.h | 30 +++--- .../mbedtls/{include/psa => }/crypto_types.h | 2 +- .../mbedtls/{include/psa => }/crypto_values.h | 2 +- third_party/mbedtls/{library => }/ctr_drbg.c | 15 ++- .../mbedtls/{include/mbedtls => }/ctr_drbg.h | 6 +- third_party/mbedtls/{library => }/debug.c | 13 ++- .../mbedtls/{include/mbedtls => }/debug.h | 6 +- third_party/mbedtls/{library => }/des.c | 13 ++- .../mbedtls/{include/mbedtls => }/des.h | 4 +- third_party/mbedtls/{library => }/dhm.c | 20 ++-- .../mbedtls/{include/mbedtls => }/dhm.h | 6 +- third_party/mbedtls/{library => }/ecdh.c | 13 ++- .../mbedtls/{include/mbedtls => }/ecdh.h | 4 +- third_party/mbedtls/{library => }/ecdsa.c | 19 ++-- .../mbedtls/{include/mbedtls => }/ecdsa.h | 6 +- third_party/mbedtls/{library => }/ecjpake.c | 15 ++- .../mbedtls/{include/mbedtls => }/ecjpake.h | 8 +- third_party/mbedtls/{library => }/ecp.c | 23 +++-- .../mbedtls/{include/mbedtls => }/ecp.h | 6 +- .../mbedtls/{library => }/ecp_curves.c | 13 ++- .../{include/mbedtls => }/ecp_internal.h | 2 +- third_party/mbedtls/{library => }/entropy.c | 21 ++-- .../mbedtls/{include/mbedtls => }/entropy.h | 10 +- .../mbedtls/{library => }/entropy_poll.c | 19 ++-- .../{include/mbedtls => }/entropy_poll.h | 2 +- third_party/mbedtls/{library => }/error.c | 99 ++++++++++--------- .../mbedtls/{include/mbedtls => }/error.h | 2 +- third_party/mbedtls/{library => }/gcm.c | 19 ++-- .../mbedtls/{include/mbedtls => }/gcm.h | 6 +- third_party/mbedtls/{library => }/havege.c | 13 ++- .../mbedtls/{include/mbedtls => }/havege.h | 2 +- third_party/mbedtls/{library => }/hkdf.c | 13 ++- .../mbedtls/{include/mbedtls => }/hkdf.h | 4 +- third_party/mbedtls/{library => }/hmac_drbg.c | 15 ++- .../mbedtls/{include/mbedtls => }/hmac_drbg.h | 6 +- third_party/mbedtls/mbedtls.mk | 4 +- third_party/mbedtls/{library => }/md.c | 31 +++--- .../mbedtls/{include/mbedtls => }/md.h | 2 +- third_party/mbedtls/{library => }/md2.c | 15 ++- .../mbedtls/{include/mbedtls => }/md2.h | 4 +- third_party/mbedtls/{library => }/md4.c | 15 ++- .../mbedtls/{include/mbedtls => }/md4.h | 4 +- third_party/mbedtls/{library => }/md5.c | 15 ++- .../mbedtls/{include/mbedtls => }/md5.h | 4 +- .../{include/mbedtls => }/md_internal.h | 4 +- .../{library => }/memory_buffer_alloc.c | 10 +- .../mbedtls => }/memory_buffer_alloc.h | 2 +- .../mbedtls/{include/mbedtls => }/net.h | 4 +- .../mbedtls/{library => }/net_sockets.c | 8 +- .../{include/mbedtls => }/net_sockets.h | 4 +- third_party/mbedtls/{library => }/nist_kw.c | 10 +- .../mbedtls/{include/mbedtls => }/nist_kw.h | 6 +- third_party/mbedtls/{library => }/oid.c | 10 +- .../mbedtls/{include/mbedtls => }/oid.h | 10 +- third_party/mbedtls/{library => }/padlock.c | 4 +- .../mbedtls/{include/mbedtls => }/padlock.h | 4 +- third_party/mbedtls/{library => }/pem.c | 20 ++-- .../mbedtls/{include/mbedtls => }/pem.h | 2 +- third_party/mbedtls/{library => }/pk.c | 20 ++-- .../mbedtls/{include/mbedtls => }/pk.h | 12 +-- .../{include/mbedtls => }/pk_internal.h | 4 +- third_party/mbedtls/{library => }/pk_wrap.c | 26 ++--- third_party/mbedtls/{library => }/pkcs11.c | 10 +- .../mbedtls/{include/mbedtls => }/pkcs11.h | 4 +- third_party/mbedtls/{library => }/pkcs12.c | 16 +-- .../mbedtls/{include/mbedtls => }/pkcs12.h | 8 +- third_party/mbedtls/{library => }/pkcs5.c | 19 ++-- .../mbedtls/{include/mbedtls => }/pkcs5.h | 6 +- third_party/mbedtls/{library => }/pkparse.c | 26 ++--- third_party/mbedtls/{library => }/pkwrite.c | 30 +++--- third_party/mbedtls/{library => }/platform.c | 13 ++- .../mbedtls/{include/mbedtls => }/platform.h | 6 +- .../{include/mbedtls => }/platform_time.h | 2 +- .../mbedtls/{library => }/platform_util.c | 8 +- .../{include/mbedtls => }/platform_util.h | 4 +- third_party/mbedtls/{library => }/poly1305.c | 15 ++- .../mbedtls/{include/mbedtls => }/poly1305.h | 4 +- .../mbedtls/{library => }/psa_crypto.c | 98 +++++++++--------- .../mbedtls/{library => }/psa_crypto_client.c | 8 +- .../mbedtls/{library => }/psa_crypto_core.h | 8 +- .../psa_crypto_driver_wrappers.c | 8 +- .../psa_crypto_driver_wrappers.h | 6 +- .../mbedtls/{library => }/psa_crypto_ecp.c | 18 ++-- .../mbedtls/{library => }/psa_crypto_ecp.h | 4 +- .../{library => }/psa_crypto_invasive.h | 8 +- .../mbedtls/{library => }/psa_crypto_its.h | 4 +- .../{library => }/psa_crypto_random_impl.h | 14 +-- .../mbedtls/{library => }/psa_crypto_rsa.c | 20 ++-- .../mbedtls/{library => }/psa_crypto_rsa.h | 4 +- .../mbedtls/{library => }/psa_crypto_se.c | 14 +-- .../mbedtls/{library => }/psa_crypto_se.h | 6 +- .../psa_crypto_service_integration.h | 2 +- .../psa_crypto_slot_management.c | 16 +-- .../psa_crypto_slot_management.h | 6 +- .../{library => }/psa_crypto_storage.c | 18 ++-- .../{library => }/psa_crypto_storage.h | 4 +- .../mbedtls/{library => }/psa_its_file.c | 6 +- .../mbedtls/{include/mbedtls => }/psa_util.h | 16 +-- third_party/mbedtls/{library => }/rando.c | 2 +- third_party/mbedtls/{library => }/ripemd160.c | 15 ++- .../mbedtls/{include/mbedtls => }/ripemd160.h | 4 +- third_party/mbedtls/{library => }/rsa.c | 23 +++-- .../mbedtls/{include/mbedtls => }/rsa.h | 10 +- .../mbedtls/{library => }/rsa_internal.c | 8 +- .../{include/mbedtls => }/rsa_internal.h | 4 +- third_party/mbedtls/{library => }/sha1.c | 15 ++- .../mbedtls/{include/mbedtls => }/sha1.h | 4 +- third_party/mbedtls/{library => }/sha256.c | 15 ++- .../mbedtls/{include/mbedtls => }/sha256.h | 4 +- third_party/mbedtls/{library => }/sha512.c | 15 ++- .../mbedtls/{include/mbedtls => }/sha512.h | 4 +- .../mbedtls/{include/psa => }/sheesh.h | 2 +- .../mbedtls/{include/mbedtls => }/ssl.h | 20 ++-- third_party/mbedtls/{library => }/ssl_cache.c | 8 +- .../mbedtls/{include/mbedtls => }/ssl_cache.h | 6 +- .../mbedtls/{library => }/ssl_ciphersuites.c | 8 +- .../{include/mbedtls => }/ssl_ciphersuites.h | 8 +- third_party/mbedtls/{library => }/ssl_cli.c | 20 ++-- .../mbedtls/{library => }/ssl_cookie.c | 12 +-- .../{include/mbedtls => }/ssl_cookie.h | 6 +- .../{include/mbedtls => }/ssl_internal.h | 22 ++--- .../mbedtls/{library => }/ssl_invasive.h | 4 +- third_party/mbedtls/{library => }/ssl_msg.c | 24 ++--- third_party/mbedtls/{library => }/ssl_srv.c | 18 ++-- .../mbedtls/{library => }/ssl_ticket.c | 12 +-- .../{include/mbedtls => }/ssl_ticket.h | 8 +- third_party/mbedtls/{library => }/ssl_tls.c | 29 +++--- .../mbedtls/{library => }/ssl_tls13_keys.c | 8 +- .../mbedtls/{library => }/ssl_tls13_keys.h | 4 +- third_party/mbedtls/{library => }/threading.c | 4 +- .../mbedtls/{include/mbedtls => }/threading.h | 2 +- third_party/mbedtls/{library => }/timing.c | 6 +- .../mbedtls/{include/mbedtls => }/timing.h | 2 +- third_party/mbedtls/{library => }/version.c | 4 +- .../mbedtls/{include/mbedtls => }/version.h | 2 +- .../mbedtls/{library => }/version_features.c | 4 +- third_party/mbedtls/{library => }/x509.c | 27 ++--- .../mbedtls/{include/mbedtls => }/x509.h | 8 +- .../mbedtls/{library => }/x509_create.c | 10 +- third_party/mbedtls/{library => }/x509_crl.c | 19 ++-- .../mbedtls/{include/mbedtls => }/x509_crl.h | 4 +- third_party/mbedtls/{library => }/x509_crt.c | 20 ++-- .../mbedtls/{include/mbedtls => }/x509_crt.h | 8 +- third_party/mbedtls/{library => }/x509_csr.c | 14 +-- .../mbedtls/{include/mbedtls => }/x509_csr.h | 4 +- .../mbedtls/{library => }/x509write_crt.c | 21 ++-- .../mbedtls/{library => }/x509write_csr.c | 25 +++-- third_party/mbedtls/{library => }/xtea.c | 13 ++- .../mbedtls/{include/mbedtls => }/xtea.h | 4 +- 199 files changed, 1184 insertions(+), 944 deletions(-) rename third_party/mbedtls/{library => }/aes.c (99%) rename third_party/mbedtls/{include/mbedtls => }/aes.h (99%) rename third_party/mbedtls/{library => }/aesni.c (98%) rename third_party/mbedtls/{include/mbedtls => }/aesni.h (97%) rename third_party/mbedtls/{library => }/arc4.c (93%) rename third_party/mbedtls/{include/mbedtls => }/arc4.h (97%) rename third_party/mbedtls/{library => }/aria.c (99%) rename third_party/mbedtls/{include/mbedtls => }/aria.h (98%) rename third_party/mbedtls/{include/mbedtls => }/asn1.h (99%) rename third_party/mbedtls/{library => }/asn1parse.c (96%) rename third_party/mbedtls/{library => }/asn1write.c (97%) rename third_party/mbedtls/{include/mbedtls => }/asn1write.h (99%) rename third_party/mbedtls/{library => }/base64.c (97%) rename third_party/mbedtls/{include/mbedtls => }/base64.h (98%) rename third_party/mbedtls/{library => }/bignum.c (99%) rename third_party/mbedtls/{include/mbedtls => }/bignum.h (99%) rename third_party/mbedtls/{library => }/blowfish.c (99%) rename third_party/mbedtls/{include/mbedtls => }/blowfish.h (98%) rename third_party/mbedtls/{include/mbedtls => }/bn_mul.h (99%) rename third_party/mbedtls/{library => }/camellia.c (99%) rename third_party/mbedtls/{include/mbedtls => }/camellia.h (98%) rename third_party/mbedtls/{library => }/ccm.c (98%) rename third_party/mbedtls/{include/mbedtls => }/ccm.h (98%) rename third_party/mbedtls/{library => }/certs.c (99%) rename third_party/mbedtls/{include/mbedtls => }/certs.h (99%) rename third_party/mbedtls/{library => }/chacha20.c (98%) rename third_party/mbedtls/{include/mbedtls => }/chacha20.h (98%) rename third_party/mbedtls/{library => }/chachapoly.c (98%) rename third_party/mbedtls/{include/mbedtls => }/chachapoly.h (98%) rename third_party/mbedtls/{include/mbedtls => }/check_config.h (100%) rename third_party/mbedtls/{library => }/check_crypto_config.h (100%) rename third_party/mbedtls/{library => }/cipher.c (98%) rename third_party/mbedtls/{include/mbedtls => }/cipher.h (99%) rename third_party/mbedtls/{include/mbedtls => }/cipher_internal.h (96%) rename third_party/mbedtls/{library => }/cipher_wrap.c (98%) rename third_party/mbedtls/{library => }/cmac.c (99%) rename third_party/mbedtls/{include/mbedtls => }/cmac.h (97%) rename third_party/mbedtls/{library => }/common.h (96%) rename third_party/mbedtls/{include/mbedtls => }/compat-1.3.h (99%) rename third_party/mbedtls/{include/mbedtls => }/config.h (99%) rename third_party/mbedtls/{include/mbedtls => }/config_psa.h (99%) rename third_party/mbedtls/{include/psa => }/crypto.h (99%) rename third_party/mbedtls/{include/psa => }/crypto_compat.h (99%) rename third_party/mbedtls/{include/psa => }/crypto_config.h (100%) rename third_party/mbedtls/{include/psa => }/crypto_driver_common.h (94%) rename third_party/mbedtls/{include/psa => }/crypto_extra.h (99%) rename third_party/mbedtls/{include/psa => }/crypto_platform.h (96%) rename third_party/mbedtls/{include/psa => }/crypto_se_driver.h (99%) rename third_party/mbedtls/{include/psa => }/crypto_sizes.h (99%) rename third_party/mbedtls/{include/psa => }/crypto_struct.h (94%) rename third_party/mbedtls/{include/psa => }/crypto_types.h (99%) rename third_party/mbedtls/{include/psa => }/crypto_values.h (99%) rename third_party/mbedtls/{library => }/ctr_drbg.c (98%) rename third_party/mbedtls/{include/mbedtls => }/ctr_drbg.h (99%) rename third_party/mbedtls/{library => }/debug.c (97%) rename third_party/mbedtls/{include/mbedtls => }/debug.h (98%) rename third_party/mbedtls/{library => }/des.c (99%) rename third_party/mbedtls/{include/mbedtls => }/des.h (98%) rename third_party/mbedtls/{library => }/dhm.c (98%) rename third_party/mbedtls/{include/mbedtls => }/dhm.h (99%) rename third_party/mbedtls/{library => }/ecdh.c (98%) rename third_party/mbedtls/{include/mbedtls => }/ecdh.h (99%) rename third_party/mbedtls/{library => }/ecdsa.c (98%) rename third_party/mbedtls/{include/mbedtls => }/ecdsa.h (99%) rename third_party/mbedtls/{library => }/ecjpake.c (99%) rename third_party/mbedtls/{include/mbedtls => }/ecjpake.h (98%) rename third_party/mbedtls/{library => }/ecp.c (99%) rename third_party/mbedtls/{include/mbedtls => }/ecp.h (99%) rename third_party/mbedtls/{library => }/ecp_curves.c (99%) rename third_party/mbedtls/{include/mbedtls => }/ecp_internal.h (99%) rename third_party/mbedtls/{library => }/entropy.c (97%) rename third_party/mbedtls/{include/mbedtls => }/entropy.h (97%) rename third_party/mbedtls/{library => }/entropy_poll.c (94%) rename third_party/mbedtls/{include/mbedtls => }/entropy_poll.h (98%) rename third_party/mbedtls/{library => }/error.c (93%) rename third_party/mbedtls/{include/mbedtls => }/error.h (98%) rename third_party/mbedtls/{library => }/gcm.c (98%) rename third_party/mbedtls/{include/mbedtls => }/gcm.h (98%) rename third_party/mbedtls/{library => }/havege.c (96%) rename third_party/mbedtls/{include/mbedtls => }/havege.h (97%) rename third_party/mbedtls/{library => }/hkdf.c (93%) rename third_party/mbedtls/{include/mbedtls => }/hkdf.h (98%) rename third_party/mbedtls/{library => }/hmac_drbg.c (98%) rename third_party/mbedtls/{include/mbedtls => }/hmac_drbg.h (99%) rename third_party/mbedtls/{library => }/md.c (97%) rename third_party/mbedtls/{include/mbedtls => }/md.h (99%) rename third_party/mbedtls/{library => }/md2.c (96%) rename third_party/mbedtls/{include/mbedtls => }/md2.h (98%) rename third_party/mbedtls/{library => }/md4.c (97%) rename third_party/mbedtls/{include/mbedtls => }/md4.h (98%) rename third_party/mbedtls/{library => }/md5.c (97%) rename third_party/mbedtls/{include/mbedtls => }/md5.h (98%) rename third_party/mbedtls/{include/mbedtls => }/md_internal.h (95%) rename third_party/mbedtls/{library => }/memory_buffer_alloc.c (98%) rename third_party/mbedtls/{include/mbedtls => }/memory_buffer_alloc.h (98%) rename third_party/mbedtls/{include/mbedtls => }/net.h (90%) rename third_party/mbedtls/{library => }/net_sockets.c (98%) rename third_party/mbedtls/{include/mbedtls => }/net_sockets.h (99%) rename third_party/mbedtls/{library => }/nist_kw.c (98%) rename third_party/mbedtls/{include/mbedtls => }/nist_kw.h (97%) rename third_party/mbedtls/{library => }/oid.c (99%) rename third_party/mbedtls/{include/mbedtls => }/oid.h (99%) rename third_party/mbedtls/{library => }/padlock.c (97%) rename third_party/mbedtls/{include/mbedtls => }/padlock.h (97%) rename third_party/mbedtls/{library => }/pem.c (96%) rename third_party/mbedtls/{include/mbedtls => }/pem.h (98%) rename third_party/mbedtls/{library => }/pk.c (97%) rename third_party/mbedtls/{include/mbedtls => }/pk.h (99%) rename third_party/mbedtls/{include/mbedtls => }/pk_internal.h (97%) rename third_party/mbedtls/{library => }/pk_wrap.c (97%) rename third_party/mbedtls/{library => }/pkcs11.c (95%) rename third_party/mbedtls/{include/mbedtls => }/pkcs11.h (98%) rename third_party/mbedtls/{library => }/pkcs12.c (96%) rename third_party/mbedtls/{include/mbedtls => }/pkcs12.h (95%) rename third_party/mbedtls/{library => }/pkcs5.c (96%) rename third_party/mbedtls/{include/mbedtls => }/pkcs5.h (95%) rename third_party/mbedtls/{library => }/pkparse.c (98%) rename third_party/mbedtls/{library => }/pkwrite.c (96%) rename third_party/mbedtls/{library => }/platform.c (97%) rename third_party/mbedtls/{include/mbedtls => }/platform.h (98%) rename third_party/mbedtls/{include/mbedtls => }/platform_time.h (97%) rename third_party/mbedtls/{library => }/platform_util.c (95%) rename third_party/mbedtls/{include/mbedtls => }/platform_util.h (98%) rename third_party/mbedtls/{library => }/poly1305.c (98%) rename third_party/mbedtls/{include/mbedtls => }/poly1305.h (98%) rename third_party/mbedtls/{library => }/psa_crypto.c (98%) rename third_party/mbedtls/{library => }/psa_crypto_client.c (91%) rename third_party/mbedtls/{library => }/psa_crypto_core.h (98%) rename third_party/mbedtls/{library => }/psa_crypto_driver_wrappers.c (99%) rename third_party/mbedtls/{library => }/psa_crypto_driver_wrappers.h (95%) rename third_party/mbedtls/{library => }/psa_crypto_ecp.c (97%) rename third_party/mbedtls/{library => }/psa_crypto_ecp.h (99%) rename third_party/mbedtls/{library => }/psa_crypto_invasive.h (93%) rename third_party/mbedtls/{library => }/psa_crypto_its.h (98%) rename third_party/mbedtls/{library => }/psa_crypto_random_impl.h (93%) rename third_party/mbedtls/{library => }/psa_crypto_rsa.c (97%) rename third_party/mbedtls/{library => }/psa_crypto_rsa.h (99%) rename third_party/mbedtls/{library => }/psa_crypto_se.c (96%) rename third_party/mbedtls/{library => }/psa_crypto_se.h (97%) rename third_party/mbedtls/{library => }/psa_crypto_service_integration.h (95%) rename third_party/mbedtls/{library => }/psa_crypto_slot_management.c (96%) rename third_party/mbedtls/{library => }/psa_crypto_slot_management.h (98%) rename third_party/mbedtls/{library => }/psa_crypto_storage.c (97%) rename third_party/mbedtls/{library => }/psa_crypto_storage.h (99%) rename third_party/mbedtls/{library => }/psa_its_file.c (97%) rename third_party/mbedtls/{include/mbedtls => }/psa_util.h (97%) rename third_party/mbedtls/{library => }/rando.c (97%) rename third_party/mbedtls/{library => }/ripemd160.c (98%) rename third_party/mbedtls/{include/mbedtls => }/ripemd160.h (98%) rename third_party/mbedtls/{library => }/rsa.c (99%) rename third_party/mbedtls/{include/mbedtls => }/rsa.h (99%) rename third_party/mbedtls/{library => }/rsa_internal.c (98%) rename third_party/mbedtls/{include/mbedtls => }/rsa_internal.h (98%) rename third_party/mbedtls/{library => }/sha1.c (98%) rename third_party/mbedtls/{include/mbedtls => }/sha1.h (99%) rename third_party/mbedtls/{library => }/sha256.c (98%) rename third_party/mbedtls/{include/mbedtls => }/sha256.h (98%) rename third_party/mbedtls/{library => }/sha512.c (98%) rename third_party/mbedtls/{include/mbedtls => }/sha512.h (98%) rename third_party/mbedtls/{include/psa => }/sheesh.h (91%) rename third_party/mbedtls/{include/mbedtls => }/ssl.h (99%) rename third_party/mbedtls/{library => }/ssl_cache.c (97%) rename third_party/mbedtls/{include/mbedtls => }/ssl_cache.h (96%) rename third_party/mbedtls/{library => }/ssl_ciphersuites.c (99%) rename third_party/mbedtls/{include/mbedtls => }/ssl_ciphersuites.h (99%) rename third_party/mbedtls/{library => }/ssl_cli.c (99%) rename third_party/mbedtls/{library => }/ssl_cookie.c (95%) rename third_party/mbedtls/{include/mbedtls => }/ssl_cookie.h (94%) rename third_party/mbedtls/{include/mbedtls => }/ssl_internal.h (98%) rename third_party/mbedtls/{library => }/ssl_invasive.h (97%) rename third_party/mbedtls/{library => }/ssl_msg.c (99%) rename third_party/mbedtls/{library => }/ssl_srv.c (99%) rename third_party/mbedtls/{library => }/ssl_ticket.c (97%) rename third_party/mbedtls/{include/mbedtls => }/ssl_ticket.h (95%) rename third_party/mbedtls/{library => }/ssl_tls.c (99%) rename third_party/mbedtls/{library => }/ssl_tls13_keys.c (98%) rename third_party/mbedtls/{library => }/ssl_tls13_keys.h (99%) rename third_party/mbedtls/{library => }/threading.c (98%) rename third_party/mbedtls/{include/mbedtls => }/threading.h (98%) rename third_party/mbedtls/{library => }/timing.c (98%) rename third_party/mbedtls/{include/mbedtls => }/timing.h (98%) rename third_party/mbedtls/{library => }/version.c (91%) rename third_party/mbedtls/{include/mbedtls => }/version.h (98%) rename third_party/mbedtls/{library => }/version_features.c (99%) rename third_party/mbedtls/{library => }/x509.c (97%) rename third_party/mbedtls/{include/mbedtls => }/x509.h (98%) rename third_party/mbedtls/{library => }/x509_create.c (97%) rename third_party/mbedtls/{library => }/x509_crl.c (98%) rename third_party/mbedtls/{include/mbedtls => }/x509_crl.h (97%) rename third_party/mbedtls/{library => }/x509_crt.c (99%) rename third_party/mbedtls/{include/mbedtls => }/x509_crt.h (99%) rename third_party/mbedtls/{library => }/x509_csr.c (96%) rename third_party/mbedtls/{include/mbedtls => }/x509_csr.h (98%) rename third_party/mbedtls/{library => }/x509write_crt.c (97%) rename third_party/mbedtls/{library => }/x509write_csr.c (94%) rename third_party/mbedtls/{library => }/xtea.c (95%) rename third_party/mbedtls/{include/mbedtls => }/xtea.h (96%) diff --git a/examples/tls.c b/examples/tls.c index 1f0211825..6383bbad1 100644 --- a/examples/tls.c +++ b/examples/tls.c @@ -10,16 +10,16 @@ #include "libc/log/check.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" -#include "third_party/mbedtls/include/mbedtls/ctr_drbg.h" -#include "third_party/mbedtls/include/mbedtls/dhm.h" -#include "third_party/mbedtls/include/mbedtls/entropy.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/net_sockets.h" -#include "third_party/mbedtls/include/mbedtls/pk.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" -#include "third_party/mbedtls/include/mbedtls/ssl.h" -#include "third_party/mbedtls/include/mbedtls/ssl_cache.h" -#include "third_party/mbedtls/include/mbedtls/x509_crt.h" +#include "third_party/mbedtls/ctr_drbg.h" +#include "third_party/mbedtls/dhm.h" +#include "third_party/mbedtls/entropy.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/net_sockets.h" +#include "third_party/mbedtls/pk.h" +#include "third_party/mbedtls/platform.h" +#include "third_party/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl_cache.h" +#include "third_party/mbedtls/x509_crt.h" #define R(e) \ if ((r = e)) goto Die diff --git a/third_party/mbedtls/library/aes.c b/third_party/mbedtls/aes.c similarity index 99% rename from third_party/mbedtls/library/aes.c rename to third_party/mbedtls/aes.c index 3f704ba76..60486daee 100644 --- a/third_party/mbedtls/library/aes.c +++ b/third_party/mbedtls/aes.c @@ -1,4 +1,10 @@ /* clang-format off */ + +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * FIPS-197 compliant AES implementation * @@ -17,6 +23,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /* * The AES block cipher was designed by Vincent Rijmen and Joan Daemen. * @@ -25,25 +32,25 @@ */ #include "libc/nexgen32e/x86feature.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_AES_C) -#include "third_party/mbedtls/include/mbedtls/aes.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/aes.h" +#include "third_party/mbedtls/platform.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_PADLOCK_C) -#include "third_party/mbedtls/include/mbedtls/padlock.h" +#include "third_party/mbedtls/padlock.h" #endif #if defined(MBEDTLS_AESNI_C) -#include "third_party/mbedtls/include/mbedtls/aesni.h" +#include "third_party/mbedtls/aesni.h" #endif #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/aes.h b/third_party/mbedtls/aes.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/aes.h rename to third_party/mbedtls/aes.h index d9a8d0f8c..80466bee6 100644 --- a/third_party/mbedtls/include/mbedtls/aes.h +++ b/third_party/mbedtls/aes.h @@ -43,7 +43,7 @@ #define MBEDTLS_AES_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -111,7 +111,7 @@ typedef struct mbedtls_aes_xts_context #endif /* MBEDTLS_CIPHER_MODE_XTS */ #else /* MBEDTLS_AES_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/aes_alt.h" */ +/* #include "third_party/mbedtls/aes_alt.h" */ #endif /* MBEDTLS_AES_ALT */ /** diff --git a/third_party/mbedtls/library/aesni.c b/third_party/mbedtls/aesni.c similarity index 98% rename from third_party/mbedtls/library/aesni.c rename to third_party/mbedtls/aesni.c index a9cec5c83..9f34b5fca 100644 --- a/third_party/mbedtls/library/aesni.c +++ b/third_party/mbedtls/aesni.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * AES-NI support functions * @@ -25,7 +30,7 @@ */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_AESNI_C) @@ -35,7 +40,7 @@ #endif #endif -#include "third_party/mbedtls/include/mbedtls/aesni.h" +#include "third_party/mbedtls/aesni.h" #ifndef asm diff --git a/third_party/mbedtls/include/mbedtls/aesni.h b/third_party/mbedtls/aesni.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/aesni.h rename to third_party/mbedtls/aesni.h index 6e3152368..01ab9c46b 100644 --- a/third_party/mbedtls/include/mbedtls/aesni.h +++ b/third_party/mbedtls/aesni.h @@ -28,12 +28,12 @@ #define MBEDTLS_AESNI_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/aes.h" +#include "third_party/mbedtls/aes.h" #define MBEDTLS_AESNI_AES 0x02000000u #define MBEDTLS_AESNI_CLMUL 0x00000002u diff --git a/third_party/mbedtls/library/arc4.c b/third_party/mbedtls/arc4.c similarity index 93% rename from third_party/mbedtls/library/arc4.c rename to third_party/mbedtls/arc4.c index e5061571e..02b8623a3 100644 --- a/third_party/mbedtls/library/arc4.c +++ b/third_party/mbedtls/arc4.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * An implementation of the ARCFOUR algorithm * @@ -18,6 +23,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /* * The ARCFOUR algorithm was publicly disclosed on 94/09. * @@ -25,16 +31,16 @@ */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ARC4_C) -#include "third_party/mbedtls/include/mbedtls/arc4.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/arc4.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/arc4.h b/third_party/mbedtls/arc4.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/arc4.h rename to third_party/mbedtls/arc4.h index 85e8c9913..494444314 100644 --- a/third_party/mbedtls/include/mbedtls/arc4.h +++ b/third_party/mbedtls/arc4.h @@ -29,7 +29,7 @@ #define MBEDTLS_ARC4_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -62,7 +62,7 @@ typedef struct mbedtls_arc4_context mbedtls_arc4_context; #else /* MBEDTLS_ARC4_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/arc4_alt.h" */ +/* #include "third_party/mbedtls/arc4_alt.h" */ #endif /* MBEDTLS_ARC4_ALT */ /** diff --git a/third_party/mbedtls/library/aria.c b/third_party/mbedtls/aria.c similarity index 99% rename from third_party/mbedtls/library/aria.c rename to third_party/mbedtls/aria.c index a6fe42e37..d480cd94e 100644 --- a/third_party/mbedtls/library/aria.c +++ b/third_party/mbedtls/aria.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * ARIA implementation * @@ -25,16 +30,16 @@ * [2] https://tools.ietf.org/html/rfc5794 */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ARIA_C) -#include "third_party/mbedtls/include/mbedtls/aria.h" +#include "third_party/mbedtls/aria.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ @@ -42,7 +47,7 @@ #if !defined(MBEDTLS_ARIA_ALT) -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform_util.h" #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ !defined(inline) && !defined(__cplusplus) diff --git a/third_party/mbedtls/include/mbedtls/aria.h b/third_party/mbedtls/aria.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/aria.h rename to third_party/mbedtls/aria.h index f670c4b7c..60981cfb4 100644 --- a/third_party/mbedtls/include/mbedtls/aria.h +++ b/third_party/mbedtls/aria.h @@ -32,13 +32,13 @@ #define MBEDTLS_ARIA_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform_util.h" #define MBEDTLS_ARIA_ENCRYPT 1 /**< ARIA encryption. */ #define MBEDTLS_ARIA_DECRYPT 0 /**< ARIA decryption. */ @@ -81,7 +81,7 @@ typedef struct mbedtls_aria_context mbedtls_aria_context; #else /* MBEDTLS_ARIA_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/aria_alt.h" */ +/* #include "third_party/mbedtls/aria_alt.h" */ #endif /* MBEDTLS_ARIA_ALT */ /** diff --git a/third_party/mbedtls/include/mbedtls/asn1.h b/third_party/mbedtls/asn1.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/asn1.h rename to third_party/mbedtls/asn1.h index cf378dc08..be8bb783d 100644 --- a/third_party/mbedtls/include/mbedtls/asn1.h +++ b/third_party/mbedtls/asn1.h @@ -24,14 +24,14 @@ #define MBEDTLS_ASN1_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if defined(MBEDTLS_BIGNUM_C) -#include "third_party/mbedtls/include/mbedtls/bignum.h" +#include "third_party/mbedtls/bignum.h" #endif /** diff --git a/third_party/mbedtls/library/asn1parse.c b/third_party/mbedtls/asn1parse.c similarity index 96% rename from third_party/mbedtls/library/asn1parse.c rename to third_party/mbedtls/asn1parse.c index c61372d46..eee4662fe 100644 --- a/third_party/mbedtls/library/asn1parse.c +++ b/third_party/mbedtls/asn1parse.c @@ -1,5 +1,4 @@ /* clang-format off */ - /* * Generic ASN.1 parsing * @@ -18,22 +17,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "third_party/mbedtls/common.h" -#include "third_party/mbedtls/library/common.h" +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); #if defined(MBEDTLS_ASN1_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_BIGNUM_C) -#include "third_party/mbedtls/include/mbedtls/bignum.h" +#include "third_party/mbedtls/bignum.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/asn1write.c b/third_party/mbedtls/asn1write.c similarity index 97% rename from third_party/mbedtls/library/asn1write.c rename to third_party/mbedtls/asn1write.c index 27abf9057..4ed8bf7d1 100644 --- a/third_party/mbedtls/library/asn1write.c +++ b/third_party/mbedtls/asn1write.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * ASN.1 buffer writing functionality * @@ -19,16 +24,16 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ASN1_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/asn1write.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/asn1write.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/include/mbedtls/asn1write.h b/third_party/mbedtls/asn1write.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/asn1write.h rename to third_party/mbedtls/asn1write.h index 3e366d2ec..f2ecf217b 100644 --- a/third_party/mbedtls/include/mbedtls/asn1write.h +++ b/third_party/mbedtls/asn1write.h @@ -25,12 +25,12 @@ #define MBEDTLS_ASN1_WRITE_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/asn1.h" +#include "third_party/mbedtls/asn1.h" #define MBEDTLS_ASN1_CHK_ADD(g, f) \ do \ diff --git a/third_party/mbedtls/library/base64.c b/third_party/mbedtls/base64.c similarity index 97% rename from third_party/mbedtls/library/base64.c rename to third_party/mbedtls/base64.c index c75a7a071..09c7c4bbc 100644 --- a/third_party/mbedtls/library/base64.c +++ b/third_party/mbedtls/base64.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * RFC 1521 base64 encoding/decoding * @@ -19,16 +24,16 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_BASE64_C) -#include "third_party/mbedtls/include/mbedtls/base64.h" +#include "third_party/mbedtls/base64.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/base64.h b/third_party/mbedtls/base64.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/base64.h rename to third_party/mbedtls/base64.h index 551096c6e..c079a2321 100644 --- a/third_party/mbedtls/include/mbedtls/base64.h +++ b/third_party/mbedtls/base64.h @@ -25,7 +25,7 @@ #define MBEDTLS_BASE64_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/bignum.c b/third_party/mbedtls/bignum.c similarity index 99% rename from third_party/mbedtls/library/bignum.c rename to third_party/mbedtls/bignum.c index 2c9afd0b8..b99a87289 100644 --- a/third_party/mbedtls/library/bignum.c +++ b/third_party/mbedtls/bignum.c @@ -35,18 +35,18 @@ * */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_BIGNUM_C) -#include "third_party/mbedtls/include/mbedtls/bignum.h" -#include "third_party/mbedtls/include/mbedtls/bn_mul.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/bignum.h" +#include "third_party/mbedtls/bn_mul.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #define mbedtls_calloc calloc diff --git a/third_party/mbedtls/include/mbedtls/bignum.h b/third_party/mbedtls/bignum.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/bignum.h rename to third_party/mbedtls/bignum.h index d063b3357..7ce4083fe 100644 --- a/third_party/mbedtls/include/mbedtls/bignum.h +++ b/third_party/mbedtls/bignum.h @@ -25,7 +25,7 @@ #include "libc/stdio/stdio.h" #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/blowfish.c b/third_party/mbedtls/blowfish.c similarity index 99% rename from third_party/mbedtls/library/blowfish.c rename to third_party/mbedtls/blowfish.c index 12a370d27..f2679fd75 100644 --- a/third_party/mbedtls/library/blowfish.c +++ b/third_party/mbedtls/blowfish.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Blowfish implementation * @@ -26,12 +31,12 @@ */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_BLOWFISH_C) -#include "third_party/mbedtls/include/mbedtls/blowfish.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/blowfish.h" +#include "third_party/mbedtls/platform_util.h" #if !defined(MBEDTLS_BLOWFISH_ALT) diff --git a/third_party/mbedtls/include/mbedtls/blowfish.h b/third_party/mbedtls/blowfish.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/blowfish.h rename to third_party/mbedtls/blowfish.h index bd9b439f6..08a73902a 100644 --- a/third_party/mbedtls/include/mbedtls/blowfish.h +++ b/third_party/mbedtls/blowfish.h @@ -25,13 +25,13 @@ #define MBEDTLS_BLOWFISH_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform_util.h" #define MBEDTLS_BLOWFISH_ENCRYPT 1 #define MBEDTLS_BLOWFISH_DECRYPT 0 @@ -70,7 +70,7 @@ typedef struct mbedtls_blowfish_context mbedtls_blowfish_context; #else /* MBEDTLS_BLOWFISH_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/blowfish_alt.h" */ +/* #include "third_party/mbedtls/blowfish_alt.h" */ #endif /* MBEDTLS_BLOWFISH_ALT */ /** diff --git a/third_party/mbedtls/include/mbedtls/bn_mul.h b/third_party/mbedtls/bn_mul.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/bn_mul.h rename to third_party/mbedtls/bn_mul.h index c16bc2efc..917890cd3 100644 --- a/third_party/mbedtls/include/mbedtls/bn_mul.h +++ b/third_party/mbedtls/bn_mul.h @@ -39,12 +39,12 @@ #define MBEDTLS_BN_MUL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/bignum.h" +#include "third_party/mbedtls/bignum.h" #if defined(MBEDTLS_HAVE_ASM) diff --git a/third_party/mbedtls/library/camellia.c b/third_party/mbedtls/camellia.c similarity index 99% rename from third_party/mbedtls/library/camellia.c rename to third_party/mbedtls/camellia.c index 6f11a3e52..45bfa3220 100644 --- a/third_party/mbedtls/library/camellia.c +++ b/third_party/mbedtls/camellia.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Camellia implementation * @@ -25,17 +30,17 @@ * http://info.isl.ntt.co.jp/crypt/eng/camellia/dl/01espec.pdf */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_CAMELLIA_C) -#include "third_party/mbedtls/include/mbedtls/camellia.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/camellia.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/camellia.h b/third_party/mbedtls/camellia.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/camellia.h rename to third_party/mbedtls/camellia.h index 44c2f56d2..3163afaaf 100644 --- a/third_party/mbedtls/include/mbedtls/camellia.h +++ b/third_party/mbedtls/camellia.h @@ -25,13 +25,13 @@ #define MBEDTLS_CAMELLIA_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform_util.h" #define MBEDTLS_CAMELLIA_ENCRYPT 1 #define MBEDTLS_CAMELLIA_DECRYPT 0 @@ -66,7 +66,7 @@ typedef struct mbedtls_camellia_context mbedtls_camellia_context; #else /* MBEDTLS_CAMELLIA_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/camellia_alt.h" */ +/* #include "third_party/mbedtls/camellia_alt.h" */ #endif /* MBEDTLS_CAMELLIA_ALT */ /** diff --git a/third_party/mbedtls/library/ccm.c b/third_party/mbedtls/ccm.c similarity index 98% rename from third_party/mbedtls/library/ccm.c rename to third_party/mbedtls/ccm.c index 9721fe43e..f91082f67 100644 --- a/third_party/mbedtls/library/ccm.c +++ b/third_party/mbedtls/ccm.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * NIST SP800-38C compliant CCM implementation * @@ -28,17 +33,17 @@ * RFC 5116 "An Interface and Algorithms for Authenticated Encryption" */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_CCM_C) -#include "third_party/mbedtls/include/mbedtls/ccm.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/ccm.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/ccm.h b/third_party/mbedtls/ccm.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/ccm.h rename to third_party/mbedtls/ccm.h index 2a4f349fa..09556f1ae 100644 --- a/third_party/mbedtls/include/mbedtls/ccm.h +++ b/third_party/mbedtls/ccm.h @@ -50,12 +50,12 @@ #define MBEDTLS_CCM_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/cipher.h" #define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D /**< Bad input parameters to the function. */ #define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F /**< Authenticated decryption failed. */ @@ -82,7 +82,7 @@ typedef struct mbedtls_ccm_context mbedtls_ccm_context; #else /* MBEDTLS_CCM_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/ccm_alt.h" */ +/* #include "third_party/mbedtls/ccm_alt.h" */ #endif /* MBEDTLS_CCM_ALT */ /** diff --git a/third_party/mbedtls/library/certs.c b/third_party/mbedtls/certs.c similarity index 99% rename from third_party/mbedtls/library/certs.c rename to third_party/mbedtls/certs.c index 8b740405c..8b5749d20 100644 --- a/third_party/mbedtls/library/certs.c +++ b/third_party/mbedtls/certs.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * X.509 test certificates * @@ -19,9 +24,9 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" -#include "third_party/mbedtls/include/mbedtls/certs.h" +#include "third_party/mbedtls/certs.h" #if defined(MBEDTLS_CERTS_C) diff --git a/third_party/mbedtls/include/mbedtls/certs.h b/third_party/mbedtls/certs.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/certs.h rename to third_party/mbedtls/certs.h index a4002fd91..691427dbb 100644 --- a/third_party/mbedtls/include/mbedtls/certs.h +++ b/third_party/mbedtls/certs.h @@ -25,7 +25,7 @@ #define MBEDTLS_CERTS_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/chacha20.c b/third_party/mbedtls/chacha20.c similarity index 98% rename from third_party/mbedtls/library/chacha20.c rename to third_party/mbedtls/chacha20.c index f3bf27042..2df9c8369 100644 --- a/third_party/mbedtls/library/chacha20.c +++ b/third_party/mbedtls/chacha20.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /** * \file chacha20.c * @@ -23,18 +28,18 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_CHACHA20_C) -#include "third_party/mbedtls/include/mbedtls/chacha20.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/chacha20.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/chacha20.h b/third_party/mbedtls/chacha20.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/chacha20.h rename to third_party/mbedtls/chacha20.h index bf6969fd8..623303e07 100644 --- a/third_party/mbedtls/include/mbedtls/chacha20.h +++ b/third_party/mbedtls/chacha20.h @@ -35,7 +35,7 @@ #define MBEDTLS_CHACHA20_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -66,7 +66,7 @@ typedef struct mbedtls_chacha20_context mbedtls_chacha20_context; #else /* MBEDTLS_CHACHA20_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/chacha20_alt.h" */ +/* #include "third_party/mbedtls/chacha20_alt.h" */ #endif /* MBEDTLS_CHACHA20_ALT */ /** diff --git a/third_party/mbedtls/library/chachapoly.c b/third_party/mbedtls/chachapoly.c similarity index 98% rename from third_party/mbedtls/library/chachapoly.c rename to third_party/mbedtls/chachapoly.c index acfcfd01d..3dd6e1100 100644 --- a/third_party/mbedtls/library/chachapoly.c +++ b/third_party/mbedtls/chachapoly.c @@ -20,18 +20,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_CHACHAPOLY_C) -#include "third_party/mbedtls/include/mbedtls/chachapoly.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/chachapoly.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/chachapoly.h b/third_party/mbedtls/chachapoly.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/chachapoly.h rename to third_party/mbedtls/chachapoly.h index 87ae0b158..70167292e 100644 --- a/third_party/mbedtls/include/mbedtls/chachapoly.h +++ b/third_party/mbedtls/chachapoly.h @@ -35,13 +35,13 @@ #define MBEDTLS_CHACHAPOLY_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif /* for shared error codes */ -#include "third_party/mbedtls/include/mbedtls/poly1305.h" +#include "third_party/mbedtls/poly1305.h" #define MBEDTLS_ERR_CHACHAPOLY_BAD_STATE -0x0054 /**< The requested operation is not permitted in the current state. */ #define MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED -0x0056 /**< Authenticated decryption failed: data was not authentic. */ @@ -59,7 +59,7 @@ mbedtls_chachapoly_mode_t; #if !defined(MBEDTLS_CHACHAPOLY_ALT) -#include "third_party/mbedtls/include/mbedtls/chacha20.h" +#include "third_party/mbedtls/chacha20.h" typedef struct mbedtls_chachapoly_context { @@ -73,7 +73,7 @@ typedef struct mbedtls_chachapoly_context mbedtls_chachapoly_context; #else /* !MBEDTLS_CHACHAPOLY_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/chachapoly_alt.h" */ +/* #include "third_party/mbedtls/chachapoly_alt.h" */ #endif /* !MBEDTLS_CHACHAPOLY_ALT */ /** diff --git a/third_party/mbedtls/include/mbedtls/check_config.h b/third_party/mbedtls/check_config.h similarity index 100% rename from third_party/mbedtls/include/mbedtls/check_config.h rename to third_party/mbedtls/check_config.h diff --git a/third_party/mbedtls/library/check_crypto_config.h b/third_party/mbedtls/check_crypto_config.h similarity index 100% rename from third_party/mbedtls/library/check_crypto_config.h rename to third_party/mbedtls/check_crypto_config.h diff --git a/third_party/mbedtls/library/cipher.c b/third_party/mbedtls/cipher.c similarity index 98% rename from third_party/mbedtls/library/cipher.c rename to third_party/mbedtls/cipher.c index fed60b7f5..f14ade685 100644 --- a/third_party/mbedtls/library/cipher.c +++ b/third_party/mbedtls/cipher.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /** * \file cipher.c * @@ -23,48 +28,48 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_CIPHER_C) -#include "third_party/mbedtls/include/psa/sheesh.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" -#include "third_party/mbedtls/include/mbedtls/cipher_internal.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/sheesh.h" +#include "third_party/mbedtls/cipher.h" +#include "third_party/mbedtls/cipher_internal.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_CHACHAPOLY_C) -#include "third_party/mbedtls/include/mbedtls/chachapoly.h" +#include "third_party/mbedtls/chachapoly.h" #endif #if defined(MBEDTLS_GCM_C) -#include "third_party/mbedtls/include/mbedtls/gcm.h" +#include "third_party/mbedtls/gcm.h" #endif #if defined(MBEDTLS_CCM_C) -#include "third_party/mbedtls/include/mbedtls/ccm.h" +#include "third_party/mbedtls/ccm.h" #endif #if defined(MBEDTLS_CHACHA20_C) -#include "third_party/mbedtls/include/mbedtls/chacha20.h" +#include "third_party/mbedtls/chacha20.h" #endif #if defined(MBEDTLS_CMAC_C) -#include "third_party/mbedtls/include/mbedtls/cmac.h" +#include "third_party/mbedtls/cmac.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/mbedtls/psa_util.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_util.h" #endif /* MBEDTLS_USE_PSA_CRYPTO */ #if defined(MBEDTLS_NIST_KW_C) -#include "third_party/mbedtls/include/mbedtls/nist_kw.h" +#include "third_party/mbedtls/nist_kw.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/include/mbedtls/cipher.h b/third_party/mbedtls/cipher.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/cipher.h rename to third_party/mbedtls/cipher.h index 04bb40228..74ed4e1eb 100644 --- a/third_party/mbedtls/include/mbedtls/cipher.h +++ b/third_party/mbedtls/cipher.h @@ -30,12 +30,12 @@ #define MBEDTLS_CIPHER_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) #define MBEDTLS_CIPHER_MODE_AEAD diff --git a/third_party/mbedtls/include/mbedtls/cipher_internal.h b/third_party/mbedtls/cipher_internal.h similarity index 96% rename from third_party/mbedtls/include/mbedtls/cipher_internal.h rename to third_party/mbedtls/cipher_internal.h index c06f29ec0..41d0a2806 100644 --- a/third_party/mbedtls/include/mbedtls/cipher_internal.h +++ b/third_party/mbedtls/cipher_internal.h @@ -27,15 +27,15 @@ #define MBEDTLS_CIPHER_WRAP_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/cipher.h" #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/crypto.h" #endif /* MBEDTLS_USE_PSA_CRYPTO */ #ifdef __cplusplus diff --git a/third_party/mbedtls/library/cipher_wrap.c b/third_party/mbedtls/cipher_wrap.c similarity index 98% rename from third_party/mbedtls/library/cipher_wrap.c rename to third_party/mbedtls/cipher_wrap.c index 6e0f4c312..f201549f5 100644 --- a/third_party/mbedtls/library/cipher_wrap.c +++ b/third_party/mbedtls/cipher_wrap.c @@ -23,62 +23,62 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_CIPHER_C) -#include "third_party/mbedtls/include/mbedtls/cipher_internal.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/cipher_internal.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_CHACHAPOLY_C) -#include "third_party/mbedtls/include/mbedtls/chachapoly.h" +#include "third_party/mbedtls/chachapoly.h" #endif #if defined(MBEDTLS_AES_C) -#include "third_party/mbedtls/include/mbedtls/aes.h" +#include "third_party/mbedtls/aes.h" #endif #if defined(MBEDTLS_ARC4_C) -#include "third_party/mbedtls/include/mbedtls/arc4.h" +#include "third_party/mbedtls/arc4.h" #endif #if defined(MBEDTLS_CAMELLIA_C) -#include "third_party/mbedtls/include/mbedtls/camellia.h" +#include "third_party/mbedtls/camellia.h" #endif #if defined(MBEDTLS_ARIA_C) -#include "third_party/mbedtls/include/mbedtls/aria.h" +#include "third_party/mbedtls/aria.h" #endif #if defined(MBEDTLS_DES_C) -#include "third_party/mbedtls/include/mbedtls/des.h" +#include "third_party/mbedtls/des.h" #endif #if defined(MBEDTLS_BLOWFISH_C) -#include "third_party/mbedtls/include/mbedtls/blowfish.h" +#include "third_party/mbedtls/blowfish.h" #endif #if defined(MBEDTLS_CHACHA20_C) -#include "third_party/mbedtls/include/mbedtls/chacha20.h" +#include "third_party/mbedtls/chacha20.h" #endif #if defined(MBEDTLS_GCM_C) -#include "third_party/mbedtls/include/mbedtls/gcm.h" +#include "third_party/mbedtls/gcm.h" #endif #if defined(MBEDTLS_CCM_C) -#include "third_party/mbedtls/include/mbedtls/ccm.h" +#include "third_party/mbedtls/ccm.h" #endif #if defined(MBEDTLS_NIST_KW_C) -#include "third_party/mbedtls/include/mbedtls/nist_kw.h" +#include "third_party/mbedtls/nist_kw.h" #endif #if defined(MBEDTLS_CIPHER_NULL_CIPHER) #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/cmac.c b/third_party/mbedtls/cmac.c similarity index 99% rename from third_party/mbedtls/library/cmac.c rename to third_party/mbedtls/cmac.c index 81b671cc2..37ab06a09 100644 --- a/third_party/mbedtls/library/cmac.c +++ b/third_party/mbedtls/cmac.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /** * \file cmac.c * @@ -40,14 +45,14 @@ * */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_CMAC_C) -#include "third_party/mbedtls/include/mbedtls/cmac.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/cmac.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/platform.h" #if !defined(MBEDTLS_CMAC_ALT) || defined(MBEDTLS_SELF_TEST) diff --git a/third_party/mbedtls/include/mbedtls/cmac.h b/third_party/mbedtls/cmac.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/cmac.h rename to third_party/mbedtls/cmac.h index 9fe585718..93759acba 100644 --- a/third_party/mbedtls/include/mbedtls/cmac.h +++ b/third_party/mbedtls/cmac.h @@ -29,12 +29,12 @@ #define MBEDTLS_CMAC_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/cipher.h" #ifdef __cplusplus extern "C" { @@ -71,7 +71,7 @@ struct mbedtls_cmac_context_t }; #else /* !MBEDTLS_CMAC_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/cmac_alt.h" */ +/* #include "third_party/mbedtls/cmac_alt.h" */ #endif /* !MBEDTLS_CMAC_ALT */ /** diff --git a/third_party/mbedtls/library/common.h b/third_party/mbedtls/common.h similarity index 96% rename from third_party/mbedtls/library/common.h rename to third_party/mbedtls/common.h index 553dd914e..558aa8827 100644 --- a/third_party/mbedtls/library/common.h +++ b/third_party/mbedtls/common.h @@ -28,7 +28,7 @@ #if defined(MBEDTLS_CONFIG_FILE) #include MBEDTLS_CONFIG_FILE #else -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #endif /** Helper to define a function as static except when building invasive tests. diff --git a/third_party/mbedtls/include/mbedtls/compat-1.3.h b/third_party/mbedtls/compat-1.3.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/compat-1.3.h rename to third_party/mbedtls/compat-1.3.h index b51ff0299..00540892e 100644 --- a/third_party/mbedtls/include/mbedtls/compat-1.3.h +++ b/third_party/mbedtls/compat-1.3.h @@ -26,7 +26,7 @@ */ #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/include/mbedtls/config.h b/third_party/mbedtls/config.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/config.h rename to third_party/mbedtls/config.h index 754106e77..6173157c8 100644 --- a/third_party/mbedtls/include/mbedtls/config.h +++ b/third_party/mbedtls/config.h @@ -3958,9 +3958,9 @@ #endif #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -#include "third_party/mbedtls/include/mbedtls/config_psa.h" +#include "third_party/mbedtls/config_psa.h" #endif -#include "third_party/mbedtls/include/mbedtls/check_config.h" +#include "third_party/mbedtls/check_config.h" #endif /* MBEDTLS_CONFIG_H */ diff --git a/third_party/mbedtls/include/mbedtls/config_psa.h b/third_party/mbedtls/config_psa.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/config_psa.h rename to third_party/mbedtls/config_psa.h index b950a0599..42da44048 100644 --- a/third_party/mbedtls/include/mbedtls/config_psa.h +++ b/third_party/mbedtls/config_psa.h @@ -33,7 +33,7 @@ #define MBEDTLS_CONFIG_PSA_H #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -#include "third_party/mbedtls/include/psa/crypto_config.h" +#include "third_party/mbedtls/crypto_config.h" #endif /* defined(MBEDTLS_PSA_CRYPTO_CONFIG) */ #ifdef __cplusplus diff --git a/third_party/mbedtls/include/psa/crypto.h b/third_party/mbedtls/crypto.h similarity index 99% rename from third_party/mbedtls/include/psa/crypto.h rename to third_party/mbedtls/crypto.h index 01c59babb..06f7b2977 100644 --- a/third_party/mbedtls/include/psa/crypto.h +++ b/third_party/mbedtls/crypto.h @@ -21,7 +21,7 @@ */ #ifndef PSA_CRYPTO_H #define PSA_CRYPTO_H -#include "third_party/mbedtls/include/psa/crypto_platform.h" +#include "third_party/mbedtls/crypto_platform.h" #ifdef __DOXYGEN_ONLY__ /* This __DOXYGEN_ONLY__ block contains mock definitions for things that @@ -42,7 +42,7 @@ extern "C" { /* The file "crypto_types.h" declares types that encode errors, * algorithms, key types, policies, etc. */ -#include "third_party/mbedtls/include/psa/crypto_types.h" +#include "third_party/mbedtls/crypto_types.h" /** \defgroup version API version * @{ @@ -62,7 +62,7 @@ extern "C" { /* The file "crypto_values.h" declares macros to build and analyze values * of integral types defined in "crypto_types.h". */ -#include "third_party/mbedtls/include/psa/crypto_values.h" +#include "third_party/mbedtls/crypto_values.h" /** \defgroup initialization Library initialization * @{ @@ -3761,14 +3761,14 @@ psa_status_t psa_generate_key(const psa_key_attributes_t *attributes, /* The file "crypto_sizes.h" contains definitions for size calculation * macros whose definitions are implementation-specific. */ -#include "third_party/mbedtls/include/psa/crypto_sizes.h" +#include "third_party/mbedtls/crypto_sizes.h" /* The file "crypto_struct.h" contains definitions for * implementation-specific structs that are declared above. */ -#include "third_party/mbedtls/include/psa/crypto_struct.h" +#include "third_party/mbedtls/crypto_struct.h" /* The file "crypto_extra.h" contains vendor-specific definitions. This * can include vendor-defined algorithms, extra functions, etc. */ -#include "third_party/mbedtls/include/psa/crypto_extra.h" +#include "third_party/mbedtls/crypto_extra.h" #endif /* PSA_CRYPTO_H */ diff --git a/third_party/mbedtls/include/psa/crypto_compat.h b/third_party/mbedtls/crypto_compat.h similarity index 99% rename from third_party/mbedtls/include/psa/crypto_compat.h rename to third_party/mbedtls/crypto_compat.h index cccc09cc1..35dde5687 100644 --- a/third_party/mbedtls/include/psa/crypto_compat.h +++ b/third_party/mbedtls/crypto_compat.h @@ -29,8 +29,8 @@ */ #ifndef PSA_CRYPTO_COMPAT_H #define PSA_CRYPTO_COMPAT_H -#include "third_party/mbedtls/include/psa/crypto_values.h" -#include "third_party/mbedtls/include/psa/crypto_types.h" +#include "third_party/mbedtls/crypto_values.h" +#include "third_party/mbedtls/crypto_types.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/include/psa/crypto_config.h b/third_party/mbedtls/crypto_config.h similarity index 100% rename from third_party/mbedtls/include/psa/crypto_config.h rename to third_party/mbedtls/crypto_config.h diff --git a/third_party/mbedtls/include/psa/crypto_driver_common.h b/third_party/mbedtls/crypto_driver_common.h similarity index 94% rename from third_party/mbedtls/include/psa/crypto_driver_common.h rename to third_party/mbedtls/crypto_driver_common.h index 14e55805c..fb302e3ec 100644 --- a/third_party/mbedtls/include/psa/crypto_driver_common.h +++ b/third_party/mbedtls/crypto_driver_common.h @@ -39,8 +39,8 @@ /* Include type definitions (psa_status_t, psa_algorithm_t, * psa_key_type_t, etc.) and macros to build and analyze values * of these types. */ -#include "third_party/mbedtls/include/psa/crypto_types.h" -#include "third_party/mbedtls/include/psa/crypto_values.h" +#include "third_party/mbedtls/crypto_types.h" +#include "third_party/mbedtls/crypto_values.h" /** For encrypt-decrypt functions, whether the operation is an encryption * or a decryption. */ diff --git a/third_party/mbedtls/include/psa/crypto_extra.h b/third_party/mbedtls/crypto_extra.h similarity index 99% rename from third_party/mbedtls/include/psa/crypto_extra.h rename to third_party/mbedtls/crypto_extra.h index e9471ee29..a37a506fb 100644 --- a/third_party/mbedtls/include/psa/crypto_extra.h +++ b/third_party/mbedtls/crypto_extra.h @@ -26,10 +26,10 @@ */ #ifndef PSA_CRYPTO_EXTRA_H #define PSA_CRYPTO_EXTRA_H -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/psa/crypto_compat.h" -#include "third_party/mbedtls/include/psa/crypto_struct.h" -#include "third_party/mbedtls/include/psa/crypto_types.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/crypto_compat.h" +#include "third_party/mbedtls/crypto_struct.h" +#include "third_party/mbedtls/crypto_types.h" /* clang-format off */ #ifdef __cplusplus extern "C" { @@ -568,7 +568,7 @@ psa_status_t psa_get_key_domain_parameters( */ #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" /** Convert an ECC curve identifier from the Mbed TLS encoding to PSA. * diff --git a/third_party/mbedtls/include/psa/crypto_platform.h b/third_party/mbedtls/crypto_platform.h similarity index 96% rename from third_party/mbedtls/include/psa/crypto_platform.h rename to third_party/mbedtls/crypto_platform.h index 9edc7ae53..e8efd1a96 100644 --- a/third_party/mbedtls/include/psa/crypto_platform.h +++ b/third_party/mbedtls/crypto_platform.h @@ -33,8 +33,8 @@ */ #ifndef PSA_CRYPTO_PLATFORM_H #define PSA_CRYPTO_PLATFORM_H -#include "third_party/mbedtls/include/mbedtls/config.h" -#include "third_party/mbedtls/include/mbedtls/config_psa.h" +#include "third_party/mbedtls/config.h" +#include "third_party/mbedtls/config_psa.h" #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ !defined(inline) && !defined(__cplusplus) diff --git a/third_party/mbedtls/include/psa/crypto_se_driver.h b/third_party/mbedtls/crypto_se_driver.h similarity index 99% rename from third_party/mbedtls/include/psa/crypto_se_driver.h rename to third_party/mbedtls/crypto_se_driver.h index f80f405d6..2f32ba4e2 100644 --- a/third_party/mbedtls/include/psa/crypto_se_driver.h +++ b/third_party/mbedtls/crypto_se_driver.h @@ -36,7 +36,7 @@ #ifndef PSA_CRYPTO_SE_DRIVER_H #define PSA_CRYPTO_SE_DRIVER_H -#include "third_party/mbedtls/include/psa/crypto_driver_common.h" +#include "third_party/mbedtls/crypto_driver_common.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/include/psa/crypto_sizes.h b/third_party/mbedtls/crypto_sizes.h similarity index 99% rename from third_party/mbedtls/include/psa/crypto_sizes.h rename to third_party/mbedtls/crypto_sizes.h index 27e9535c4..9bdc66f32 100644 --- a/third_party/mbedtls/include/psa/crypto_sizes.h +++ b/third_party/mbedtls/crypto_sizes.h @@ -45,7 +45,7 @@ /* Include the Mbed TLS configuration file, the way Mbed TLS does it * in each of its header files. */ #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/include/psa/crypto_struct.h b/third_party/mbedtls/crypto_struct.h similarity index 94% rename from third_party/mbedtls/include/psa/crypto_struct.h rename to third_party/mbedtls/crypto_struct.h index 6c493ab20..00d86a1b7 100644 --- a/third_party/mbedtls/include/psa/crypto_struct.h +++ b/third_party/mbedtls/crypto_struct.h @@ -51,21 +51,21 @@ */ #ifndef PSA_CRYPTO_STRUCT_H #define PSA_CRYPTO_STRUCT_H -#include "third_party/mbedtls/include/mbedtls/cipher.h" -#include "third_party/mbedtls/include/mbedtls/cmac.h" -#include "third_party/mbedtls/include/mbedtls/config.h" -#include "third_party/mbedtls/include/mbedtls/gcm.h" -#include "third_party/mbedtls/include/mbedtls/md.h" -#include "third_party/mbedtls/include/mbedtls/md2.h" -#include "third_party/mbedtls/include/mbedtls/md4.h" -#include "third_party/mbedtls/include/mbedtls/md5.h" -#include "third_party/mbedtls/include/mbedtls/ripemd160.h" -#include "third_party/mbedtls/include/mbedtls/sha1.h" -#include "third_party/mbedtls/include/mbedtls/sha256.h" -#include "third_party/mbedtls/include/mbedtls/sha512.h" -#include "third_party/mbedtls/include/psa/crypto_sizes.h" -#include "third_party/mbedtls/include/psa/crypto_types.h" -#include "third_party/mbedtls/include/psa/crypto_values.h" +#include "third_party/mbedtls/cipher.h" +#include "third_party/mbedtls/cmac.h" +#include "third_party/mbedtls/config.h" +#include "third_party/mbedtls/gcm.h" +#include "third_party/mbedtls/md.h" +#include "third_party/mbedtls/md2.h" +#include "third_party/mbedtls/md4.h" +#include "third_party/mbedtls/md5.h" +#include "third_party/mbedtls/ripemd160.h" +#include "third_party/mbedtls/sha1.h" +#include "third_party/mbedtls/sha256.h" +#include "third_party/mbedtls/sha512.h" +#include "third_party/mbedtls/crypto_sizes.h" +#include "third_party/mbedtls/crypto_types.h" +#include "third_party/mbedtls/crypto_values.h" /* clang-format off */ #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/include/psa/crypto_types.h b/third_party/mbedtls/crypto_types.h similarity index 99% rename from third_party/mbedtls/include/psa/crypto_types.h rename to third_party/mbedtls/crypto_types.h index f434ebe15..003bd50bc 100644 --- a/third_party/mbedtls/include/psa/crypto_types.h +++ b/third_party/mbedtls/crypto_types.h @@ -32,7 +32,7 @@ */ #ifndef PSA_CRYPTO_TYPES_H #define PSA_CRYPTO_TYPES_H -#include "third_party/mbedtls/include/psa/crypto_platform.h" +#include "third_party/mbedtls/crypto_platform.h" /* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT * is defined as well to include all PSA code. diff --git a/third_party/mbedtls/include/psa/crypto_values.h b/third_party/mbedtls/crypto_values.h similarity index 99% rename from third_party/mbedtls/include/psa/crypto_values.h rename to third_party/mbedtls/crypto_values.h index 1132f7898..094d449e6 100644 --- a/third_party/mbedtls/include/psa/crypto_values.h +++ b/third_party/mbedtls/crypto_values.h @@ -33,7 +33,7 @@ */ #ifndef PSA_CRYPTO_VALUES_H #define PSA_CRYPTO_VALUES_H -#include "third_party/mbedtls/include/psa/crypto_types.h" +#include "third_party/mbedtls/crypto_types.h" /** \defgroup error Error codes * @{ diff --git a/third_party/mbedtls/library/ctr_drbg.c b/third_party/mbedtls/ctr_drbg.c similarity index 98% rename from third_party/mbedtls/library/ctr_drbg.c rename to third_party/mbedtls/ctr_drbg.c index 74d03c4ac..a0eedf877 100644 --- a/third_party/mbedtls/library/ctr_drbg.c +++ b/third_party/mbedtls/ctr_drbg.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * CTR_DRBG implementation based on AES-256 (NIST SP 800-90) * @@ -26,17 +31,17 @@ #include "libc/str/str.h" #include "libc/stdio/stdio.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_CTR_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/ctr_drbg.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/ctr_drbg.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/ctr_drbg.h b/third_party/mbedtls/ctr_drbg.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/ctr_drbg.h rename to third_party/mbedtls/ctr_drbg.h index 747737d93..b4d96b739 100644 --- a/third_party/mbedtls/include/mbedtls/ctr_drbg.h +++ b/third_party/mbedtls/ctr_drbg.h @@ -44,15 +44,15 @@ #define MBEDTLS_CTR_DRBG_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/aes.h" +#include "third_party/mbedtls/aes.h" #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif #define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -0x0034 /**< The entropy source failed. */ diff --git a/third_party/mbedtls/library/debug.c b/third_party/mbedtls/debug.c similarity index 97% rename from third_party/mbedtls/library/debug.c rename to third_party/mbedtls/debug.c index 4d8b4ea92..50c23a4c1 100644 --- a/third_party/mbedtls/library/debug.c +++ b/third_party/mbedtls/debug.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Debugging routines * @@ -19,12 +24,12 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_DEBUG_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free @@ -33,8 +38,8 @@ #define mbedtls_vsnprintf vsnprintf #endif -#include "third_party/mbedtls/include/mbedtls/debug.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/debug.h" +#include "third_party/mbedtls/error.h" #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ !defined(inline) && !defined(__cplusplus) diff --git a/third_party/mbedtls/include/mbedtls/debug.h b/third_party/mbedtls/debug.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/debug.h rename to third_party/mbedtls/debug.h index 3217d4230..d3f02f743 100644 --- a/third_party/mbedtls/include/mbedtls/debug.h +++ b/third_party/mbedtls/debug.h @@ -25,15 +25,15 @@ #define MBEDTLS_DEBUG_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl.h" #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" #endif #if defined(MBEDTLS_DEBUG_C) diff --git a/third_party/mbedtls/library/des.c b/third_party/mbedtls/des.c similarity index 99% rename from third_party/mbedtls/library/des.c rename to third_party/mbedtls/des.c index 04e0ae689..32543bb56 100644 --- a/third_party/mbedtls/library/des.c +++ b/third_party/mbedtls/des.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * FIPS-46-3 compliant Triple-DES implementation * @@ -25,16 +30,16 @@ * http://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_DES_C) -#include "third_party/mbedtls/include/mbedtls/des.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/des.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/des.h b/third_party/mbedtls/des.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/des.h rename to third_party/mbedtls/des.h index 81d3c86d8..bd718772f 100644 --- a/third_party/mbedtls/include/mbedtls/des.h +++ b/third_party/mbedtls/des.h @@ -30,7 +30,7 @@ #define MBEDTLS_DES_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -77,7 +77,7 @@ typedef struct mbedtls_des3_context mbedtls_des3_context; #else /* MBEDTLS_DES_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/des_alt.h" */ +/* #include "third_party/mbedtls/des_alt.h" */ #endif /* MBEDTLS_DES_ALT */ /** diff --git a/third_party/mbedtls/library/dhm.c b/third_party/mbedtls/dhm.c similarity index 98% rename from third_party/mbedtls/library/dhm.c rename to third_party/mbedtls/dhm.c index 18b9da6c0..bcb55d53c 100644 --- a/third_party/mbedtls/library/dhm.c +++ b/third_party/mbedtls/dhm.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Diffie-Hellman-Merkle key exchange * @@ -18,6 +23,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /* * The following sources were referenced in the design of this implementation * of the Diffie-Hellman-Merkle algorithm: @@ -28,25 +34,25 @@ */ #include "libc/calls/calls.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_DHM_C) -#include "third_party/mbedtls/include/mbedtls/dhm.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/dhm.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_PEM_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_ASN1_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/asn1.h" +#include "third_party/mbedtls/asn1.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #define mbedtls_calloc calloc diff --git a/third_party/mbedtls/include/mbedtls/dhm.h b/third_party/mbedtls/dhm.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/dhm.h rename to third_party/mbedtls/dhm.h index 32018b33f..39ba6d8ee 100644 --- a/third_party/mbedtls/include/mbedtls/dhm.h +++ b/third_party/mbedtls/dhm.h @@ -66,11 +66,11 @@ #define MBEDTLS_DHM_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/bignum.h" +#include "third_party/mbedtls/bignum.h" /* * DHM Error codes @@ -116,7 +116,7 @@ typedef struct mbedtls_dhm_context mbedtls_dhm_context; #else /* MBEDTLS_DHM_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/dhm_alt.h" */ +/* #include "third_party/mbedtls/dhm_alt.h" */ #endif /* MBEDTLS_DHM_ALT */ /** diff --git a/third_party/mbedtls/library/ecdh.c b/third_party/mbedtls/ecdh.c similarity index 98% rename from third_party/mbedtls/library/ecdh.c rename to third_party/mbedtls/ecdh.c index df226b0c1..f3c40423e 100644 --- a/third_party/mbedtls/library/ecdh.c +++ b/third_party/mbedtls/ecdh.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Elliptic curve Diffie-Hellman * @@ -26,13 +31,13 @@ * RFC 4492 */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ECDH_C) -#include "third_party/mbedtls/include/mbedtls/ecdh.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/ecdh.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" /* Parameter validation macros based on platform_util.h */ diff --git a/third_party/mbedtls/include/mbedtls/ecdh.h b/third_party/mbedtls/ecdh.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/ecdh.h rename to third_party/mbedtls/ecdh.h index 8160041a6..3d1b01be5 100644 --- a/third_party/mbedtls/include/mbedtls/ecdh.h +++ b/third_party/mbedtls/ecdh.h @@ -35,12 +35,12 @@ #define MBEDTLS_ECDH_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" #if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) #undef MBEDTLS_ECDH_LEGACY_CONTEXT diff --git a/third_party/mbedtls/library/ecdsa.c b/third_party/mbedtls/ecdsa.c similarity index 98% rename from third_party/mbedtls/library/ecdsa.c rename to third_party/mbedtls/ecdsa.c index eb3569941..3a766e63a 100644 --- a/third_party/mbedtls/library/ecdsa.c +++ b/third_party/mbedtls/ecdsa.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Elliptic curve DSA * @@ -25,27 +30,27 @@ * SEC1 http://www.secg.org/index.php?action=secg,docs_secg */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ECDSA_C) -#include "third_party/mbedtls/include/mbedtls/ecdsa.h" -#include "third_party/mbedtls/include/mbedtls/asn1write.h" +#include "third_party/mbedtls/ecdsa.h" +#include "third_party/mbedtls/asn1write.h" #if defined(MBEDTLS_ECDSA_DETERMINISTIC) -#include "third_party/mbedtls/include/mbedtls/hmac_drbg.h" +#include "third_party/mbedtls/hmac_drbg.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" /* Parameter validation macros based on platform_util.h */ #define ECDSA_VALIDATE_RET( cond ) \ diff --git a/third_party/mbedtls/include/mbedtls/ecdsa.h b/third_party/mbedtls/ecdsa.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/ecdsa.h rename to third_party/mbedtls/ecdsa.h index b53742134..0225c76e1 100644 --- a/third_party/mbedtls/include/mbedtls/ecdsa.h +++ b/third_party/mbedtls/ecdsa.h @@ -33,13 +33,13 @@ #define MBEDTLS_ECDSA_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/ecp.h" +#include "third_party/mbedtls/md.h" /** * \brief Maximum ECDSA signature size for a given curve bit size diff --git a/third_party/mbedtls/library/ecjpake.c b/third_party/mbedtls/ecjpake.c similarity index 99% rename from third_party/mbedtls/library/ecjpake.c rename to third_party/mbedtls/ecjpake.c index 277496b84..c97d7a0d3 100644 --- a/third_party/mbedtls/library/ecjpake.c +++ b/third_party/mbedtls/ecjpake.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Elliptic curve J-PAKE * @@ -24,13 +29,13 @@ * available to members of the Thread Group http://threadgroup.org/ */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ECJPAKE_C) -#include "third_party/mbedtls/include/mbedtls/ecjpake.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/ecjpake.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if !defined(MBEDTLS_ECJPAKE_ALT) @@ -801,7 +806,7 @@ cleanup: #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif diff --git a/third_party/mbedtls/include/mbedtls/ecjpake.h b/third_party/mbedtls/ecjpake.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/ecjpake.h rename to third_party/mbedtls/ecjpake.h index c004ed9cd..13fbd0a7b 100644 --- a/third_party/mbedtls/include/mbedtls/ecjpake.h +++ b/third_party/mbedtls/ecjpake.h @@ -41,13 +41,13 @@ * also be use outside TLS. */ #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/ecp.h" +#include "third_party/mbedtls/md.h" #ifdef __cplusplus extern "C" { @@ -93,7 +93,7 @@ typedef struct mbedtls_ecjpake_context } mbedtls_ecjpake_context; #else /* MBEDTLS_ECJPAKE_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/ecjpake_alt.h" */ +/* #include "third_party/mbedtls/ecjpake_alt.h" */ #endif /* MBEDTLS_ECJPAKE_ALT */ /** diff --git a/third_party/mbedtls/library/ecp.c b/third_party/mbedtls/ecp.c similarity index 99% rename from third_party/mbedtls/library/ecp.c rename to third_party/mbedtls/ecp.c index 832db2396..a76088ba9 100644 --- a/third_party/mbedtls/library/ecp.c +++ b/third_party/mbedtls/ecp.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Elliptic curves over GF(p): generic functions * @@ -41,7 +46,7 @@ * */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" /** * \brief Function level alternative implementation. @@ -74,10 +79,10 @@ #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/threading.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/ecp.h" +#include "third_party/mbedtls/threading.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if !defined(MBEDTLS_ECP_ALT) @@ -89,20 +94,20 @@ MBEDTLS_INTERNAL_VALIDATE( cond ) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/ecp_internal.h" +#include "third_party/mbedtls/ecp_internal.h" #if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG) #if defined(MBEDTLS_HMAC_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/hmac_drbg.h" +#include "third_party/mbedtls/hmac_drbg.h" #elif defined(MBEDTLS_CTR_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/ctr_drbg.h" +#include "third_party/mbedtls/ctr_drbg.h" #else #error "Invalid configuration detected. Include check_config.h to ensure that the configuration is valid." #endif diff --git a/third_party/mbedtls/include/mbedtls/ecp.h b/third_party/mbedtls/ecp.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/ecp.h rename to third_party/mbedtls/ecp.h index 27e13483d..16d6b6bde 100644 --- a/third_party/mbedtls/include/mbedtls/ecp.h +++ b/third_party/mbedtls/ecp.h @@ -37,12 +37,12 @@ #define MBEDTLS_ECP_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/bignum.h" +#include "third_party/mbedtls/bignum.h" /* * ECP error codes @@ -298,7 +298,7 @@ mbedtls_ecp_group; /* \} name SECTION: Module settings */ #else /* MBEDTLS_ECP_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/ecp_alt.h" */ +/* #include "third_party/mbedtls/ecp_alt.h" */ #endif /* MBEDTLS_ECP_ALT */ #if defined(MBEDTLS_ECP_RESTARTABLE) diff --git a/third_party/mbedtls/library/ecp_curves.c b/third_party/mbedtls/ecp_curves.c similarity index 99% rename from third_party/mbedtls/library/ecp_curves.c rename to third_party/mbedtls/ecp_curves.c index de3f52fb9..c3c4e3044 100644 --- a/third_party/mbedtls/library/ecp_curves.c +++ b/third_party/mbedtls/ecp_curves.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Elliptic curves over GF(p): curve-specific data and functions * @@ -19,13 +24,13 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/ecp.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if !defined(MBEDTLS_ECP_ALT) diff --git a/third_party/mbedtls/include/mbedtls/ecp_internal.h b/third_party/mbedtls/ecp_internal.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/ecp_internal.h rename to third_party/mbedtls/ecp_internal.h index 32f7634fa..2be5227e5 100644 --- a/third_party/mbedtls/include/mbedtls/ecp_internal.h +++ b/third_party/mbedtls/ecp_internal.h @@ -62,7 +62,7 @@ #define MBEDTLS_ECP_INTERNAL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/entropy.c b/third_party/mbedtls/entropy.c similarity index 97% rename from third_party/mbedtls/library/entropy.c rename to third_party/mbedtls/entropy.c index 85870733d..3d66f0587 100644 --- a/third_party/mbedtls/library/entropy.c +++ b/third_party/mbedtls/entropy.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Entropy accumulator implementation * @@ -21,7 +26,7 @@ #include "libc/calls/calls.h" #include "libc/stdio/stdio.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ENTROPY_C) @@ -31,29 +36,29 @@ #warning "**** THIS BUILD IS *NOT* SUITABLE FOR PRODUCTION USE " #endif -#include "third_party/mbedtls/include/mbedtls/entropy.h" -#include "third_party/mbedtls/include/mbedtls/entropy_poll.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/entropy.h" +#include "third_party/mbedtls/entropy_poll.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_FS_IO) #endif #if defined(MBEDTLS_ENTROPY_NV_SEED) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #endif #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ #endif /* MBEDTLS_SELF_TEST */ #if defined(MBEDTLS_HAVEGE_C) -#include "third_party/mbedtls/include/mbedtls/havege.h" +#include "third_party/mbedtls/havege.h" #endif #define ENTROPY_MAX_LOOP 256 /**< Maximum amount to loop before error */ diff --git a/third_party/mbedtls/include/mbedtls/entropy.h b/third_party/mbedtls/entropy.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/entropy.h rename to third_party/mbedtls/entropy.h index cc56ae78a..cb2cbb145 100644 --- a/third_party/mbedtls/include/mbedtls/entropy.h +++ b/third_party/mbedtls/entropy.h @@ -25,28 +25,28 @@ #define MBEDTLS_ENTROPY_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if defined(MBEDTLS_SHA512_C) && !defined(MBEDTLS_ENTROPY_FORCE_SHA256) -#include "third_party/mbedtls/include/mbedtls/sha512.h" +#include "third_party/mbedtls/sha512.h" #define MBEDTLS_ENTROPY_SHA512_ACCUMULATOR #else #if defined(MBEDTLS_SHA256_C) #define MBEDTLS_ENTROPY_SHA256_ACCUMULATOR -#include "third_party/mbedtls/include/mbedtls/sha256.h" +#include "third_party/mbedtls/sha256.h" #endif #endif #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif #if defined(MBEDTLS_HAVEGE_C) -#include "third_party/mbedtls/include/mbedtls/havege.h" +#include "third_party/mbedtls/havege.h" #endif #define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -0x003C /**< Critical entropy source failure. */ diff --git a/third_party/mbedtls/library/entropy_poll.c b/third_party/mbedtls/entropy_poll.c similarity index 94% rename from third_party/mbedtls/library/entropy_poll.c rename to third_party/mbedtls/entropy_poll.c index 5e016e353..3efdf593f 100644 --- a/third_party/mbedtls/library/entropy_poll.c +++ b/third_party/mbedtls/entropy_poll.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Platform-specific and custom entropy polling functions * @@ -25,23 +30,23 @@ #endif #include "libc/stdio/stdio.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_ENTROPY_C) -#include "third_party/mbedtls/include/mbedtls/entropy.h" -#include "third_party/mbedtls/include/mbedtls/entropy_poll.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/entropy.h" +#include "third_party/mbedtls/entropy_poll.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_TIMING_C) -#include "third_party/mbedtls/include/mbedtls/timing.h" +#include "third_party/mbedtls/timing.h" #endif #if defined(MBEDTLS_HAVEGE_C) -#include "third_party/mbedtls/include/mbedtls/havege.h" +#include "third_party/mbedtls/havege.h" #endif #if defined(MBEDTLS_ENTROPY_NV_SEED) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #endif #if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) diff --git a/third_party/mbedtls/include/mbedtls/entropy_poll.h b/third_party/mbedtls/entropy_poll.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/entropy_poll.h rename to third_party/mbedtls/entropy_poll.h index 0d7705695..ae1d01e42 100644 --- a/third_party/mbedtls/include/mbedtls/entropy_poll.h +++ b/third_party/mbedtls/entropy_poll.h @@ -25,7 +25,7 @@ #define MBEDTLS_ENTROPY_POLL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/error.c b/third_party/mbedtls/error.c similarity index 93% rename from third_party/mbedtls/library/error.c rename to third_party/mbedtls/error.c index f2855e9f5..399a5f962 100644 --- a/third_party/mbedtls/library/error.c +++ b/third_party/mbedtls/error.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Error message information * @@ -19,194 +24,194 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_ERROR_C) || defined(MBEDTLS_ERROR_STRERROR_DUMMY) #if defined(MBEDTLS_ERROR_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_snprintf snprintf #endif #if defined(MBEDTLS_AES_C) -#include "third_party/mbedtls/include/mbedtls/aes.h" +#include "third_party/mbedtls/aes.h" #endif #if defined(MBEDTLS_ARC4_C) -#include "third_party/mbedtls/include/mbedtls/arc4.h" +#include "third_party/mbedtls/arc4.h" #endif #if defined(MBEDTLS_ARIA_C) -#include "third_party/mbedtls/include/mbedtls/aria.h" +#include "third_party/mbedtls/aria.h" #endif #if defined(MBEDTLS_ASN1_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/asn1.h" +#include "third_party/mbedtls/asn1.h" #endif #if defined(MBEDTLS_BASE64_C) -#include "third_party/mbedtls/include/mbedtls/base64.h" +#include "third_party/mbedtls/base64.h" #endif #if defined(MBEDTLS_BIGNUM_C) -#include "third_party/mbedtls/include/mbedtls/bignum.h" +#include "third_party/mbedtls/bignum.h" #endif #if defined(MBEDTLS_BLOWFISH_C) -#include "third_party/mbedtls/include/mbedtls/blowfish.h" +#include "third_party/mbedtls/blowfish.h" #endif #if defined(MBEDTLS_CAMELLIA_C) -#include "third_party/mbedtls/include/mbedtls/camellia.h" +#include "third_party/mbedtls/camellia.h" #endif #if defined(MBEDTLS_CCM_C) -#include "third_party/mbedtls/include/mbedtls/ccm.h" +#include "third_party/mbedtls/ccm.h" #endif #if defined(MBEDTLS_CHACHA20_C) -#include "third_party/mbedtls/include/mbedtls/chacha20.h" +#include "third_party/mbedtls/chacha20.h" #endif #if defined(MBEDTLS_CHACHAPOLY_C) -#include "third_party/mbedtls/include/mbedtls/chachapoly.h" +#include "third_party/mbedtls/chachapoly.h" #endif #if defined(MBEDTLS_CIPHER_C) -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/cipher.h" #endif #if defined(MBEDTLS_CMAC_C) -#include "third_party/mbedtls/include/mbedtls/cmac.h" +#include "third_party/mbedtls/cmac.h" #endif #if defined(MBEDTLS_CTR_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/ctr_drbg.h" +#include "third_party/mbedtls/ctr_drbg.h" #endif #if defined(MBEDTLS_DES_C) -#include "third_party/mbedtls/include/mbedtls/des.h" +#include "third_party/mbedtls/des.h" #endif #if defined(MBEDTLS_DHM_C) -#include "third_party/mbedtls/include/mbedtls/dhm.h" +#include "third_party/mbedtls/dhm.h" #endif #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" #endif #if defined(MBEDTLS_ENTROPY_C) -#include "third_party/mbedtls/include/mbedtls/entropy.h" +#include "third_party/mbedtls/entropy.h" #endif #if defined(MBEDTLS_ERROR_C) -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/error.h" #endif #if defined(MBEDTLS_GCM_C) -#include "third_party/mbedtls/include/mbedtls/gcm.h" +#include "third_party/mbedtls/gcm.h" #endif #if defined(MBEDTLS_HKDF_C) -#include "third_party/mbedtls/include/mbedtls/hkdf.h" +#include "third_party/mbedtls/hkdf.h" #endif #if defined(MBEDTLS_HMAC_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/hmac_drbg.h" +#include "third_party/mbedtls/hmac_drbg.h" #endif #if defined(MBEDTLS_MD_C) -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/md.h" #endif #if defined(MBEDTLS_MD2_C) -#include "third_party/mbedtls/include/mbedtls/md2.h" +#include "third_party/mbedtls/md2.h" #endif #if defined(MBEDTLS_MD4_C) -#include "third_party/mbedtls/include/mbedtls/md4.h" +#include "third_party/mbedtls/md4.h" #endif #if defined(MBEDTLS_MD5_C) -#include "third_party/mbedtls/include/mbedtls/md5.h" +#include "third_party/mbedtls/md5.h" #endif #if defined(MBEDTLS_NET_C) -#include "third_party/mbedtls/include/mbedtls/net_sockets.h" +#include "third_party/mbedtls/net_sockets.h" #endif #if defined(MBEDTLS_OID_C) -#include "third_party/mbedtls/include/mbedtls/oid.h" +#include "third_party/mbedtls/oid.h" #endif #if defined(MBEDTLS_PADLOCK_C) -#include "third_party/mbedtls/include/mbedtls/padlock.h" +#include "third_party/mbedtls/padlock.h" #endif #if defined(MBEDTLS_PEM_PARSE_C) || defined(MBEDTLS_PEM_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_PK_C) -#include "third_party/mbedtls/include/mbedtls/pk.h" +#include "third_party/mbedtls/pk.h" #endif #if defined(MBEDTLS_PKCS12_C) -#include "third_party/mbedtls/include/mbedtls/pkcs12.h" +#include "third_party/mbedtls/pkcs12.h" #endif #if defined(MBEDTLS_PKCS5_C) -#include "third_party/mbedtls/include/mbedtls/pkcs5.h" +#include "third_party/mbedtls/pkcs5.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #endif #if defined(MBEDTLS_POLY1305_C) -#include "third_party/mbedtls/include/mbedtls/poly1305.h" +#include "third_party/mbedtls/poly1305.h" #endif #if defined(MBEDTLS_RIPEMD160_C) -#include "third_party/mbedtls/include/mbedtls/ripemd160.h" +#include "third_party/mbedtls/ripemd160.h" #endif #if defined(MBEDTLS_RSA_C) -#include "third_party/mbedtls/include/mbedtls/rsa.h" +#include "third_party/mbedtls/rsa.h" #endif #if defined(MBEDTLS_SHA1_C) -#include "third_party/mbedtls/include/mbedtls/sha1.h" +#include "third_party/mbedtls/sha1.h" #endif #if defined(MBEDTLS_SHA256_C) -#include "third_party/mbedtls/include/mbedtls/sha256.h" +#include "third_party/mbedtls/sha256.h" #endif #if defined(MBEDTLS_SHA512_C) -#include "third_party/mbedtls/include/mbedtls/sha512.h" +#include "third_party/mbedtls/sha512.h" #endif #if defined(MBEDTLS_SSL_TLS_C) -#include "third_party/mbedtls/include/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl.h" #endif #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif #if defined(MBEDTLS_X509_USE_C) || defined(MBEDTLS_X509_CREATE_C) -#include "third_party/mbedtls/include/mbedtls/x509.h" +#include "third_party/mbedtls/x509.h" #endif #if defined(MBEDTLS_XTEA_C) -#include "third_party/mbedtls/include/mbedtls/xtea.h" +#include "third_party/mbedtls/xtea.h" #endif diff --git a/third_party/mbedtls/include/mbedtls/error.h b/third_party/mbedtls/error.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/error.h rename to third_party/mbedtls/error.h index bb694d26e..7687dd0b0 100644 --- a/third_party/mbedtls/include/mbedtls/error.h +++ b/third_party/mbedtls/error.h @@ -25,7 +25,7 @@ #define MBEDTLS_ERROR_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/gcm.c b/third_party/mbedtls/gcm.c similarity index 98% rename from third_party/mbedtls/library/gcm.c rename to third_party/mbedtls/gcm.c index fc7834336..c377abbbd 100644 --- a/third_party/mbedtls/library/gcm.c +++ b/third_party/mbedtls/gcm.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * NIST SP800-38D compliant GCM implementation * @@ -31,22 +36,22 @@ #include "libc/str/str.h" #include "libc/nexgen32e/x86feature.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_GCM_C) -#include "third_party/mbedtls/include/mbedtls/gcm.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/gcm.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_AESNI_C) -#include "third_party/mbedtls/include/mbedtls/aesni.h" +#include "third_party/mbedtls/aesni.h" #endif #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) -#include "third_party/mbedtls/include/mbedtls/aes.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/aes.h" +#include "third_party/mbedtls/platform.h" #if !defined(MBEDTLS_PLATFORM_C) #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/gcm.h b/third_party/mbedtls/gcm.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/gcm.h rename to third_party/mbedtls/gcm.h index 05990ad6b..d0c1f85ab 100644 --- a/third_party/mbedtls/include/mbedtls/gcm.h +++ b/third_party/mbedtls/gcm.h @@ -34,12 +34,12 @@ #define MBEDTLS_GCM_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/cipher.h" #define MBEDTLS_GCM_ENCRYPT 1 @@ -78,7 +78,7 @@ typedef struct mbedtls_gcm_context mbedtls_gcm_context; #else /* !MBEDTLS_GCM_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/gcm_alt.h" */ +/* #include "third_party/mbedtls/gcm_alt.h" */ #endif /* !MBEDTLS_GCM_ALT */ /** diff --git a/third_party/mbedtls/library/havege.c b/third_party/mbedtls/havege.c similarity index 96% rename from third_party/mbedtls/library/havege.c rename to third_party/mbedtls/havege.c index f6b6e0ef6..1186f5635 100644 --- a/third_party/mbedtls/library/havege.c +++ b/third_party/mbedtls/havege.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /** * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion * @@ -26,13 +31,13 @@ * Contact: seznec(at)irisa_dot_fr - orocheco(at)irisa_dot_fr */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_HAVEGE_C) -#include "third_party/mbedtls/include/mbedtls/havege.h" -#include "third_party/mbedtls/include/mbedtls/timing.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/havege.h" +#include "third_party/mbedtls/timing.h" +#include "third_party/mbedtls/platform_util.h" /* ------------------------------------------------------------------------ * On average, one iteration accesses two 8-word blocks in the havege WALK diff --git a/third_party/mbedtls/include/mbedtls/havege.h b/third_party/mbedtls/havege.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/havege.h rename to third_party/mbedtls/havege.h index 0800b27f1..6340329fd 100644 --- a/third_party/mbedtls/include/mbedtls/havege.h +++ b/third_party/mbedtls/havege.h @@ -25,7 +25,7 @@ #define MBEDTLS_HAVEGE_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/hkdf.c b/third_party/mbedtls/hkdf.c similarity index 93% rename from third_party/mbedtls/library/hkdf.c rename to third_party/mbedtls/hkdf.c index de10cda32..56f01555c 100644 --- a/third_party/mbedtls/library/hkdf.c +++ b/third_party/mbedtls/hkdf.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * HKDF implementation -- RFC 5869 * @@ -19,13 +24,13 @@ * limitations under the License. */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_HKDF_C) -#include "third_party/mbedtls/include/mbedtls/hkdf.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/hkdf.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" int mbedtls_hkdf( const mbedtls_md_info_t *md, const unsigned char *salt, size_t salt_len, const unsigned char *ikm, size_t ikm_len, diff --git a/third_party/mbedtls/include/mbedtls/hkdf.h b/third_party/mbedtls/hkdf.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/hkdf.h rename to third_party/mbedtls/hkdf.h index 95d760934..21c318b32 100644 --- a/third_party/mbedtls/include/mbedtls/hkdf.h +++ b/third_party/mbedtls/hkdf.h @@ -28,12 +28,12 @@ #define MBEDTLS_HKDF_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/md.h" /** * \name HKDF Error codes diff --git a/third_party/mbedtls/library/hmac_drbg.c b/third_party/mbedtls/hmac_drbg.c similarity index 98% rename from third_party/mbedtls/library/hmac_drbg.c rename to third_party/mbedtls/hmac_drbg.c index 6edd6f790..e904570b8 100644 --- a/third_party/mbedtls/library/hmac_drbg.c +++ b/third_party/mbedtls/hmac_drbg.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * HMAC_DRBG implementation (NIST SP 800-90) * @@ -27,13 +32,13 @@ #include "libc/str/str.h" #include "libc/stdio/stdio.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_HMAC_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/hmac_drbg.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/hmac_drbg.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_FS_IO) @@ -41,7 +46,7 @@ #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_SELF_TEST */ diff --git a/third_party/mbedtls/include/mbedtls/hmac_drbg.h b/third_party/mbedtls/hmac_drbg.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/hmac_drbg.h rename to third_party/mbedtls/hmac_drbg.h index ae28ed0b9..fcc73a9d0 100644 --- a/third_party/mbedtls/include/mbedtls/hmac_drbg.h +++ b/third_party/mbedtls/hmac_drbg.h @@ -29,15 +29,15 @@ #define MBEDTLS_HMAC_DRBG_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/md.h" #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif /* diff --git a/third_party/mbedtls/mbedtls.mk b/third_party/mbedtls/mbedtls.mk index d5e847c1a..1c91526cd 100644 --- a/third_party/mbedtls/mbedtls.mk +++ b/third_party/mbedtls/mbedtls.mk @@ -6,9 +6,7 @@ PKGS += THIRD_PARTY_MBEDTLS THIRD_PARTY_MBEDTLS_ARTIFACTS += THIRD_PARTY_MBEDTLS_A THIRD_PARTY_MBEDTLS = $(THIRD_PARTY_MBEDTLS_A_DEPS) $(THIRD_PARTY_MBEDTLS_A) THIRD_PARTY_MBEDTLS_A = o/$(MODE)/third_party/mbedtls/mbedtls.a -THIRD_PARTY_MBEDTLS_A_FILES := \ - $(wildcard third_party/mbedtls/library/*.*) \ - $(wildcard third_party/mbedtls/include/*/*.*) +THIRD_PARTY_MBEDTLS_A_FILES := $(wildcard third_party/mbedtls/*) THIRD_PARTY_MBEDTLS_A_HDRS = $(filter %.h,$(THIRD_PARTY_MBEDTLS_A_FILES)) THIRD_PARTY_MBEDTLS_A_SRCS = $(filter %.c,$(THIRD_PARTY_MBEDTLS_A_FILES)) diff --git a/third_party/mbedtls/library/md.c b/third_party/mbedtls/md.c similarity index 97% rename from third_party/mbedtls/library/md.c rename to third_party/mbedtls/md.c index 0f6cced48..2cda888ee 100644 --- a/third_party/mbedtls/library/md.c +++ b/third_party/mbedtls/md.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /** * \file md.c * @@ -23,25 +28,25 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_MD_C) -#include "third_party/mbedtls/include/mbedtls/md.h" -#include "third_party/mbedtls/include/mbedtls/md_internal.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/md.h" +#include "third_party/mbedtls/md_internal.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/md2.h" -#include "third_party/mbedtls/include/mbedtls/md4.h" -#include "third_party/mbedtls/include/mbedtls/md5.h" -#include "third_party/mbedtls/include/mbedtls/ripemd160.h" -#include "third_party/mbedtls/include/mbedtls/sha1.h" -#include "third_party/mbedtls/include/mbedtls/sha256.h" -#include "third_party/mbedtls/include/mbedtls/sha512.h" +#include "third_party/mbedtls/md2.h" +#include "third_party/mbedtls/md4.h" +#include "third_party/mbedtls/md5.h" +#include "third_party/mbedtls/ripemd160.h" +#include "third_party/mbedtls/sha1.h" +#include "third_party/mbedtls/sha256.h" +#include "third_party/mbedtls/sha512.h" #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/include/mbedtls/md.h b/third_party/mbedtls/md.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/md.h rename to third_party/mbedtls/md.h index ce2cd28e8..049d7afd3 100644 --- a/third_party/mbedtls/include/mbedtls/md.h +++ b/third_party/mbedtls/md.h @@ -29,7 +29,7 @@ #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/md2.c b/third_party/mbedtls/md2.c similarity index 96% rename from third_party/mbedtls/library/md2.c rename to third_party/mbedtls/md2.c index be90e42c7..9fee5bc86 100644 --- a/third_party/mbedtls/library/md2.c +++ b/third_party/mbedtls/md2.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * RFC 1115/1319 compliant MD2 implementation * @@ -25,18 +30,18 @@ * http://www.ietf.org/rfc/rfc1319.txt */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_MD2_C) -#include "third_party/mbedtls/include/mbedtls/md2.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/md2.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/md2.h b/third_party/mbedtls/md2.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/md2.h rename to third_party/mbedtls/md2.h index 9f84f43d3..a9e539fb6 100644 --- a/third_party/mbedtls/include/mbedtls/md2.h +++ b/third_party/mbedtls/md2.h @@ -30,7 +30,7 @@ #define MBEDTLS_MD2_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -65,7 +65,7 @@ typedef struct mbedtls_md2_context mbedtls_md2_context; #else /* MBEDTLS_MD2_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/md2_alt.h" */ +/* #include "third_party/mbedtls/md2_alt.h" */ #endif /* MBEDTLS_MD2_ALT */ /** diff --git a/third_party/mbedtls/library/md4.c b/third_party/mbedtls/md4.c similarity index 97% rename from third_party/mbedtls/library/md4.c rename to third_party/mbedtls/md4.c index 54a38b78c..c78fb5d39 100644 --- a/third_party/mbedtls/library/md4.c +++ b/third_party/mbedtls/md4.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * RFC 1186/1320 compliant MD4 implementation * @@ -25,18 +30,18 @@ * http://www.ietf.org/rfc/rfc1320.txt */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_MD4_C) -#include "third_party/mbedtls/include/mbedtls/md4.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/md4.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/md4.h b/third_party/mbedtls/md4.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/md4.h rename to third_party/mbedtls/md4.h index aae4906ad..281141c27 100644 --- a/third_party/mbedtls/include/mbedtls/md4.h +++ b/third_party/mbedtls/md4.h @@ -30,7 +30,7 @@ #define MBEDTLS_MD4_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -64,7 +64,7 @@ typedef struct mbedtls_md4_context mbedtls_md4_context; #else /* MBEDTLS_MD4_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/md4_alt.h" */ +/* #include "third_party/mbedtls/md4_alt.h" */ #endif /* MBEDTLS_MD4_ALT */ /** diff --git a/third_party/mbedtls/library/md5.c b/third_party/mbedtls/md5.c similarity index 97% rename from third_party/mbedtls/library/md5.c rename to third_party/mbedtls/md5.c index a436bacee..50eb02324 100644 --- a/third_party/mbedtls/library/md5.c +++ b/third_party/mbedtls/md5.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * RFC 1321 compliant MD5 implementation * @@ -24,18 +29,18 @@ * http://www.ietf.org/rfc/rfc1321.txt */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_MD5_C) -#include "third_party/mbedtls/include/mbedtls/md5.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/md5.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/md5.h b/third_party/mbedtls/md5.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/md5.h rename to third_party/mbedtls/md5.h index 61e43501d..4bf57f337 100644 --- a/third_party/mbedtls/include/mbedtls/md5.h +++ b/third_party/mbedtls/md5.h @@ -29,7 +29,7 @@ #define MBEDTLS_MD5_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -63,7 +63,7 @@ typedef struct mbedtls_md5_context mbedtls_md5_context; #else /* MBEDTLS_MD5_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/md5_alt.h" */ +/* #include "third_party/mbedtls/md5_alt.h" */ #endif /* MBEDTLS_MD5_ALT */ /** diff --git a/third_party/mbedtls/include/mbedtls/md_internal.h b/third_party/mbedtls/md_internal.h similarity index 95% rename from third_party/mbedtls/include/mbedtls/md_internal.h rename to third_party/mbedtls/md_internal.h index adac3ab2c..2cc92246b 100644 --- a/third_party/mbedtls/include/mbedtls/md_internal.h +++ b/third_party/mbedtls/md_internal.h @@ -29,12 +29,12 @@ #define MBEDTLS_MD_WRAP_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/md.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/library/memory_buffer_alloc.c b/third_party/mbedtls/memory_buffer_alloc.c similarity index 98% rename from third_party/mbedtls/library/memory_buffer_alloc.c rename to third_party/mbedtls/memory_buffer_alloc.c index 243dfb72a..dd190e00a 100644 --- a/third_party/mbedtls/library/memory_buffer_alloc.c +++ b/third_party/mbedtls/memory_buffer_alloc.c @@ -19,18 +19,18 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) -#include "third_party/mbedtls/include/mbedtls/memory_buffer_alloc.h" +#include "third_party/mbedtls/memory_buffer_alloc.h" /* No need for the header guard as MBEDTLS_MEMORY_BUFFER_ALLOC_C is dependent upon MBEDTLS_PLATFORM_C */ -#include "third_party/mbedtls/include/mbedtls/platform.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif #define MAGIC1 0xFF00AA55 diff --git a/third_party/mbedtls/include/mbedtls/memory_buffer_alloc.h b/third_party/mbedtls/memory_buffer_alloc.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/memory_buffer_alloc.h rename to third_party/mbedtls/memory_buffer_alloc.h index eb193ac2c..1a6ac7a30 100644 --- a/third_party/mbedtls/include/mbedtls/memory_buffer_alloc.h +++ b/third_party/mbedtls/memory_buffer_alloc.h @@ -25,7 +25,7 @@ #define MBEDTLS_MEMORY_BUFFER_ALLOC_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/include/mbedtls/net.h b/third_party/mbedtls/net.h similarity index 90% rename from third_party/mbedtls/include/mbedtls/net.h rename to third_party/mbedtls/net.h index c5d9f9377..38564db97 100644 --- a/third_party/mbedtls/include/mbedtls/net.h +++ b/third_party/mbedtls/net.h @@ -24,13 +24,13 @@ * limitations under the License. */ #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if !defined(MBEDTLS_DEPRECATED_REMOVED) -#include "third_party/mbedtls/include/mbedtls/net_sockets.h" +#include "third_party/mbedtls/net_sockets.h" #if defined(MBEDTLS_DEPRECATED_WARNING) #warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" #endif /* MBEDTLS_DEPRECATED_WARNING */ diff --git a/third_party/mbedtls/library/net_sockets.c b/third_party/mbedtls/net_sockets.c similarity index 98% rename from third_party/mbedtls/library/net_sockets.c rename to third_party/mbedtls/net_sockets.c index 1842da94e..0907aa3f0 100644 --- a/third_party/mbedtls/library/net_sockets.c +++ b/third_party/mbedtls/net_sockets.c @@ -34,7 +34,7 @@ #include "libc/sysv/consts/so.h" #include "libc/sysv/consts/sock.h" #include "libc/sysv/consts/sol.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" /* clang-format off */ #if defined(MBEDTLS_NET_C) @@ -46,12 +46,12 @@ #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #endif -#include "third_party/mbedtls/include/mbedtls/net_sockets.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/net_sockets.h" +#include "third_party/mbedtls/error.h" #if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(EFIX64) && \ diff --git a/third_party/mbedtls/include/mbedtls/net_sockets.h b/third_party/mbedtls/net_sockets.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/net_sockets.h rename to third_party/mbedtls/net_sockets.h index d24a41b6f..9af47b956 100644 --- a/third_party/mbedtls/include/mbedtls/net_sockets.h +++ b/third_party/mbedtls/net_sockets.h @@ -41,12 +41,12 @@ #define MBEDTLS_NET_SOCKETS_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl.h" #define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */ diff --git a/third_party/mbedtls/library/nist_kw.c b/third_party/mbedtls/nist_kw.c similarity index 98% rename from third_party/mbedtls/library/nist_kw.c rename to third_party/mbedtls/nist_kw.c index 2364f2b52..88af68aa0 100644 --- a/third_party/mbedtls/library/nist_kw.c +++ b/third_party/mbedtls/nist_kw.c @@ -29,18 +29,18 @@ * the wrapping and unwrapping operation than the definition in NIST SP 800-38F. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_NIST_KW_C) -#include "third_party/mbedtls/include/mbedtls/nist_kw.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/nist_kw.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/nist_kw.h b/third_party/mbedtls/nist_kw.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/nist_kw.h rename to third_party/mbedtls/nist_kw.h index 50028b5bc..dab6351be 100644 --- a/third_party/mbedtls/include/mbedtls/nist_kw.h +++ b/third_party/mbedtls/nist_kw.h @@ -38,12 +38,12 @@ #define MBEDTLS_NIST_KW_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/cipher.h" #ifdef __cplusplus extern "C" { @@ -71,7 +71,7 @@ typedef struct { } mbedtls_nist_kw_context; #else /* MBEDTLS_NIST_key wrapping_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/nist_kw_alt.h" */ +/* #include "third_party/mbedtls/nist_kw_alt.h" */ #endif /* MBEDTLS_NIST_KW_ALT */ /** diff --git a/third_party/mbedtls/library/oid.c b/third_party/mbedtls/oid.c similarity index 99% rename from third_party/mbedtls/library/oid.c rename to third_party/mbedtls/oid.c index 7e7188d4c..61bc3a922 100644 --- a/third_party/mbedtls/library/oid.c +++ b/third_party/mbedtls/oid.c @@ -21,17 +21,17 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_OID_C) -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/rsa.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/rsa.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_snprintf snprintf #endif diff --git a/third_party/mbedtls/include/mbedtls/oid.h b/third_party/mbedtls/oid.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/oid.h rename to third_party/mbedtls/oid.h index 9e5eaff9e..439eb4478 100644 --- a/third_party/mbedtls/include/mbedtls/oid.h +++ b/third_party/mbedtls/oid.h @@ -25,21 +25,21 @@ #define MBEDTLS_OID_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/pk.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/pk.h" #if defined(MBEDTLS_CIPHER_C) -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/cipher.h" #endif #if defined(MBEDTLS_MD_C) -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/md.h" #endif #define MBEDTLS_ERR_OID_NOT_FOUND -0x002E /**< OID is not found. */ diff --git a/third_party/mbedtls/library/padlock.c b/third_party/mbedtls/padlock.c similarity index 97% rename from third_party/mbedtls/library/padlock.c rename to third_party/mbedtls/padlock.c index 628be4053..f389eb907 100644 --- a/third_party/mbedtls/library/padlock.c +++ b/third_party/mbedtls/padlock.c @@ -25,11 +25,11 @@ * programming_guide.pdf */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PADLOCK_C) -#include "third_party/mbedtls/include/mbedtls/padlock.h" +#include "third_party/mbedtls/padlock.h" #ifndef asm diff --git a/third_party/mbedtls/include/mbedtls/padlock.h b/third_party/mbedtls/padlock.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/padlock.h rename to third_party/mbedtls/padlock.h index c66cc9627..238a2365a 100644 --- a/third_party/mbedtls/include/mbedtls/padlock.h +++ b/third_party/mbedtls/padlock.h @@ -29,12 +29,12 @@ #define MBEDTLS_PADLOCK_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/aes.h" +#include "third_party/mbedtls/aes.h" #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ diff --git a/third_party/mbedtls/library/pem.c b/third_party/mbedtls/pem.c similarity index 96% rename from third_party/mbedtls/library/pem.c rename to third_party/mbedtls/pem.c index d12d2f111..1db11d5df 100644 --- a/third_party/mbedtls/library/pem.c +++ b/third_party/mbedtls/pem.c @@ -19,22 +19,22 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PEM_PARSE_C) || defined(MBEDTLS_PEM_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" -#include "third_party/mbedtls/include/mbedtls/base64.h" -#include "third_party/mbedtls/include/mbedtls/des.h" -#include "third_party/mbedtls/include/mbedtls/aes.h" -#include "third_party/mbedtls/include/mbedtls/md5.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/pem.h" +#include "third_party/mbedtls/base64.h" +#include "third_party/mbedtls/des.h" +#include "third_party/mbedtls/aes.h" +#include "third_party/mbedtls/md5.h" +#include "third_party/mbedtls/cipher.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/include/mbedtls/pem.h b/third_party/mbedtls/pem.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/pem.h rename to third_party/mbedtls/pem.h index bde6aa701..e17349909 100644 --- a/third_party/mbedtls/include/mbedtls/pem.h +++ b/third_party/mbedtls/pem.h @@ -25,7 +25,7 @@ #define MBEDTLS_PEM_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/pk.c b/third_party/mbedtls/pk.c similarity index 97% rename from third_party/mbedtls/library/pk.c rename to third_party/mbedtls/pk.c index 44cb5da99..417d86395 100644 --- a/third_party/mbedtls/library/pk.c +++ b/third_party/mbedtls/pk.c @@ -19,28 +19,28 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PK_C) -#include "third_party/mbedtls/include/psa/sheesh.h" -#include "third_party/mbedtls/include/mbedtls/pk.h" -#include "third_party/mbedtls/include/mbedtls/pk_internal.h" +#include "third_party/mbedtls/sheesh.h" +#include "third_party/mbedtls/pk.h" +#include "third_party/mbedtls/pk_internal.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_RSA_C) -#include "third_party/mbedtls/include/mbedtls/rsa.h" +#include "third_party/mbedtls/rsa.h" #endif #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" #endif #if defined(MBEDTLS_ECDSA_C) -#include "third_party/mbedtls/include/mbedtls/ecdsa.h" +#include "third_party/mbedtls/ecdsa.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/mbedtls/psa_util.h" +#include "third_party/mbedtls/psa_util.h" #endif /* Parameter validation macros based on platform_util.h */ diff --git a/third_party/mbedtls/include/mbedtls/pk.h b/third_party/mbedtls/pk.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/pk.h rename to third_party/mbedtls/pk.h index ee9d9175a..76b8734fe 100644 --- a/third_party/mbedtls/include/mbedtls/pk.h +++ b/third_party/mbedtls/pk.h @@ -26,27 +26,27 @@ #define MBEDTLS_PK_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/md.h" #if defined(MBEDTLS_RSA_C) -#include "third_party/mbedtls/include/mbedtls/rsa.h" +#include "third_party/mbedtls/rsa.h" #endif #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" #endif #if defined(MBEDTLS_ECDSA_C) -#include "third_party/mbedtls/include/mbedtls/ecdsa.h" +#include "third_party/mbedtls/ecdsa.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/crypto.h" #endif #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ diff --git a/third_party/mbedtls/include/mbedtls/pk_internal.h b/third_party/mbedtls/pk_internal.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/pk_internal.h rename to third_party/mbedtls/pk_internal.h index f933ce54d..57e246de9 100644 --- a/third_party/mbedtls/include/mbedtls/pk_internal.h +++ b/third_party/mbedtls/pk_internal.h @@ -26,12 +26,12 @@ #define MBEDTLS_PK_WRAP_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/pk.h" +#include "third_party/mbedtls/pk.h" struct mbedtls_pk_info_t { diff --git a/third_party/mbedtls/library/pk_wrap.c b/third_party/mbedtls/pk_wrap.c similarity index 97% rename from third_party/mbedtls/library/pk_wrap.c rename to third_party/mbedtls/pk_wrap.c index 263d362c2..2037aa8b6 100644 --- a/third_party/mbedtls/library/pk_wrap.c +++ b/third_party/mbedtls/pk_wrap.c @@ -19,41 +19,41 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" -#include "third_party/mbedtls/include/psa/sheesh.h" +#include "third_party/mbedtls/common.h" +#include "third_party/mbedtls/sheesh.h" #if defined(MBEDTLS_PK_C) -#include "third_party/mbedtls/include/mbedtls/pk_internal.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/pk_internal.h" +#include "third_party/mbedtls/error.h" /* Even if RSA not activated, for the sake of RSA-alt */ -#include "third_party/mbedtls/include/mbedtls/rsa.h" +#include "third_party/mbedtls/rsa.h" #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" #endif #if defined(MBEDTLS_ECDSA_C) -#include "third_party/mbedtls/include/mbedtls/ecdsa.h" +#include "third_party/mbedtls/ecdsa.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/mbedtls/asn1write.h" +#include "third_party/mbedtls/asn1write.h" #endif #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform_util.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/mbedtls/psa_util.h" -#include "third_party/mbedtls/include/mbedtls/asn1.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_util.h" +#include "third_party/mbedtls/asn1.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/pkcs11.c b/third_party/mbedtls/pkcs11.c similarity index 95% rename from third_party/mbedtls/library/pkcs11.c rename to third_party/mbedtls/pkcs11.c index 1f08006ea..959b73511 100644 --- a/third_party/mbedtls/library/pkcs11.c +++ b/third_party/mbedtls/pkcs11.c @@ -23,16 +23,16 @@ * limitations under the License. */ -#include "third_party/mbedtls/include/mbedtls/pkcs11.h" +#include "third_party/mbedtls/pkcs11.h" #if defined(MBEDTLS_PKCS11_C) -#include "third_party/mbedtls/include/mbedtls/md.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/x509_crt.h" +#include "third_party/mbedtls/md.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/x509_crt.h" #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/include/mbedtls/pkcs11.h b/third_party/mbedtls/pkcs11.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/pkcs11.h rename to third_party/mbedtls/pkcs11.h index dccca7e4a..75a140d73 100644 --- a/third_party/mbedtls/include/mbedtls/pkcs11.h +++ b/third_party/mbedtls/pkcs11.h @@ -27,14 +27,14 @@ #define MBEDTLS_PKCS11_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if defined(MBEDTLS_PKCS11_C) -#include "third_party/mbedtls/include/mbedtls/x509_crt.h" +#include "third_party/mbedtls/x509_crt.h" #include diff --git a/third_party/mbedtls/library/pkcs12.c b/third_party/mbedtls/pkcs12.c similarity index 96% rename from third_party/mbedtls/library/pkcs12.c rename to third_party/mbedtls/pkcs12.c index dcc92dda0..e028bf107 100644 --- a/third_party/mbedtls/library/pkcs12.c +++ b/third_party/mbedtls/pkcs12.c @@ -25,23 +25,23 @@ * ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12v1-1.asn */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PKCS12_C) -#include "third_party/mbedtls/include/mbedtls/pkcs12.h" -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/pkcs12.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/cipher.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_ARC4_C) -#include "third_party/mbedtls/include/mbedtls/arc4.h" +#include "third_party/mbedtls/arc4.h" #endif #if defined(MBEDTLS_DES_C) -#include "third_party/mbedtls/include/mbedtls/des.h" +#include "third_party/mbedtls/des.h" #endif #if defined(MBEDTLS_ASN1_PARSE_C) diff --git a/third_party/mbedtls/include/mbedtls/pkcs12.h b/third_party/mbedtls/pkcs12.h similarity index 95% rename from third_party/mbedtls/include/mbedtls/pkcs12.h rename to third_party/mbedtls/pkcs12.h index 149b881d5..170f5e87d 100644 --- a/third_party/mbedtls/include/mbedtls/pkcs12.h +++ b/third_party/mbedtls/pkcs12.h @@ -25,14 +25,14 @@ #define MBEDTLS_PKCS12_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/md.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" -#include "third_party/mbedtls/include/mbedtls/asn1.h" +#include "third_party/mbedtls/md.h" +#include "third_party/mbedtls/cipher.h" +#include "third_party/mbedtls/asn1.h" #define MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -0x1F80 /**< Bad input parameters to function. */ diff --git a/third_party/mbedtls/library/pkcs5.c b/third_party/mbedtls/pkcs5.c similarity index 96% rename from third_party/mbedtls/library/pkcs5.c rename to third_party/mbedtls/pkcs5.c index 2845ddb3c..f902a4e15 100644 --- a/third_party/mbedtls/library/pkcs5.c +++ b/third_party/mbedtls/pkcs5.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /** * \file pkcs5.c * @@ -29,22 +34,22 @@ * http://tools.ietf.org/html/rfc6070 (Test vectors) */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PKCS5_C) -#include "third_party/mbedtls/include/mbedtls/pkcs5.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/pkcs5.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_ASN1_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/cipher.h" +#include "third_party/mbedtls/oid.h" #endif /* MBEDTLS_ASN1_PARSE_C */ #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif diff --git a/third_party/mbedtls/include/mbedtls/pkcs5.h b/third_party/mbedtls/pkcs5.h similarity index 95% rename from third_party/mbedtls/include/mbedtls/pkcs5.h rename to third_party/mbedtls/pkcs5.h index 6da27d306..d6a17104d 100644 --- a/third_party/mbedtls/include/mbedtls/pkcs5.h +++ b/third_party/mbedtls/pkcs5.h @@ -27,13 +27,13 @@ #define MBEDTLS_PKCS5_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/md.h" #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */ diff --git a/third_party/mbedtls/library/pkparse.c b/third_party/mbedtls/pkparse.c similarity index 98% rename from third_party/mbedtls/library/pkparse.c rename to third_party/mbedtls/pkparse.c index 95addb282..1c5d55347 100644 --- a/third_party/mbedtls/library/pkparse.c +++ b/third_party/mbedtls/pkparse.c @@ -20,38 +20,38 @@ */ #include "libc/calls/calls.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PK_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/pk.h" -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/pk.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_RSA_C) -#include "third_party/mbedtls/include/mbedtls/rsa.h" +#include "third_party/mbedtls/rsa.h" #endif #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" #endif #if defined(MBEDTLS_ECDSA_C) -#include "third_party/mbedtls/include/mbedtls/ecdsa.h" +#include "third_party/mbedtls/ecdsa.h" #endif #if defined(MBEDTLS_PEM_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_PKCS5_C) -#include "third_party/mbedtls/include/mbedtls/pkcs5.h" +#include "third_party/mbedtls/pkcs5.h" #endif #if defined(MBEDTLS_PKCS12_C) -#include "third_party/mbedtls/include/mbedtls/pkcs12.h" +#include "third_party/mbedtls/pkcs12.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/pkwrite.c b/third_party/mbedtls/pkwrite.c similarity index 96% rename from third_party/mbedtls/library/pkwrite.c rename to third_party/mbedtls/pkwrite.c index 7433e0469..373c609a8 100644 --- a/third_party/mbedtls/library/pkwrite.c +++ b/third_party/mbedtls/pkwrite.c @@ -19,38 +19,38 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PK_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/pk.h" -#include "third_party/mbedtls/include/mbedtls/asn1write.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/pk.h" +#include "third_party/mbedtls/asn1write.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_RSA_C) -#include "third_party/mbedtls/include/mbedtls/rsa.h" +#include "third_party/mbedtls/rsa.h" #endif #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/bignum.h" -#include "third_party/mbedtls/include/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/bignum.h" +#include "third_party/mbedtls/ecp.h" +#include "third_party/mbedtls/platform_util.h" #endif #if defined(MBEDTLS_ECDSA_C) -#include "third_party/mbedtls/include/mbedtls/ecdsa.h" +#include "third_party/mbedtls/ecdsa.h" #endif #if defined(MBEDTLS_PEM_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/mbedtls/psa_util.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_util.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/platform.c b/third_party/mbedtls/platform.c similarity index 97% rename from third_party/mbedtls/library/platform.c rename to third_party/mbedtls/platform.c index 8607b325c..0366e0208 100644 --- a/third_party/mbedtls/library/platform.c +++ b/third_party/mbedtls/platform.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * Platform abstraction layer * @@ -19,13 +24,13 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/platform.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" /* The compile time configuration of memory allocation via the macros * MBEDTLS_PLATFORM_{FREE/CALLOC}_MACRO takes precedence over the runtime diff --git a/third_party/mbedtls/include/mbedtls/platform.h b/third_party/mbedtls/platform.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/platform.h rename to third_party/mbedtls/platform.h index 3f8a41222..3c6168573 100644 --- a/third_party/mbedtls/include/mbedtls/platform.h +++ b/third_party/mbedtls/platform.h @@ -35,13 +35,13 @@ #include "libc/stdio/stdio.h" #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if defined(MBEDTLS_HAVE_TIME) -#include "third_party/mbedtls/include/mbedtls/platform_time.h" +#include "third_party/mbedtls/platform_time.h" #endif #define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED -0x0070 /**< Hardware accelerator failed */ @@ -371,7 +371,7 @@ typedef struct mbedtls_platform_context mbedtls_platform_context; #else -/* #include "third_party/mbedtls/include/mbedtls/platform_alt.h" */ +/* #include "third_party/mbedtls/platform_alt.h" */ #endif /* !MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ /** diff --git a/third_party/mbedtls/include/mbedtls/platform_time.h b/third_party/mbedtls/platform_time.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/platform_time.h rename to third_party/mbedtls/platform_time.h index 7363d8ba3..b7dc9fa75 100644 --- a/third_party/mbedtls/include/mbedtls/platform_time.h +++ b/third_party/mbedtls/platform_time.h @@ -26,7 +26,7 @@ #include "libc/calls/weirdtypes.h" #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/platform_util.c b/third_party/mbedtls/platform_util.c similarity index 95% rename from third_party/mbedtls/library/platform_util.c rename to third_party/mbedtls/platform_util.c index 36e8dd8b8..f84fd1f04 100644 --- a/third_party/mbedtls/library/platform_util.c +++ b/third_party/mbedtls/platform_util.c @@ -31,11 +31,11 @@ #include "libc/time/time.h" #include "libc/time/struct/tm.h" #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform.h" +#include "third_party/mbedtls/threading.h" #if !defined(MBEDTLS_PLATFORM_ZEROIZE_ALT) diff --git a/third_party/mbedtls/include/mbedtls/platform_util.h b/third_party/mbedtls/platform_util.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/platform_util.h rename to third_party/mbedtls/platform_util.h index 4992cb434..4e688b325 100644 --- a/third_party/mbedtls/include/mbedtls/platform_util.h +++ b/third_party/mbedtls/platform_util.h @@ -26,13 +26,13 @@ #define MBEDTLS_PLATFORM_UTIL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if defined(MBEDTLS_HAVE_TIME_DATE) -#include "third_party/mbedtls/include/mbedtls/platform_time.h" +#include "third_party/mbedtls/platform_time.h" #endif /* MBEDTLS_HAVE_TIME_DATE */ #ifdef __cplusplus diff --git a/third_party/mbedtls/library/poly1305.c b/third_party/mbedtls/poly1305.c similarity index 98% rename from third_party/mbedtls/library/poly1305.c rename to third_party/mbedtls/poly1305.c index 8b05bdc89..d51279a53 100644 --- a/third_party/mbedtls/library/poly1305.c +++ b/third_party/mbedtls/poly1305.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /** * \file poly1305.c * @@ -21,18 +26,18 @@ * limitations under the License. */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_POLY1305_C) -#include "third_party/mbedtls/include/mbedtls/poly1305.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/poly1305.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/poly1305.h b/third_party/mbedtls/poly1305.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/poly1305.h rename to third_party/mbedtls/poly1305.h index 20a823944..ecc922439 100644 --- a/third_party/mbedtls/include/mbedtls/poly1305.h +++ b/third_party/mbedtls/poly1305.h @@ -35,7 +35,7 @@ #define MBEDTLS_POLY1305_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -68,7 +68,7 @@ typedef struct mbedtls_poly1305_context mbedtls_poly1305_context; #else /* MBEDTLS_POLY1305_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/poly1305_alt.h" */ +/* #include "third_party/mbedtls/poly1305_alt.h" */ #endif /* MBEDTLS_POLY1305_ALT */ /** diff --git a/third_party/mbedtls/library/psa_crypto.c b/third_party/mbedtls/psa_crypto.c similarity index 98% rename from third_party/mbedtls/library/psa_crypto.c rename to third_party/mbedtls/psa_crypto.c index 4d304af7f..465444a32 100644 --- a/third_party/mbedtls/library/psa_crypto.c +++ b/third_party/mbedtls/psa_crypto.c @@ -20,72 +20,72 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PSA_CRYPTO_C) #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -#include "third_party/mbedtls/library/check_crypto_config.h" +#include "third_party/mbedtls/check_crypto_config.h" #endif -#include "third_party/mbedtls/library/psa_crypto_service_integration.h" -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/psa_crypto_service_integration.h" +#include "third_party/mbedtls/crypto.h" -#include "third_party/mbedtls/library/psa_crypto_core.h" -#include "third_party/mbedtls/library/psa_crypto_invasive.h" -#include "third_party/mbedtls/library/psa_crypto_driver_wrappers.h" -#include "third_party/mbedtls/library/psa_crypto_ecp.h" -#include "third_party/mbedtls/library/psa_crypto_rsa.h" -#include "third_party/mbedtls/library/psa_crypto_ecp.h" +#include "third_party/mbedtls/psa_crypto_core.h" +#include "third_party/mbedtls/psa_crypto_invasive.h" +#include "third_party/mbedtls/psa_crypto_driver_wrappers.h" +#include "third_party/mbedtls/psa_crypto_ecp.h" +#include "third_party/mbedtls/psa_crypto_rsa.h" +#include "third_party/mbedtls/psa_crypto_ecp.h" #if defined(MBEDTLS_PSA_CRYPTO_SE_C) -#include "third_party/mbedtls/library/psa_crypto_se.h" +#include "third_party/mbedtls/psa_crypto_se.h" #endif -#include "third_party/mbedtls/library/psa_crypto_slot_management.h" +#include "third_party/mbedtls/psa_crypto_slot_management.h" /* Include internal declarations that are useful for implementing persistently * stored keys. */ -#include "third_party/mbedtls/library/psa_crypto_storage.h" +#include "third_party/mbedtls/psa_crypto_storage.h" -#include "third_party/mbedtls/library/psa_crypto_random_impl.h" +#include "third_party/mbedtls/psa_crypto_random_impl.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #if !defined(MBEDTLS_PLATFORM_C) #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/aes.h" -#include "third_party/mbedtls/include/mbedtls/arc4.h" -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/asn1write.h" -#include "third_party/mbedtls/include/mbedtls/bignum.h" -#include "third_party/mbedtls/include/mbedtls/blowfish.h" -#include "third_party/mbedtls/include/mbedtls/camellia.h" -#include "third_party/mbedtls/include/mbedtls/chacha20.h" -#include "third_party/mbedtls/include/mbedtls/chachapoly.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" -#include "third_party/mbedtls/include/mbedtls/ccm.h" -#include "third_party/mbedtls/include/mbedtls/cmac.h" -#include "third_party/mbedtls/include/mbedtls/des.h" -#include "third_party/mbedtls/include/mbedtls/ecdh.h" -#include "third_party/mbedtls/include/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/entropy.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/gcm.h" -#include "third_party/mbedtls/include/mbedtls/md2.h" -#include "third_party/mbedtls/include/mbedtls/md4.h" -#include "third_party/mbedtls/include/mbedtls/md5.h" -#include "third_party/mbedtls/include/mbedtls/md.h" -#include "third_party/mbedtls/include/mbedtls/md_internal.h" -#include "third_party/mbedtls/include/mbedtls/pk.h" -#include "third_party/mbedtls/include/mbedtls/pk_internal.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/ripemd160.h" -#include "third_party/mbedtls/include/mbedtls/rsa.h" -#include "third_party/mbedtls/include/mbedtls/sha1.h" -#include "third_party/mbedtls/include/mbedtls/sha256.h" -#include "third_party/mbedtls/include/mbedtls/sha512.h" -#include "third_party/mbedtls/include/mbedtls/xtea.h" +#include "third_party/mbedtls/aes.h" +#include "third_party/mbedtls/arc4.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/asn1write.h" +#include "third_party/mbedtls/bignum.h" +#include "third_party/mbedtls/blowfish.h" +#include "third_party/mbedtls/camellia.h" +#include "third_party/mbedtls/chacha20.h" +#include "third_party/mbedtls/chachapoly.h" +#include "third_party/mbedtls/cipher.h" +#include "third_party/mbedtls/ccm.h" +#include "third_party/mbedtls/cmac.h" +#include "third_party/mbedtls/des.h" +#include "third_party/mbedtls/ecdh.h" +#include "third_party/mbedtls/ecp.h" +#include "third_party/mbedtls/entropy.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/gcm.h" +#include "third_party/mbedtls/md2.h" +#include "third_party/mbedtls/md4.h" +#include "third_party/mbedtls/md5.h" +#include "third_party/mbedtls/md.h" +#include "third_party/mbedtls/md_internal.h" +#include "third_party/mbedtls/pk.h" +#include "third_party/mbedtls/pk_internal.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/ripemd160.h" +#include "third_party/mbedtls/rsa.h" +#include "third_party/mbedtls/sha1.h" +#include "third_party/mbedtls/sha256.h" +#include "third_party/mbedtls/sha512.h" +#include "third_party/mbedtls/xtea.h" #define ARRAY_LENGTH( array ) ( sizeof( array ) / sizeof( *( array ) ) ) @@ -5861,7 +5861,7 @@ int mbedtls_psa_get_random( void *p_rng, #endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ #if defined(MBEDTLS_PSA_INJECT_ENTROPY) -#include "third_party/mbedtls/include/mbedtls/entropy_poll.h" +#include "third_party/mbedtls/entropy_poll.h" psa_status_t mbedtls_psa_inject_entropy( const uint8_t *seed, size_t seed_size ) diff --git a/third_party/mbedtls/library/psa_crypto_client.c b/third_party/mbedtls/psa_crypto_client.c similarity index 91% rename from third_party/mbedtls/library/psa_crypto_client.c rename to third_party/mbedtls/psa_crypto_client.c index 1e81626db..55e875508 100644 --- a/third_party/mbedtls/library/psa_crypto_client.c +++ b/third_party/mbedtls/psa_crypto_client.c @@ -20,13 +20,13 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" -#include "third_party/mbedtls/library/psa_crypto_service_integration.h" -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/common.h" +#include "third_party/mbedtls/psa_crypto_service_integration.h" +#include "third_party/mbedtls/crypto.h" #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #if !defined(MBEDTLS_PLATFORM_C) #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/psa_crypto_core.h b/third_party/mbedtls/psa_crypto_core.h similarity index 98% rename from third_party/mbedtls/library/psa_crypto_core.h rename to third_party/mbedtls/psa_crypto_core.h index cca895ec4..94ab6e306 100644 --- a/third_party/mbedtls/library/psa_crypto_core.h +++ b/third_party/mbedtls/psa_crypto_core.h @@ -24,15 +24,15 @@ #define PSA_CRYPTO_CORE_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/psa/crypto_se_driver.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/crypto_se_driver.h" -#include "third_party/mbedtls/include/mbedtls/md_internal.h" +#include "third_party/mbedtls/md_internal.h" /** The data structure representing a key slot, containing key material * and metadata for one key. diff --git a/third_party/mbedtls/library/psa_crypto_driver_wrappers.c b/third_party/mbedtls/psa_crypto_driver_wrappers.c similarity index 99% rename from third_party/mbedtls/library/psa_crypto_driver_wrappers.c rename to third_party/mbedtls/psa_crypto_driver_wrappers.c index aa44e9b32..66b46ed52 100644 --- a/third_party/mbedtls/library/psa_crypto_driver_wrappers.c +++ b/third_party/mbedtls/psa_crypto_driver_wrappers.c @@ -21,9 +21,9 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/psa_crypto_core.h" -#include "third_party/mbedtls/library/psa_crypto_driver_wrappers.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/psa_crypto_core.h" +#include "third_party/mbedtls/psa_crypto_driver_wrappers.h" +#include "third_party/mbedtls/platform.h" #if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) @@ -55,7 +55,7 @@ #ifndef PSA_CRYPTO_DRIVER_PRESENT #define PSA_CRYPTO_DRIVER_PRESENT #endif -#include "third_party/mbedtls/library/psa_crypto_se.h" +#include "third_party/mbedtls/psa_crypto_se.h" #endif /* Start delegation functions */ diff --git a/third_party/mbedtls/library/psa_crypto_driver_wrappers.h b/third_party/mbedtls/psa_crypto_driver_wrappers.h similarity index 95% rename from third_party/mbedtls/library/psa_crypto_driver_wrappers.h rename to third_party/mbedtls/psa_crypto_driver_wrappers.h index 334e28678..2da32f094 100644 --- a/third_party/mbedtls/library/psa_crypto_driver_wrappers.h +++ b/third_party/mbedtls/psa_crypto_driver_wrappers.h @@ -24,9 +24,9 @@ #ifndef PSA_CRYPTO_DRIVER_WRAPPERS_H #define PSA_CRYPTO_DRIVER_WRAPPERS_H -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/library/psa_crypto_core.h" -#include "third_party/mbedtls/include/psa/crypto_driver_common.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_crypto_core.h" +#include "third_party/mbedtls/crypto_driver_common.h" /* * Signature functions diff --git a/third_party/mbedtls/library/psa_crypto_ecp.c b/third_party/mbedtls/psa_crypto_ecp.c similarity index 97% rename from third_party/mbedtls/library/psa_crypto_ecp.c rename to third_party/mbedtls/psa_crypto_ecp.c index 58e95b54f..b69b39d18 100644 --- a/third_party/mbedtls/library/psa_crypto_ecp.c +++ b/third_party/mbedtls/psa_crypto_ecp.c @@ -20,24 +20,24 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PSA_CRYPTO_C) -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/library/psa_crypto_core.h" -#include "third_party/mbedtls/library/psa_crypto_ecp.h" -#include "third_party/mbedtls/library/psa_crypto_random_impl.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_crypto_core.h" +#include "third_party/mbedtls/psa_crypto_ecp.h" +#include "third_party/mbedtls/psa_crypto_random_impl.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #if !defined(MBEDTLS_PLATFORM_C) #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/ecdsa.h" -#include "third_party/mbedtls/include/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/ecdsa.h" +#include "third_party/mbedtls/ecp.h" +#include "third_party/mbedtls/error.h" #if ( defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR) || \ ( defined(PSA_CRYPTO_DRIVER_TEST) && \ diff --git a/third_party/mbedtls/library/psa_crypto_ecp.h b/third_party/mbedtls/psa_crypto_ecp.h similarity index 99% rename from third_party/mbedtls/library/psa_crypto_ecp.h rename to third_party/mbedtls/psa_crypto_ecp.h index 2d39daa34..57310510b 100644 --- a/third_party/mbedtls/library/psa_crypto_ecp.h +++ b/third_party/mbedtls/psa_crypto_ecp.h @@ -23,8 +23,8 @@ #ifndef PSA_CRYPTO_ECP_H #define PSA_CRYPTO_ECP_H -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/ecp.h" /** Load the contents of a key buffer into an internal ECP representation * diff --git a/third_party/mbedtls/library/psa_crypto_invasive.h b/third_party/mbedtls/psa_crypto_invasive.h similarity index 93% rename from third_party/mbedtls/library/psa_crypto_invasive.h rename to third_party/mbedtls/psa_crypto_invasive.h index 128e0c52b..2f1164b26 100644 --- a/third_party/mbedtls/library/psa_crypto_invasive.h +++ b/third_party/mbedtls/psa_crypto_invasive.h @@ -33,13 +33,13 @@ #if defined(MBEDTLS_CONFIG_FILE) #include MBEDTLS_CONFIG_FILE #else -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #endif -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/common.h" -#include "third_party/mbedtls/include/mbedtls/entropy.h" +#include "third_party/mbedtls/entropy.h" #if !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) /** \brief Configure entropy sources. diff --git a/third_party/mbedtls/library/psa_crypto_its.h b/third_party/mbedtls/psa_crypto_its.h similarity index 98% rename from third_party/mbedtls/library/psa_crypto_its.h rename to third_party/mbedtls/psa_crypto_its.h index d08499def..0e9c2ac40 100644 --- a/third_party/mbedtls/library/psa_crypto_its.h +++ b/third_party/mbedtls/psa_crypto_its.h @@ -24,8 +24,8 @@ #define PSA_CRYPTO_ITS_H -#include "third_party/mbedtls/include/psa/crypto_types.h" -#include "third_party/mbedtls/include/psa/crypto_values.h" +#include "third_party/mbedtls/crypto_types.h" +#include "third_party/mbedtls/crypto_values.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/library/psa_crypto_random_impl.h b/third_party/mbedtls/psa_crypto_random_impl.h similarity index 93% rename from third_party/mbedtls/library/psa_crypto_random_impl.h rename to third_party/mbedtls/psa_crypto_random_impl.h index d462f6ec2..b6b0fb378 100644 --- a/third_party/mbedtls/library/psa_crypto_random_impl.h +++ b/third_party/mbedtls/psa_crypto_random_impl.h @@ -32,12 +32,12 @@ #ifndef PSA_CRYPTO_RANDOM_IMPL_H #define PSA_CRYPTO_RANDOM_IMPL_H -#include "third_party/mbedtls/include/mbedtls/psa_util.h" +#include "third_party/mbedtls/psa_util.h" #if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) -#include "third_party/mbedtls/include/mbedtls/entropy.h" // only for error code -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/entropy.h" // only for error code +#include "third_party/mbedtls/crypto.h" typedef mbedtls_psa_external_random_context_t mbedtls_psa_random_context_t; @@ -54,15 +54,15 @@ int mbedtls_psa_get_random( void *p_rng, /* Choose a DRBG based on configuration and availability */ #if defined(MBEDTLS_PSA_HMAC_DRBG_MD_TYPE) -#include "third_party/mbedtls/include/mbedtls/hmac_drbg.h" +#include "third_party/mbedtls/hmac_drbg.h" #elif defined(MBEDTLS_CTR_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/ctr_drbg.h" +#include "third_party/mbedtls/ctr_drbg.h" #elif defined(MBEDTLS_HMAC_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/hmac_drbg.h" +#include "third_party/mbedtls/hmac_drbg.h" #if defined(MBEDTLS_SHA512_C) && defined(MBEDTLS_SHA256_C) #if SIZE_MAX > 0xffffffff /* Looks like a 64-bit system, so prefer SHA-512. */ @@ -83,7 +83,7 @@ int mbedtls_psa_get_random( void *p_rng, #error "No DRBG module available for the psa_crypto module." #endif -#include "third_party/mbedtls/include/mbedtls/entropy.h" +#include "third_party/mbedtls/entropy.h" /** Initialize the PSA DRBG. * diff --git a/third_party/mbedtls/library/psa_crypto_rsa.c b/third_party/mbedtls/psa_crypto_rsa.c similarity index 97% rename from third_party/mbedtls/library/psa_crypto_rsa.c rename to third_party/mbedtls/psa_crypto_rsa.c index 21dee0332..f6cb3bf24 100644 --- a/third_party/mbedtls/library/psa_crypto_rsa.c +++ b/third_party/mbedtls/psa_crypto_rsa.c @@ -21,25 +21,25 @@ */ #include "libc/limits.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PSA_CRYPTO_C) -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/library/psa_crypto_core.h" -#include "third_party/mbedtls/library/psa_crypto_random_impl.h" -#include "third_party/mbedtls/library/psa_crypto_rsa.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_crypto_core.h" +#include "third_party/mbedtls/psa_crypto_random_impl.h" +#include "third_party/mbedtls/psa_crypto_rsa.h" -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #if !defined(MBEDTLS_PLATFORM_C) #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/rsa.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/pk.h" -#include "third_party/mbedtls/include/mbedtls/pk_internal.h" +#include "third_party/mbedtls/rsa.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/pk.h" +#include "third_party/mbedtls/pk_internal.h" #if ( defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR) || \ ( defined(PSA_CRYPTO_DRIVER_TEST) && \ diff --git a/third_party/mbedtls/library/psa_crypto_rsa.h b/third_party/mbedtls/psa_crypto_rsa.h similarity index 99% rename from third_party/mbedtls/library/psa_crypto_rsa.h rename to third_party/mbedtls/psa_crypto_rsa.h index e5f1ab607..0ea6ebf1a 100644 --- a/third_party/mbedtls/library/psa_crypto_rsa.h +++ b/third_party/mbedtls/psa_crypto_rsa.h @@ -23,8 +23,8 @@ #ifndef PSA_CRYPTO_RSA_H #define PSA_CRYPTO_RSA_H -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/mbedtls/rsa.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/rsa.h" /** Load the contents of a key buffer into an internal RSA representation * diff --git a/third_party/mbedtls/library/psa_crypto_se.c b/third_party/mbedtls/psa_crypto_se.c similarity index 96% rename from third_party/mbedtls/library/psa_crypto_se.c rename to third_party/mbedtls/psa_crypto_se.c index 54e4b0016..e097a3596 100644 --- a/third_party/mbedtls/library/psa_crypto_se.c +++ b/third_party/mbedtls/psa_crypto_se.c @@ -20,23 +20,23 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PSA_CRYPTO_SE_C) -#include "third_party/mbedtls/include/psa/crypto_se_driver.h" +#include "third_party/mbedtls/crypto_se_driver.h" -#include "third_party/mbedtls/library/psa_crypto_se.h" +#include "third_party/mbedtls/psa_crypto_se.h" #if defined(MBEDTLS_PSA_ITS_FILE_C) -#include "third_party/mbedtls/library/psa_crypto_its.h" +#include "third_party/mbedtls/psa_crypto_its.h" #else /* Native ITS implementation */ -#include "third_party/mbedtls/include/mbedtls/error.h" -/* #include "third_party/mbedtls/include/psa/internal_trusted_storage.h" */ +#include "third_party/mbedtls/error.h" +/* #include "third_party/mbedtls/internal_trusted_storage.h" */ #endif -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #if !defined(MBEDTLS_PLATFORM_C) #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/psa_crypto_se.h b/third_party/mbedtls/psa_crypto_se.h similarity index 97% rename from third_party/mbedtls/library/psa_crypto_se.h rename to third_party/mbedtls/psa_crypto_se.h index a2f5c6c12..7542767d1 100644 --- a/third_party/mbedtls/library/psa_crypto_se.h +++ b/third_party/mbedtls/psa_crypto_se.h @@ -24,13 +24,13 @@ #define PSA_CRYPTO_SE_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/psa/crypto_se_driver.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/crypto_se_driver.h" /** The maximum location value that this implementation supports * for a secure element. diff --git a/third_party/mbedtls/library/psa_crypto_service_integration.h b/third_party/mbedtls/psa_crypto_service_integration.h similarity index 95% rename from third_party/mbedtls/library/psa_crypto_service_integration.h rename to third_party/mbedtls/psa_crypto_service_integration.h index 5585f758e..32eda2b72 100644 --- a/third_party/mbedtls/library/psa_crypto_service_integration.h +++ b/third_party/mbedtls/psa_crypto_service_integration.h @@ -35,7 +35,7 @@ * flag. */ #define PSA_CRYPTO_SECURE 1 -/* #include "third_party/mbedtls/include/mbedtls/crypto_spe.h" */ +/* #include "third_party/mbedtls/crypto_spe.h" */ #endif // MBEDTLS_PSA_CRYPTO_SPM #endif // PSA_CRYPTO_SERVICE_INTEGRATION_H diff --git a/third_party/mbedtls/library/psa_crypto_slot_management.c b/third_party/mbedtls/psa_crypto_slot_management.c similarity index 96% rename from third_party/mbedtls/library/psa_crypto_slot_management.c rename to third_party/mbedtls/psa_crypto_slot_management.c index 187e9a579..9cdf788e0 100644 --- a/third_party/mbedtls/library/psa_crypto_slot_management.c +++ b/third_party/mbedtls/psa_crypto_slot_management.c @@ -20,22 +20,22 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_PSA_CRYPTO_C) -#include "third_party/mbedtls/library/psa_crypto_service_integration.h" -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/psa_crypto_service_integration.h" +#include "third_party/mbedtls/crypto.h" -#include "third_party/mbedtls/library/psa_crypto_core.h" -#include "third_party/mbedtls/library/psa_crypto_slot_management.h" -#include "third_party/mbedtls/library/psa_crypto_storage.h" +#include "third_party/mbedtls/psa_crypto_core.h" +#include "third_party/mbedtls/psa_crypto_slot_management.h" +#include "third_party/mbedtls/psa_crypto_storage.h" #if defined(MBEDTLS_PSA_CRYPTO_SE_C) -#include "third_party/mbedtls/library/psa_crypto_se.h" +#include "third_party/mbedtls/psa_crypto_se.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/psa_crypto_slot_management.h b/third_party/mbedtls/psa_crypto_slot_management.h similarity index 98% rename from third_party/mbedtls/library/psa_crypto_slot_management.h rename to third_party/mbedtls/psa_crypto_slot_management.h index c8fbe797d..eab95e569 100644 --- a/third_party/mbedtls/library/psa_crypto_slot_management.h +++ b/third_party/mbedtls/psa_crypto_slot_management.h @@ -23,10 +23,10 @@ #ifndef PSA_CRYPTO_SLOT_MANAGEMENT_H #define PSA_CRYPTO_SLOT_MANAGEMENT_H -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/library/psa_crypto_core.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_crypto_core.h" #include "libc/limits.h" -#include "third_party/mbedtls/library/psa_crypto_se.h" +#include "third_party/mbedtls/psa_crypto_se.h" /** Range of volatile key identifiers. * diff --git a/third_party/mbedtls/library/psa_crypto_storage.c b/third_party/mbedtls/psa_crypto_storage.c similarity index 97% rename from third_party/mbedtls/library/psa_crypto_storage.c rename to third_party/mbedtls/psa_crypto_storage.c index be3af1bbe..e5d2c5f24 100644 --- a/third_party/mbedtls/library/psa_crypto_storage.c +++ b/third_party/mbedtls/psa_crypto_storage.c @@ -23,26 +23,26 @@ #if defined(MBEDTLS_CONFIG_FILE) #include MBEDTLS_CONFIG_FILE #else -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #endif #if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) -#include "third_party/mbedtls/library/psa_crypto_service_integration.h" -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/library/psa_crypto_storage.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/psa_crypto_service_integration.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_crypto_storage.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_PSA_ITS_FILE_C) -#include "third_party/mbedtls/library/psa_crypto_its.h" +#include "third_party/mbedtls/psa_crypto_its.h" #else /* Native ITS implementation */ -#include "third_party/mbedtls/include/mbedtls/error.h" -/* #include "third_party/mbedtls/include/psa/internal_trusted_storage.h" */ +#include "third_party/mbedtls/error.h" +/* #include "third_party/mbedtls/internal_trusted_storage.h" */ #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/psa_crypto_storage.h b/third_party/mbedtls/psa_crypto_storage.h similarity index 99% rename from third_party/mbedtls/library/psa_crypto_storage.h rename to third_party/mbedtls/psa_crypto_storage.h index 53f0e2385..d38e16e97 100644 --- a/third_party/mbedtls/library/psa_crypto_storage.h +++ b/third_party/mbedtls/psa_crypto_storage.h @@ -29,8 +29,8 @@ extern "C" { #endif -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/psa/crypto_se_driver.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/crypto_se_driver.h" /* Limit the maximum key size in storage. This should have no effect diff --git a/third_party/mbedtls/library/psa_its_file.c b/third_party/mbedtls/psa_its_file.c similarity index 97% rename from third_party/mbedtls/library/psa_its_file.c rename to third_party/mbedtls/psa_its_file.c index 8a5691b82..5fe5d2cbe 100644 --- a/third_party/mbedtls/library/psa_its_file.c +++ b/third_party/mbedtls/psa_its_file.c @@ -25,13 +25,13 @@ #else #include "libc/limits.h" #include "libc/calls/calls.h" -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #endif #if defined(MBEDTLS_PSA_ITS_FILE_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_snprintf snprintf #endif @@ -39,7 +39,7 @@ #if defined(_WIN32) #endif -#include "third_party/mbedtls/library/psa_crypto_its.h" +#include "third_party/mbedtls/psa_crypto_its.h" #if !defined(PSA_ITS_STORAGE_PREFIX) diff --git a/third_party/mbedtls/include/mbedtls/psa_util.h b/third_party/mbedtls/psa_util.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/psa_util.h rename to third_party/mbedtls/psa_util.h index 2aed9485e..e98d0798e 100644 --- a/third_party/mbedtls/include/mbedtls/psa_util.h +++ b/third_party/mbedtls/psa_util.h @@ -29,19 +29,19 @@ #define MBEDTLS_PSA_UTIL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/crypto.h" -#include "third_party/mbedtls/include/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/md.h" -#include "third_party/mbedtls/include/mbedtls/pk.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" +#include "third_party/mbedtls/ecp.h" +#include "third_party/mbedtls/md.h" +#include "third_party/mbedtls/pk.h" +#include "third_party/mbedtls/oid.h" /* Translations for symmetric crypto. */ @@ -489,11 +489,11 @@ int mbedtls_psa_get_random( void *p_rng, #else /* !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) */ #if defined(MBEDTLS_CTR_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/ctr_drbg.h" +#include "third_party/mbedtls/ctr_drbg.h" typedef mbedtls_ctr_drbg_context mbedtls_psa_drbg_context_t; static mbedtls_f_rng_t *const mbedtls_psa_get_random = mbedtls_ctr_drbg_random; #elif defined(MBEDTLS_HMAC_DRBG_C) -#include "third_party/mbedtls/include/mbedtls/hmac_drbg.h" +#include "third_party/mbedtls/hmac_drbg.h" typedef mbedtls_hmac_drbg_context mbedtls_psa_drbg_context_t; static mbedtls_f_rng_t *const mbedtls_psa_get_random = mbedtls_hmac_drbg_random; #endif diff --git a/third_party/mbedtls/library/rando.c b/third_party/mbedtls/rando.c similarity index 97% rename from third_party/mbedtls/library/rando.c rename to third_party/mbedtls/rando.c index 9340c691f..6984eb161 100644 --- a/third_party/mbedtls/library/rando.c +++ b/third_party/mbedtls/rando.c @@ -17,7 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/rand/rand.h" -#include "third_party/mbedtls/include/mbedtls/entropy_poll.h" +#include "third_party/mbedtls/entropy_poll.h" int mbedtls_hardware_poll(void *wut, unsigned char *p, size_t n, size_t *olen) { uint64_t x; diff --git a/third_party/mbedtls/library/ripemd160.c b/third_party/mbedtls/ripemd160.c similarity index 98% rename from third_party/mbedtls/library/ripemd160.c rename to third_party/mbedtls/ripemd160.c index 425098163..fcd172f46 100644 --- a/third_party/mbedtls/library/ripemd160.c +++ b/third_party/mbedtls/ripemd160.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * RIPE MD-160 implementation * @@ -25,18 +30,18 @@ * http://ehash.iaik.tugraz.at/wiki/RIPEMD-160 */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_RIPEMD160_C) -#include "third_party/mbedtls/include/mbedtls/ripemd160.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/ripemd160.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/ripemd160.h b/third_party/mbedtls/ripemd160.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/ripemd160.h rename to third_party/mbedtls/ripemd160.h index e04190843..b0b459a6b 100644 --- a/third_party/mbedtls/include/mbedtls/ripemd160.h +++ b/third_party/mbedtls/ripemd160.h @@ -25,7 +25,7 @@ #define MBEDTLS_RIPEMD160_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -55,7 +55,7 @@ typedef struct mbedtls_ripemd160_context mbedtls_ripemd160_context; #else /* MBEDTLS_RIPEMD160_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/ripemd160_alt.h" */ +/* #include "third_party/mbedtls/ripemd160_alt.h" */ #endif /* MBEDTLS_RIPEMD160_ALT */ /** diff --git a/third_party/mbedtls/library/rsa.c b/third_party/mbedtls/rsa.c similarity index 99% rename from third_party/mbedtls/library/rsa.c rename to third_party/mbedtls/rsa.c index bedb63d76..49f517557 100644 --- a/third_party/mbedtls/library/rsa.c +++ b/third_party/mbedtls/rsa.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * The RSA public-key cryptosystem * @@ -38,26 +43,26 @@ */ #include "libc/rand/rand.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_RSA_C) -#include "third_party/mbedtls/include/mbedtls/rsa.h" -#include "third_party/mbedtls/include/mbedtls/rsa_internal.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/rsa.h" +#include "third_party/mbedtls/rsa_internal.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_PKCS1_V21) -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/md.h" #endif #if defined(MBEDTLS_PKCS1_V15) && !defined(__OpenBSD__) && !defined(__NetBSD__) #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #define mbedtls_calloc calloc @@ -2560,7 +2565,7 @@ void mbedtls_rsa_free( mbedtls_rsa_context *ctx ) #if defined(MBEDTLS_SELF_TEST) -#include "third_party/mbedtls/include/mbedtls/sha1.h" +#include "third_party/mbedtls/sha1.h" /* * Example RSA-1024 keypair, for test purposes diff --git a/third_party/mbedtls/include/mbedtls/rsa.h b/third_party/mbedtls/rsa.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/rsa.h rename to third_party/mbedtls/rsa.h index 308f81259..2ee79fa86 100644 --- a/third_party/mbedtls/include/mbedtls/rsa.h +++ b/third_party/mbedtls/rsa.h @@ -31,16 +31,16 @@ #define MBEDTLS_RSA_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/bignum.h" -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/bignum.h" +#include "third_party/mbedtls/md.h" #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif /* @@ -139,7 +139,7 @@ typedef struct mbedtls_rsa_context mbedtls_rsa_context; #else /* MBEDTLS_RSA_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/rsa_alt.h" */ +/* #include "third_party/mbedtls/rsa_alt.h" */ #endif /* MBEDTLS_RSA_ALT */ /** diff --git a/third_party/mbedtls/library/rsa_internal.c b/third_party/mbedtls/rsa_internal.c similarity index 98% rename from third_party/mbedtls/library/rsa_internal.c rename to third_party/mbedtls/rsa_internal.c index de02e9ae7..5d46455b7 100644 --- a/third_party/mbedtls/library/rsa_internal.c +++ b/third_party/mbedtls/rsa_internal.c @@ -20,13 +20,13 @@ * */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_RSA_C) -#include "third_party/mbedtls/include/mbedtls/rsa.h" -#include "third_party/mbedtls/include/mbedtls/bignum.h" -#include "third_party/mbedtls/include/mbedtls/rsa_internal.h" +#include "third_party/mbedtls/rsa.h" +#include "third_party/mbedtls/bignum.h" +#include "third_party/mbedtls/rsa_internal.h" /* * Compute RSA prime factors from public and private exponents diff --git a/third_party/mbedtls/include/mbedtls/rsa_internal.h b/third_party/mbedtls/rsa_internal.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/rsa_internal.h rename to third_party/mbedtls/rsa_internal.h index 9f9257887..4c1372170 100644 --- a/third_party/mbedtls/include/mbedtls/rsa_internal.h +++ b/third_party/mbedtls/rsa_internal.h @@ -58,12 +58,12 @@ #define MBEDTLS_RSA_INTERNAL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/bignum.h" +#include "third_party/mbedtls/bignum.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/library/sha1.c b/third_party/mbedtls/sha1.c similarity index 98% rename from third_party/mbedtls/library/sha1.c rename to third_party/mbedtls/sha1.c index 716f7b2f9..38b10c201 100644 --- a/third_party/mbedtls/library/sha1.c +++ b/third_party/mbedtls/sha1.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * FIPS-180-1 compliant SHA-1 implementation * @@ -25,17 +30,17 @@ */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SHA1_C) -#include "third_party/mbedtls/include/mbedtls/sha1.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/sha1.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/sha1.h b/third_party/mbedtls/sha1.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/sha1.h rename to third_party/mbedtls/sha1.h index 0ad3f0844..8e4662330 100644 --- a/third_party/mbedtls/include/mbedtls/sha1.h +++ b/third_party/mbedtls/sha1.h @@ -32,7 +32,7 @@ #define MBEDTLS_SHA1_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -67,7 +67,7 @@ typedef struct mbedtls_sha1_context mbedtls_sha1_context; #else /* MBEDTLS_SHA1_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/sha1_alt.h" */ +/* #include "third_party/mbedtls/sha1_alt.h" */ #endif /* MBEDTLS_SHA1_ALT */ /** diff --git a/third_party/mbedtls/library/sha256.c b/third_party/mbedtls/sha256.c similarity index 98% rename from third_party/mbedtls/library/sha256.c rename to third_party/mbedtls/sha256.c index 6381fbb51..6355f8b8f 100644 --- a/third_party/mbedtls/library/sha256.c +++ b/third_party/mbedtls/sha256.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * FIPS-180-2 compliant SHA-256 implementation * @@ -25,18 +30,18 @@ */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SHA256_C) -#include "third_party/mbedtls/include/mbedtls/sha256.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/sha256.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #define mbedtls_calloc calloc diff --git a/third_party/mbedtls/include/mbedtls/sha256.h b/third_party/mbedtls/sha256.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/sha256.h rename to third_party/mbedtls/sha256.h index 3e688590f..fbe60c464 100644 --- a/third_party/mbedtls/include/mbedtls/sha256.h +++ b/third_party/mbedtls/sha256.h @@ -28,7 +28,7 @@ #define MBEDTLS_SHA256_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -64,7 +64,7 @@ typedef struct mbedtls_sha256_context mbedtls_sha256_context; #else /* MBEDTLS_SHA256_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/sha256_alt.h" */ +/* #include "third_party/mbedtls/sha256_alt.h" */ #endif /* MBEDTLS_SHA256_ALT */ /** diff --git a/third_party/mbedtls/library/sha512.c b/third_party/mbedtls/sha512.c similarity index 98% rename from third_party/mbedtls/library/sha512.c rename to third_party/mbedtls/sha512.c index 44d14f314..c75899a2a 100644 --- a/third_party/mbedtls/library/sha512.c +++ b/third_party/mbedtls/sha512.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * FIPS-180-2 compliant SHA-384/512 implementation * @@ -26,13 +31,13 @@ #include "libc/str/str.h" #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SHA512_C) -#include "third_party/mbedtls/include/mbedtls/sha512.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/sha512.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/error.h" #if defined(_MSC_VER) || defined(__WATCOMC__) #define UL64(x) x##ui64 @@ -43,7 +48,7 @@ #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #define mbedtls_calloc calloc diff --git a/third_party/mbedtls/include/mbedtls/sha512.h b/third_party/mbedtls/sha512.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/sha512.h rename to third_party/mbedtls/sha512.h index cd4482f92..1aae8eab6 100644 --- a/third_party/mbedtls/include/mbedtls/sha512.h +++ b/third_party/mbedtls/sha512.h @@ -27,7 +27,7 @@ #define MBEDTLS_SHA512_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -65,7 +65,7 @@ typedef struct mbedtls_sha512_context mbedtls_sha512_context; #else /* MBEDTLS_SHA512_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/sha512_alt.h" */ +/* #include "third_party/mbedtls/sha512_alt.h" */ #endif /* MBEDTLS_SHA512_ALT */ /** diff --git a/third_party/mbedtls/include/psa/sheesh.h b/third_party/mbedtls/sheesh.h similarity index 91% rename from third_party/mbedtls/include/psa/sheesh.h rename to third_party/mbedtls/sheesh.h index 9e48af6d1..75f3d69e5 100644 --- a/third_party/mbedtls/include/psa/sheesh.h +++ b/third_party/mbedtls/sheesh.h @@ -1,6 +1,6 @@ #ifndef COSMOPOLITAN_THIRD_PARTY_MBEDTLS_INCLUDE_PSA_SHEESH_H_ #define COSMOPOLITAN_THIRD_PARTY_MBEDTLS_INCLUDE_PSA_SHEESH_H_ -#include "third_party/mbedtls/include/psa/crypto_extra.h" +#include "third_party/mbedtls/crypto_extra.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ diff --git a/third_party/mbedtls/include/mbedtls/ssl.h b/third_party/mbedtls/ssl.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/ssl.h rename to third_party/mbedtls/ssl.h index 32031dd90..75283426f 100644 --- a/third_party/mbedtls/include/mbedtls/ssl.h +++ b/third_party/mbedtls/ssl.h @@ -25,23 +25,23 @@ #define MBEDTLS_SSL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/bignum.h" -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/bignum.h" +#include "third_party/mbedtls/ecp.h" -#include "third_party/mbedtls/include/mbedtls/ssl_ciphersuites.h" +#include "third_party/mbedtls/ssl_ciphersuites.h" #if defined(MBEDTLS_X509_CRT_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/x509_crt.h" -#include "third_party/mbedtls/include/mbedtls/x509_crl.h" +#include "third_party/mbedtls/x509_crt.h" +#include "third_party/mbedtls/x509_crl.h" #endif #if defined(MBEDTLS_DHM_C) -#include "third_party/mbedtls/include/mbedtls/dhm.h" +#include "third_party/mbedtls/dhm.h" #endif /* Adding guard for MBEDTLS_ECDSA_C to ensure no compile errors due @@ -50,7 +50,7 @@ * MBEDTLS_ECDSA_C which does not seem correct. */ #if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C) -#include "third_party/mbedtls/include/mbedtls/ecdh.h" +#include "third_party/mbedtls/ecdh.h" #endif #if defined(MBEDTLS_ZLIB_SUPPORT) @@ -67,11 +67,11 @@ #endif #if defined(MBEDTLS_HAVE_TIME) -#include "third_party/mbedtls/include/mbedtls/platform_time.h" +#include "third_party/mbedtls/platform_time.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/crypto.h" #endif /* MBEDTLS_USE_PSA_CRYPTO */ /* diff --git a/third_party/mbedtls/library/ssl_cache.c b/third_party/mbedtls/ssl_cache.c similarity index 97% rename from third_party/mbedtls/library/ssl_cache.c rename to third_party/mbedtls/ssl_cache.c index 77738fc84..195888416 100644 --- a/third_party/mbedtls/library/ssl_cache.c +++ b/third_party/mbedtls/ssl_cache.c @@ -23,19 +23,19 @@ * to store and retrieve the session information. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_CACHE_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/ssl_cache.h" -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/ssl_cache.h" +#include "third_party/mbedtls/ssl_internal.h" void mbedtls_ssl_cache_init( mbedtls_ssl_cache_context *cache ) diff --git a/third_party/mbedtls/include/mbedtls/ssl_cache.h b/third_party/mbedtls/ssl_cache.h similarity index 96% rename from third_party/mbedtls/include/mbedtls/ssl_cache.h rename to third_party/mbedtls/ssl_cache.h index 9b8acab47..c51668087 100644 --- a/third_party/mbedtls/include/mbedtls/ssl_cache.h +++ b/third_party/mbedtls/ssl_cache.h @@ -25,15 +25,15 @@ #define MBEDTLS_SSL_CACHE_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl.h" #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif /** diff --git a/third_party/mbedtls/library/ssl_ciphersuites.c b/third_party/mbedtls/ssl_ciphersuites.c similarity index 99% rename from third_party/mbedtls/library/ssl_ciphersuites.c rename to third_party/mbedtls/ssl_ciphersuites.c index b42b922a1..f911e3a2a 100644 --- a/third_party/mbedtls/library/ssl_ciphersuites.c +++ b/third_party/mbedtls/ssl_ciphersuites.c @@ -21,17 +21,17 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_TLS_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #endif -#include "third_party/mbedtls/include/mbedtls/ssl_ciphersuites.h" -#include "third_party/mbedtls/include/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl_ciphersuites.h" +#include "third_party/mbedtls/ssl.h" /* diff --git a/third_party/mbedtls/include/mbedtls/ssl_ciphersuites.h b/third_party/mbedtls/ssl_ciphersuites.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/ssl_ciphersuites.h rename to third_party/mbedtls/ssl_ciphersuites.h index 756b72a99..70ae12609 100644 --- a/third_party/mbedtls/include/mbedtls/ssl_ciphersuites.h +++ b/third_party/mbedtls/ssl_ciphersuites.h @@ -25,14 +25,14 @@ #define MBEDTLS_SSL_CIPHERSUITES_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/pk.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/pk.h" +#include "third_party/mbedtls/cipher.h" +#include "third_party/mbedtls/md.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/library/ssl_cli.c b/third_party/mbedtls/ssl_cli.c similarity index 99% rename from third_party/mbedtls/library/ssl_cli.c rename to third_party/mbedtls/ssl_cli.c index 76a36260f..128a4725c 100644 --- a/third_party/mbedtls/library/ssl_cli.c +++ b/third_party/mbedtls/ssl_cli.c @@ -19,35 +19,35 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_CLI_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/psa/sheesh.h" -#include "third_party/mbedtls/include/mbedtls/ssl.h" -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" -#include "third_party/mbedtls/include/mbedtls/debug.h" -#include "third_party/mbedtls/include/mbedtls/error.h" +#include "third_party/mbedtls/sheesh.h" +#include "third_party/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/debug.h" +#include "third_party/mbedtls/error.h" #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/mbedtls/psa_util.h" +#include "third_party/mbedtls/psa_util.h" #endif /* MBEDTLS_USE_PSA_CRYPTO */ #if defined(MBEDTLS_HAVE_TIME) -#include "third_party/mbedtls/include/mbedtls/platform_time.h" +#include "third_party/mbedtls/platform_time.h" #endif #if defined(MBEDTLS_SSL_SESSION_TICKETS) -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform_util.h" #endif #if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) diff --git a/third_party/mbedtls/library/ssl_cookie.c b/third_party/mbedtls/ssl_cookie.c similarity index 95% rename from third_party/mbedtls/library/ssl_cookie.c rename to third_party/mbedtls/ssl_cookie.c index 2f5761c15..d2741f965 100644 --- a/third_party/mbedtls/library/ssl_cookie.c +++ b/third_party/mbedtls/ssl_cookie.c @@ -23,21 +23,21 @@ * to store and retrieve the session information. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_COOKIE_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/ssl_cookie.h" -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/ssl_cookie.h" +#include "third_party/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/platform_util.h" /* diff --git a/third_party/mbedtls/include/mbedtls/ssl_cookie.h b/third_party/mbedtls/ssl_cookie.h similarity index 94% rename from third_party/mbedtls/include/mbedtls/ssl_cookie.h rename to third_party/mbedtls/ssl_cookie.h index 60a40f508..67118c032 100644 --- a/third_party/mbedtls/include/mbedtls/ssl_cookie.h +++ b/third_party/mbedtls/ssl_cookie.h @@ -25,15 +25,15 @@ #define MBEDTLS_SSL_COOKIE_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl.h" #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif /** diff --git a/third_party/mbedtls/include/mbedtls/ssl_internal.h b/third_party/mbedtls/ssl_internal.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/ssl_internal.h rename to third_party/mbedtls/ssl_internal.h index d9dd72942..ff6de4f21 100644 --- a/third_party/mbedtls/include/mbedtls/ssl_internal.h +++ b/third_party/mbedtls/ssl_internal.h @@ -25,41 +25,41 @@ #define MBEDTLS_SSL_INTERNAL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/ssl.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/ssl.h" +#include "third_party/mbedtls/cipher.h" #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/crypto.h" #endif #if defined(MBEDTLS_MD5_C) -#include "third_party/mbedtls/include/mbedtls/md5.h" +#include "third_party/mbedtls/md5.h" #endif #if defined(MBEDTLS_SHA1_C) -#include "third_party/mbedtls/include/mbedtls/sha1.h" +#include "third_party/mbedtls/sha1.h" #endif #if defined(MBEDTLS_SHA256_C) -#include "third_party/mbedtls/include/mbedtls/sha256.h" +#include "third_party/mbedtls/sha256.h" #endif #if defined(MBEDTLS_SHA512_C) -#include "third_party/mbedtls/include/mbedtls/sha512.h" +#include "third_party/mbedtls/sha512.h" #endif #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) -#include "third_party/mbedtls/include/mbedtls/ecjpake.h" +#include "third_party/mbedtls/ecjpake.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/mbedtls/psa_util.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_util.h" #endif /* MBEDTLS_USE_PSA_CRYPTO */ #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ diff --git a/third_party/mbedtls/library/ssl_invasive.h b/third_party/mbedtls/ssl_invasive.h similarity index 97% rename from third_party/mbedtls/library/ssl_invasive.h rename to third_party/mbedtls/ssl_invasive.h index 6a547e52e..71257f78e 100644 --- a/third_party/mbedtls/library/ssl_invasive.h +++ b/third_party/mbedtls/ssl_invasive.h @@ -28,8 +28,8 @@ #ifndef MBEDTLS_SSL_INVASIVE_H #define MBEDTLS_SSL_INVASIVE_H -#include "third_party/mbedtls/library/common.h" -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/common.h" +#include "third_party/mbedtls/md.h" #if defined(MBEDTLS_TEST_HOOKS) && \ defined(MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC) diff --git a/third_party/mbedtls/library/ssl_msg.c b/third_party/mbedtls/ssl_msg.c similarity index 99% rename from third_party/mbedtls/library/ssl_msg.c rename to third_party/mbedtls/ssl_msg.c index 47ad62f20..947167bb8 100644 --- a/third_party/mbedtls/library/ssl_msg.c +++ b/third_party/mbedtls/ssl_msg.c @@ -29,34 +29,34 @@ */ #include "libc/limits.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_TLS_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/ssl.h" -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" -#include "third_party/mbedtls/include/mbedtls/debug.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/version.h" +#include "third_party/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/debug.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/version.h" -#include "third_party/mbedtls/library/ssl_invasive.h" +#include "third_party/mbedtls/ssl_invasive.h" #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/mbedtls/psa_util.h" -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/psa_util.h" +#include "third_party/mbedtls/crypto.h" #endif #if defined(MBEDTLS_X509_CRT_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/oid.h" +#include "third_party/mbedtls/oid.h" #endif static uint32_t ssl_get_hs_total_len( mbedtls_ssl_context const *ssl ); diff --git a/third_party/mbedtls/library/ssl_srv.c b/third_party/mbedtls/ssl_srv.c similarity index 99% rename from third_party/mbedtls/library/ssl_srv.c rename to third_party/mbedtls/ssl_srv.c index 6938efa81..f65b9b72c 100644 --- a/third_party/mbedtls/library/ssl_srv.c +++ b/third_party/mbedtls/ssl_srv.c @@ -19,30 +19,30 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_SRV_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/ssl.h" -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" -#include "third_party/mbedtls/include/mbedtls/debug.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/debug.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_ECP_C) -#include "third_party/mbedtls/include/mbedtls/ecp.h" +#include "third_party/mbedtls/ecp.h" #endif #if defined(MBEDTLS_HAVE_TIME) -#include "third_party/mbedtls/include/mbedtls/platform_time.h" +#include "third_party/mbedtls/platform_time.h" #endif #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) diff --git a/third_party/mbedtls/library/ssl_ticket.c b/third_party/mbedtls/ssl_ticket.c similarity index 97% rename from third_party/mbedtls/library/ssl_ticket.c rename to third_party/mbedtls/ssl_ticket.c index dd228ed6d..da4ca249f 100644 --- a/third_party/mbedtls/library/ssl_ticket.c +++ b/third_party/mbedtls/ssl_ticket.c @@ -19,21 +19,21 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_TICKET_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" -#include "third_party/mbedtls/include/mbedtls/ssl_ticket.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/ssl_ticket.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/platform_util.h" /* diff --git a/third_party/mbedtls/include/mbedtls/ssl_ticket.h b/third_party/mbedtls/ssl_ticket.h similarity index 95% rename from third_party/mbedtls/include/mbedtls/ssl_ticket.h rename to third_party/mbedtls/ssl_ticket.h index 4807035ee..acc441ec0 100644 --- a/third_party/mbedtls/include/mbedtls/ssl_ticket.h +++ b/third_party/mbedtls/ssl_ticket.h @@ -25,7 +25,7 @@ #define MBEDTLS_SSL_TICKET_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -36,11 +36,11 @@ * secrecy, when MBEDTLS_HAVE_TIME is defined. */ -#include "third_party/mbedtls/include/mbedtls/ssl.h" -#include "third_party/mbedtls/include/mbedtls/cipher.h" +#include "third_party/mbedtls/ssl.h" +#include "third_party/mbedtls/cipher.h" #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif #ifdef __cplusplus diff --git a/third_party/mbedtls/library/ssl_tls.c b/third_party/mbedtls/ssl_tls.c similarity index 99% rename from third_party/mbedtls/library/ssl_tls.c rename to third_party/mbedtls/ssl_tls.c index 8b18617ef..8afb08d35 100644 --- a/third_party/mbedtls/library/ssl_tls.c +++ b/third_party/mbedtls/ssl_tls.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * SSLv3/TLSv1 shared functions * @@ -27,32 +32,32 @@ * http://www.ietf.org/rfc/rfc4346.txt */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_TLS_C) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free #endif -#include "third_party/mbedtls/include/psa/sheesh.h" -#include "third_party/mbedtls/include/mbedtls/ssl.h" -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" -#include "third_party/mbedtls/include/mbedtls/debug.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/version.h" +#include "third_party/mbedtls/sheesh.h" +#include "third_party/mbedtls/ssl.h" +#include "third_party/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/debug.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/version.h" #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/mbedtls/psa_util.h" -#include "third_party/mbedtls/include/psa/crypto.h" +#include "third_party/mbedtls/psa_util.h" +#include "third_party/mbedtls/crypto.h" #endif #if defined(MBEDTLS_X509_CRT_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/oid.h" +#include "third_party/mbedtls/oid.h" #endif #if defined(MBEDTLS_SSL_PROTO_DTLS) diff --git a/third_party/mbedtls/library/ssl_tls13_keys.c b/third_party/mbedtls/ssl_tls13_keys.c similarity index 98% rename from third_party/mbedtls/library/ssl_tls13_keys.c rename to third_party/mbedtls/ssl_tls13_keys.c index e1be3168e..268595033 100644 --- a/third_party/mbedtls/library/ssl_tls13_keys.c +++ b/third_party/mbedtls/ssl_tls13_keys.c @@ -19,13 +19,13 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL) -#include "third_party/mbedtls/include/mbedtls/hkdf.h" -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" -#include "third_party/mbedtls/library/ssl_tls13_keys.h" +#include "third_party/mbedtls/hkdf.h" +#include "third_party/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/ssl_tls13_keys.h" #define MBEDTLS_SSL_TLS1_3_LABEL( name, string ) \ diff --git a/third_party/mbedtls/library/ssl_tls13_keys.h b/third_party/mbedtls/ssl_tls13_keys.h similarity index 99% rename from third_party/mbedtls/library/ssl_tls13_keys.h rename to third_party/mbedtls/ssl_tls13_keys.h index 24febb916..775a2c8cb 100644 --- a/third_party/mbedtls/library/ssl_tls13_keys.h +++ b/third_party/mbedtls/ssl_tls13_keys.h @@ -1,6 +1,6 @@ /* clang-format off */ -#include "third_party/mbedtls/include/mbedtls/ssl_internal.h" -#include "third_party/mbedtls/include/mbedtls/md.h" +#include "third_party/mbedtls/ssl_internal.h" +#include "third_party/mbedtls/md.h" /* * TLS 1.3 key schedule diff --git a/third_party/mbedtls/library/threading.c b/third_party/mbedtls/threading.c similarity index 98% rename from third_party/mbedtls/library/threading.c rename to third_party/mbedtls/threading.c index 70855cf3d..86de8d934 100644 --- a/third_party/mbedtls/library/threading.c +++ b/third_party/mbedtls/threading.c @@ -27,11 +27,11 @@ #define _POSIX_C_SOURCE 200112L #endif -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_PLATFORM_GMTIME_R_ALT) diff --git a/third_party/mbedtls/include/mbedtls/threading.h b/third_party/mbedtls/threading.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/threading.h rename to third_party/mbedtls/threading.h index e9c3bccd4..7c4a2ca3b 100644 --- a/third_party/mbedtls/include/mbedtls/threading.h +++ b/third_party/mbedtls/threading.h @@ -25,7 +25,7 @@ #define MBEDTLS_THREADING_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/timing.c b/third_party/mbedtls/timing.c similarity index 98% rename from third_party/mbedtls/library/timing.c rename to third_party/mbedtls/timing.c index 6398518d3..aee0d9f8d 100644 --- a/third_party/mbedtls/library/timing.c +++ b/third_party/mbedtls/timing.c @@ -21,17 +21,17 @@ #include "libc/calls/calls.h" #include "libc/time/time.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif #if defined(MBEDTLS_TIMING_C) -#include "third_party/mbedtls/include/mbedtls/timing.h" +#include "third_party/mbedtls/timing.h" #if !defined(MBEDTLS_TIMING_ALT) diff --git a/third_party/mbedtls/include/mbedtls/timing.h b/third_party/mbedtls/timing.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/timing.h rename to third_party/mbedtls/timing.h index 8c5921d4c..cc13174da 100644 --- a/third_party/mbedtls/include/mbedtls/timing.h +++ b/third_party/mbedtls/timing.h @@ -25,7 +25,7 @@ #define MBEDTLS_TIMING_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/version.c b/third_party/mbedtls/version.c similarity index 91% rename from third_party/mbedtls/library/version.c rename to third_party/mbedtls/version.c index 894939b7a..10227b47a 100644 --- a/third_party/mbedtls/library/version.c +++ b/third_party/mbedtls/version.c @@ -20,11 +20,11 @@ */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_VERSION_C) -#include "third_party/mbedtls/include/mbedtls/version.h" +#include "third_party/mbedtls/version.h" unsigned int mbedtls_version_get_number( void ) { diff --git a/third_party/mbedtls/include/mbedtls/version.h b/third_party/mbedtls/version.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/version.h rename to third_party/mbedtls/version.h index e3e13ffea..185ed1e9d 100644 --- a/third_party/mbedtls/include/mbedtls/version.h +++ b/third_party/mbedtls/version.h @@ -29,7 +29,7 @@ #define MBEDTLS_VERSION_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif diff --git a/third_party/mbedtls/library/version_features.c b/third_party/mbedtls/version_features.c similarity index 99% rename from third_party/mbedtls/library/version_features.c rename to third_party/mbedtls/version_features.c index dd3103017..e3ad7184e 100644 --- a/third_party/mbedtls/library/version_features.c +++ b/third_party/mbedtls/version_features.c @@ -20,11 +20,11 @@ */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_VERSION_C) -#include "third_party/mbedtls/include/mbedtls/version.h" +#include "third_party/mbedtls/version.h" static const char * const features[] = { #if defined(MBEDTLS_VERSION_FEATURES) diff --git a/third_party/mbedtls/library/x509.c b/third_party/mbedtls/x509.c similarity index 97% rename from third_party/mbedtls/library/x509.c rename to third_party/mbedtls/x509.c index d0190e1f3..dd2d10987 100644 --- a/third_party/mbedtls/library/x509.c +++ b/third_party/mbedtls/x509.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * X.509 common functions for parsing and verification * @@ -30,22 +35,22 @@ */ #include "libc/time/struct/tm.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_X509_USE_C) -#include "third_party/mbedtls/include/mbedtls/x509.h" -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" +#include "third_party/mbedtls/x509.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/oid.h" #if defined(MBEDTLS_PEM_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_free free #define mbedtls_calloc calloc @@ -54,10 +59,10 @@ #endif #if defined(MBEDTLS_HAVE_TIME) -#include "third_party/mbedtls/include/mbedtls/platform_time.h" +#include "third_party/mbedtls/platform_time.h" #endif #if defined(MBEDTLS_HAVE_TIME_DATE) -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/platform_util.h" #endif #define CHECK(code) if( ( ret = ( code ) ) != 0 ){ return( ret ); } @@ -996,8 +1001,8 @@ int mbedtls_x509_time_is_future( const mbedtls_x509_time *from ) #if defined(MBEDTLS_SELF_TEST) -#include "third_party/mbedtls/include/mbedtls/x509_crt.h" -#include "third_party/mbedtls/include/mbedtls/certs.h" +#include "third_party/mbedtls/x509_crt.h" +#include "third_party/mbedtls/certs.h" /* * Checkup routine diff --git a/third_party/mbedtls/include/mbedtls/x509.h b/third_party/mbedtls/x509.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/x509.h rename to third_party/mbedtls/x509.h index 04c9a987d..fdb6250e6 100644 --- a/third_party/mbedtls/include/mbedtls/x509.h +++ b/third_party/mbedtls/x509.h @@ -25,16 +25,16 @@ #define MBEDTLS_X509_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/asn1.h" -#include "third_party/mbedtls/include/mbedtls/pk.h" +#include "third_party/mbedtls/asn1.h" +#include "third_party/mbedtls/pk.h" #if defined(MBEDTLS_RSA_C) -#include "third_party/mbedtls/include/mbedtls/rsa.h" +#include "third_party/mbedtls/rsa.h" #endif /** diff --git a/third_party/mbedtls/library/x509_create.c b/third_party/mbedtls/x509_create.c similarity index 97% rename from third_party/mbedtls/library/x509_create.c rename to third_party/mbedtls/x509_create.c index 46ae0da21..254e8352b 100644 --- a/third_party/mbedtls/library/x509_create.c +++ b/third_party/mbedtls/x509_create.c @@ -19,14 +19,14 @@ * limitations under the License. */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_X509_CREATE_C) -#include "third_party/mbedtls/include/mbedtls/x509.h" -#include "third_party/mbedtls/include/mbedtls/asn1write.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" +#include "third_party/mbedtls/x509.h" +#include "third_party/mbedtls/asn1write.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/oid.h" /* Structure linking OIDs for X.509 DN AttributeTypes to their diff --git a/third_party/mbedtls/library/x509_crl.c b/third_party/mbedtls/x509_crl.c similarity index 98% rename from third_party/mbedtls/library/x509_crl.c rename to third_party/mbedtls/x509_crl.c index cb72388e2..53cafbd67 100644 --- a/third_party/mbedtls/library/x509_crl.c +++ b/third_party/mbedtls/x509_crl.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * X.509 Certidicate Revocation List (CRL) parsing * @@ -29,22 +34,22 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_X509_CRL_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/x509_crl.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/x509_crl.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_PEM_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_free free #define mbedtls_calloc calloc diff --git a/third_party/mbedtls/include/mbedtls/x509_crl.h b/third_party/mbedtls/x509_crl.h similarity index 97% rename from third_party/mbedtls/include/mbedtls/x509_crl.h rename to third_party/mbedtls/x509_crl.h index dee96e395..a31f849e4 100644 --- a/third_party/mbedtls/include/mbedtls/x509_crl.h +++ b/third_party/mbedtls/x509_crl.h @@ -25,12 +25,12 @@ #define MBEDTLS_X509_CRL_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/x509.h" +#include "third_party/mbedtls/x509.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/library/x509_crt.c b/third_party/mbedtls/x509_crt.c similarity index 99% rename from third_party/mbedtls/library/x509_crt.c rename to third_party/mbedtls/x509_crt.c index bfab47a42..1398a37bb 100644 --- a/third_party/mbedtls/library/x509_crt.c +++ b/third_party/mbedtls/x509_crt.c @@ -36,26 +36,26 @@ #include "libc/calls/struct/dirent.h" #include "libc/calls/struct/dirent.h" #include "libc/calls/calls.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_X509_CRT_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/x509_crt.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/x509_crt.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_PEM_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/mbedtls/psa_util.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_util.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_free free #define mbedtls_calloc calloc @@ -63,7 +63,7 @@ #endif #if defined(MBEDTLS_THREADING_C) -#include "third_party/mbedtls/include/mbedtls/threading.h" +#include "third_party/mbedtls/threading.h" #endif /* diff --git a/third_party/mbedtls/include/mbedtls/x509_crt.h b/third_party/mbedtls/x509_crt.h similarity index 99% rename from third_party/mbedtls/include/mbedtls/x509_crt.h rename to third_party/mbedtls/x509_crt.h index 50469dede..5df403007 100644 --- a/third_party/mbedtls/include/mbedtls/x509_crt.h +++ b/third_party/mbedtls/x509_crt.h @@ -25,14 +25,14 @@ #define MBEDTLS_X509_CRT_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/x509.h" -#include "third_party/mbedtls/include/mbedtls/x509_crl.h" -#include "third_party/mbedtls/include/mbedtls/bignum.h" +#include "third_party/mbedtls/x509.h" +#include "third_party/mbedtls/x509_crl.h" +#include "third_party/mbedtls/bignum.h" /** * \addtogroup x509_module diff --git a/third_party/mbedtls/library/x509_csr.c b/third_party/mbedtls/x509_csr.c similarity index 96% rename from third_party/mbedtls/library/x509_csr.c rename to third_party/mbedtls/x509_csr.c index a2eb68e68..2a9b57cac 100644 --- a/third_party/mbedtls/library/x509_csr.c +++ b/third_party/mbedtls/x509_csr.c @@ -29,22 +29,22 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_X509_CSR_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/x509_csr.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/x509_csr.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_PEM_PARSE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_free free #define mbedtls_calloc calloc diff --git a/third_party/mbedtls/include/mbedtls/x509_csr.h b/third_party/mbedtls/x509_csr.h similarity index 98% rename from third_party/mbedtls/include/mbedtls/x509_csr.h rename to third_party/mbedtls/x509_csr.h index 5ce640047..94930694c 100644 --- a/third_party/mbedtls/include/mbedtls/x509_csr.h +++ b/third_party/mbedtls/x509_csr.h @@ -25,12 +25,12 @@ #define MBEDTLS_X509_CSR_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif -#include "third_party/mbedtls/include/mbedtls/x509.h" +#include "third_party/mbedtls/x509.h" #ifdef __cplusplus extern "C" { diff --git a/third_party/mbedtls/library/x509write_crt.c b/third_party/mbedtls/x509write_crt.c similarity index 97% rename from third_party/mbedtls/library/x509write_crt.c rename to third_party/mbedtls/x509write_crt.c index 91c5eda2d..a1594ab5e 100644 --- a/third_party/mbedtls/library/x509write_crt.c +++ b/third_party/mbedtls/x509write_crt.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * X.509 certificate writing * @@ -25,20 +30,20 @@ * - attributes: PKCS#9 v2.0 aka RFC 2985 */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_X509_CRT_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/x509_crt.h" -#include "third_party/mbedtls/include/mbedtls/asn1write.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" -#include "third_party/mbedtls/include/mbedtls/sha1.h" +#include "third_party/mbedtls/x509_crt.h" +#include "third_party/mbedtls/asn1write.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/platform_util.h" +#include "third_party/mbedtls/sha1.h" #if defined(MBEDTLS_PEM_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif /* MBEDTLS_PEM_WRITE_C */ void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx ) diff --git a/third_party/mbedtls/library/x509write_csr.c b/third_party/mbedtls/x509write_csr.c similarity index 94% rename from third_party/mbedtls/library/x509write_csr.c rename to third_party/mbedtls/x509write_csr.c index b2c81e817..9e008e874 100644 --- a/third_party/mbedtls/library/x509write_csr.c +++ b/third_party/mbedtls/x509write_csr.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * X.509 Certificate Signing Request writing * @@ -24,27 +29,27 @@ * - attributes: PKCS#9 v2.0 aka RFC 2985 */ -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_X509_CSR_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/x509_csr.h" -#include "third_party/mbedtls/include/mbedtls/asn1write.h" -#include "third_party/mbedtls/include/mbedtls/error.h" -#include "third_party/mbedtls/include/mbedtls/oid.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/x509_csr.h" +#include "third_party/mbedtls/asn1write.h" +#include "third_party/mbedtls/error.h" +#include "third_party/mbedtls/oid.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "third_party/mbedtls/include/psa/crypto.h" -#include "third_party/mbedtls/include/mbedtls/psa_util.h" +#include "third_party/mbedtls/crypto.h" +#include "third_party/mbedtls/psa_util.h" #endif #if defined(MBEDTLS_PEM_WRITE_C) -#include "third_party/mbedtls/include/mbedtls/pem.h" +#include "third_party/mbedtls/pem.h" #endif #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_calloc calloc #define mbedtls_free free diff --git a/third_party/mbedtls/library/xtea.c b/third_party/mbedtls/xtea.c similarity index 95% rename from third_party/mbedtls/library/xtea.c rename to third_party/mbedtls/xtea.c index 8edb13139..591369673 100644 --- a/third_party/mbedtls/library/xtea.c +++ b/third_party/mbedtls/xtea.c @@ -1,5 +1,10 @@ /* clang-format off */ +asm(".ident\t\"\\n\\n\ +Mbed TLS (Apache 2.0)\\n\ +Copyright The Mbed TLS Contributors\""); +asm(".include \"libc/disclaimer.inc\""); + /* * An 32-bit implementation of the XTEA algorithm * @@ -20,17 +25,17 @@ */ #include "libc/str/str.h" -#include "third_party/mbedtls/library/common.h" +#include "third_party/mbedtls/common.h" #if defined(MBEDTLS_XTEA_C) -#include "third_party/mbedtls/include/mbedtls/xtea.h" -#include "third_party/mbedtls/include/mbedtls/platform_util.h" +#include "third_party/mbedtls/xtea.h" +#include "third_party/mbedtls/platform_util.h" #if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_PLATFORM_C) -#include "third_party/mbedtls/include/mbedtls/platform.h" +#include "third_party/mbedtls/platform.h" #else #define mbedtls_printf printf #endif /* MBEDTLS_PLATFORM_C */ diff --git a/third_party/mbedtls/include/mbedtls/xtea.h b/third_party/mbedtls/xtea.h similarity index 96% rename from third_party/mbedtls/include/mbedtls/xtea.h rename to third_party/mbedtls/xtea.h index 022fee314..893f86aa1 100644 --- a/third_party/mbedtls/include/mbedtls/xtea.h +++ b/third_party/mbedtls/xtea.h @@ -25,7 +25,7 @@ #define MBEDTLS_XTEA_H #if !defined(MBEDTLS_CONFIG_FILE) -#include "third_party/mbedtls/include/mbedtls/config.h" +#include "third_party/mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif @@ -57,7 +57,7 @@ typedef struct mbedtls_xtea_context mbedtls_xtea_context; #else /* MBEDTLS_XTEA_ALT */ -/* #include "third_party/mbedtls/include/mbedtls/xtea_alt.h" */ +/* #include "third_party/mbedtls/xtea_alt.h" */ #endif /* MBEDTLS_XTEA_ALT */ /**