sgx_ecdsa: set the load_policy at most once #94
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear librats developers,
While using WAMR and more specifically the sample of SGX-RA as found here, I realized that validating evidence more than once (can be the same, or new evidence) throws the following error in the console:
The notable information here is that the error is thrown when calling the function
sgx_qv_set_enclave_load_policy
, which raises the error0xe00c
(SGX_QL_UNSUPPORTED_LOADING_POLICY
).The issue can be reproduced by duplicating the validation calls of the sample (these ones).
After some investigations, I found out that calling
sgx_qv_set_enclave_load_policy
more than once withSGX_QL_DEFAULT
(=SGX_QL_PERSISTENT
) as an argument throws this error. So, I would suggest a patch in the verification OCALL that checks whether the load policy has already been set, and if so, don't set it more than once.This patch solved this issue on my hardware (SGX2-enabled Intel NUC).
Cheers