Skip to content

Commit

Permalink
Intel(R) SGX DCAP 1.8 Release
Browse files Browse the repository at this point in the history
Provided standalone Intel(R) SGX DCAP Quote verification library installer.
Provided standalone Intel(R) SGX DCAP Platform Certificate ID retrieval tool
  installation package.
Fixed bugs.

Signed-off-by: Li, Xun <xun.li@intel.com>
  • Loading branch information
llly committed Aug 28, 2020
1 parent e44cc23 commit c9b7074
Show file tree
Hide file tree
Showing 115 changed files with 1,806 additions and 538 deletions.
50 changes: 44 additions & 6 deletions QuoteGeneration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ opt_check_failed:
@echo "Exiting......"
@exit -2

pce_logic:
pce_logic:
$(MAKE) -C pce_wrapper/linux

qe3_logic: pce_logic
qe3_logic: pce_logic
$(MAKE) -C quote_wrapper/ql/linux

qcnl_wrapper:
Expand All @@ -63,10 +63,15 @@ qpl_wrapper: qcnl_wrapper
qve_wrapper:
$(MAKE) -C ../QuoteVerification


.PHONY: deb_sgx_dcap_ql_pkg
deb_sgx_dcap_ql_pkg: $(CHECK_OPT) pce_logic qe3_logic qve_wrapper
./installer/linux/deb/libsgx-dcap-ql/build.sh

.PHONY: deb_sgx_dcap_quote_verify_pkg
deb_sgx_dcap_quote_verify_pkg: $(CHECK_OPT) qve_wrapper
./installer/linux/deb/libsgx-dcap-quote-verify/build.sh

.PHONY: deb_sgx_dcap_default_qpl_pkg
deb_sgx_dcap_default_qpl_pkg: qcnl_wrapper qpl_wrapper
./installer/linux/deb/libsgx-dcap-default-qpl/build.sh
Expand All @@ -82,7 +87,7 @@ deb_sgx_dcap_pccs_pkg:
deb_sgx_ae_qe3_pkg: $(CHECK_OPT)
./installer/linux/deb/libsgx-ae-qe3/build.sh

.PHONY: deb_sgx_ae_qve_pkg
.PHONY: deb_sgx_ae_qve_pkg qve_wrapper
deb_sgx_ae_qve_pkg: $(CHECK_OPT)
./installer/linux/deb/libsgx-ae-qve/build.sh

Expand All @@ -94,10 +99,22 @@ deb_sgx_qe3_logic_pkg: qe3_logic
deb_sgx_pce_logic_pkg: pce_logic
./installer/linux/deb/libsgx-pce-logic/build.sh

.PHONY: deb_sgx_pck_id_retrieval_tool_pkg
deb_sgx_pck_id_retrieval_tool_pkg:
$(MAKE) -C ../tools/PCKRetrievalTool/
../tools/PCKRetrievalTool/installer/deb/sgx-pck-id-retrieval-tool/build.sh

.PHONY: deb_sgx_ra_service_pkg
deb_sgx_ra_service_pkg:
$(MAKE) -C ../tools/SGXPlatformRegistration/ deb_pkg


