Add generated files that are no longer checked in.
Remove obsolete things (including things now covered at the framework root).
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
The files are now generated during the build. Stop having them in version
control.
As formerly in Mbed TLS, `make clean` doesn't remove
configuration-independent target-independent generated files, but the new
target `make neat` does.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
We don't need to check those generated files into version control.
This fixes the problem that the generated files have precise knowledge of
the functions that exist on whatever branch of TF-PSA-Crypto is consuming
the framework.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
TF-PSA-Crypto no longer has `psa_can_do_hash()` (except as a temporary stub
to avoid breaking the build of psasim).
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
The mldsa-native and mlkem-native headers use preprocessor tricks to
construct identifiers. We can't recognize those. So f a symbol found in the
binary is in the expected sub-namespace for those parts of the library,
allow it to be undeclared.
Make the exception general enough for mldsa-native (needed now) and
mlkem-native (needed soon).
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
The pattern for internal macros was weird, in part, because of the unusual
short names we use in bignum code. Make the pattern stricter, but add an
exception mechanism. Declare an exception for those bignum names, but
allow them only in bignum code.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
I needed that to understand how the data is represented (str vs Match, list
vs set vs tuple, ...).
No semantic change.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Use a typed namespace instead of a dictionary with heterogenously typed values.
No semantic change.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Keep TEST_EQUAL() on the function that might fail so that if a failure
happen the message will report the actual function that failed.
Documentation of the helper function is also updated.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
`python` might be the wrong version, for example it might be Python 2 on
some systems, or it might be a different version of Python 3. Use
`sys.executable`, so that the same version gets used consistently.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
A new look-up table is created, "predefined_keys_psa", to list all the
predefined keys together with the corresponding PSA key type and bits.
A new look-up table was created in order not to conflict with the already
existing "predefined_keys" one.
"mbedtls_pk_helpers_get_predefined_key_data" is modified in order to
use the new look-up table.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Don't recurse into every subdirectory: that also removed files from
out-of-tree builds that the user may have placed into subdirectories. With
make as the build tool, the cleanup is mostly recoverable, but with ninja as
the build tool, you have to manually run `cmake` again after running
`all.sh`.
Instead, look for things to clean only in directories managed by git.
This also has the benefit of not touching `**/Makefile` if there hasn't been
an in-tree CMake build.
Fixes https://github.com/Mbed-TLS/mbedtls-framework/issues/252
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
mypy only checks types in functions that have a return type annotation.
In `check_generated_files`, change from returning `None` to returning a
boolean, since the function is supposed to check some boolean-valued
assertion. So far, the function always returns `True`.
In `main`, explicitly return an `int` value as expected by the caller. When
calling `check_generated_files`, convert the boolean result into an exit
status.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
- better guard for the "ecp.h" header file;
- use already existing Mbed TLS' macro for unused variables and place it
at the beginning of the declaration of "predefined_keys".
Signed-off-by: Valerio Setti <vsetti@baylibre.com>