Commit Graph

13121 Commits

Author SHA1 Message Date
sander-visser
1abe8ee554 Expose SSL HW record acceleration error.
Fix issue with variable shadowing.

Signed-off-by: sander-visser <github@visser.se>
2020-05-06 21:29:01 +02:00
Janos Follath
5435451a1a
Merge pull request #3306 from yanesca/update_contributing_discussion_link
Update link in contributing guide
2020-05-06 16:05:06 +01:00
Janos Follath
a85c2b27f3 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 11:11:39 +01:00
Gilles Peskine
d9f694960f
Merge pull request #3190 from gilles-peskine-arm/config-full-clarify-development
Clarify that the full config enables everything that can be tested together
2020-05-04 12:29:09 +02:00
Manuel Pégourié-Gonnard
1d632c26a4
Merge pull request #3239 from opatomic/win2kdns
add support for win2k
2020-05-04 12:19:45 +02:00
Gilles Peskine
39461b04f6
Merge pull request #3218 from gilles-peskine-arm/travis-rationalize
Rationalize Travis builds
2020-05-04 12:10:51 +02:00
Gilles Peskine
9515d76171
Merge pull request #3219 from aggarg/err_optimization
Remove error_description variable from strerr functions
2020-05-04 09:37:13 +02:00
Gilles Peskine
907211da88 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:14:08 +02:00
Gilles Peskine
18487f62d8 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:14:08 +02:00
Gilles Peskine
6e2fb86c1e 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:14:08 +02:00
Gilles Peskine
6537588d76 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:14:04 +02:00
Gilles Peskine
6d06134e93 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 18:41:35 +02:00
Gilles Peskine
dd2feead99
Merge pull request #3229 from gabor-mezei-arm/development
Fix spurious message about outcome file when running all.sh
2020-04-30 18:01:18 +02:00
Gilles Peskine
8386ea22b2 all.sh: explain the testing around deprecated features
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-30 09:07:29 +02:00
danh-arm
3b1c072bfc
Merge pull request #3217 from irwir/fix_ssl_tls.c
Avoid re-assigning zero to `ret` variable.
2020-04-29 18:07:10 +01:00
danh-arm
924a1f2f47
Merge pull request #3147 from gocarlos/gocarlos-patch-1
cmake: add option to treat compiler warnings as errors
2020-04-29 17:14:48 +01:00
Gilles Peskine
bdd5ba98e8
Merge pull request #3216 from gilles-peskine-arm/changelog-20200421-development
Add missing changelog entries for PRs since 2.22.0
2020-04-28 13:10:36 +02:00
Manuel Pégourié-Gonnard
0c103a8f40
Merge pull request #2853 from irwir/fix_vcxproj
Finalize fixing bugs in .vcxproj files
2020-04-28 13:03:13 +02:00
Carlos Gomes Martinho
e150c77969 build: readd unsafe build to show #warnings in CI
Signed-off-by: Carlos Gomes Martinho <carlos.gomes_martinho@siemens.com>
2020-04-28 12:55:14 +02:00
Gilles Peskine
4830d2134b Use () after function name
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-28 12:10:02 +02:00
Gilles Peskine
10cb160000 Travis: rebalance the Linux builds
Make the running time more even.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-26 21:26:42 +02:00
Gilles Peskine
b97a044837 Travis: Windows: install Python 3 and run generate_psa_constants.py
Travis Windows machines currently don't have Python 3 preinstalled.
We need it to run scripts/generate_psa_constants.py which is needed
to build mbedTLS.sln.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-26 20:54:14 +02:00
Gilles Peskine
23d249a99e 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-26 20:52:05 +02:00
Gilles Peskine
040251001b 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-26 20:52:04 +02:00
Gilles Peskine
a4a8f04718 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-26 20:52:04 +02:00
Gilles Peskine
af387e0ce1 check-files: support Windows .bat files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-26 00:43:56 +02:00
Gilles Peskine
129d04169a 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-26 00:16:34 +02:00
Gilles Peskine
f2f39ddd89 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-26 00:16:34 +02:00
Gilles Peskine
5dcfb947d1 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-26 00:16:34 +02:00
Gilles Peskine
a5ced5b103 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-26 00:16:34 +02:00
Gilles Peskine
a2d3ec22bb 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-25 22:39:27 +02:00
Gilles Peskine
dc566758a3 Travis: call all.sh for the default-configuration build
This way anything we change in all.sh, such as adding tests for
programs/*/*, will be reflected here.

The build now uses GCC instead of Clang, which doesn't make much
difference in practice. The build now enables ASan and UBSan.

The tests now run compat.sh and ssl-opt.sh fully.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-25 22:39:27 +02:00
Gilles Peskine
3c7ffd7a40 Travis: call all.sh for sanity checks
Different releases have different sets of sanity checks. Keep the list
in one place, namely all.sh.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-25 22:39:27 +02:00
Gilles Peskine
a38f3685dc Travis: run Pylint
Declare an explicit Python version. Pick 3.5 which is the default
version on Ubuntu 16.04. This is necessary on Travis to have a working
pip for Python 3.

Install Pylint 2.4.4. There's nothing special about this version, it's
just the latest version.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-25 22:39:26 +02:00
Gilles Peskine
b49a4576ae Travis: move doxygen dependencies into the "sanity" job
Only this job uses doxygen and graphviz.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-25 22:39:24 +02:00
Gilles Peskine
d0f543a5dc Travis: split the build into three parallel jobs
Split the build between:
* Basic checks
* A build in the default configuration with extensive tests
* Builds in other configurations with less testing

The intent is to have one shorter job with basic tests, and two longer
jobs that take roughly the same amount of time (split as evenly as
possible while keeping an easy-to-understand separation).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-25 22:34:28 +02:00
Gilles Peskine
c9cdd21a04 Travis: don't test with both gcc and clang
In practice, we hardly ever get different outcomes, so there is no
gain in running tests with different compilers.

Experimentally, with the builds and tests we currently do and with the
compiler versions on a Travis Ubuntu 16.04, gcc jobs are significantly
faster than clang jobs (13 min vs 24 min). So use gcc.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-25 22:34:28 +02:00
Gilles Peskine
60f267bb1e all.sh: make the arm-gcc cross-compiler prefix configurable
Make it possible to use a compiler that isn't in $PATH, or that's
installed with a different name, or even a compiler for a different
target such as arm-linux-gnueabi.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-25 22:34:28 +02:00
Gilles Peskine
97bea01ff4 all.sh: run selftest in the full config and with ASan
Almost everything the selftest program does is in the test suites. But
just in case run the selftest program itself once in the full
configuration, and once in the default configuration with ASan, in
addition to running it out of box.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-25 22:34:23 +02:00
opatomic
2b2acf1111 add support for win2k
getaddrinfo() is not available on win2k. By including wspiapi.h (if
_WIN32_WINNT is defined as value < 0x0501) then a compatibility layer
will be used when running on win2k. For more details, refer to Microsoft
docs for getaddrinfo().

Signed-off-by: opatomic <j@opatomic.com>
2020-04-24 10:40:24 -04:00
Manuel Pégourié-Gonnard
b1c8e41ae3
Merge pull request #3209 from aurel32/fix-ecp_double_add_mxz
Fix wrong modulo call in ecp_double_add_mxz
2020-04-24 09:28:17 +02:00
Aurelien Jarno
66deb38d64 Fix wrong modulo call in ecp_double_add_mxz
ecp_double_add_mxz wrongly does an MPI addition followed by a call to
MOD_MUL instead of MOD_ADD. This is more visible since the
mbedtls_mpi_xxx_mod functions have been added in commit 3b3b34f608
("Replace some macros by functions").

Fix that by using mbedtls_mpi_add_mod instead. The testsuite still
passes after that change.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2020-04-23 23:16:11 +02:00
danh-arm
494f6cb823
Merge pull request #3153 from kennethsoerensen/format-signedness
Fix GCC format-signedness warnings
2020-04-23 11:00:45 +01:00
Gaurav Aggarwal
cabde25289 Align with coding style
return statements use parentheses to contain their value.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2020-04-22 08:13:25 -07:00
Kenneth Soerensen
518d435e7b Fix GCC format-signedness warnings
Signed-off-by: Kenneth Soerensen <knnthsrnsn@gmail.com>
2020-04-22 16:01:48 +02:00
gabor-mezei-arm
88d7eee00b Check for empty string in outcome file name
Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
2020-04-22 11:07:34 +02:00
Gilles Peskine
19028a8bb1 Add changelog entry for #3150: simplify ssl_write_certificate_request
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-22 09:51:51 +02:00
Manuel Pégourié-Gonnard
6bd4c79999
Merge pull request #3150 from irwir/fix_ssl_srv
Simplify checks in ssl_write_certificate_request
2020-04-22 09:31:00 +02:00
Gaurav Aggarwal
8663c7415a Remove error_description variable from strerr functions
This was suggested on this PR: https://github.com/ARMmbed/mbedtls/pull/3176

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2020-04-21 14:04:19 -07:00
irwir
d3085ab2b8 Avoid re-assigning zero to ret variable.
Resolve #3182.

Signed-off-by: irwir <irwir@users.noreply.github.com>
2020-04-21 22:26:59 +03:00