.PHONY: deb_pkg
deb_pkg: deb_sgx_pce_logic_pkg deb_sgx_qe3_logic_pkg deb_sgx_dcap_ql_pkg deb_sgx_dcap_default_qpl_pkg deb_sgx_dcap_pccs_pkg deb_sgx_ae_qe3_pkg deb_sgx_ae_qve_pkg
deb_pkg: deb_sgx_pce_logic_pkg deb_sgx_qe3_logic_pkg deb_sgx_dcap_ql_pkg deb_sgx_dcap_quote_verify_pkg deb_sgx_dcap_default_qpl_pkg deb_sgx_dcap_pccs_pkg deb_sgx_ae_qe3_pkg deb_sgx_ae_qve_pkg deb_sgx_pck_id_retrieval_tool_pkg deb_sgx_ra_service_pkg
@$(RM) -f ./installer/linux/deb/*.deb ./installer/linux/deb/*.ddeb
cp `find ./installer/linux/deb/ -name "*.deb" -o -name "*.ddeb"` ./installer/linux/deb/
cp `find ../tools/PCKRetrievalTool/installer/deb/ -name "*.deb" -o -name "*.ddeb"` ./installer/linux/deb/
cp `find ../tools/SGXPlatformRegistration/build/installer/ -name "*.deb" -o -name "*.ddeb"` ./installer/linux/deb/

.PHONY: rpm_sgx_dcap_ql_pkg
rpm_sgx_dcap_ql_pkg: $(CHECK_OPT) pce_logic qe3_logic qve_wrapper
Expand All @@ -119,9 +136,13 @@ rpm_sgx_ae_qe3_pkg: $(CHECK_OPT)
./installer/linux/rpm/libsgx-ae-qe3/build.sh

.PHONY: rpm_sgx_ae_qve_pkg
rpm_sgx_ae_qve_pkg: $(CHECK_OPT)
rpm_sgx_ae_qve_pkg: $(CHECK_OPT) qve_wrapper
./installer/linux/rpm/libsgx-ae-qve/build.sh

.PHONY: rpm_sgx_dcap_quote_verify_pkg
rpm_sgx_dcap_quote_verify_pkg: $(CHECK_OPT) qve_wrapper
./installer/linux/rpm/libsgx-dcap-quote-verify/build.sh

.PHONY: rpm_sgx_qe3_logic_pkg
rpm_sgx_qe3_logic_pkg: qe3_logic
./installer/linux/rpm/libsgx-qe3-logic/build.sh
Expand All @@ -130,35 +151,52 @@ rpm_sgx_qe3_logic_pkg: qe3_logic
rpm_sgx_pce_logic_pkg: pce_logic
./installer/linux/rpm/libsgx-pce-logic/build.sh

.PHONY: rpm_sgx_pck_id_retrieval_tool_pkg
rpm_sgx_pck_id_retrieval_tool_pkg:
$(MAKE) -C ../tools/PCKRetrievalTool/
../tools/PCKRetrievalTool/installer/rpm/sgx-pck-id-retrieval-tool/build.sh

.PHONY: rpm_sgx_ra_service_pkg
rpm_sgx_ra_service_pkg:
$(MAKE) -C ../tools/SGXPlatformRegistration/ rpm_pkg

.PHONY: rpm_pkg
rpm_pkg: rpm_sgx_dcap_ql_pkg rpm_sgx_dcap_default_qpl_pkg rpm_sgx_dcap_pccs_pkg rpm_sgx_ae_qe3_pkg rpm_sgx_ae_qve_pkg rpm_sgx_pce_logic_pkg rpm_sgx_qe3_logic_pkg
rpm_pkg: rpm_sgx_dcap_ql_pkg rpm_sgx_dcap_default_qpl_pkg rpm_sgx_dcap_pccs_pkg rpm_sgx_ae_qe3_pkg rpm_sgx_ae_qve_pkg rpm_sgx_dcap_quote_verify_pkg rpm_sgx_pce_logic_pkg rpm_sgx_qe3_logic_pkg rpm_sgx_pck_id_retrieval_tool_pkg rpm_sgx_ra_service_pkg
@$(RM) -f ./installer/linux/rpm/*.rpm
cp `find ./installer/linux/rpm/ -name "*.rpm"` ./installer/linux/rpm/
cp `find ../tools/PCKRetrievalTool/installer/rpm/ -name "*.rpm"` ./installer/linux/rpm/
cp `find ../tools/SGXPlatformRegistration/build/installer/ -name "*.rpm"` ./installer/linux/rpm/

clean:
$(MAKE) -C pce_wrapper/linux clean
$(MAKE) -C quote_wrapper/ql/linux clean
$(MAKE) -C qcnl/linux clean
$(MAKE) -C qpl/linux clean
$(MAKE) -C ../QuoteVerification clean
$(MAKE) -C ../tools/PCKRetrievalTool clean
$(MAKE) -C ../tools/SGXPlatformRegistration clean
@$(RM) -rf ./build/
@$(RM) -f ./installer/linux/deb/*.deb
@$(RM) -f ./installer/linux/deb/*.ddeb
@$(RM) -f ./installer/linux/rpm/*.rpm
./installer/linux/deb/libsgx-dcap-ql/clean.sh
./installer/linux/deb/libsgx-dcap-quote-verify/clean.sh
./installer/linux/deb/libsgx-ae-qe3/clean.sh
./installer/linux/deb/libsgx-ae-qve/clean.sh
./installer/linux/deb/libsgx-pce-logic/clean.sh
./installer/linux/deb/libsgx-qe3-logic/clean.sh
./installer/linux/deb/libsgx-dcap-default-qpl/clean.sh
./installer/linux/deb/sgx-dcap-pccs/clean.sh
../tools/PCKRetrievalTool/installer/deb/sgx-pck-id-retrieval-tool/clean.sh
./installer/linux/rpm/libsgx-dcap-ql/clean.sh
./installer/linux/rpm/libsgx-ae-qe3/clean.sh
./installer/linux/rpm/libsgx-ae-qve/clean.sh
./installer/linux/rpm/libsgx-dcap-quote-verify/clean.sh
./installer/linux/rpm/libsgx-pce-logic/clean.sh
./installer/linux/rpm/libsgx-qe3-logic/clean.sh
./installer/linux/rpm/libsgx-dcap-default-qpl/clean.sh
./installer/linux/rpm/sgx-dcap-pccs/clean.sh
../tools/PCKRetrievalTool/installer/rpm/sgx-pck-id-retrieval-tool/clean.sh

rebuild:
$(MAKE) -f $(CUR_MKFILE) clean
Expand Down
2 changes: 1 addition & 1 deletion QuoteGeneration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For Windows* OS
**NOTE**:`sgx_dcap_dev.inf` is for Windows* Server 2016 LTSC and `sgx_dcap.inf` is for Windows* Server 2019 LTSC.

## How to install
Refer to the *"Installation Instructions"* section in the [Intel(R) Software Guard Extensions: Data Center Attestation Primitives Installation Guide For Windows* OS](https://download.01.org/intel-sgx/sgx-dcap/1.7/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf) to install the right packages on your platform.
Refer to the *"Installation Instructions"* section in the [Intel(R) Software Guard Extensions: Data Center Attestation Primitives Installation Guide For Windows* OS](https://download.01.org/intel-sgx/sgx-dcap/1.8/windows/docs/Intel_SGX_DCAP_Windows_SW_Installation_Guide.pdf) to install the right packages on your platform.


For Linux* OS
Expand Down
9 changes: 1 addition & 8 deletions QuoteGeneration/buildenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ parent-dir = $(patsubst %/,%,$(dir $(1:%/=%)))
# Returns : the directory of the current Makefile
# Usage : $(my-dir)
# -----------------------------------------------------------------------------
my-dir = $(realpath $(call parent-dir,$(lastword $(MAKEFILE_LIST))))
my-dir = $(call parent-dir,$(lastword $(MAKEFILE_LIST)))


ROOT_DIR := $(call my-dir)
Expand Down Expand Up @@ -115,13 +115,6 @@ ifdef SE_SIM
COMMON_FLAGS += -DSE_SIM
endif

# Disable ref-LE build by default.
# Users could enable the ref-LE build
# by explicitly specifying 'BUILD_REF_LE=1'
BUILD_REF_LE ?= 0
ifeq ($(BUILD_REF_LE), 1)
COMMON_FLAGS += -DREF_LE
endif

COMMON_FLAGS += -ffunction-sections -fdata-sections

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,17 @@ template <class R = unsigned>
inline R rdrand(void)
{
R r;
__asm__ volatile ("rdrand %0" : "=r"(r));
__asm__ volatile (
"1: rdrand %0\n"
" jnc 1b\n"
: "=r" (r)
);

return r;

}


/*
* To invoke somefunc(arg1, arg2,...), use
* + random_stack_advance(somefunc, arg1, args2,...)
Expand Down
8 changes: 4 additions & 4 deletions QuoteGeneration/common/inc/internal/se_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#define STRFILEVER "1.7.100.2"
#define STRFILEVER "1.8.100.2"
#define COPYRIGHT "Copyright (C) 2020 Intel Corporation"
#define FILEVER 1,7,100,2
#define PRODUCTVER 1,7,100,2
#define STRPRODUCTVER "1.7.100.2"
#define FILEVER 1,8,100,2
#define PRODUCTVER 1,8,100,2
#define STRPRODUCTVER "1.8.100.2"
#define COMPANYNAME "Intel Corporation"
#define PRODUCTNAME "Intel® Software Guard Extensions"
6 changes: 3 additions & 3 deletions QuoteGeneration/download_prebuilt.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

@echo off

set ae_file_name=prebuilt_windows_dcap_1.7.zip
set checksum_file=SHA256SUM_prebuilt_windows_dcap_1.7.txt
set server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.7/windows/
set ae_file_name=prebuilt_windows_dcap_1.8.zip
set checksum_file=SHA256SUM_prebuilt_windows_dcap_1.8.txt
set server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.8/windows/
set server_ae_url=%server_url_path%/%ae_file_name%
set server_checksum_url=%server_url_path%/%checksum_file%

Expand Down
6 changes: 3 additions & 3 deletions QuoteGeneration/download_prebuilt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

top_dir=`dirname $0`
out_dir=$top_dir
ae_file_name=prebuilt_dcap_1.7.tar.gz
checksum_file=SHA256SUM_prebuilt_dcap_1.7.txt
server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.7/linux
ae_file_name=prebuilt_dcap_1.8.tar.gz
checksum_file=SHA256SUM_prebuilt_dcap_1.8.txt
server_url_path=https://download.01.org/intel-sgx/sgx-dcap/1.8/linux
server_ae_url=$server_url_path/$ae_file_name
server_checksum_url=$server_url_path/$checksum_file

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
DeliveryName InstallName FileCheckSum FileFeature FileOwner
<deliverydir>/build/linux/libsgx_dcap_ql.so <installdir>/lib/libsgx_dcap_ql.so 0 main STP
<deliverydir>/build/linux/libsgx_dcap_quoteverify.so <installdir>/lib/libsgx_dcap_quoteverify.so 0 main STP
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ install: $(PACKAGES)
cd $(shell readlink -m $(DESTDIR)/$(DCAP_QL_PACKAGE_NAME)/$(USR_LIB_PATH)) && \
mv libsgx_dcap_ql.so libsgx_dcap_ql.so.$(USR_LIB_VER) && \
ln -fs libsgx_dcap_ql.so.$(USR_LIB_VER) libsgx_dcap_ql.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) && \
mv libsgx_dcap_quoteverify.so libsgx_dcap_quoteverify.so.$(USR_LIB_VER) && \
ln -fs libsgx_dcap_quoteverify.so.$(USR_LIB_VER) libsgx_dcap_quoteverify.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1)
cd $(shell readlink -m $(DESTDIR)/$(DCAP_QL_DEV_PACKAGE_NAME)/$(USR_LIB_PATH)) && \
ln -fs libsgx_dcap_ql.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) libsgx_dcap_ql.so && \
ln -fs libsgx_dcap_quoteverify.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) libsgx_dcap_quoteverify.so
ln -fs libsgx_dcap_ql.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) libsgx_dcap_ql.so

$(PACKAGES):
install -d $(shell readlink -m $(DESTDIR)/$@)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ LINUX_INSTALLER_COMMON_DIR="${LINUX_INSTALLER_DIR}/common"

INSTALL_PATH=${SCRIPT_DIR}/output

LINUX_QV_DIR="${ROOT_DIR}/../QuoteVerification"
[[ -z "${SGX_SDK}" ]] && SGX_SDK=/opt/intel/sgxsdk

# Cleanup
Expand All @@ -55,7 +54,6 @@ cp ${LINUX_INSTALLER_COMMON_DIR}/gen_source/gen_source.py ${SCRIPT_DIR}
# Copy the files according to the BOM
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-dcap-ql.txt --installdir=pkgroot/libsgx-dcap-ql
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-dcap-ql-dev.txt --cleanup=false --installdir=pkgroot/libsgx-dcap-ql-dev
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-dcap-ql-dev-qvinc.txt --deliverydir=${LINUX_QV_DIR} --cleanup=false --installdir=pkgroot/libsgx-dcap-ql-dev
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-dcap-ql-dev-commoninc.txt --deliverydir=${SGX_SDK}/include --cleanup=false --installdir=pkgroot/libsgx-dcap-ql-dev
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-dcap-ql-package.txt --cleanup=false
python ${SCRIPT_DIR}/gen_source.py --bom=../licenses/BOM_license.txt --cleanup=false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DeliveryName InstallName FileCheckSum FileFeature FileOwner
<deliverydir>/installer/linux/common/libsgx-dcap-quote-verify/installConfig <installdir>/installConfig 0 main STP
<deliverydir>/installer/linux/common/libsgx-dcap-quote-verify/Makefile <installdir>/Makefile 0 main STP
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DeliveryName InstallName FileCheckSum FileFeature FileOwner
<deliverydir>/build/linux/libsgx_dcap_quoteverify.so <installdir>/lib/libsgx_dcap_quoteverify.so 0 main STP
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#
# Copyright (C) 2011-2020 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#

include installConfig

PACKAGE_ROOT_FOLDER=pkgroot
PACKAGES=$(notdir $(wildcard $(PACKAGE_ROOT_FOLDER)/*))

USR_LIB_PATH=/usr/$(notdir $(shell gcc -print-multi-os-directory))/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null)
USR_INC_PATH=/usr/$(INC_DIR)

USR_LIB_VER=1.0.0
SPLIT_VERSION=$(word $2,$(subst ., ,$1))

default:

install: $(PACKAGES)
cd $(shell readlink -m $(DESTDIR)/$(DCAP_QVL_PACKAGE_NAME)/$(USR_LIB_PATH)) && \
mv libsgx_dcap_quoteverify.so libsgx_dcap_quoteverify.so.$(USR_LIB_VER) && \
ln -fs libsgx_dcap_quoteverify.so.$(USR_LIB_VER) libsgx_dcap_quoteverify.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1)
cd $(shell readlink -m $(DESTDIR)/$(DCAP_QVL_DEV_PACKAGE_NAME)/$(USR_LIB_PATH)) && \
ln -fs libsgx_dcap_quoteverify.so.$(call SPLIT_VERSION,$(USR_LIB_VER),1) libsgx_dcap_quoteverify.so

$(PACKAGES):
install -d $(shell readlink -m $(DESTDIR)/$@)
$(if $(wildcard $(PACKAGE_ROOT_FOLDER)/$@/$(LIB_DIR)/*.so), \
install -d $(shell readlink -m $(DESTDIR)/$@/$(USR_LIB_PATH)) && \
mv $(PACKAGE_ROOT_FOLDER)/$@/$(LIB_DIR)/*.so $(DESTDIR)/$@/$(USR_LIB_PATH))
$(if $(wildcard $(PACKAGE_ROOT_FOLDER)/$@/$(INC_DIR)/.*), \
install -d $(shell readlink -m $(DESTDIR)/$@/$(USR_INC_PATH)) && \
install -d $(shell readlink -m $(DESTDIR)/$@/$(USR_LIB_PATH)) && \
mv $(PACKAGE_ROOT_FOLDER)/$@/$(INC_DIR)/* $(DESTDIR)/$@/$(USR_INC_PATH))
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
#
# Copyright (C) 2011-2020 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#


set -e

SCRIPT_DIR=$(dirname "$0")
ROOT_DIR="${SCRIPT_DIR}/../../../../"
LINUX_INSTALLER_DIR="${ROOT_DIR}/installer/linux"
LINUX_INSTALLER_COMMON_DIR="${LINUX_INSTALLER_DIR}/common"

INSTALL_PATH=${SCRIPT_DIR}/output

LINUX_QV_DIR="${ROOT_DIR}/../QuoteVerification"
[[ -z "${SGX_SDK}" ]] && SGX_SDK=/opt/intel/sgxsdk

# Cleanup
rm -fr ${INSTALL_PATH}

# Get the configuration for this package
source ${SCRIPT_DIR}/installConfig

# Fetch the gen_source script
cp ${LINUX_INSTALLER_COMMON_DIR}/gen_source/gen_source.py ${SCRIPT_DIR}

# Copy the files according to the BOM
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-dcap-qvl.txt --installdir=pkgroot/libsgx-dcap-quote-verify
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-dcap-ql-dev-qvinc.txt --deliverydir=${LINUX_QV_DIR} --cleanup=false --installdir=pkgroot/libsgx-dcap-quote-verify-dev
python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/libsgx-dcap-qvl-package.txt --cleanup=false
python ${SCRIPT_DIR}/gen_source.py --bom=../licenses/BOM_license.txt --cleanup=false

# Create the tarball
SGX_VERSION=$(awk '/STRFILEVER/ {print $3}' ${ROOT_DIR}/common/inc/internal/se_version.h|sed 's/^\"\(.*\)\"$/\1/')
pushd ${INSTALL_PATH} &> /dev/null
sed -i "s/USR_LIB_VER=.*/USR_LIB_VER=${SGX_VERSION}/" Makefile
tar -zcvf ${TARBALL_NAME} *
popd &> /dev/null
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DCAP_QVL_VERSION="1.0"
TARBALL_NAME=libsgx-dcap-quote-verify_1.0.orig.tar.gz

DCAP_QVL_PACKAGE_NAME=libsgx-dcap-quote-verify
DCAP_QVL_DEV_PACKAGE_NAME=libsgx-dcap-quote-verify-dev

LIB_DIR=lib
INC_DIR=include
Loading

0 comments on commit c9b7074

Please sign in to comment.