-
Notifications
You must be signed in to change notification settings - Fork 3k
Upgrade to Mbed TLS 2.21.0 and Mbed Crypto 3.1.0 #12767
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
Conversation
Update Mbed OS's PSA Crypto service to work with Mbed Crypto 3.x. - psa_asymmetric_verify() is now called psa_verify_hash(). - psa_asymmetric_sign() is now called psa_sign_hash(). Compatibilty wrappers are provided via crypto_compat.h for source-level backwards compatibility.
Note that this includes the commit "crypto: Update the service for Mbed Crypto 3.x " from #12150 |
Please review events failures in Travis
|
Updated with "crypto: Use updated ECC curve macros" commit, to use new ECC curve macros instead of old ones. |
@Patater, thank you for your changes. |
Test run: FAILEDSummary: 3 of 3 test jobs failed Failed test jobs:
|
Please ignore lts jobs here , will be restarted |
started new CI job |
Test run: FAILEDSummary: 1 of 3 test jobs failed Failed test jobs:
|
Ci restarted |
Test run: FAILEDSummary: 1 of 10 test jobs failed Failed test jobs:
|
example restarted |
@adbridge @andypowers @bulislaw Please review and approve for 5.15.2 |
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.
Approved.
Summary of changes
Upgrade to Mbed TLS 2.21.0 and Mbed Crypto 3.1.0
Impact of changes
Migration actions required
What behavior changes are being made?
For security and NIST SP 800-90A compliance reasons, CTR DRBG now grabs a nonce from the entropy source if needed to provide the maximum security strength. A previously unused-before-seeding member of the CTR DRBG context,
mbedtls_ctr_drbg_context::reseed_counter
, is used to hold the number of bytes the user has requested to include from the nonce viambedtls_ctr_drbg_set_nonce_len()
, or-1
to indicate that the entropy nonce length was not set explicitly. This means applications that were depending on areseed_counter
value of0
to mean "not yet seeded" will need to instead handle errors from calls tombedtls_ctr_drbg_seed()
.What is being deprecated?
A few PSA Crypto asymmetric cryptography functions and macros, key usage definitions, and error code definitions have been renamed to better reflect their operation and to improve readability.
Why is this being deprecated?
The PSA Crypto API continues to develop as it heads towards its 1.0 release. Mbed Crypto 3.0.0d0 implements more of PSA Crypto 1.0b3 than was implemented in Mbed Crypto 2.x, and this brings along some API deprecations.
Mbed Crypto includes backwards compatibility macros (by way of
psa/crypto_compat.h
) to provide source-level backwards compatibility, although it's recommended to stop using the deprecated APIs as soon as you are able to.Migration
To avoid using deprecated APIs, users of PSA Crypto should update to the new version of API.
psa_asymmetric_sign()
psa_sign_hash()
psa_asymmetric_verify()
psa_verify_hash()
PSA_ASYMMETRIC_SIGNATURE_MAX_SIZE()
PSA_SIGNATURE_MAX_SIZE()
PSA_ASYMMETRIC_SIGN_OUTPUT_SIZE()
PSA_SIGN_OUTPUT_SIZE()
PSA_KEY_USAGE_SIGN
PSA_KEY_USAGE_SIGN_HASH
PSA_KEY_USAGE_VERIFY
PSA_KEY_USAGE_VERIFY_HASH
PSA_ERROR_UNKNOWN_ERROR
PSA_ERROR_GENERIC_ERROR
PSA_ERROR_OCCUPIED_SLOT
PSA_ERROR_ALREADY_EXISTS
PSA_ERROR_EMPTY_SLOT
PSA_ERROR_DOES_NOT_EXIST
PSA_ERROR_INSUFFICIENT_CAPACITY
PSA_ERROR_INSUFFICIENT_DATA
PSA_ERROR_TAMPERING_DETECTED
PSA_ERROR_CORRUPTION_DETECTED
Documentation
Pull request type
Test results
Reviewers
CC @andypowers