-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Remove use of pk_debug() #10517
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
base: development
Are you sure you want to change the base?
Remove use of pk_debug() #10517
Conversation
9b48c6c to
bf030c5
Compare
mpg
left a comment
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 pretty good to me. Just one question and one request:
- Can you clarify the motivation for the last-but-one commit?
- Looking at the test data changes in the last commit, I realise the format I was suggesting is missing some info that could be useful: I think printing the type and bitsize of the key, in addition to the key material, would make the output more helpful. (That info was present in the old output and is now much less apparent.)
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This function is no more used anywhere and can be safely removed. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Remove usage of mbedtls_pk_debug stuff and related functions (mbedtls_debug_print_psa_rsa(), mbedtls_debug_print_psa_ec(), mbedtls_debug_print_integer() and debug_count_valid_bits()) and use mbedtls_pk_write_pubkey_psa() to get the public key from the PK context. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Move single line printing to a separate function named mbedtls_debug_print_buf_one_line(). This accepts one extra parameter 'add_text' to tell if the final text chars are to be printed at the end of the line or not. Add also mbedtls_debug_print_buf_ext() as a generalized version of mbedtls_debug_print_buf() by adding the extra 'add_text' param. debug_print_pk() will now use mbedtls_debug_print_buf_ext() in order not to print chars while dumping the buffer. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Adjust dumping format of public keys following recent updates to mbedtls_debug_print_crt() and debug_print_pk() Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
I was working to fix this when I realized that actually the information is already available. For example in test case while in Isn't this a bit redundant? Edit: as far as I can tell, these info are printed for every certificate on the chain, so we are not missing anything also in the current state. |
bf030c5 to
292df93
Compare
|
The last rebase was to include recent changes in |
Ah yes, good point, I completely missed that the info is already available, just 2 lines above. I withdraw my request for adding it then, indeed it would be redundant. |
mpg
left a comment
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 on code inspection but there are CI failures which look real and related to this PR.
Ouch, the problem is that |
In tf-psa-crypto "mbedtls_pk_write_pubkey_psa()" is only available when MBEDTLS_PK_WRITE_C is defined. Therefore we need to add this guard also in mbedtls to "debug_print_pk" (and indirectly to "mbedtls_debug_print_crt") and the corresponding tests using it. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
mpg
left a comment
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.
Fixed dependencies look good to me, let's hope the CI agrees :)
Guards for "mbedtls_debug_print_crt()" were updated in previous commit, but those changes were not applied to MBEDTLS_SSL_DEBUG_CRT therefore causing build failures in the CI. This commit fixes the problem. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Sorry the previous last commit didn't properly fix all the guards. I added a new one which hopefully should make the CI fully happy. |
%zu creates problem in MinGW testing. Use MBEDTLS_PRINTF_SIZET intead. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
7148c6a to
48af8f0
Compare
|
Thanks to @gilles-peskine-arm help I was able to fix remaining issues with MinGW testing (see this commit). @mpg @davidhorstmann-arm since testing is fine and there is no conflict, I think this is finally ready for another round of reviews |
Description
Resolves #10460.
Depends on Mbed-TLS/TF-PSA-Crypto#577.Follow-up is Mbed-TLS/TF-PSA-Crypto#617
PR checklist
pk_debug()#10460)mbedtls_pk_write_pubkey_psa()TF-PSA-Crypto#577