Skip to content

Restructure cryptocell #13404

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 1 commit into from
Aug 14, 2020
Merged

Conversation

gpsimenos
Copy link
Contributor

@gpsimenos gpsimenos commented Aug 10, 2020

Summary of changes

mbed-os/features/cryptocell/FEATURE_CRYPTOCELL310 directory moved to
mbed-os/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310 and restructured according to the internal proposal.

This is one of a series of PRs aiming to clean up the mbed-os directory structure. The intention is to create a consistent tree among mbed components, following the below structure:

[component name]
├── mbed_lib.json                     // Each component comes with their own config that's appended to the App/System ├── config 
├── CMakeList.txt                     // This depends on the build system choices, part of another PREQ
├── README.md
├── include                           // The top-level include path
│   └── [component name]              // Public headers that can be accessed by the developers - `#include [component name]/*.h`
│       └── internal                  // Internal headers that implement or are included by a public header or are needed by other Mbed OS libraries - `#include [component name]/internal/*.h`
├── source                            // Source files and private headers, available only inside the component's source directory
└── tests
    ├── <framework>                   // <framework> test folder (for example CPPUTEST)
    │   └── <test suite one>          // Can be either source file or a directory
    ├── UNITTESTS                     // Unit tests (previously in UNITTESTS) folder using googletest framework (to be renamed to gtest at a later stage)
    │   └── <unit test suite one>     // Can be either source file or a directory
    └── TESTS                         // Greentea tests (previously in TESTS) folder (to be renamed to greentea at a later stage)
        └── <greentea test suite one> // Can be either source file or a directory
 
mbed-os
└── TESTS (to be renamed to greentea at a later stage)
    ├── integration   
    └── system

Impact of changes

None

Migration actions required

None


Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@evedon
@ashok-rao


@mergify mergify bot added the needs: work label Aug 10, 2020
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Aug 10, 2020
@ciarmcom ciarmcom requested review from ashok-rao, evedon and a team August 10, 2020 11:00
@ciarmcom
Copy link
Member

@gpsimenos, thank you for your changes.
@evedon @ashok-rao @ARMmbed/mbed-os-maintainers please review.

@mergify
Copy link

mergify bot commented Aug 10, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

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

Question for @ARMmbed/mbed-os-connectivity:

Here we treat cryptocell as an mbedtls dependency, thus it's moved into connectivity/drivers/mbedtls. But it's also used by some PalCrypto* functions in the Nordic Cordio BLE driver (link) that aren't called anywhere.

Do we really want cryptocell in BLE? Going forward, if we apply dependency restriction, the Nordic Cordio driver may assume cryptocell is available (if FEATURE_CRYPTOCELL310 is still defined) but its path will not be actually accessible?

.astyleignore Outdated
@@ -3,7 +3,7 @@
^connectivity/libraries/mbed-coap
^connectivity/libraries/ppp
^connectivity/drivers/emac
^features/cryptocell
^connectivity/drivers/mbedtls/cryptocell
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
^connectivity/drivers/mbedtls/cryptocell
^connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310

@LDong-Arm
Copy link
Contributor

@paul-szczepanek-arm suggests putting cryptocell in connectivity/drivers/cryptocell - being in drivers it'd still be vaguely an internal component. We need to revise the directory structure plan so everyone agrees I guess.

@gpsimenos gpsimenos force-pushed the gp-cryptocell-restruct branch from 1076cab to 2e1d0eb Compare August 11, 2020 08:29
@gpsimenos
Copy link
Contributor Author

Re-restructured to put cryptocell in connectivity/drivers. Rebased.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Move cryptocell

Please extend the commit message with a reason (just add details from the PR description)

@LDong-Arm
Copy link
Contributor

@bulislaw Are you happy with cryptocell in connectivity/drivers/FEATURE_CRYPTOCELL310, one level above connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310 previously proposed?

@gpsimenos gpsimenos force-pushed the gp-cryptocell-restruct branch from 2e1d0eb to a28bc09 Compare August 11, 2020 10:37
@gpsimenos
Copy link
Contributor Author

