Commit Graph

7234 Commits

Author SHA1 Message Date
Gilles Peskine
e7e149f469 .dsw files are Visual Studio stuff
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-28 18:34:20 +02:00
Gilles Peskine
be76c19801 Permit empty files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-28 18:34:20 +02:00
Gilles Peskine
4be18cf1f1 Normalize line endings
Convert all text files to Unix line endings unless they're Windows
stuff.

Make sure that all text files have a trailing newline.

Remove whitespace at the end of lines.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-28 18:34:20 +02:00
Gilles Peskine
4bda3254cf Check only files checked into Git
We're only interested in files that are committed and pushed to be
included in Mbed TLS, not in any other files that may be lying around.
So ask git for the list of file names.

This script is primarily intended to run on the CI, and there it runs
on a fresh Git checkout plus potentially some other checkouts or
leftovers from a previous part of the CI job. It should also run
reasonably well on developer machines, where there may be various
additional files. In both cases, git is available.

Ad hoc directory exclusions are no longer needed.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-28 18:33:56 +02:00
Gilles Peskine
986a06de94 Exclude binary files from text checks
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-28 18:33:18 +02:00
Gilles Peskine
b4805ece78 Regex mechanism for check-specific exemptions
Suffixes are convenient but not always sufficient.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-28 18:33:18 +02:00
Gilles Peskine
ab55bc71fe Check all files by default
Have an explicit list of exemptions for specific checks rather than
whitelisting files to check. Some checks, such as permissions, should
apply to all files.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-28 18:33:18 +02:00
Gilles Peskine
45137617db More accurate variable name
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-28 18:33:18 +02:00
danh-arm
64cad2fa07
Merge pull request #3359 from ronald-cron-arm/tool_versions-2.7
Backport 2.7: Add output of make, cmake and python3 versions
2020-05-27 17:44:15 +01:00
Janos Follath
ebc603051a
Merge pull request #3361 from paul-elliott-arm/fix-contributing-2.7
Backport 2.7: Fix contributing link to changelog howto
2020-05-27 07:44:47 +01:00
Paul Elliott
97bd3fa827 Change Changelog link to point at Changelog readme
Make the contributing document link to how to create a changelog rather
than just linking to the Changelog itself. Backported to 2.7

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2020-05-26 16:16:44 +01:00
Ronald Cron
6872e17b0e Add output of python3 version
Add output of python3 version to output_env.sh.
Added in addition to the version of `python` as some
project's scripts try both executable names.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2020-05-26 14:27:54 +02:00
Ronald Cron
a960dc980f Add output of make and cmake versions
Add output of make and cmake versions to output_env.sh.
That way we can see their versions in the CI.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2020-05-26 14:25:45 +02:00
Gilles Peskine
087bb4c5b1
Merge pull request #2705 from k-stachowiak/unified-exit-in-examples-2.7
Backport 2.7: Unify the example programs' termination
2020-05-12 10:47:04 +02:00
Gilles Peskine
a43d431e8a Add changelog entry file
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-05-11 22:20:41 +02:00
k-stachowiak
1ddf2928c9 Remove obsolete comment 2020-05-11 22:20:32 +02:00
Krzysztof Stachowiak
a08652233d Unify the example programs' termination
This is done to account for platforms, for which we want custom behavior
upon the program termination, hence we call `mbedtls_exit()` instead of
returning from `main()`.

