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

Use Explicit Context in the Crypto API. #77

Open
lhuang04 opened this issue Jul 17, 2023 · 1 comment
Open

Use Explicit Context in the Crypto API. #77

lhuang04 opened this issue Jul 17, 2023 · 1 comment

Comments

@lhuang04
Copy link

lhuang04 commented Jul 17, 2023

Legacy mbedtls crypto API uses explicit context, this removes the global variable and makes the thread-safety easily guaranteed .

We use mbedtls 2.x for Family of Apps in Meta Platforms. We chose it primarily because of the small binary size. Here are our use cases.

  • It is used by different libraries for different purposes.
    • As a TLS library for QUIC/HTTPS client
    • As a TLS library for MQTT client
    • As a crypto library for encryption, and decryption
  • It is linked as a single dynamic library for an App.
    • There is only one copy of mbedtls library in an App, but it may be instantiated as many different instances.
    • Each mbedtls instance is maintained by different teams for different workloads, so we like to have it independent of each other.
  • It is used in a multithreaded environment.
    • We archive thread-safety by running each mbedtls instance in its own thread.

When we started integrating mbedtls PSA crypto, one issue was the use of global_data in PSA crypto.

cc @hannestschofenig, @ronald-cron-arm, @daverodgman.

@paul-elliott-arm
Copy link
Contributor

Hi!

I can confirm we are looking at the unsafe access to key slots problem over the next quarter or so, but this is of course only one part of your complaint. I can certainly take a look at the other issues, and see how simple (or not) they would be to solve, however I cannot promise anything on them as yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants