Commit graph

4078 commits

Author SHA1 Message Date
Chris Jones
a1df4949b9 Remove internal file references in programs/
`entropy_poll.h` and `md_wrap.h` were still being used in some of the
example programs. As these headers are now internal, remove their
references and replace them with publicly available functions.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-11 17:44:43 +00:00
Chris Jones
3848e31eac Fix internal references in public documentation
Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-11 16:17:59 +00:00
Chris Jones
1508fd1064 Remove broken doxygen link to internal macro
Removes a broken doxygen link to a macro that is now internal and
cannot be seen from the public API anymore.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
ea0a865c69 Move entropy_poll.h to library
`entropy_poll.h` is not supposed to be used by application code and
is therefore being made internal.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
16dbaeb9eb Move padlock.h to library
`padlock.h` is actually an internal header and is moved accordingly.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
187782f41e Move aesni.h to library
`aesni.h` is an internal header and is moved accordingly.

Also removes some references to internal headers in scripts with
only public headers.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
daacb59c2e Rename <pk/md/cipher>_internal.h to *_wrap.h
Revert changes introduced in 50518f4195
as it is now clear that these headers are internal without the
`*_internal.h` suffix.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
66a4cd46fd Rename rsa_internal.* to rsa_alt_helpers.*
Rename both `rsa_internal.h` and `rsa_internal.c` to more descriptive
names: `rsa_alt_helpers.h` and `rsa_alt_helpers.c`.

Also re-orders `rsa_internal.c` to match the order in `rsa_internal.h`

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
84a773f8e6 Rename ssl_internal.h to ssl_misc.h
Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
4c5819c318 Move bn_mul.h to library/
Move `include/mbedtls/bn_mul.h` to `library/bn_mul.h`.

Update includes and references to `bn_mul.h` to new location.

Also remove internal headers from `cpp_dummy_build.cpp` as it should only
test public headers in the library.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
35ac46a3a3 Move internal headers from include/mbedtls/ to library/
`cipher_internal.h`, `ecp_internal.h`, `md_internal.h`, `pk_internal.h`
and `ssl_internal.h` have all been moved.