For the sake of consistency, introduces the modifications have been made
to the test and utility examples as well. These, while less likely to be
used in the low level environments, won't suffer from such a change.
2020-05-11 22:20:32 +02:00
Janos Follath
cba1fadc86
Merge pull request #3308 from yanesca/update_contributing_discussion_link-2.7
Backport 2.7: Update link in contributing guide
2020-05-06 16:04:42 +01:00
Janos Follath
648b30aa6f Update link in contributing guide
The link pointed to the website, this information is out of date, the
correct place to start discussions is the mailing list.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2020-05-06 12:46:54 +01:00
Gilles Peskine
b0483152fb
Merge pull request #3248 from gilles-peskine-arm/travis-rationalize-2.7
Backport 2.7: Rationalize Travis builds
2020-05-04 12:10:57 +02:00
danh-arm
af71b953df
Merge pull request #3295 from gilles-peskine-arm/config-full-clarify-2.7
Backport 2.7: Clarify that the full config enables everything that can be tested together
2020-05-04 10:28:50 +01:00
Gilles Peskine
7ccd0255b8 Travis: do both a Cortex-A build and a Cortex-M0+ build
The Cortex-A build is similar to Debian armel. The Cortex-M0+ is a
handy point of comparison for code size. Put that one last so that
it's easy to find in the log.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 23:32:52 +02:00
Gilles Peskine
81b60fb7bd all.sh: on arm builds (GCC or Arm Compiler), show the code size
Just show the code size in the logs, for human consumption.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 23:31:04 +02:00
Gilles Peskine
4fb7a2f23f all.sh: add a Cortex-M0+ build
It's pretty fast and adds a little variety.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 23:31:04 +02:00
Gilles Peskine
009908b562 all.sh: build_arm_none_eabi_gcc: do optimize
Otherwise the bignum assembly code is not used.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 23:31:04 +02:00
Gilles Peskine
a27af6f023 all.sh: backport component_build_arm_none_eabi_gcc_arm5vte
Backport this component that was added to development after 2.7.0.
It's easier to keep the 2.7 branch closer to the other maintained
branches.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 23:31:03 +02:00
Gilles Peskine
f1709bb4ad Rename --arm-gcc-prefix to --arm-none-eabi-gcc-prefix
This is supposed to be for GCC (or a compiler with a compatible
command line interface) targeting arm-none-eabi, so name it
accordingly.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 23:31:03 +02:00
Gilles Peskine
c15574b8f5 Travis: rebalance the Linux builds
Make the running time more even.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 23:31:03 +02:00
Gilles Peskine
adaaddbe3b all.sh: reorganize testing around deprecated features
build_deprecated combined the testing of deprecated features, and
testing of the build without deprecated features. Also, it violated the
component naming convention by being called build_xxx but running tests.

Replace it by:
* test_default_no_deprecated: check that you can remove deprecated
  features from the default build.
* test_full_deprecated_warning: check that enabling DEPRECATED_WARNING
  doesn't cause any warning from our own code.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 18:47:37 +02:00
Gilles Peskine
457351afbd Exclude DEPRECATED_WARNING in config full
In the full config, don't set MBEDTLS_DEPRECATED_WARNING. This is debatable:
the full config does not enable deprecated features in this branch, so
MBEDTLS_DEPRECATED_WARNING is compatible with the other features.
Exclude it to keep LTS branches closer to development.

In any case, baremetal and full should have the same settings regarding
deprecated features, so don't do anything about DEPRECATED_xxx in baremetal.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 18:47:36 +02:00
Gilles Peskine
63d92c6633 Strict C99: don't use extremely large string literals
Don't use string literals that are longer than 4095 bytes, which is
the minimum that C99 compilers are required to support. Compilers are
extremely likely to support longer literals, but `gcc -std=c99 -pedantic`
complains.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 18:47:36 +02:00
Gilles Peskine
3aba3f48f8 Strict C99: don't use a signed* when an unsigned* is expected
It works in practice on almost every platform, given that we're only
using the wrong type in cases where the value is guaranteed to stay
within the value bits of a signed int. But even in this case it may or
may not be strictly conforming. Anyway `gcc -std=c99 -pedantic`
rejects it.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 13:24:16 +02:00
Gilles Peskine
2717eaf1e0 Fix build failure with MBEDTLS_PLATFORM_NV_SEED_ALT
An earlier botched backport (d56ca658ab)
had the wrong name for a variable and a missing header inclusion.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 13:21:27 +02:00
Gilles Peskine
a21c5e9988 Document and fix the MBEDTLS_xxx_ALT logic for the full config
The intended logic around MBEDTLS_xxx_ALT is to exclude them from full
because they require the alternative implementation of one or more
library functions, except that MBEDTLS_PLATFORM_xxx_ALT are different:
they're alternative implementations of a platform function and they
have a built-in default, so they should be included in full. Document
this.

