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

sample: tfm_psa_template: Print attestation pubkey #19657

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hellesvik-nordic
Copy link
Contributor

Print the public key for attestation, which can be used for verifying the attestation token.

Ref: NCSDK-31111

@hellesvik-nordic hellesvik-nordic requested a review from a team as a code owner December 19, 2024 13:45
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Dec 19, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Dec 19, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 4

Inputs:

Sources:

sdk-nrf: PR head: 66a7efce348c63c495131ed8b97c791babaec564

more details

sdk-nrf:

PR head: 66a7efce348c63c495131ed8b97c791babaec564
merge base: ef172cdb46c29326938e19c3f7cd99f5af3187e4
target head (main): a0fa60254f1b693921e2499aa9615bc97d305acb
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (1)
samples
│  ├── tfm
│  │  ├── tfm_psa_template
│  │  │  ├── src
│  │  │  │  │ main.c

Outputs:

Toolchain

Version: b77d8c1312
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:b77d8c1312_912848a074

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 137
  • ✅ Integration tests
    • ✅ test-fw-nrfconnect-tfm
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_nrf_provisioning
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-thread
    • test-fw-nrfconnect-zigbee
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-sidewalk
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@hellesvik-nordic hellesvik-nordic force-pushed the attestation_sample_print_pubkey branch from 702de1b to 6c28e28 Compare December 19, 2024 13:49
samples/tfm/tfm_psa_template/src/main.c Outdated Show resolved Hide resolved
samples/tfm/tfm_psa_template/src/main.c Outdated Show resolved Hide resolved
samples/tfm/tfm_psa_template/src/main.c Outdated Show resolved Hide resolved
samples/tfm/tfm_psa_template/src/main.c Outdated Show resolved Hide resolved
@hellesvik-nordic hellesvik-nordic force-pushed the attestation_sample_print_pubkey branch from 6c28e28 to a64143a Compare December 19, 2024 14:17
psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT;

status = psa_get_key_attributes(key_handle, &attr);
if (status != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use PSA_SUCCESS here instead of hard code 0.

@@ -145,6 +177,7 @@ static void get_attestation_token(void)
} else {
printk("Received initial attestation token of %zu bytes.\n", token_size);

printf("Attestation token:\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit but replace all the printf->printk to be consistent across the sample.

Print the public key for attestation, which can be used for
verifying the attestation token.

Ref: NCSDK-31111
Signed-off-by: Sigurd Hellesvik <[email protected]>
@hellesvik-nordic hellesvik-nordic force-pushed the attestation_sample_print_pubkey branch from a64143a to 66a7efc Compare December 19, 2024 15:22
Copy link
Contributor

@MarkusLassila MarkusLassila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readme.rst includes what the sample will print when it is run. That should likely be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants