Skip to content

Conversation

ronald-cron-arm
Copy link
Contributor

@ronald-cron-arm ronald-cron-arm commented Jul 2, 2024

Description

Repo split preparation, move Mbed TLS crypto modules to tf-psa-crypto.
Companion mbedtls-framework PR: Mbed-TLS/mbedtls-framework#32
Fix #9263

PR checklist

@ronald-cron-arm ronald-cron-arm added enhancement component-crypto Crypto primitives and low-level interfaces needs-ci Needs to pass CI tests labels Jul 2, 2024
@ronald-cron-arm ronald-cron-arm force-pushed the move-mbedtls-crypto-modules branch from d5598f0 to 499a436 Compare July 3, 2024 08:58
@davidhorstmann-arm davidhorstmann-arm removed the needs-ci Needs to pass CI tests label Jul 3, 2024
@ronald-cron-arm ronald-cron-arm force-pushed the move-mbedtls-crypto-modules branch from 499a436 to 8cd4a40 Compare July 4, 2024 09:49
@ronald-cron-arm
Copy link
Contributor Author

@davidhorstmann-arm thanks for the very quick review. The CI was passing but I was still changing things locally when you pushed your review thus the force-pushed, sorry about that. The diff between 499a436 and f87e344 is not too big though. I hope it will be okay with you. I've added 3 commits to address some of your comments. One of your comment has been addressed as part of the rework I was doing.
I am checking the CI now and will rebase later to resolve the conflicts.

@ronald-cron-arm
Copy link
Contributor Author

The OpenCI has run successfully, rebasing now.

@ronald-cron-arm ronald-cron-arm force-pushed the move-mbedtls-crypto-modules branch from 8cd4a40 to 0eb5e9e Compare July 4, 2024 12:30
@ronald-cron-arm
Copy link
Contributor Author

Straightforward rebase, conflicts resolved automatically by Git.

@ronald-cron-arm ronald-cron-arm added the needs-ci Needs to pass CI tests label Jul 4, 2024
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.

Rebase and changes LGTM, thanks!

@davidhorstmann-arm
Copy link
Contributor

I expect this will need a few rebases before it gets merged, though. For example, it'll need rebasing after #9214 is merged.

@ronald-cron-arm
Copy link
Contributor Author

I expect this will need a few rebases before it gets merged, though. For example, it'll need rebasing after #9214 is merged.

Yes that's likely.

@ronald-cron-arm ronald-cron-arm added needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review and removed needs-ci Needs to pass CI tests labels Jul 4, 2024
@tom-daubney-arm tom-daubney-arm removed the needs-reviewer This PR needs someone to pick it up for review label Jul 4, 2024
@ronald-cron-arm ronald-cron-arm added the needs-backports Backports are missing or are pending review and approval. label Jul 5, 2024
@ronald-cron-arm
Copy link
Contributor Author

@davidhorstmann-arm @tom-daubney-arm a lot of conflicts but the rebase is still straightforward thus I let it like that for the time being.

tom-daubney-arm
tom-daubney-arm previously approved these changes Jul 9, 2024
Copy link
Contributor

@tom-daubney-arm tom-daubney-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 now, thanks! I will await the rebase.

@tom-daubney-arm tom-daubney-arm added approved Design and code approved - may be waiting for CI or backports and removed needs-review Every commit must be reviewed by at least two team members, labels Jul 9, 2024
Move all the modules that constitute
the crypto library as well as the
associated headers to tf-psa-crypto/core
for the PSA core modules and to
tf-psa-crypto/drivers/builtin/src for
the others.

The common.h file is copied instead of
being just moved as eventually they
will be different in mbedtls and
TF-PSA-Crypto. Some parts of it can be
shared though but this will be done later,
probably when adding the CMake build
system in tf-psa-crypto.

Signed-off-by: Ronald Cron <[email protected]>
Adjust build systems such as we can built
Mbed TLS in the default and full configuration.

