Fix preprocessor logic for standalone TF-PSA-Crypto #277

Open
bensze01 wants to merge 1 commit from bensze01/undef into main
bensze01 commented 2026-02-05 07:52:53 -06:00 (Migrated from github.com)

Description

Fix preprocessor logic for standalone TF-PSA-Crypto

PR checklist

Please add the numbers (or links) of the associated pull requests for consuming branches. You can omit branches where this pull request is not needed.

  • TF-PSA-Crypto PR provided # | not required because:
  • development PR provided # | not required because:
  • 3.6 PR provided # | not required because:
## Description Fix preprocessor logic for standalone TF-PSA-Crypto ## PR checklist Please add the numbers (or links) of the associated pull requests for consuming branches. You can omit branches where this pull request is not needed. - [ ] **TF-PSA-Crypto PR** provided # | not required because: - [ ] **development PR** provided # | not required because: - [ ] **3.6 PR** provided # | not required because:
gilles-peskine-arm (Migrated from github.com) reviewed 2026-03-05 02:46:01 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2026-03-05 02:46:01 -06:00

I can't think of a good reason to write !defined(MBEDTLS_VERSION_MAJOR). Why would we need to do something special when not building Mbed TLS? If you mean a condition to apply to TF-PSA-Crypto, use defined(TF_PSA_CRYPTO_VERSION_MAJOR).

There are a few places where we are currently using !defined(MBEDTLS_VERSION_MAJOR). They're left behind from a time when we had alreday made TF-PSA-Crypto a separately testable entity but not yet given it version macros. That was just a planning mistake, and we should be removing those !defined(MBEDTLS_VERSION_MAJOR) and using the TF_PSA_CRYPTO_xxx macro now.

I can't think of a good reason to write `!defined(MBEDTLS_VERSION_MAJOR)`. Why would we need to do something special when not building Mbed TLS? If you mean a condition to apply to TF-PSA-Crypto, use `defined(TF_PSA_CRYPTO_VERSION_MAJOR)`. There are a few places where we are currently using `!defined(MBEDTLS_VERSION_MAJOR)`. They're left behind from a time when we had alreday made TF-PSA-Crypto a separately testable entity but not yet given it version macros. That was just a planning mistake, and we should be removing those `!defined(MBEDTLS_VERSION_MAJOR)` and using the `TF_PSA_CRYPTO_xxx` macro now.
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 'bensze01/undef:bensze01/undef'
git switch 'bensze01/undef'

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 'main'
git merge --no-ff 'bensze01/undef'
git switch 'bensze01/undef'
git rebase 'main'
git switch 'main'
git merge --ff-only 'bensze01/undef'
git switch 'bensze01/undef'
git rebase 'main'
git switch 'main'
git merge --no-ff 'bensze01/undef'
git switch 'main'
git merge --squash 'bensze01/undef'
git switch 'main'
git merge --ff-only 'bensze01/undef'
git switch 'main'
git merge 'bensze01/undef'
git push origin 'main'
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/mbedtls-framework!277
No description provided.