[rkp] Return error code when requestAttestation fails
This cl converts the return value of
IVmPayloadService#requestAttestation from a binder status to
an error code defined in attestation_status_t.
In the event of an error, this value is now sent back to the
client VM payload.
Previously, the API would panic when encountering an error.
Bug: 309790130
Test: Run ServiceVmClientTestApp
Change-Id: I585e3553e2783ca019d2b8076671404398bde447
diff --git a/vm_payload/include/vm_payload.h b/vm_payload/include/vm_payload.h
index 2dfa2cb..951b57f 100644
--- a/vm_payload/include/vm_payload.h
+++ b/vm_payload/include/vm_payload.h
@@ -43,11 +43,14 @@
/** The remote attestation completes successfully. */
ATTESTATION_OK = 0,
- /** The remote attestation has failed due to an unspecified cause. */
- ATTESTATION_UNKNOWN_ERROR = -10000,
-
/** The challenge size is not between 0 and 64. */
ATTESTATION_ERROR_INVALID_CHALLENGE = -10001,
+
+ /** Failed to attest the VM. Please retry at a later time. */
+ ATTESTATION_ERROR_ATTESTATION_FAILED = -10002,
+
+ /** Remote attestation is not supported in the current environment. */
+ ATTESTATION_ERROR_UNSUPPORTED = -10003,
} attestation_status_t;
/**