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

Fix for SNP code_update_test #6787

Merged
merged 12 commits into from
Jan 31, 2025
2 changes: 1 addition & 1 deletion .snpcc_canary
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
/-xXx--//-----x=x--/-xXx--/---x---->>>--/
...
/\/\d(-_-)b/\/\
----vmpl--
----vmpl---
1 change: 1 addition & 0 deletions src/node/rpc/node_frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ namespace ccf
q.raw = node_info.quote_info.quote;
q.endorsements = node_info.quote_info.endorsements;
q.format = node_info.quote_info.format;
q.uvm_endorsements = node_info.quote_info.uvm_endorsements;

// get_measurement attempts to re-validate the quote to extract
// mrenclave and the Open Enclave is insufficiently flexible to
Expand Down
14 changes: 9 additions & 5 deletions tests/code_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def test_verify_quotes(network, args):
)

# Quick API validation - confirm that all of these /quotes/self entries match the collection returned from /quotes
assert j in all_quotes
assert (
j in all_quotes
), f"Didn't find {node.node_id}'s quote in collection\n{j}\n{json.dumps(all_quotes)}"

return network

Expand Down Expand Up @@ -648,6 +650,7 @@ def format_expected_host_data(entries):


@reqs.description("Adding a new measurement invalidates open proposals")
@reqs.not_snp("Cannot produce alternative measurement on SNP")
def test_proposal_invalidation(network, args):
primary, _ = network.find_nodes()

Expand Down Expand Up @@ -724,7 +727,8 @@ def run(args):

# Measurements
test_measurements_tables(network, args)
test_add_node_with_untrusted_measurement(network, args)
if not snp.IS_SNP:
test_add_node_with_untrusted_measurement(network, args)

# Host data/security policy
test_host_data_tables(network, args)
Expand All @@ -740,10 +744,10 @@ def run(args):
test_endorsements_tables(network, args)
test_add_node_with_no_uvm_endorsements(network, args)

# NB: Assumes the current nodes are still using args.package, so must run before test_update_all_nodes
test_proposal_invalidation(network, args)

if not snp.IS_SNP:
# NB: Assumes the current nodes are still using args.package, so must run before test_update_all_nodes
test_proposal_invalidation(network, args)

# This is in practice equivalent to either "unknown measurement" or "unknown host data", but is explicitly
# testing that (without artifically removing/corrupting those values) a replacement package differs
# in one of these values
Expand Down