xref: /aosp_15_r20/system/secretkeeper/comm/InternalHalTaMessages.cddl (revision 3f8e9d82f4020c68ad19a99fc5fdc1fc90b79379)
1*3f8e9d82SAndroid Build Coastguard Worker; Clients of the HAL service call various methods on the HAL service; these
2*3f8e9d82SAndroid Build Coastguard Worker; method invocations are internally translated into request messages
3*3f8e9d82SAndroid Build Coastguard Worker; encoded as a CBOR 2-array holding:
4*3f8e9d82SAndroid Build Coastguard Worker; - An integer indicating which request is present.
5*3f8e9d82SAndroid Build Coastguard Worker; - An inner object holding the content for that specific request.
6*3f8e9d82SAndroid Build Coastguard WorkerPerformOpReq =
7*3f8e9d82SAndroid Build Coastguard Worker  [SecretManagementOpCode, ProtectedRequestPacket] /
8*3f8e9d82SAndroid Build Coastguard Worker  [DeleteIdsOpCode, [*SecretId]] /
9*3f8e9d82SAndroid Build Coastguard Worker  [DeleteAllOpCode, nil]
10*3f8e9d82SAndroid Build Coastguard Worker
11*3f8e9d82SAndroid Build Coastguard WorkerSecretManagementOpCode = 0x10
12*3f8e9d82SAndroid Build Coastguard WorkerDeleteIdsOpCode = 0x11
13*3f8e9d82SAndroid Build Coastguard WorkerDeleteAllOpCode = 0x12
14*3f8e9d82SAndroid Build Coastguard Worker
15*3f8e9d82SAndroid Build Coastguard Worker; Internally, a HAL request corresponds to a response message encoded as a CBOR 2-array holding:
16*3f8e9d82SAndroid Build Coastguard Worker; - An integer return code value.
17*3f8e9d82SAndroid Build Coastguard Worker; - One of:
18*3f8e9d82SAndroid Build Coastguard Worker;    - If the return code is zero: a result value.
19*3f8e9d82SAndroid Build Coastguard Worker;    - If the return code is non-zero: an error message.
20*3f8e9d82SAndroid Build Coastguard WorkerPerformOpResponse =
21*3f8e9d82SAndroid Build Coastguard Worker    [0, PerformOpSuccessRsp] /
22*3f8e9d82SAndroid Build Coastguard Worker    [error_code: int .ne 0, error_message: tstr]
23*3f8e9d82SAndroid Build Coastguard Worker
24*3f8e9d82SAndroid Build Coastguard Worker; The content of an OK response depends on the corresponding `HalRequest` message
25*3f8e9d82SAndroid Build Coastguard WorkerPerformOpSuccessRsp = ProtectedResponsePacket / nil
26