Includes and dependnecies have not been renamed yet, only direct mv.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:52:37 +00:00
Chris Jones
7b9f33cc8c Move include/mbedtls/rsa_internal.h to library/rsa_internal.h
Only move `rsa_internal.h` for now to test dependancies. Other internal
headers will be moved in following commits.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-03-10 12:45:52 +00:00
Mateusz Starzyk
7d48b28218 Remove 1.3 to 2.0 transition helpers files.
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
2021-03-03 11:00:34 +01:00
Manuel Pégourié-Gonnard
3d210cf2b5
Merge pull request #4066 from mstarzyk-mobica/const_asn1write
Add missing const attribute to asn1write api
2021-02-12 12:23:24 +01:00
Manuel Pégourié-Gonnard
4dad303e99
Merge pull request #4089 from mstarzyk-mobica/remove_havege
Remove Havege module.
2021-02-12 10:02:15 +01:00
Mateusz Starzyk
0fdcc8eee9 Remove Havege module.
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
2021-02-11 14:17:07 +01:00
Manuel Pégourié-Gonnard
de6cb2605e
Merge pull request #4063 from mstarzyk-mobica/const_asn1
Add missing const attribute to asn1 api
2021-02-11 09:34:38 +01:00
Mateusz Starzyk
3292453402 Add missing const attribute to Public Key API
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
2021-02-05 12:06:01 +01:00
Mateusz Starzyk
4e300d00e8 Add missing const attribute to asn1write api
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
2021-01-27 15:37:12 +01:00
Mateusz Starzyk
59961cfc73 Add missing const attribute to asn1 api
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
2021-01-26 13:57:46 +01:00
Andrzej Kurek
2a54a6fe1c Refactor the variable buffer length config description
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2021-01-11 09:14:21 -05:00
Andrzej Kurek
557289babc Add a missing dependency to config.h
Variable buffer lengths depend on the maximum fragment length extension.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2021-01-11 09:14:15 -05:00
Andrzej Kurek
069fa96cd7 Use size_t instead of uint32_t for ssl I/O buffer lengths
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2021-01-11 09:13:58 -05:00
Gilles Peskine
a51e1dbe76
Merge pull request #3895 from gilles-peskine-arm/psa-external-random
Alternative random generator support for PSA
2021-01-06 17:09:11 +01:00
Gilles Peskine
88fa5c463e Minor documentation improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-04 21:00:53 +01:00
Manuel Pégourié-Gonnard
575ece0eed
Merge pull request #3576 from gilles-peskine-arm/psa-lifetime-persistence-indicator-tweaks
Tweak documentation about lifetimes
2020-12-15 10:17:39 +01:00
Gilles Peskine
0bb257096a Copyediting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-14 17:36:02 +01:00
Gilles Peskine
e39bdaa0ed Specialize some wording from the specification
Some of the material was originally the PSA specification, and
discusses how different implementations might behave. Replace such
statements by a description of how Mbed TLS behaves.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-11 18:47:55 +01:00
Gilles Peskine
9b3e5a7b3e Clarify the explanation of locations
It's about who has access to the key material in plaintext, not directly
where the operation is performed.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-11 18:47:11 +01:00
Janos Follath
f3c856536b
Merge pull request #789 from ARMmbed/mbedtls-2.25.0r0
Merge release candidate back to development
2020-12-11 14:36:29 +00:00
Manuel Pégourié-Gonnard
a27a4e2f18
Merge pull request #3929 from gilles-peskine-arm/psa-driver-remove-old-accel
Remove old proposed accelerator interfaces
2020-12-10 11:31:47 +01:00
Janos Follath
0cbdc61171 Bump version to Mbed TLS 2.25.0
Executed ./scripts/bump_version.sh --version 2.25.0 --so-crypto 6

Increasing the SO version of the crypto library, because the openless
API improvement came with API/ABI incompatibilities. For example
    - the size of psa_key_handle_t changed
    - the type of a parameter in 18 public functions has changed from
      psa_key_handle_t to mbedtls_svc_key_id_t

Signed-off-by: Janos Follath <janos.follath@arm.com>
2020-12-09 15:05:22 +00:00
Janos Follath
a946dcf8b2 Merge branch 'development-restricted' into mbedtls-2.25.0r0-pr 2020-12-08 20:59:45 +00:00
Gilles Peskine
2b759626a9
Merge pull request #3948 from bensze01/update_psa_values
Update the values of PSA Crypto API macros to version 1.0.0
2020-12-08 11:03:33 +01:00
Bence Szépkúti
99ffb2b275 Simplify description of PSA_ALG_STREAM_CIPHER
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2020-12-08 00:09:08 +01:00
Bence Szépkúti
cbe395332c Substitute PSA_ALG_STREAM_CIPHER into all files
Deprecate PSA_ALG_ARC4 and PSA_ALG_CHACHA20.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2020-12-08 00:01:31 +01:00
Bence Szépkúti
a294551446 Update PSA Crypto macro values to version 1.0.0
This should be everything that's needed for the stable storage format.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2020-12-07 21:03:05 +01:00
Bence Szépkúti
1de907d4a4 Introduce PSA_ALG_STREAM_CIPHER
This algorithm replaces the pre-existing stream cipher algorithms.
The underlying stream cipher is determined by the key type.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2020-12-07 21:03:05 +01:00
Gilles Peskine
e995b9b3f0 Clarify statuses from mbedtls_psa_external_get_random
Add and document PSA_ERROR_INSUFFICIENT_ENTROPY.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-12-07 20:42:57 +01:00
Ronald Cron
771090659e
Merge pull request #3393 from geecrypt/development
Support set *_drbg reseed interval before seed
2020-12-07 14:29:52 +01:00
Gilles Peskine
3a0535b465
Merge pull request #3916 from jdurkop/psa-crypto-config-hashes-3672
Add support to crypto config for hashes
2020-12-07 13:50:56 +01:00
Manuel Pégourié-Gonnard
b23e31d86a Minor documentation/comment fixes
typos, overlong lines

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-12-07 09:57:35 +01:00
Manuel Pégourié-Gonnard
513c243317 Deprecate mbedtls_cipher_auth_xxcrypt()
This temporarily breaks all.sh '*deprecated*' (deprecated functions still used
in the library), which will be fix in the next commit.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-12-03 12:25:09 +01:00
Manuel Pégourié-Gonnard
f2ffbc4387 Stop supporting NIST_KW in cipher_auth_xxcrypt()
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-12-03 12:25:09 +01:00
Manuel Pégourié-Gonnard
9cc079db7a Declare cipher_auth_{en,de}crypt_ext()
Work in progress: next steps are to implement and test it.