Signed-off-by: Ronald Cron <[email protected]>
Signed-off-by: Ronald Cron <[email protected]>
Signed-off-by: Ronald Cron <[email protected]>
Signed-off-by: Ronald Cron <[email protected]>
@ronald-cron-arm ronald-cron-arm force-pushed the move-mbedtls-crypto-modules branch from 0eb5e9e to 080ab4f Compare July 10, 2024 06:13
@ronald-cron-arm ronald-cron-arm added needs-review Every commit must be reviewed by at least two team members, and removed approved Design and code approved - may be waiting for CI or backports labels Jul 10, 2024
@ronald-cron-arm ronald-cron-arm added needs-ci Needs to pass CI tests and removed needs-review Every commit must be reviewed by at least two team members, labels Jul 10, 2024
@ronald-cron-arm
Copy link
Contributor Author

@tom-daubney-arm @davidhorstmann-arm I've just rebased against the head of development. I had to resolve only two conflicts manually:

  • commit "Move crypto modules", the file library/ecp_internal_alt.h was moved by the commit but deleted by Remove asymmetric crypto alt interfaces #9271. Resolution: "git rm" of the file.
  • commit "Adapt check-generated-files.sh": framework conflict resolved by rebasing on top of main and the framework companion PR32 has been updated accordingly.

Let's see what the CI says now.

@ronald-cron-arm
Copy link
Contributor Author

@tom-daubney-arm OpenCI passed and I have then updated the framework submodule following the merge of #32. It is ready for re-review I believe.

@ronald-cron-arm ronald-cron-arm added needs-review Every commit must be reviewed by at least two team members, and removed needs-ci Needs to pass CI tests labels Jul 10, 2024
Copy link
Contributor

@tom-daubney-arm tom-daubney-arm left a comment

Choose a reason for hiding this comment

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

Rebase (and fw update) LGTM, thanks!

@minosgalanakis minosgalanakis self-requested a review July 10, 2024 13:19
Copy link
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

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

LGTM (Icremental review on post rebase changes)

@ronald-cron-arm
Copy link
Contributor Author

LGTM (Icremental review on post rebase changes)

Thanks @minosgalanakis

@ronald-cron-arm
Copy link
Contributor Author

ronald-cron-arm commented Jul 10, 2024

@minosgalanakis please have a look to the very partial backport as well, thanks. #9383

@ronald-cron-arm ronald-cron-arm added this pull request to the merge queue Jul 10, 2024
@minosgalanakis
Copy link
Contributor

@minosgalanakis please have a look to the very partial backport as well, thanks. #9383

Is that a backport or just a single commit mirroing 1992c9122f ?

@ronald-cron-arm
Copy link
Contributor Author

@minosgalanakis please have a look to the very partial backport as well, thanks. #9383

Is that a backport or just a single commit mirroing 1992c9122f ?

It is the only thing to backport to me. All other changes in #9340 are migration of C modules and their consequences which are not relevant in 3.6.

Merged via the queue into Mbed-TLS:development with commit 1004c9c Jul 10, 2024
@ronald-cron-arm ronald-cron-arm added approved Design and code approved - may be waiting for CI or backports and removed needs-backports Backports are missing or are pending review and approval. needs-review Every commit must be reviewed by at least two team members, labels Jul 10, 2024
rm -f $(OBJS_CRYPTO)
rm -f $(THIRDPARTY_CRYPTO_OBJECTS)
else
if exist *.o del /Q /F *.o
Copy link
Contributor

Choose a reason for hiding this comment

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

On Windows, crypto objects in different directories aren't cleaned anymore. What's the plan here? Do nothing and wait until we abandon plain makefile support? A pending fix? I would like to have at least a comment explaining what's up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I try to not break anything. I am going to fix that in the next PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, thanks. I noticed because of a conflict with #9293, so your fix would conflict with that too.

@@ -0,0 +1,435 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

The common.h file is copied instead of
being just moved as eventually they
will be different in mbedtls and
TF-PSA-Crypto. Some parts of it can be
shared though but this will be done later,
probably when adding the CMake build
system in tf-psa-crypto.

sigh Why? Why isn't library/common.h just #include "core/common.h"? Or just omit library/common.h since we don't actually have anything to put there? Why are we spending effort on keeping two files identical? And how will that work when they're no longer in the same repository?

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 component-crypto Crypto primitives and low-level interfaces enhancement

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Move Mbed TLS crypto C modules to tf-psa-crypto directory

5 participants