Rebased. Commit message extended.

@mergify mergify bot dismissed 0xc0170’s stale review August 11, 2020 10:38

Pull request has been modified.

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

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

LGTM if there's no objection from anyone towards the new path.

@gpsimenos
Copy link
Contributor Author

Let's run CI @0xc0170

@mergify
Copy link

mergify bot commented Aug 12, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@gpsimenos gpsimenos force-pushed the gp-cryptocell-restruct branch from a28bc09 to 6598e54 Compare August 12, 2020 09:31
@gpsimenos
Copy link
Contributor Author

Rebased.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 12, 2020

I'll start CI jobs on all PRs after one 5.15 job completes (should be within a hour or so)

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 12, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 12, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

0xc0170
0xc0170 previously approved these changes Aug 12, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 12, 2020

@bulislaw Are you happy with cryptocell in connectivity/drivers/FEATURE_CRYPTOCELL310, one level above connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310 previously proposed?

I dont see this answered or anyone else. Fine with me

@bulislaw
Copy link
Member

Sorry for being late to the part, like always. It's not really a connectivity driver... it's a specifically HW acceleration for TLS, I'd prefer to keep it with TLS so people can actually find it. I wouldn't think to look for it in connectivity drivers. Not sure why wouldn't we have a drivers in tls?

mbed-os/features/cryptocell/FEATURE_CRYPTOCELL310 directory moved
to mbed-os/connectivity/drivers/cryptocell/FEATURE_CRYPTOCELL310
and restructured according to the internal proposal.
@gpsimenos gpsimenos force-pushed the gp-cryptocell-restruct branch from 6598e54 to a4fc83d Compare August 13, 2020 08:26
@mergify mergify bot dismissed 0xc0170’s stale review August 13, 2020 08:27

Pull request has been modified.

@gpsimenos
Copy link
Contributor Author

Un-re-restructured to put cryptocell back in connectivity/drivers/mbedtls. Rebased.

@LDong-Arm
Copy link
Contributor

@bulislaw Cryptocell is used in Cordio, so Mbed TLS is not the only component that uses it. The Cordio functions that use it are not used by Mbed OS BLE, but still if we switch to a new build system and Cryptocell becomes unavailable to Cordio, we can get build errors.
So my question for the connectivity team is whether we can get rid of those usages in Cordio.

@paul-szczepanek-arm
Copy link
Member

paul-szczepanek-arm commented Aug 13, 2020

crytpocell wasn't in mbedtls before and I don't think it's an element of mbedtls, it's just used by it but there's nothing mbedtls specific in it there's quite a lot in fact

@bulislaw
Copy link
Member

In a nutshell it's a crypto accelerator, it's not meant to be directly exposed to the users, but used via MbedTLS/Crypto. If it's used in BLE I'm ok to put it under connectivity/drivers/crypto or mbedtls.

@donatieng
Copy link
Contributor

Agreed with Bartek, ultimately we'll have to move it out of connectivity - as it's crypto related.
For now the proposed connectivity/drivers/crypto sounds good to me.

@rajkan01
Copy link
Contributor

@0xc0170 Could you check, why the continuous-integration/jenkins/pr-head was not reported the status

@LDong-Arm
Copy link
Contributor

@0xc0170 Could you check, why the continuous-integration/jenkins/pr-head was not reported the status

It shows up like this when CI hasn't been run since the last update.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 14, 2020

CI started

@rajkan01
Copy link
Contributor

@0xc0170 Could you check, why the continuous-integration/jenkins/pr-head was not reported the status

It shows up like this when CI hasn't been run since the last update.

Thanks for checking

@mbed-ci
Copy link

mbed-ci commented Aug 14, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

@rajkan01
Copy link
Contributor

@0xc0170 CI passed for this PR, please merge

@0xc0170 0xc0170 merged commit 94c62f2 into ARMmbed:master Aug 14, 2020
@mbedmain mbedmain added release-version: 6.2.1 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Aug 16, 2020
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.

10 participants