mbedtls/tests/scripts
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
..
all-in-docker.sh Clean up file prologue comments 2019-06-29 17:45:34 -05:00
all.sh Merge mbed-crypto into mbedtls: the merge commit 2020-03-23 17:54:46 +01:00
basic-build-test.sh Revert "Remove tests that depend on TLS or X.509" 2020-03-19 14:17:54 +01:00
basic-in-docker.sh Merge remote-tracking branch 'tls/development' into development 2019-07-31 10:37:53 +01:00
check-doxy-blocks.pl Use "#!/usr/bin/env perl" as shebang line. 2018-04-04 21:44:29 +00:00
check-files.py 3rdparty: Fix Makefile coding conventions 2019-08-29 16:12:38 +01:00
check-generated-files.sh query_config: Move to programs/test 2020-02-11 19:26:27 +01:00
check-names.sh Move 3rdparty mentions to a separate line 2020-02-19 20:13:29 +01:00
check-python-files.sh Fix pylint errors going uncaught 2019-02-27 11:03:25 +01:00
check-test-cases.py Add command line option to hide warnings 2020-01-30 12:27:14 +01:00
curves.pl Invoke config.py instead of config.pl 2019-11-13 14:33:33 +00:00
depends-hashes.pl Adjust depends-hashes.pl to test NO_SHA384 as well 2020-01-06 11:40:23 +01:00
depends-pkalgs.pl Revert "config: Remove TLS and NET options" 2020-03-19 13:55:04 +01:00
docker_env.sh Improve compatibility with firewalled networks 2019-06-29 17:45:34 -05:00
doxygen.sh Add scripts/apidoc_full.sh 2016-01-12 14:48:03 +00:00
gen_ctr_drbg.pl Merge remote-tracking branch 'public/pr/1533' into development 2018-06-27 10:50:58 +01:00
gen_gcm_decrypt.pl Use "#!/usr/bin/env perl" as shebang line. 2018-04-04 21:44:29 +00:00
gen_gcm_encrypt.pl Use "#!/usr/bin/env perl" as shebang line. 2018-04-04 21:44:29 +00:00
gen_pkcs1_v21_sign_verify.pl Merge remote-tracking branch 'public/pr/1533' into development 2018-06-27 10:50:58 +01:00
generate_test_code.py Revert "tests: Update generator with Mbed Crypto comments" 2020-03-04 15:39:14 +01:00
generate-afl-tests.sh Added script to split the test case data files 2016-03-09 19:32:09 +00:00
key-exchanges.pl Invoke config.py instead of config.pl in reverted content 2020-03-19 14:23:45 +01:00
list-enum-consts.pl Fix preprocessor directive recognition in list-enum-consts.pl 2019-08-29 16:12:38 +01:00
list-identifiers.sh Make check-names.sh find the right names in 3rdparty 2019-08-19 13:36:44 +01:00
list-macros.sh Revert "check-names: Enable referencing Mbed TLS macros" 2020-03-19 13:55:04 +01:00
list-symbols.sh Invoke config.py instead of config.pl 2019-11-13 14:33:33 +00:00
mbedtls_test.py Fix some pylint warnings 2019-12-20 15:14:59 +00:00
psa_collect_statuses.py PSA return status coverage script 2019-09-06 19:28:47 +02:00
recursion.pl Revert "recursion.pl: Don't depend on X.509" 2020-03-19 14:23:45 +01:00
run-test-suites.pl 'make test' must fail if Asan fails 2019-10-21 20:10:21 +02:00
tcp_client.pl Revert "Remove tests that depend on TLS or X.509" 2020-03-19 14:17:54 +01:00
test_config_script.py Add set+get tests 2019-11-13 14:33:34 +00:00
test_generate_test_code.py Silence pylint 2019-02-27 11:03:25 +01:00
test_psa_constant_names.py Change key types to a 16-bit encoding 2020-01-31 10:24:21 +01:00
test_zeroize.gdb Merge remote-tracking branch 'origin/pr/2332' into development 2019-01-30 15:53:00 +00:00
test-ref-configs.pl Revert "Remove tests that depend on TLS or X.509" 2020-03-19 14:17:54 +01:00
travis-log-failure.sh Revert "Remove tests that depend on TLS or X.509" 2020-03-19 14:17:54 +01:00