wasp256
wasp256

Reputation: 6242

SGX Quote attestation with IAS

I was able to use run SGX in hardware mode and retrieve the SigRL successfully from IAS. But I'm struggling when trying to perform the Quote attestation using their REST API. I used the REST API interface description here. I connected successfully to the server with the HTTP POST request

https://test-as.sgx.trustedservices.intel.com:443/attestation//sgx/v1/report

But I always receive an error: 400 Bad request!?

On the client side I get msg3 as follows

ret = sgx_ra_proc_msg2(this->enclave->getContext(),
                               this->enclave->getID(),
                               sgx_ra_proc_msg2_trusted,
                               sgx_ra_get_msg3_trusted,
                               p_msg2,
                               size,
                               &p_msg3,
                               &msg3_size);

which returns SGX_SUCCESS. Then I prepare the quote in the p_msg3 structure

std::string quoteStr = ConvertToString(p_msg3->quote);
quoteStr = EncodeToBase64(quoteStr);

and finally I put the quote in the JSON string which results in

{"isvEnclaveQuote": "MDIwMDAxMDBlMzBhMDAwMDA0MDA...RiMjUyYTgxOGE4NTIzMzQxZDY3"}

which is now sent as payload to the IAS.

Upvotes: 7

Views: 665

Answers (1)

fzgregor
fzgregor

Reputation: 1897

400 Bad Request is generally returned if there is something wrong with your Quote.

Please double check whether the SPID and linkability options you used to create the Quote match and the one you used to register with IAS.

Upvotes: 1

Related Questions