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
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions common/crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ENDIF()
# Builds the ias-certificates.cpp file using the script. This is not used
# by the client (ias verification requires sgx).
################################################################################

IF (BUILD_TRUSTED OR BUILD_UNTRUSTED)
SET(CRYPTO_BUILD_DIR ${CMAKE_BINARY_DIR}/crypto)
SET(INTEL_ROOT_CACERT_PATH ${CRYPTO_BUILD_DIR}/Intel_SGX_Attestation_RootCA.pem)
Expand All @@ -52,10 +53,27 @@ IF (BUILD_TRUSTED OR BUILD_UNTRUSTED)
${INTEL_ROOT_CACERT_PATH}
INTEL_ROOT_CA_PEM
)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/verify_ias_report/ias-certificates.h.in
${IAS_CERTIFICATES_H_PATH}
)
# create the header file containing the root CA certificate stored as a global variable
FILE(WRITE ${IAS_CERTIFICATES_H_PATH}
"
/*
* Copyright 2023 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once

#ifdef __cplusplus
extern \"C\" {
#endif
extern const char ias_report_signing_ca_cert_pem[] =
R\"MLT(${INTEL_ROOT_CA_PEM}
)MLT\"
;
#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.

ENDIF()

################################################################################
Expand Down
18 changes: 0 additions & 18 deletions common/crypto/verify_ias_report/ias-certificates.h.in

This file was deleted.