@@ -987,6 +987,33 @@ def corrupt_value(value: str):
987987 for key , value in r .body .json ().items ():
988988 LOG .info (f"{ key } : { value } " )
989989
990+ # Test with endorsed_tcb derived from the reported_tcb of the
991+ # first call, which also captures the architecture (Milan/Genoa/Turin)
992+ endorsed_tcb = report_json ["reported_tcb" ]
993+ LOG .info (f"Testing with endorsed_tcb: { endorsed_tcb } " )
994+ r = c .post (
995+ "/app/verifySnpAttestation" ,
996+ {
997+ "evidence" : primary_quote_info ["raw" ],
998+ "endorsements" : primary_quote_info ["endorsements" ],
999+ "uvm_endorsements" : primary_quote_info ["uvm_endorsements" ],
1000+ "endorsed_tcb" : endorsed_tcb ,
1001+ },
1002+ )
1003+ assert r .status_code == http .HTTPStatus .OK , r .status_code
1004+
1005+ # Test with endorsed_tcb of correct size but all zeroes, should be rejected
1006+ r = c .post (
1007+ "/app/verifySnpAttestation" ,
1008+ {
1009+ "evidence" : primary_quote_info ["raw" ],
1010+ "endorsements" : primary_quote_info ["endorsements" ],
1011+ "uvm_endorsements" : primary_quote_info ["uvm_endorsements" ],
1012+ "endorsed_tcb" : "0" * len (endorsed_tcb ),
1013+ },
1014+ )
1015+ assert r .status_code == http .HTTPStatus .BAD_REQUEST , r .status_code
1016+
9901017 validate_openapi (c )
9911018 generate_and_verify_jwk (c )
9921019
0 commit comments