diff --git a/eservice/bin/register-with-ledger.sh b/eservice/bin/register-with-ledger.sh index bc0ad99d..6fb8b18c 100755 --- a/eservice/bin/register-with-ledger.sh +++ b/eservice/bin/register-with-ledger.sh @@ -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} @@ -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} @@ -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 diff --git a/eservice/pdo/eservice/pdo_enclave.py b/eservice/pdo/eservice/pdo_enclave.py index e483fe2d..7697e14f 100644 --- a/eservice/pdo/eservice/pdo_enclave.py +++ b/eservice/pdo/eservice/pdo_enclave.py @@ -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') diff --git a/eservice/pdo/eservice/scripts/EServiceEnclaveInfoCLI.py b/eservice/pdo/eservice/scripts/EServiceEnclaveInfoCLI.py index 172e90e2..b7672074 100644 --- a/eservice/pdo/eservice/scripts/EServiceEnclaveInfoCLI.py +++ b/eservice/pdo/eservice/scripts/EServiceEnclaveInfoCLI.py @@ -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