Skip to content

Commit

Permalink
Debugging code to try and narrow down CI issues
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Elliott <[email protected]>
  • Loading branch information
paul-elliott-arm committed Oct 7, 2024
1 parent 897a1b8 commit 4759795
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tf-psa-crypto/core/psa_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -8179,14 +8179,23 @@ psa_status_t psa_generate_key_iop_complete(
return PSA_ERROR_BAD_STATE;
}

//mbedtls_fprintf(stderr, "\npsa_generate_key_iop_complete()\n");

status = mbedtls_psa_generate_key_complete(&operation->ctx, key_data,
MBEDTLS_ECP_MAX_BYTES, &key_len);
if (status != PSA_SUCCESS) {
goto exit;
}

//mbedtls_fprintf(stderr, "\npost mbedtls_psa_generate_key_complete()\n");

status = psa_import_key(&operation->attributes, key_data, key_len, key);

if (status != PSA_SUCCESS && status != PSA_OPERATION_INCOMPLETE) {
mbedtls_fprintf(stderr, "\npsa_import_key() failed (key_len = %u\n",
(unsigned) key_len);
}

exit:
if (status != PSA_OPERATION_INCOMPLETE) {
if (status != PSA_SUCCESS) {
Expand Down
8 changes: 8 additions & 0 deletions tf-psa-crypto/core/psa_crypto_ecp.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,14 @@ psa_status_t mbedtls_psa_generate_key_complete(
status = mbedtls_ecp_gen_privkey(&operation->ecp.grp, &operation->ecp.d,
mbedtls_psa_get_random, MBEDTLS_PSA_RANDOM_STATE);

if (status) {

mbedtls_fprintf(stderr, "\nmbedtls_ecp_gen_privkey() failed\n");
if (mbedtls_ecp_get_type(&operation->ecp.grp) == MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS) {
mbedtls_fprintf(stderr, "\nIs Weierstrass\n");
}
}

if (status) {
return mbedtls_to_psa_error(status);
}
Expand Down

0 comments on commit 4759795

Please sign in to comment.