Skip to content

Commit

Permalink
error fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
  • Loading branch information
bvavala committed Nov 8, 2022
1 parent 333b46f commit bff1abc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions eservice/bin/register-with-ledger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ if (( "$#" == 1 )) ; then
SPID=$1
fi

#Set ATTESTATION_TYPE to parameter if passed
ATTESTATION_TYPE=$PDO_ATTESTATION_TYPE
if (( "$#" == 2 )) ; then
ATTESTATION_TYPE=$2
fi

function DeriveIasPublicKey {
try test -e ${PDO_IAS_SIGNING_CERT_PATH}
try openssl x509 -pubkey -noout -in ${PDO_IAS_SIGNING_CERT_PATH} > ${PDO_IAS_KEY_PEM}
Expand All @@ -69,13 +75,16 @@ function DeriveIasPublicKey {
# However, getting basename via enclave invocation & quote is somewhat cleaner than below ..
function Store {
: "${SPID:?Need PDO_SPID environment variable set or passed in for valid MR_BASENAME}"
: "${ATTESTATION_TYPE:?Need PDO_ATTESTATION_TYPE environment variable set or passed in}"
try test -e ${ETCDIR}/${ESERVICE_TOML}
try test -e ${ETCDIR}/${ENCLAVE_TOML}
yell Download IAS certificates and Compute the enclave information
try eservice-enclave-info \
--spid ${SPID} \
--attestation-type ${ATTESTATION_TYPE} \
--save ${eservice_enclave_info_file} \
--loglevel warn \
--logfile __screen__ \
--identity ${ESERVICE_IDENTITY} \
--config ${ESERVICE_TOML} ${ENCLAVE_TOML} \
--config-dir ${ETCDIR}
Expand Down Expand Up @@ -105,12 +114,12 @@ function Register {
}

if [ "$SGX_MODE" = "HW" ]; then
if [ "$PDO_ATTESTATION_TYPE" = "epid-linkable" ]; then
if [ "$ATTESTATION_TYPE" = "epid-linkable" ]; then
Store
DeriveIasPublicKey
Register
else
yell Registration failed! PDO_ATTESTATION_TYPE not set to epid-linkable
yell Registration failed! attestation type not set to epid-linkable
fi
else
yell Registration failed! SGX_MODE not set to HW
Expand Down
2 changes: 1 addition & 1 deletion eservice/pdo/eservice/pdo_enclave.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def get_enclave_service_info(spid, attestation_type, config=None) :
logger.debug("Attempting to load enclave at: %s", signed_enclave)

num_of_enclaves = 1
pdo = enclave.pdo_enclave_info(signed_enclave, spid, attestations_type, num_of_enclaves)
pdo = enclave.pdo_enclave_info(signed_enclave, spid, attestation_type, num_of_enclaves)
if pdo is None :
raise Exception('unable to load the enclave')

Expand Down
2 changes: 1 addition & 1 deletion eservice/pdo/eservice/scripts/EServiceEnclaveInfoCLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def Main() :
spid = options.spid

if options.attestation_type :
attestation-type = options.attestation_type
attestation_type = options.attestation_type

global config_map
config_map['identity'] = options.identity
Expand Down

0 comments on commit bff1abc

Please sign in to comment.