Skip to content

Crypto Service - keys access control TESTS #9780

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

Merged
merged 15 commits into from
Mar 1, 2019

Conversation

itayzafrir
Copy link
Contributor

@itayzafrir itayzafrir commented Feb 20, 2019

Description

Tests for crypto access control in PSA systems.

This PR needs preceding PR #9638

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[X] Test update
[ ] Breaking change

Reviewers

@avolinski

Release Notes

@ciarmcom ciarmcom requested review from alekshex and a team February 20, 2019 18:00
@ciarmcom
Copy link
Member

@itayzafrir, thank you for your changes.
@avolinski @ARMmbed/mbed-os-maintainers please review.

read_input_param_from_message(msg, 1, &key_type);
read_input_param_from_message(msg, 2, &key_data_size);

key_data = calloc(1, key_data_size);
Copy link
Contributor

Choose a reason for hiding this comment

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

where key_data is being freed?

Copy link
Contributor Author

@itayzafrir itayzafrir Feb 24, 2019

Choose a reason for hiding this comment

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

oops :(
added in 391ff6135acbb28bd7797e847b7556f9dee0763c


/* via test partition - create a key, set key policy but no key material */
key_handle = 0;
TEST_ASSERT_EQUAL(PSA_SUCCESS, test_partition_crypto_create_persistent_key(key_id, &key_handle));
Copy link
Contributor

Choose a reason for hiding this comment

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

when is this key destroyed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All ITS keys are being erased in case_setup_handler and case_teardown_handler.

size_t len;

/* via test partition - create a key, set key policy, generate key material and close */
TEST_ASSERT_EQUAL(PSA_SUCCESS, create_and_generate_key_via_test_partition(key_id, key_type, key_alg, key_usage,
Copy link
Contributor

Choose a reason for hiding this comment

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

were is teardown for this key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All ITS keys are being erased in case_setup_handler and case_teardown_handler.

psa_cipher_operation_t operation;

/* via test partition - create a key, set key policy, generate key material and close */
TEST_ASSERT_EQUAL(PSA_SUCCESS, create_and_generate_key_via_test_partition(key_id, key_type, key_alg, key_usage,
Copy link
Contributor

Choose a reason for hiding this comment

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

were is teardown for this key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All ITS keys are being erased in case_setup_handler and case_teardown_handler.

@itayzafrir itayzafrir force-pushed the crypto-access-control-tests branch from 3b4d187 to c75ede1 Compare February 24, 2019 13:37
@itayzafrir
Copy link
Contributor Author

rebased on master + aligned with updated error codes

@cmonr cmonr added risk: R and removed risk: A labels Feb 25, 2019
@cmonr
Copy link
Contributor

cmonr commented Feb 27, 2019

CI started

@itayzafrir
Copy link
Contributor Author

CI won't pass now, this needs preceding PR #9638

@mbed-ci
Copy link

mbed-ci commented Feb 27, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2019

It did pass, what do we miss?

@itayzafrir
Copy link
Contributor Author

It did pass, what do we miss?

There was no reason for compilation to break, but running the tests would have failed. AFAIK for targets which are FUTURE_SEQUANA_PSA tests are only built and not run, correct me if I'm wrong.

@itayzafrir itayzafrir force-pushed the crypto-access-control-tests branch from 391ff61 to a7efc0e Compare February 27, 2019 10:00
@itayzafrir
Copy link
Contributor Author

Rebased on master & added a7efc0e which aligns error code handling to latest standards.

@itayzafrir
Copy link
Contributor Author

#9638 is merged, this PR is unblocked now.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 27, 2019

Test run: FAILED

Summary: 3 of 8 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARMC6
  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@alekla01
Copy link
Contributor

Restarted CI.

@mbed-ci
Copy link

mbed-ci commented Feb 27, 2019

Test run: FAILED

Summary: 1 of 8 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM

@itayzafrir itayzafrir force-pushed the crypto-access-control-tests branch from a7efc0e to b124ae2 Compare February 27, 2019 16:34
@itayzafrir
Copy link
Contributor Author

CI failure doesn't seem to be directly related to the changes in this PR.

Rebased branch on master & added 2 new commits:

  1. Fix for test asymmetric encrypt decrypt (5f3989bec701f156cb666017725b8a4a5a27c57a)
  2. Update secure side binary hex (b124ae2c28286ff17d10d88eb31c0d4977506ccc)

@cmonr
Copy link
Contributor

cmonr commented Feb 27, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Feb 27, 2019

Test run: FAILED

Summary: 1 of 8 test jobs failed
Build number : 4
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM

@cmonr
Copy link
Contributor

cmonr commented Feb 27, 2019

@itayzafrir Please take a look at the NUMAKER_PFM_M2351 ARM build failure.

@cmonr
Copy link
Contributor

cmonr commented Feb 27, 2019

Info: A CI config issue appears to be affecting NUMAKER_PFM_M2351 builds. Please ignore build errors against the target for now.

Other build failures should still be investigated, if any. Will restart CI when appropriate.

@itayzafrir itayzafrir force-pushed the crypto-access-control-tests branch from b124ae2 to 02f5918 Compare February 28, 2019 08:30
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 28, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Feb 28, 2019

Test run: FAILED

Summary: 2 of 13 test jobs failed
Build number : 5
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test
  • jenkins-ci/mbed-os-ci_exporter

@itayzafrir
Copy link
Contributor Author

CI failures don't seem to be related to changes in this PR:

  1. | K66F-IAR | K66F | components-storage-blockdevice-component_sd-tests-filesystem-parallel | FAIL | 74.5 | default |
  2. Exporter -> IAR -> NUMAKER_PFM_NUC472

@mikisch81 mikisch81 mentioned this pull request Feb 28, 2019
@alekla01
Copy link
Contributor

@0xc0170: Ci will be restarted (iar8 exporter issue we will resolve separately).

@cmonr cmonr merged commit 486f4f5 into ARMmbed:master Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants