Updates to the 0e plans #392

Open
gilles-peskine-arm wants to merge 5 commits from gilles-peskine-arm/0e-plans-july-updates into development
gilles-peskine-arm commented 2025-07-25 11:27:29 -05:00 (Migrated from github.com)

Updates to the specification for API changes based on the implementation work: change things that need changing, or clarify things that were unclear. I propose to keep accumulating changes here during development.

  • Expand on MBEDTLS_PSA_CRYPTO_RNG_HASH and how to check it.
  • Expand on DES removal.
  • Expand on the md.h split.
  • Tweak the value of PSA_KEY_USAGE_DERIVE_PUBLIC.

PR checklist

  • changelog not required because: doc only
  • framework PR not required
  • mbedtls development PR not required because: doc only
  • mbedtls 3.6 PR not required because: new stuff
  • tests not required because: doc only
Updates to the specification for API changes based on the implementation work: change things that need changing, or clarify things that were unclear. I propose to keep accumulating changes here during development. * Expand on `MBEDTLS_PSA_CRYPTO_RNG_HASH` and how to check it. * Expand on DES removal. * Expand on the `md.h` split. * Tweak the value of `PSA_KEY_USAGE_DERIVE_PUBLIC`. ## PR checklist - [x] **changelog** not required because: doc only - [x] **framework PR** not required - [x] **mbedtls development PR** not required because: doc only - [x] **mbedtls 3.6 PR** not required because: new stuff - **tests** not required because: doc only
minosgalanakis (Migrated from github.com) reviewed 2025-07-25 11:27:29 -05:00
minosgalanakis (Migrated from github.com) reviewed 2025-07-25 11:34:08 -05:00
minosgalanakis (Migrated from github.com) left a comment
No description provided.
LGTM
ronald-cron-arm (Migrated from github.com) reviewed 2025-09-08 07:17:19 -05:00
ronald-cron-arm (Migrated from github.com) commented 2025-09-08 07:17:19 -05:00

Thanks for this. This is clearer to me where we want to go. Regarding:

The function mbedtls_md_setup() is only partially covered by MBEDTLS_MD_C. Specifically, the light configuration omits HMAC support. The whole code needs to stay (it's used by HMAC_DRBG and PKCS5), but the documentation should now state that the hmac argument must be 0. (Alternatively, we remove the hmac argument and split the function in two.)

I am in favour of removing the hmac argument in the public API, that's cleaner. Looking at the code it seems that we have the time to do it. Otherwise we could probably guard the "3.6 MD_C specific code" with MBEDTLS_PKCS5_C || MBEDTLS_HMAC_DRGB_C.

Thanks for this. This is clearer to me where we want to go. Regarding: >The function `mbedtls_md_setup()` is only partially covered by `MBEDTLS_MD_C`. Specifically, the light configuration omits HMAC support. The whole code needs to stay (it's used by HMAC_DRBG and PKCS5), but the documentation should now state that the `hmac` argument must be 0. (Alternatively, we remove the `hmac` argument and split the function in two.) I am in favour of removing the `hmac` argument in the public API, that's cleaner. Looking at the code it seems that we have the time to do it. Otherwise we could probably guard the "3.6 MD_C specific code" with `MBEDTLS_PKCS5_C || MBEDTLS_HMAC_DRGB_C`.
davidhorstmann-arm (Migrated from github.com) reviewed 2025-09-08 10:20:02 -05:00
davidhorstmann-arm (Migrated from github.com) commented 2025-09-08 10:20:02 -05:00

The problem with removing it is that we don't retain the backwards-compatibility in the MD API. As I understand it the point of retaining a subset of MD is that people using that subset don't have to rewrite their code (otherwise we might as well just ask them to migrate to PSA).

If we keep the hmac parameter, people who aren't using HMAC won't need any code changes.

The problem with removing it is that we don't retain the backwards-compatibility in the MD API. As I understand it the point of retaining a subset of MD is that people using that subset don't have to rewrite their code (otherwise we might as well just ask them to migrate to PSA). If we keep the `hmac` parameter, people who aren't using HMAC won't need any code changes.
gilles-peskine-arm (Migrated from github.com) reviewed 2025-09-08 10:24:04 -05:00
gilles-peskine-arm (Migrated from github.com) commented 2025-09-08 10:24:04 -05:00

mbedtls/md.h is a transitional API, so making it cleaner isn't an important goal. If we were to make it cleaner, I'd also get rid of the type→info indirection. But applications have to make major changes to their code, they might as well move to PSA.

`mbedtls/md.h` is a transitional API, so making it cleaner isn't an important goal. If we were to make it cleaner, I'd also get rid of the type→info indirection. But applications have to make major changes to their code, they might as well move to PSA.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'gilles-peskine-arm/0e-plans-july-updates:gilles-peskine-arm/0e-plans-july-updates'
git switch 'gilles-peskine-arm/0e-plans-july-updates'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'development'
git merge --no-ff 'gilles-peskine-arm/0e-plans-july-updates'
git switch 'gilles-peskine-arm/0e-plans-july-updates'
git rebase 'development'
git switch 'development'
git merge --ff-only 'gilles-peskine-arm/0e-plans-july-updates'
git switch 'gilles-peskine-arm/0e-plans-july-updates'
git rebase 'development'
git switch 'development'
git merge --no-ff 'gilles-peskine-arm/0e-plans-july-updates'
git switch 'development'
git merge --squash 'gilles-peskine-arm/0e-plans-july-updates'
git switch 'development'
git merge --ff-only 'gilles-peskine-arm/0e-plans-july-updates'
git switch 'development'
git merge 'gilles-peskine-arm/0e-plans-july-updates'
git push origin 'development'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Mbed-TLS/TF-PSA-Crypto!392
No description provided.