Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable check names component #143

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

Harry-Ramsey
Copy link
Contributor

@Harry-Ramsey Harry-Ramsey commented Jan 9, 2025

Enable check names component for TF-PSA-Crypto. Closes #52.

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog provided | not required because: testing enhancement.
  • framework PR provided Mbed-TLS/mbedtls-framework: #117
  • mbedtls PR provided Mbed-TLS/mbedtls: not required.
  • tests provided | not required because:

Notes for the submitter

Please refer to the contributing guidelines, especially the
checklist for PR contributors.

Help make review efficient:

  • Multiple simple commits
    • please structure your PR into a series of small commits, each of which does one thing
  • Avoid force-push
    • please do not force-push to update your PR - just add new commit(s)
  • See our Guidelines for Contributors for more details about the review process.

This commit adds a new check-names component to TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <[email protected]>
@Harry-Ramsey Harry-Ramsey self-assigned this Jan 9, 2025
@Harry-Ramsey Harry-Ramsey added enhancement New feature or request size-m Estimated task size: medium (~1w) needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review labels Jan 9, 2025
@Harry-Ramsey
Copy link
Contributor Author

The failures reported here are to do with the test successfully running but have been propogated to TF-PSA-Crypto.

@ronald-cron-arm
Copy link
Contributor

ronald-cron-arm commented Jan 14, 2025

The failures reported here are to do with the test successfully running but have been propogated to TF-PSA-Crypto.

I am not sure to understand. What is needed for the new component tf_psa_crypto_check_names to run successfully? We cannot merge this PR in that state.

@Harry-Ramsey
Copy link
Contributor Author

The failures reported here are to do with the test successfully running but have been propogated to TF-PSA-Crypto.

I am not sure to understand. What is needed for the new component tf_psa_crypto_check_names to run successfully? We cannot merge this PR in that state.

Sorry, there was an extreme number of errors much higher than expected. I forgot to remove code from check_names.py which overwrote selected paths resulting in these errors.

@Harry-Ramsey Harry-Ramsey force-pushed the check-names branch 2 times, most recently from 50d81f6 to 41311a8 Compare January 15, 2025 10:13
This commit removes macro in comments in the crypto_config.h which
relate to Mbed TLS. In particular macros like MBEDTLS_TLS* from
TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <[email protected]>
This commit updates the framework for check-names.py to independently
run for TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <[email protected]>
@ronald-cron-arm
Copy link
Contributor

Regarding

#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && defined(MBEDTLS_USE_PSA_CRYPTO) && \   
    !(defined(PSA_WANT_ALG_SHA_1) || defined(PSA_WANT_ALG_SHA_256) || defined(PSA_WANT_ALG_SHA_512))
#error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"            
#endif 

in ./drivers/builtin/src/check_crypto_config.h, this should rather be in mbedtls:include/mbedtls/check_config.h. No need for defined(MBEDTLS_USE_PSA_CRYPTO) as MBEDTLS_USE_PSA_CRYPTO is always on now. Thus just:

#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \   
    !(defined(PSA_WANT_ALG_SHA_1) || defined(PSA_WANT_ALG_SHA_256) || defined(PSA_WANT_ALG_SHA_512))
#error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"            
#endif

@ronald-cron-arm
Copy link
Contributor

Regarding MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS in crypto_config.h and ecp.h I think we can just remove the references to MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS. Looking in ssl.h at the documentation of the TLS functions that return MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS I do not feel the need to change their documentation because of the removals of the comments in TF-PSA-Crypto.

@ronald-cron-arm
Copy link
Contributor

Regarding psa_util_internal.h:

#if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)
extern const mbedtls_error_pair_t psa_to_ssl_errors[7];
#endif

can be moved to library/ssl_misc.h. It is defined in library/ssl_tls.c.

@ronald-cron-arm
Copy link
Contributor

In entropy_poll.c

#if defined(MBEDTLS_TIMING_C)
#include "mbedtls/timing.h"
#endif

can just be removed it seems.

@ronald-cron-arm
Copy link
Contributor

ronald-cron-arm commented Jan 17, 2025

In crypto_config.h the note:

 * \note If MBEDTLS_TIMING_C is set - to enable the semi-portable timing
 *       interface - timing.c will include time.h on suitable platforms
 *       regardless of the setting of MBEDTLS_HAVE_TIME, unless
 *       MBEDTLS_TIMING_ALT is used. See timing.c for more information.

can be just removed. We already have the same note in MBEDTLS_TIMING_C documentation in mbedtls_config.h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review size-m Estimated task size: medium (~1w)
Projects
Status: TF-PSA-Crypto all.sh 1 - basic-checks
Development

Successfully merging this pull request may close these issues.

Add name checks
2 participants