Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move trusted root cert configuration to cmake and cleanup #440

Closed

Conversation

bvavala
Copy link
Member

@bvavala bvavala commented May 6, 2023

This PR removes the machinery for configuring the IAS root certificate at build time, and moves the task to the crypto cmake.

Two notes.

First, the artifacts -- namely the IAS root certificate and the crypto header which embeds the certificate itself -- are now generated by cmake itself, and they are not cleaned up through make. For this reason, both have been moved within the build folder -- so that they are removed when the build folder itself is removed.
This is fine for the crypto header, since it's only necessary when compiling the crypto libraries -- other sources do not need to include it.

Second, the root certificate is always built into the crypto library by default, thereby simplifying the code.

Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
Copy link
Contributor

@cmickeyb cmickeyb left a comment

Choose a reason for hiding this comment

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

i still don't see the value in a template file when there are reasonable alternatives that do not require the template.

;
#ifdef __cplusplus
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

i still dont understand why this is necessary.
you can build the file in the cmake completely without using a template.

)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/verify_ias_report/ias-certificates.h.in
${IAS_CERTIFICATES_H_PATH}
Copy link
Contributor

Choose a reason for hiding this comment

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

i suggest you add a custom command to the clean target to remove these

Copy link
Contributor

Choose a reason for hiding this comment

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

one more... it might also be useful to turn on "show progress" for this file

Copy link
Member Author

Choose a reason for hiding this comment

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

i suggest you add a custom command to the clean target to remove these

We could, but we would end up in a situation where cmake generates the artifacts and make cleans them up.
In that case, it's probably better to keep the script for fetching/generating these artifacts, which is called by make.

Keeping these artifacts in the build folder may still make sense considering that:

  • the certificate is valid until 2049 and
  • the header is rebuilt (by cmake!) when the source changes.

Copy link
Member Author

Choose a reason for hiding this comment

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

one more... it might also be useful to turn on "show progress" for this file

done

bvavala added 2 commits May 8, 2023 20:26
Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
@bvavala bvavala force-pushed the bruno.230505.fix-ias-certs branch from 81e5512 to eb55e08 Compare May 8, 2023 21:21
#ifdef __cplusplus
}
#endif
")
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need a full on cpp file? just wrap with the string literals. then you don't need a template at all.

@bvavala bvavala marked this pull request as draft May 8, 2023 22:32
@bvavala
Copy link
Member Author

bvavala commented Aug 29, 2023

(stale, will be addressed in a subsequent PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants