Darryl Green
2f0eb51aae
psa: Define mbedtls_ecc_group_to_psa() inline
...
On dual world platforms, we want to run the PK module (pk.c) on the NS
side so TLS can use PSA APIs via the PK interface. PK currently has a
hard dependency on mbedtls_ecc_group_to_psa() which is declared in
crypto_extra.h, but only defined in psa_crypto.c, which is only built
for the S side.
Without this change, dual world platforms get error messages like the
following.
[Error] @0,0: L6218E: Undefined symbol mbedtls_ecc_group_to_psa (referred from BUILD/LPC55S69_NS/ARM/mbed-os/features/mbedtls/mbed-crypto/src/pk.o)
Make mbedtls_ecc_group_to_psa() inline within crypto_extra.h so that it
is available to both NS and S world code.
Fixes #3300
Signed-off-by: Darryl Green <darryl.green@arm.com>
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-05-05 12:41:48 +01:00
Jaeden Amero
1bde9cdf71
psa: Clear bits in mbedtls_ecc_group_to_psa()
...
Clear bits in mbedtls_ecc_group_to_psa() to avoid static analyzers and
possibly compilers from warning that bits may be used uninitialized in
certain code paths.
For example, if mbedtls_ecc_group_to_psa() were to be inlined in
crypto_extra.h, the following compiler warning is likely.
In file included from ../include/psa/crypto.h:3774:0,
from ../include/mbedtls/pk.h:49,
from pk.c:29:
pk.c: In function 'mbedtls_pk_wrap_as_opaque':
../include/psa/crypto_struct.h:460:33: error: 'bits' may be used uninitialized in this function [-Werror=maybe-uninitialized]
attributes->core.bits = (psa_key_bits_t) bits;
^~~~~~~~~~~~~~~~~~~~~
pk.c:608:12: note: 'bits' was declared here
size_t bits;
^~~~
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-05-05 12:41:41 +01: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
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
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
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
Gilles Peskine
bdc639b86f
Add changelog entry for #3208 : md.c switch case unification
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-21 20:19:29 +02:00
Gilles Peskine
fd0627521b
Add changelog entry for #3176 : new error functions
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-21 20:18:26 +02:00
Gilles Peskine
14884f9822
Add changelog entry for #3127 : ssl_context_info
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-21 20:15:37 +02:00
Gilles Peskine
e7a5386eb9
Add changelog entry for #3192 : x509_crt max_pathlen int overflow fix
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-21 19:56:53 +02:00
Gilles Peskine
5cac337228
Merge pull request #3208 from irwir/fix_md.c
...
Fix "same actions in two cases of a switch statement" warning
2020-04-21 16:25:20 +02:00
Gilles Peskine
dc9c47da6c
Merge pull request #3176 from aggarg/development
...
Add support for const error description strings
2020-04-21 13:57:11 +02:00
irwir
c9bc300724
Simplify bounds check in ssl_write_certificate_request
...
It is sufficient to check for the strongest limit only. Using a smaller
type ensures there is no overflow (assuming size_t is at least 32 bits).
Fixes #2916
Signed-off-by: irwir <irwir@users.noreply.github.com>
2020-04-21 14:51:08 +03:00
Gilles Peskine
e50c6edeee
Merge pull request #3210 from gilles-peskine-arm/ssl_context_info-fix_checks
...
Re-generate a file
2020-04-21 10:20:20 +02:00
Gaurav Aggarwal
6ea4fc7b53
Address review comments
...
1. The functions mbedtls_high_level_strerr and mbedtls_low_level_strerr
accept any error code and extract the high-level and low-level parts
respectively.
2. Documentation updates.
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2020-04-20 16:03:46 -07:00
Gilles Peskine
3669208c8e
Re-run generate_visualc_files.pl
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-04-20 21:44:57 +02:00
Jaeden Amero
3a7ca1d0cb
Merge pull request #3194 from piotr-now/serialized_to_file
...
Saving the serialized context to a file
2020-04-20 15:50:12 +01:00
Gilles Peskine
b72df54f9b
Merge pull request #2840 from k-stachowiak/check-bounds-of-test-intex-in-suites
...
Add lower bound check to function index lookup
2020-04-20 15:19:55 +02:00
Gilles Peskine
5a2710e9af
Merge pull request #3120 from gilles-peskine-arm/check-windows-files
...
Check Windows files for sanity as well
2020-04-20 13:59:27 +02:00
irwir
f0fec77e3e
Fix "same actions in two cases of a switch statement" warning
...
Resolves #3202
Signed-off-by: irwir <irwir@users.noreply.github.com>
2020-04-20 13:56:09 +03:00
irwir
af81957abd
Add changelog
...
Signed-off-by: irwir <irwir@users.noreply.github.com>
2020-04-20 13:23:21 +03:00
irwir
96b45a4370
Merge remote-tracking branch 'upstream/development' into fix_vcxproj
...
Signed-off-by: irwir <irwir@users.noreply.github.com>
2020-04-20 13:21:46 +03:00
irwir
febf8802d7
Merge remote-tracking branch 'upstream/development' into fix_vcxproj
...
Signed-off-by: irwir <irwir@users.noreply.github.com>
2020-04-20 13:20:06 +03:00
Gilles Peskine
23352a39a9
Merge pull request #3177 from mpg/fix-overflow-benchmark-dev
...
Fix arithmetic overflow in benchmark
2020-04-20 12:02:45 +02:00
Gilles Peskine
bb6b163cb0
Merge pull request #3162 from mpg/sort-lists
...
Improve formatting of lists in Makefile, CMakeLists.txt and .gitignore
2020-04-20 10:16:32 +02:00
Gilles Peskine
5c34ee14d3
Merge pull request #3118 from gilles-peskine-arm/pylint-up-to-2.4-development
...
Pass Pylint up to 2.4
2020-04-20 09:47:40 +02:00
irwir
49d46a7473
Finalize fixing the issue #1430 .
...
The previous PRs had correct template project, but somehow it was not merged.
Signed-off-by: irwir <irwir@users.noreply.github.com>
2020-04-19 16:25:54 +03:00
Piotr Nowicki
3de298f18f
Saving the serialized context to a file
...
Signed-off-by: Piotr Nowicki <piotr.nowicki@arm.com>
2020-04-17 16:26:43 +02:00
Piotr Nowicki
136bebf934
Add missing newline character
...
Signed-off-by: Piotr Nowicki <piotr.nowicki@arm.com>
2020-04-17 14:47:33 +02:00
Manuel Pégourié-Gonnard
6ff11895f4
Sort lists in .gitignore files
...
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-04-17 11:58:54 +02:00
Manuel Pégourié-Gonnard
6f830251a1
Sort lists in CMakeLists.txt files
...
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-04-17 11:58:54 +02:00
Manuel Pégourié-Gonnard
10a5b535f1
Sort lists in Makefiles and have one item per line
...
A file generated based on the output of `make list` from programs has been
re-generated.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-04-17 11:57:50 +02:00
Manuel Pégourié-Gonnard
5edd388da0
Get rid of a magic value in benchmark.c
...
Also update its value while at it.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-04-17 11:28:25 +02:00
Gilles Peskine
5f69cbe2cc
Merge pull request #3155 from ronald-cron-arm/unmet-dependencies-buffer-overflow-fix
...
Unmet dependencies buffer overflow fix
2020-04-17 10:08:14 +02:00
Jaeden Amero
31f4cd9de2
Merge pull request #3192 from AndrzejKurek/max_pathlen_overflow
...
Guard from undefined behaviour in case of an INT_MAX max_pathlen
2020-04-16 16:29:44 +01:00
Jaeden Amero
ed9e4779ab
Merge pull request #3127 from piotr-now/ssl_base64_dump
...
Add program for deserializing from base64 code
2020-04-16 12:00:25 +01:00