mbedtls/library
Gilles Peskine b99bd39b4e Merge mbed-crypto into mbedtls: the merge commit
Merge `unremove-non-crypto` into `mbedtls/development`. The branch
`unremove-non-crypto` was obtained by starting from `mbed-crypto/development`,
then reverting many commits that removed X.509 and TLS functionality when Mbed
Crypto forked from Mbed TLS (the “unremoval”), then make a few tweaks to
facilitate the merge.

The unremoval step restored old versions of some tls files. If a file doesn't
exist in mbed-crypto, check out the mbedtls version, regardless of what
happened during the unremoval of tls files in the crypto tree. Also
unconditionally take the mbedtls version of a few files where the
modifications are completely project-specific and are not relevant in
mbed-crypto:

* `.github/issue_template.md`: completely different. We may want to reconcile
  them independently as a follow-up.
* `.travis.yml`: would only be reverted to an earlier tls version.
* `README.md`: completely different. We may want to reconcile them
  independently as a follow-up.
* `doxygen/input/doc_mainpage.h`: the changes in crypto were minimal and not
  relevant except as a stopgap as mbed-crypto did not have its own product
  versioning in the Doxygen documentation.
* `tests/.jenkins/Jenkinsfile`: completely different.
* `tests/data_files/Makefile`: there were no changes in mbed-crypto,
  but the unremoval step restored an old version.

Shell script for everything to do after the merge apart from the conflict
resolution:
```
tls_files=($(comm -23 <(git ls-tree -r --name-only HEAD) <(git ls-tree -r --name-only $(git merge-base upstream-crypto/development MERGE_HEAD))))
tls_files+=($tls_files .github/issue_template.md .travis.yml README.md doxygen/input/doc_mainpage.h tests/.jenkins/Jenkinsfile tests/data_files/Makefile)
git checkout --theirs HEAD -- $tls_files
git add -- $tls_files
```

Resolve the remaining conflicts:

* `library/CMakeLists.txt`:
    * Keep the TLS definition of `src_crypto`
    * `USE_SHARED_MBEDTLS_LIBRARY`: keep all three libraries, with both
      `include` and `crypto/include` in `target_include_directories`, all with
      version `2.21.0`.
* `programs/Makefile`:
    * Reconcile the APPS lists (add/add from a differently-formatted common
      ancestor): insert the `psa/*` from crypto into the tls list.
    * Keep the `fuzz` target defined only in tls version.
    * Keep the recipe (only in tls version) cleaning `ssl_pthread_server`
      stuff for the `clean` target.
* `scripts/config.py`:
    * `include_in_full`: add/add conflict. Keep both.
* `tests/scripts/all.sh`:
    * `component_test_no_use_psa_crypto_full_cmake_asan`: partially old
      version in crypto. Take the tls version.
    * `component_test_malloc_0_null` and more: take
      `component_test_malloc_0_null` from crypto (with `config.py` rather than
      `config.pl`, and with `$ASAN_FLAGS` rather than an explicit list), but
      add the call to `ssl-opt.sh` from tls. Take the other components from
      crypto.

With this commit, building and running the unit tests with both `make ` and
`cmake` work in the default configuration on Linux. Other platforms, build
systems and configurations are likely not to work, and there is some
regression in test coverage.

There is some loss of functionality because the unremoval step restored older
versions of tls content. This commit contains the latest tls version of
tls-only files, but some changes from the tls side in files that existed on
both sides have regressed. Most problematic changes are hunks that remove some
tls-specific feature and contain either a C preprocessor symbol identifying a
tls-specific module or option, or the name of a tls-specific file. Hunks
that remove a tls-specific preprocessor symbol can be identified with the
regular expression `^-.*MBEDTLS_(ERR_)?(PKCS11|X509|NET|SSL)_`.

