-
Notifications
You must be signed in to change notification settings - Fork 178
optee-client: Add support for libckteec from optee_client #1379
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: master
Are you sure you want to change the base?
Conversation
Added support for the ckteec library v4.0.0 via an optee-client recipe. libckteec provides the PKCS#11 platform-agnostic interface for talking to cryptographic hardware such as smart cards and HSMs. It calls into the Global Platform defined standard TEE APIs for talking to the PKCS#11 Trusted Application (TA) running on the platform's TEE. On Qualcomm platforms, these Global Platform APIs are implemented via the minkteec library and so the ckteec library must link to it instead of the teec library. This is due to Qualcomm TEE only understanding the MINK IPC protocol. The optee-client recipe is written to only install the ckteec library from the optee-client package since the other libraries from this package cannot be currently used on Qualcomm platforms which only support QTEE. The recipe also patches the CMake file to alter it's linkage from the default teec library to minkteec. The ckteec library interface is tested by running the pkcs11 test suite from the xtest client v4.0.0 hosted at github.com/OP-TEE/optee_test on the RB3Gen2 board with a compatible PKCS#11 TA. Signed-off-by: Harshal Dev <[email protected]>
| Added teec_trace.h and teec_trace.c to libckteec library since minkteec | ||
| library does not export and install them unlike the optee teec library. | ||
|
|
||
| Upstream-Status: Pending |
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.
Please submit upstream
| on Qualcomm platforms to talk to the PKCS#11 Trusted Application via | ||
| conversion between the GP interface and the MINK protocol. | ||
|
|
||
| Upstream-Status: Pending |
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.
Likewise
|
|
||
| #v4.0.0 | ||
| SRCREV = "acb0885c117e73cb6c5c9b1dd9054cb3f93507ee" | ||
| SRC_URI = "git://github.com/OP-TEE/optee_client.git;branch=master;protocol=https \ |
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.
Why are we not using optee-client from meta-arm?
|
Both patches added here are needed because you are not building against libteec, can you please work directly with upstream to add support for building TAs with alternatives like minkteec? |
| inherit systemd cmake pkgconfig | ||
|
|
||
| DEPENDS += "minkipc util-linux" | ||
| EXTRA_OEMAKE += "PKG_CONFIG=pkg-config" |
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.
This will break other layers that are also building optee-client, since nothing here is isolated to the qcom override.
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.
I wonder if this is even needed as the recipe is using cmake.
|
We are expecting to integrate OP-TEE (not just this TA) soon (see #1172), so NAK for including a custom optee-client recipe that is only suitable for minkipc. What should be done here:
|
|
@harshaldev27 IIRC, last time we talked about this feature was to add support for |
|
Hi @ricardosalveti , thank you so much for your comments and providing useful pointers.
I think there is a slight confusion here. This PR is not for integrating the PKCS#11 Trusted Application (TA). This PR is for fetching and building the Also, this PR is orthogonal to the OP-TEE enablement PR. I can see that there is a discussion on PR #1172 between @lumag and @b49020 regarding whether When OP-TEE support comes, I have no doubt that these will become relevant again, and must be included as part of an alternate OPTEE-based distro configuration perhaps? (I don't know what is the plan there, please let me know)
I agree with this, I believe I can try to send the patch for providing a build-time option for linking
Like I mentioned, I am fine with leveraging the Is there some recommendation for writing an override for the
I could not understand this comment fully @ricardosalveti , could you please elaborate a bit further what are you requesting here? Thanks, |
|
Hi Sumit,
We did not want to pursue the temporary solution of adding
Also, my intent wasn't to break any OPTEE-use cases. The
I agree, I think better to allow a build-time option which enables alternatively linking Thanks, |
|
@harshaldev27 first of all you need to understand that
It is rather better you import Handling this logic in
Start a thread upstream here: https://github.com/OP-TEE/optee_client/issues with your proposal and gather feedback from the community. To me |
This effort has to be done irrespective of that since
Open-source projects usually have third party dependencies. Both projects follow the BSD license.
Nope |
Added support for the ckteec library v4.0.0 via an optee-client recipe.
libckteec provides the PKCS#11 platform-agnostic interface for talking to cryptographic hardware such as smart cards and HSMs. It calls into the Global Platform defined standard TEE APIs for talking to the PKCS#11 Trusted Application (TA) running on the platform's TEE.
On Qualcomm platforms, these Global Platform APIs are implemented via the minkteec library and so the ckteec library must link to it instead of the teec library. This is due to Qualcomm TEE only understanding the MINK IPC protocol.
The optee-client recipe is written to only install the ckteec library from the optee-client package since the other libraries from this package cannot be currently used on Qualcomm platforms which only support QTEE. The recipe also patches the CMake file to alter it's linkage from the default teec library to minkteec.
The ckteec library interface is tested by running the pkcs11 test suite from the xtest client v4.0.0 hosted at github.com/OP-TEE/optee_test on the RB3Gen2 board with a compatible PKCS#11 TA.