Skip to content

Conversation

@gilles-peskine-arm
Copy link
Contributor

Backport of Mbed-TLS/TF-PSA-Crypto#550. The structure is similar, but the commit "Include common.h before system headers" is a little different, both because the header name changed and because the set of affected files is slightly different.

PR checklist

In library source files, the order of things should be:

1. Define macros that affect the behavior of system headers, such as
   `_POSIX_C_SOURCE` and `_GNU_SOURCE`.
2. Include the library's common header: `common.h`.
   It takes care of many things, including defining the library
   configuration, granting access to private fields in structures, and
   activating platform-specific hacks.
3. Possibly a few header inclusions and macro definitions.
4. Guard everything else by `#if defined(MBEDTLS_XXX_C)` or some such.

Enforce this order in files that previously did things they shouldn't have
before including `common.h`. To locate the potentially
problematic files:

```
grep -m1 '^#' library/*.c | grep -v -F common.h
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
@gilles-peskine-arm gilles-peskine-arm added bug needs-ci Needs to pass CI tests labels Dec 2, 2025
@gilles-peskine-arm gilles-peskine-arm added priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most) labels Dec 2, 2025
@gilles-peskine-arm gilles-peskine-arm added the needs-review Every commit must be reviewed by at least two team members, label Dec 2, 2025
Copy link
Contributor

@davidhorstmann-arm davidhorstmann-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, thanks!

@@ -0,0 +1,3 @@
Bugfix
* Fix compilation errors in `aesce.c` in some Visual Studio builds.
Fixes #548.
Copy link
Contributor

Choose a reason for hiding this comment

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

TF-PSA-Crypto#548, maybe? In this repository it was very old different issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, thanks.

I amended the last commit, to also fix the changelog message (which would have caused GitHub to close #548 if it had been an open issue).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug needs-review Every commit must be reviewed by at least two team members, priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most)

Projects

Status: In Development

Development

Successfully merging this pull request may close these issues.

4 participants