-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
driver-only ECC: ECPf.PK testing #7682
Conversation
Note for reviewers: this PR starts at de15ba2 |
dfda836
to
80fc0b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good, just a few suggestions for improvements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks almost entirely good to me! Just one last point - upon closer inspection, I changed my mind about a suggestion I made, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for noticing the missing free()
call that I misses. (Or was it caught by the CI?)
It was caught by the CI indeed. At first I didn't realize that |
@@ -2452,7 +2429,6 @@ component_test_psa_crypto_full_accel_all_ec_algs_no_ecp_use_psa () { | |||
not grep mbedtls_ecjpake_ library/ecjpake.o | |||
# Also ensure that ECP or RSA modules were not re-enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSA should no longer be mentioned here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still stands
Note: there a few remaining occurrences of I'm not sure if we should consider fixing this in scope for this PR, or leave it for a follow-up, but it will need to be fixed at some point. Also, I'm starting to wonder if have #7717 depend on this one is really the right way, or if we should have this one depending on 7717 instead. Possible reasons for reversing the dependency:
Wdyt? |
I'm more for a follow up PR if this is not strictly mandatory to make the CI happy for this one. This helps in keeping the PRs smaller and easy to review.
Ok, this sounds to me like a major benefit of reversing the dependency, so I'll work on this for both PRs |
Agreed. |
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Note: both MBEDTLS_PK_USE_PSA_EC_DATA and MBEDTLS_PK_HAVE_ECC_KEYS has been move on top of the pk.h file because we need these symbols when crypto.h is evaluated otherwise functions like mbedtls_ecc_group_of_psa() won't be available. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
… one Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
…group_of_psa() This allows also to: - removing the dependency on ECP_C for these functions and only rely on PSA symbols - removing extra header inclusing from crypto_extra.h - return MBEDTLS_PK_USE_PSA_EC_DATA and MBEDTLS_PK_HAVE_ECC_KEYS to their original position in pk.h Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
…ECP at all Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
tests/suites/test_suite_pkparse.data
Outdated
pk_parse_public_keyfile_ec:"data_files/ec_bp512_pub.pem":0 | ||
|
||
Parse Public EC Key #9a (RFC 5480, brainpoolP512r1, compressed) | ||
depends_on:MBEDTLS_PEM_PARSE_C:MBEDTLS_PK_PARSE_EC_COMPRESSED:MBEDTLS_ECP_DP_BP512R1_ENABLED | ||
pk_parse_public_keyfile_ec:"data_files/ec_bp512_pub.comp.pem":0 | ||
|
||
Parse Public EC Key #10 (RFC 8410, DER, X25519) | ||
depends_on:MBEDTLS_PEM_PARSE_C:MBEDTLS_ECP_LIGHT:MBEDTLS_ECP_DP_CURVE25519_ENABLED | ||
depends_on:MBEDTLS_PEM_PARSE_C:MBEDTLS_PK_HAVE_ECC_KEYS:MBEDTLS_ECP_DP_CURVE25519_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost all of these tests have duplicated "depends_on" field, MBEDTLS_PK_HAVE_ECC_KEYS
, with the place in the function file,
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO:MBEDTLS_PK_HAVE_ECC_KEYS */
void pk_parse_public_keyfile_ec(char *key_file, int result)
If all test cases that call this function need this define, then there's no use of adding it again in the .data file.
If only selected test cases need this define, please remove it from the .function file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct! Thanks for noticing this ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one remark about the tests left.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR re-enables the PK module while keeping the ECP one disabled in the following test components:
component_test_psa_crypto_full_accel_all_ec_algs_no_ecp_use_psa
component_test_psa_crypto_full_reference_all_ec_algs_no_ecp_use_psa
Depends on #7717
Resolve #7453
PR checklist