Compared to the existing non-ext version:

- to separate tag parameter
- explicit output_len parameter

Also, this version will retain support for NIST_KW (hence documents it), while
the non-ext version will lose it in a few commits.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-12-03 10:09:44 +01:00
Manuel Pégourié-Gonnard
3ba84d5bd6 Improve documentation of cipher_auth_xxcrypt()
- Document constraints on buffers/pointers NULLability explicitly.
- Simplify terminology around IV/nonce: all AEADs implemented so far call that
  a nonce. Keep the parameter names (iv, iv_len) to avoid having to change the
code (or having different names in the header and C files).
- Align documentation to the code regarding parameter constraints: the
  documentation said the for ciphers with fixed nonce/tag length, the
iv_len/tag_len arguments were ignored, while the code enforced them to be the
expected value. This is more consistent with what's done with GCM/CCM, which
for tag_len for example accept more than one value, but from a relatively
small set, and will return errors for values outside that set. Accepting a
single value is a particular case of that (the set of acceptable value only
has one element).

Don't document behaviour with NIST KW as we're about to change that.

Note: this function is currently only defined if at least one of GCM, CCM or
ChachaPoly is enabled, even though it's supposed to handle NIST KW as well. No
need to fix this as the function will soon no longer support NIST KW.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2020-12-03 10:01:28 +01:00
John Durkop
d62b678473 Minor updates to address review comments
Removed unecessary checks on the ALG_SHA_224 and ALG_SHA_384 since
those are handled in config_psa.h by ensuring the correct _C is
included. Reformatted config_psa.h to be alphabetical and made the
assignments line up correctly for consistency. Fixed the guards
for ALG_SHA_224 and ALG_SHA_384 to be correct in the crypto library
source.

Signed-off-by: John Durkop <john.durkop@fermatsoftware.com>
2020-11-30 21:06:05 -08:00
Gilles Peskine
db6b03b4f2 Remove old-style accelerator and entropy driver interfaces
The driver interfaces described in crypto_accel_driver.h and
crypto_entropy_driver.h are no longer being worked on. We do not
intend to finish the design of these interfaces or to implement them
in Mbed TLS. They have been superseded by the unified driver
interface (docs/proposed/psa-driver-interface.md), which is being
actively worked on both to finalize the specification and to implement
it in Mbed TLS.

The partially implemented dynamic secure element interface is staying
for now.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-30 17:37:14 +01:00
Gilles Peskine
b0a748e340 Copyediting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-11-30 12:01:54 +01:00
Bence Szépkúti
d4585ff3c5 Fix removal of deprecated PSA constants
Due to a misplaced #endif, the (non-functional) macro definitions were
not properly removed from crypto_compat.h if MBEDTLS_DEPRECATED_REMOVED
was declared.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2020-11-27 17:52:56 +01:00