Subsequent commits will revert a few parts of the patch from this merge commit
in order to restore the tls functionality that it removes, ensure that the
test coverage includes what was covered in either branch, and fix test
failures.
2020-03-23 17:54:46 +01:00
..
.gitignore
aes.c Merge branch 'development' into development-restricted 2020-01-15 15:55:11 +00:00
aesni.c
arc4.c
aria.c
asn1parse.c Replace use of uint8_t by unsigned char in ASN.1 seq traversal API 2020-02-03 10:39:55 +00:00
asn1write.c Merge pull request #323 from yanesca/iotcrypt-942-initialise-return-values 2019-12-19 10:24:22 +00:00
base64.c
bignum.c Merge pull request #346 from gilles-peskine-arm/mpi_copy_shrink 2020-02-06 09:52:01 +01:00
blowfish.c
camellia.c
ccm.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
certs.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
chacha20.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
chachapoly.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
cipher_wrap.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
cipher.c Remove redundant block_size validity check 2020-01-21 15:02:14 +01:00
cmac.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
CMakeLists.txt Merge mbed-crypto into mbedtls: the merge commit 2020-03-23 17:54:46 +01:00
ctr_drbg.c Merge branch 'development' into development-restricted 2020-01-15 15:55:11 +00:00
debug.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
des.c des: Reduce number of self-test iterations 2019-09-04 10:11:45 +01:00
dhm.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
ecdh.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
ecdsa.c Fix incrementing pointer instead of value 2020-01-24 12:11:56 +01:00
ecjpake.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
ecp_curves.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
ecp.c Revert "ecp: Remove dependency on TLS and X.509" 2020-03-19 14:23:45 +01:00
entropy_poll.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
entropy.c Merge pull request #323 from yanesca/iotcrypt-942-initialise-return-values 2019-12-19 10:24:22 +00:00
error.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
gcm.c Merge branch 'development' into development-restricted 2020-01-15 15:55:11 +00:00
havege.c
hkdf.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
hmac_drbg.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
Makefile Merge mbed-crypto into mbedtls: the merge commit 2020-03-23 17:54:46 +01:00
md2.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
md4.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
md5.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
md.c Revert "md: Remove dependency on X.509" 2020-03-19 14:23:45 +01:00
memory_buffer_alloc.c
net_sockets.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
nist_kw.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
oid.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
padlock.c
pem.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
pk_wrap.c Remove mbedtls_psa_translate_ecc_group 2020-01-31 10:15:32 +01:00
pk.c pk: USE_PSA_CRYPTO: don't translate via the TLS ID 2020-01-31 10:15:32 +01:00
pkcs5.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
pkcs11.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
pkcs12.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
pkparse.c Fix pkparse bug wrt MBEDTLS_RSA_ALT 2020-02-18 10:31:29 +01:00
pkwrite.c Change key types to a 16-bit encoding 2020-01-31 10:24:21 +01:00
platform_util.c Check for zero length and NULL buffer pointer. 2019-09-04 11:31:35 +01:00
platform.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
poly1305.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
psa_crypto_core.h
psa_crypto_invasive.h
psa_crypto_its.h
psa_crypto_se.c SE driver: Fix loading of persistent data 2019-10-01 16:55:29 +02:00
psa_crypto_se.h SE driver: call the p_init method during psa_crypto_init() 2019-10-01 15:22:29 +02:00
psa_crypto_service_integration.h
psa_crypto_slot_management.c Make psa_close_key(0) and psa_destroy_key(0) succeed 2019-10-08 15:57:27 +02:00
psa_crypto_slot_management.h
psa_crypto_storage.c Change key types to a 16-bit encoding 2020-01-31 10:24:21 +01:00
psa_crypto_storage.h
psa_crypto.c Merge pull request #345 from gilles-peskine-arm/psa_mac_verify_finish-status 2020-02-03 13:55:11 +00:00
psa_its_file.c Add an input check in psa_its_set 2019-09-05 09:34:34 -04:00
ripemd160.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
rsa_internal.c
rsa.c Final review comments 2020-01-28 14:43:52 -05:00
sha1.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
sha256.c Initialise return values to an error 2019-12-03 16:07:18 +00:00
sha512.c Fix some whitespace issues 2020-01-29 09:46:49 +01:00
ssl_cache.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
ssl_ciphersuites.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
ssl_cli.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
ssl_cookie.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
ssl_msg.c Move ssl_mac() from ssl_tls.c to ssl_msg.c 2020-02-07 11:38:03 +00:00
ssl_srv.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
ssl_ticket.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
ssl_tls.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
threading.c
timing.c
version_features.c Revert "config: Remove TLS and NET options" 2020-03-19 13:55:04 +01:00
version.c
x509_create.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509_crl.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509_crt.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509_csr.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509write_crt.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
x509write_csr.c Revert "Remove unused TLS, NET, and X.509 files" 2020-03-19 13:36:33 +01:00
xtea.c