Skip to content

x509_crt: Add initialization to time now - #10828

Open
ThePseudo wants to merge 1 commit into
Mbed-TLS:mbedtls-3.6from
ThePseudo:initialize_time
Open

x509_crt: Add initialization to time now#10828
ThePseudo wants to merge 1 commit into
Mbed-TLS:mbedtls-3.6from
ThePseudo:initialize_time

Conversation

@ThePseudo

Copy link
Copy Markdown

Description

When -Werror is set on the compiler together with -Wuninitialized-const-pointer, we get an error on library/x509_crt.c:2631:37.

This patch fixes this issue.

If MBEDTLS_HAVE_TIME_DATE is defined, then it is initialized. Otherwise, having an initialized structure can be helpful for error checking.

This should also be ported into 4.1 and development branches

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog not required because: trivial change
  • framework PR not required: does not change
  • TF-PSA-Crypto development PR not required because: does not change
  • TF-PSA-Crypto 1.1 PR not required because: does not change
  • mbedtls development PR not required because: trivial change
  • mbedtls 4.1 PR not required because: trivial change
  • mbedtls 3.6 PR not required because: trivial change
  • tests not required because: nothing new was added

Notes for the submitter

Please refer to the contributing guidelines, especially the
checklist for PR contributors.

Help make review efficient:

  • Multiple simple commits
    • please structure your PR into a series of small commits, each of which does one thing
  • Avoid force-push
    • please do not force-push to update your PR - just add new commit(s)
  • See our Guidelines for Contributors for more details about the review process.

When creating time `now`, it is not initialized. This leads to an error
when building the project using -WError.
This patch fixes this issue

Signed-off-by: Andrea Calabrese <andrea.calabrese@amarulasolutions.com>
@yanesca yanesca added bug component-x509 size-xs Estimated task size: extra small (a few hours at most) labels Jul 14, 2026
@aduskett

aduskett commented Aug 7, 2026

Copy link
Copy Markdown

Anyone want to apply this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug component-x509 size-xs Estimated task size: extra small (a few hours at most)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants