Skip to content

Conversation

@gilles-peskine-arm
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm commented May 15, 2025

Improved testing for #9814 and #9975:

Needs preceding PR:

PR checklist

When initializing a multipart or interruptible operation structure, use an
auxiliary function that doesn't initialize union members to all-bits-zero.
Context: on most compilers, initializing a union to `{0}` initializes it to
all bits zero; but on some compilers, the trailing part of members other
than the first is left uninitialized. This way, we can run the tests on any
platform and validate that the code would work correctly on platforms where
union initialization is short.

This commit makes a systematic replacement in `test_suite_psa_crypto.function`
and `test_suite_psa_crypto_driver_wrappers.function`, which gives good
enough coverage.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Partially undo "Use short initializers for multipart operation structures",
only in test functions that specifically aim to test initializers. In these
functions, do try with the short initializers, but alongside the standard
ones.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
@gilles-peskine-arm gilles-peskine-arm force-pushed the union-initialization-gcc15-driver-checks-3.6 branch from e359e63 to 821a5db Compare May 22, 2025 08:28
@gilles-peskine-arm gilles-peskine-arm added needs-review Every commit must be reviewed by at least two team members, and removed needs-preceding-pr Requires another PR to be merged first labels May 22, 2025
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I guess the framework pointer should be updated to the merge commit of Mbed-TLS/mbedtls-framework#168 (currently pointing at the tip of the associated branch).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
@gilles-peskine-arm gilles-peskine-arm force-pushed the union-initialization-gcc15-driver-checks-3.6 branch from 821a5db to 0050f5f Compare June 3, 2025 10:39
@gilles-peskine-arm
Copy link
Contributor Author

I've amended the last commit to update the framework submodule to the head of main instead of the now-merged pull request branch.

@gilles-peskine-arm gilles-peskine-arm requested a review from mpg June 3, 2025 10:40
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Contributor

@gabor-mezei-arm gabor-mezei-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-project-automation github-project-automation bot moved this from In Development to Has Approval in Roadmap pull requests (new board) Jun 6, 2025
@gabor-mezei-arm gabor-mezei-arm removed the needs-review Every commit must be reviewed by at least two team members, label Jun 6, 2025
@gabor-mezei-arm gabor-mezei-arm added the approved Design and code approved - may be waiting for CI or backports label Jun 6, 2025
@mpg mpg added this pull request to the merge queue Jun 10, 2025
Merged via the queue into Mbed-TLS:mbedtls-3.6 with commit 4c26d7d Jun 10, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from Has Approval to Done in Roadmap pull requests (new board) Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Design and code approved - may be waiting for CI or backports needs-backports Backports are missing or are pending review and approval. priority-high High priority - will be reviewed soon size-s Estimated task size: small (~2d)

Development

Successfully merging this pull request may close these issues.

3 participants