Skip to content

Commit

Permalink
Harden SGX-mode registration
Browse files Browse the repository at this point in the history
* Handle missing SGX verification status CONFIGURATION_AND_SW_HARDENING_NEEDED

Signed-off-by: Michael Steiner <[email protected]>
  • Loading branch information
Michael Steiner authored and bvavala committed Apr 9, 2024
1 parent f34f9a0 commit b42682d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions eservice/pdo/eservice/pdo_enclave.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ def create_signup_info(originator_public_key_hash, nonce):
logger.warning("Quote has GROUP_OUT_OF_DATE status (update your BIOS/microcode!!!) keep going")
elif _ias.last_verification_error() == "SW_HARDENING_NEEDED":
logger.warning("Quote has SW_HARDENING_NEEDED status (update your platform!!!) keep going")
elif _ias.last_verification_error() == "CONFIGURATION_AND_SW_HARDENING_NEEDED":
logger.warning("Quote has CONFIGURATION_AND_SW_HARDENING_NEEDED status (update your platform!!!) keep going")
else:
logger.error("invalid report fields")
return None
Expand Down
6 changes: 4 additions & 2 deletions ledgers/ccf/transaction_processor/pdo_tp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@ namespace ccfapp
// Verify the verification report enclave quote status
transform(verification_report.isvEnclaveQuoteStatus.begin(), verification_report.isvEnclaveQuoteStatus.end(),
verification_report.isvEnclaveQuoteStatus.begin(), ::toupper);
if ((verification_report.isvEnclaveQuoteStatus != OK_QUOTE_STATUS) && (verification_report.isvEnclaveQuoteStatus != GROUP_OUT_OF_DATE_QUOTE_STATUS) &&
(verification_report.isvEnclaveQuoteStatus != SW_HARDENING_NEEDED_QUOTE_STATUS)) {
if ((verification_report.isvEnclaveQuoteStatus != OK_QUOTE_STATUS) &&
(verification_report.isvEnclaveQuoteStatus != GROUP_OUT_OF_DATE_QUOTE_STATUS) &&
(verification_report.isvEnclaveQuoteStatus != SW_HARDENING_NEEDED_QUOTE_STATUS) &&
(verification_report.isvEnclaveQuoteStatus != CONFIGURATION_AND_SW_HARDENING_NEEDED_QUOTE_STATUS)) {
return ccf::make_error(
HTTP_STATUS_BAD_REQUEST, ccf::errors::InvalidInput, "Enclave attestation report verification Failed. Invalid quote status");
}
Expand Down
1 change: 1 addition & 0 deletions ledgers/ccf/transaction_processor/pdo_tp.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ namespace ccfapp
const string OK_QUOTE_STATUS{"OK"};
const string GROUP_OUT_OF_DATE_QUOTE_STATUS{"GROUP_OUT_OF_DATE"};
const string SW_HARDENING_NEEDED_QUOTE_STATUS{"SW_HARDENING_NEEDED"};
const string CONFIGURATION_AND_SW_HARDENING_NEEDED_QUOTE_STATUS{"CONFIGURATION_AND_SW_HARDENING_NEEDED"};
const int BASENAME_SIZE{32};
const int ORIGINATOR_KEY_HASH_SIZE{64};

Expand Down
2 changes: 1 addition & 1 deletion pservice/lib/libpdo_enclave/secret_enclave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ pdo_err_t VerifyEnclaveInfo(const std::string& enclaveInfo,
int r;
// verify quote (group-of-date is considered ok)
r = verify_enclave_quote_status(verificationReport.c_str(), verificationReport.length(),
QSF_ACCEPT_GROUP_OUT_OF_DATE | QSF_ACCEPT_SW_HARDENING_NEEDED);
QSF_ACCEPT_GROUP_OUT_OF_DATE | QSF_ACCEPT_SW_HARDENING_NEEDED | QSF_ACCEPT_CONFIGURATION_AND_SW_HARDENING_NEEDED);
pdo::error::ThrowIf<pdo::error::ValueError>(
r!=VERIFY_SUCCESS, "Invalid Enclave Quote");

Expand Down

0 comments on commit b42682d

Please sign in to comment.