Fix a bug whereby MBEDTLS_PLATFORM_xxx_ALT didn't catch symbols where
xxx contains an underscore. As a consequence, MBEDTLS_PLATFORM_NV_SEED_ALT
is now enabled in the full config. Explicitly exclude
MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT because it behaves like the
non-platform ones, requiring an extra build-time dependency.
Explicitly exclude MBEDTLS_PLATFORM_NV_SEED_ALT from baremetal
because it requires MBEDTLS_ENTROPY_NV_SEED, and likewise explicitly
unset it from builds that unset MBEDTLS_ENTROPY_NV_SEED.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 09:16:36 +02:00
Gilles Peskine
ba5dbae974 Sort lists for easier maintenance
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-29 15:52:39 +02:00
Gilles Peskine
f48d468111 Explain the rationale for inclusion in "full" and "baremetal"
Remove the duplicated, and often out-of-date, list in the comments.
Instead explain in a comment, and have a single copy of the list which
is in the code.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-29 15:51:28 +02:00
Gilles Peskine
165d1bb379 Enable X509_ALLOW_EXTENSIONS_NON_V3 in config full
Enable MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 in the full config. There's
no reason to keep it out. We weren't testing it at all on the CI.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-29 15:51:28 +02:00
Gilles Peskine
89361c9471 Remove obsolete options from config.pl
These options haven't existed for a long time.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-29 15:51:28 +02:00
Gilles Peskine
b8da88d398
Merge pull request #3284 from gilles-peskine-arm/changelog-20200421-2.7
2.7 only: Add missing changelog entry for PRs since 2.7.15
2020-04-28 13:10:43 +02:00
Manuel Pégourié-Gonnard
b60bf72b05
Merge pull request #3204 from irwir/fix_vcxproj-2.7
[backport 2.7] Finalize fixing bugs in .vcxproj files
2020-04-28 13:03:23 +02:00
Gilles Peskine
a958a01400 Add changelog entry for #3196: x509_crt max_pathlen int overflow fix
Backport of #3192

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-28 12:14:32 +02:00
Gilles Peskine
00f2436bf3 Travis: Windows: target Visual Studio 2017
Only the Visual Studio 2017 toolset is currently preinstalled on Travis.
Use this, instead of our solution's default which is VS 2010.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:27:39 +02:00
Gilles Peskine
a1cf6d5bda Travis: add a build with Visual Studio on Windows
Travis now offers a Windows environment. Do a build with Visual
Studio. This brings diversity into the Travis CI which otherwise only
uses GCC and Clang.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:27:39 +02:00
Gilles Peskine
35170f1190 Add a simple build script for Windows with Visual Studio
Keep it simple and mostly non-parametrizable for now.
A path to Visual Studio 2017 is hard-coded.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:27:39 +02:00
Gilles Peskine
86e5816dda check-files: support Windows .bat files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:27:39 +02:00
Gilles Peskine
e4fdfc499c Travis: add a build on macOS
Just do the default build with Clang and run the unit tests. The
objective is to have one build on a Unix-like platform other than
Linux.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:27:39 +02:00
Gilles Peskine
59afb731da Travis: add a baremetal build
Add a baremetal build to Travis, to catch inadvertent dependencies on
platform functions.

The exact choice of target platform doesn't matter for this purpose.
Pick one that's present in all.sh, that uses a compiler that's
available in the Travis build environment (Ubuntu 16.04), and that
happens to be close to the Debian "armel" distribution.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:27:36 +02:00
Gilles Peskine
04c4a7e3f2 Travis: call all depends_* tests
Call all.sh to run all the available test_depends_* components. This
adds a run of depends-hashes.pl and depends-pkgalgs.pl.

Keep invoking test-ref-configs.pl rather than via all.sh so that it
doesn't run with ASan. This saves some time and ASan there doesn't
turn up much more than in the full config.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:25:45 +02:00
Gilles Peskine
2bebfc9476 Travis: install gnutls-bin for all jobs
Some jobs don't actually test against GnuTLS, but all.sh checks its
presence in all test jobs, so it needs to be installed regardless.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:25:45 +02:00
Gilles Peskine
12141d0fac Travis: replace "default configuration by "full configuration"
For the one long job with ASan, use the full configuration.

We get more coverage this way, at the cost of a slightly longer
runtime which we can afford since the "enumerated configurations" job
is slower.

Add a default-configuration build to the "basic checks" job. This job
is fairly quick (no ASan, no SSL testing).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-27 11:25:45 +02:00