nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | syntax = "proto3"; |
| 18 | |
| 19 | package nugget.app.keymaster; |
| 20 | |
Andrew Scull | b5f24a5 | 2017-10-13 19:46:40 +0100 | [diff] [blame] | 21 | import "nugget/app/keymaster/keymaster_defs.proto"; |
| 22 | import "nugget/app/keymaster/keymaster_types.proto"; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 23 | import "nugget/protobuf/options.proto"; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 24 | |
| 25 | /* |
| 26 | * Keymaster service methods. |
| 27 | * |
| 28 | * TODO: some methods may be implemented in the host side HAL implementation. |
| 29 | */ |
| 30 | service Keymaster { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 31 | option (nugget.protobuf.app_id) = "KEYMASTER"; |
| 32 | option (nugget.protobuf.app_name) = "Keymaster"; |
| 33 | option (nugget.protobuf.app_version) = 1; |
nagendra modadugu | 89e50ed | 2017-10-30 22:13:01 -0700 | [diff] [blame] | 34 | /* |
| 35 | * Both request and response buffers are sized such |
| 36 | * that a key-blob may be fully contained. |
| 37 | * |
| 38 | * TODO: revisit this choice in the event that memory |
| 39 | * is running out. Supporting smaller buffers will |
| 40 | * require that the keymaster app switch from the |
| 41 | * transport API to the datagram API. |
| 42 | */ |
nagendra modadugu | 4f532bc | 2018-01-23 16:39:04 -0800 | [diff] [blame] | 43 | option (nugget.protobuf.request_buffer_size) = 3072; |
nagendra modadugu | 89e50ed | 2017-10-30 22:13:01 -0700 | [diff] [blame] | 44 | option (nugget.protobuf.response_buffer_size) = 2048; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 45 | |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 46 | /* |
| 47 | * KM3 methods, from: |
| 48 | * ::android::hardware::keymaster::V3_0::IKeymasterDevice |
| 49 | */ |
| 50 | rpc AddRngEntropy (AddRngEntropyRequest) returns (AddRngEntropyResponse); |
| 51 | rpc GenerateKey (GenerateKeyRequest) returns (GenerateKeyResponse); |
| 52 | rpc GetKeyCharacteristics (GetKeyCharacteristicsRequest) returns (GetKeyCharacteristicsResponse); |
| 53 | rpc ImportKey (ImportKeyRequest) returns (ImportKeyResponse); |
| 54 | rpc ExportKey (ExportKeyRequest) returns (ExportKeyResponse); |
| 55 | rpc AttestKey (AttestKeyRequest) returns (AttestKeyResponse); |
| 56 | rpc UpgradeKey (UpgradeKeyRequest) returns (UpgradeKeyResponse); |
| 57 | rpc DeleteKey (DeleteKeyRequest) returns (DeleteKeyResponse); |
| 58 | rpc DeleteAllKeys (DeleteAllKeysRequest) returns (DeleteAllKeysResponse); |
| 59 | rpc DestroyAttestationIds (DestroyAttestationIdsRequest) returns (DestroyAttestationIdsResponse); |
| 60 | rpc BeginOperation (BeginOperationRequest) returns (BeginOperationResponse); |
| 61 | rpc UpdateOperation (UpdateOperationRequest) returns (UpdateOperationResponse); |
| 62 | rpc FinishOperation (FinishOperationRequest) returns (FinishOperationResponse); |
| 63 | rpc AbortOperation (AbortOperationRequest) returns (AbortOperationResponse); |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 64 | |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 65 | /* |
| 66 | * KM4 methods. |
| 67 | */ |
nagendra modadugu | bdf53cd | 2017-12-04 21:28:02 -0800 | [diff] [blame] | 68 | rpc ImportWrappedKey (ImportWrappedKeyRequest) returns (ImportKeyResponse); |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 69 | |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 70 | /* |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 71 | * Vendor specific methods (bootloader, manufacturing, status, |
| 72 | * factory reset, upgrade). |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 73 | */ |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 74 | // Only callable by the Bootloader. |
| 75 | rpc SetRootOfTrust (SetRootOfTrustRequest) returns (SetRootOfTrustResponse); |
| 76 | // Only callable by the Bootloader. |
| 77 | rpc SetBootState (SetBootStateRequest) returns (SetBootStateResponse); |
nagendra modadugu | 0121ffb | 2018-03-08 22:37:33 -0800 | [diff] [blame] | 78 | // Only callable at the Device Factory. |
| 79 | rpc ProvisionDeviceIds (ProvisionDeviceIdsRequest) returns (ProvisionDeviceIdsResponse); |
| 80 | // Only callable at the Device Factory. |
| 81 | rpc ReadTeeBatchCertificate (ReadTeeBatchCertificateRequest) returns (ReadTeeBatchCertificateResponse); |
Janis Danisevskis | 4f705a7 | 2018-04-13 14:52:38 -0700 | [diff] [blame] | 82 | |
| 83 | /* |
| 84 | * More KM4 methods. |
| 85 | */ |
| 86 | rpc GetHmacSharingParameters (GetHmacSharingParametersRequest) returns (GetHmacSharingParametersResponse); |
| 87 | rpc ComputeSharedHmac (ComputeSharedHmacRequest) returns (ComputeSharedHmacResponse); |
Janis Danisevskis | e0a319a | 2018-04-11 16:51:44 -0700 | [diff] [blame] | 88 | |
| 89 | /* |
| 90 | * DTup input session methods. |
| 91 | */ |
| 92 | rpc HandshakeDTup (DTupHandshakeRequest) returns (DTupHandshakeResponse); |
| 93 | rpc FetchDTupInputEvent (DTupFetchInputEventRequest) returns (DTupFetchInputEventResponse); |
Allen Webb | 4424c2c | 2018-05-25 08:31:56 -0700 | [diff] [blame] | 94 | |
| 95 | /* |
| 96 | * More vendor specific methods. |
| 97 | */ |
| 98 | // Only callable once per boot. |
| 99 | rpc SetSystemVersionInfo (SetSystemVersionInfoRequest) returns (SetSystemVersionInfoResponse); |
Allen Webb | f2e6dcf | 2018-05-30 14:31:28 -0700 | [diff] [blame] | 100 | rpc GetBootInfo (GetBootInfoRequest) returns (GetBootInfoResponse); |
Allen Webb | 4424c2c | 2018-05-25 08:31:56 -0700 | [diff] [blame] | 101 | |
Janis Danisevskis | 64a6d54 | 2018-05-29 21:56:21 -0700 | [diff] [blame] | 102 | /* |
| 103 | * Called during provisioning by the CitadelProvision tool. |
| 104 | */ |
| 105 | rpc ProvisionPresharedSecret (ProvisionPresharedSecretRequest) returns (ProvisionPresharedSecretResponse); |
Allen Webb | 4424c2c | 2018-05-25 08:31:56 -0700 | [diff] [blame] | 106 | // These are implemented with a enum, so new RPCs must be appended, and |
| 107 | // deprecated RPCs need placeholders. |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | /* |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 111 | * KM3 messages. |
| 112 | */ |
| 113 | |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 114 | // AddEntropy |
| 115 | message AddRngEntropyRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 116 | bytes data = 1; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 117 | } |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 118 | message AddRngEntropyResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 119 | ErrorCode error_code = 1; |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 120 | } |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 121 | |
| 122 | // GenerateKey |
| 123 | message GenerateKeyRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 124 | KeyParameters params = 1; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 125 | } |
| 126 | message GenerateKeyResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 127 | ErrorCode error_code = 1; |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 128 | KeyBlob blob = 2; |
| 129 | KeyCharacteristics characteristics = 3; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | // GetKeyCharacteristics |
| 133 | message GetKeyCharacteristicsRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 134 | KeyBlob blob = 1; |
| 135 | bytes client_id = 2; |
| 136 | bytes app_data = 3; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 137 | } |
| 138 | message GetKeyCharacteristicsResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 139 | ErrorCode error_code = 1; |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 140 | KeyCharacteristics characteristics = 2; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | // ImportKey |
| 144 | message ImportKeyRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 145 | KeyParameters params = 1; |
| 146 | RSAKey rsa = 2; |
| 147 | ECKey ec = 3; |
| 148 | SymmetricKey symmetric_key = 4; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 149 | }; |
| 150 | message ImportKeyResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 151 | ErrorCode error_code = 1; |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 152 | KeyBlob blob = 2; |
| 153 | KeyCharacteristics characteristics = 3; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 154 | }; |
| 155 | |
| 156 | // ExportKey |
| 157 | message ExportKeyRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 158 | KeyFormat format = 1; |
| 159 | KeyBlob blob = 2; |
| 160 | bytes client_id = 3; |
| 161 | bytes app_data = 4; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 162 | }; |
| 163 | message ExportKeyResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 164 | ErrorCode error_code = 1; |
nagendra modadugu | 95ac9bb | 2018-01-24 16:33:03 -0800 | [diff] [blame] | 165 | Algorithm algorithm = 2; |
| 166 | RSAKey rsa = 3; |
| 167 | ECKey ec = 4; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 168 | }; |
| 169 | |
| 170 | // AttestKey |
| 171 | message AttestKeyRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 172 | KeyBlob blob = 1; |
| 173 | KeyParameters params = 2; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 174 | } |
| 175 | message AttestKeyResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 176 | ErrorCode error_code = 1; |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 177 | CertificateChain chain = 2; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | // UpgradeKey |
| 181 | message UpgradeKeyRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 182 | KeyBlob blob = 1; |
| 183 | KeyParameters params = 2; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 184 | } |
| 185 | message UpgradeKeyResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 186 | ErrorCode error_code = 1; |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 187 | KeyBlob blob = 2; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | // DeleteKey |
| 191 | message DeleteKeyRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 192 | KeyBlob blob = 1; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 193 | } |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 194 | message DeleteKeyResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 195 | ErrorCode error_code = 1; |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 196 | } |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 197 | |
| 198 | // DeleteAllKeys |
| 199 | message DeleteAllKeysRequest {} |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 200 | message DeleteAllKeysResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 201 | ErrorCode error_code = 1; |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 202 | } |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 203 | |
| 204 | // DestroyAttestationIds |
| 205 | message DestroyAttestationIdsRequest {} |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 206 | message DestroyAttestationIdsResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 207 | ErrorCode error_code = 1; |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 208 | } |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 209 | |
| 210 | // BeginOperation |
| 211 | message BeginOperationRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 212 | KeyPurpose purpose = 1; |
| 213 | KeyBlob blob = 2; |
| 214 | KeyParameters params = 3; |
nagendra modadugu | 251238b | 2018-05-07 16:24:49 -0700 | [diff] [blame] | 215 | HardwareAuthToken auth_token = 4; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 216 | } |
| 217 | message BeginOperationResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 218 | ErrorCode error_code = 1; |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 219 | KeyParameters params = 2; |
| 220 | OperationHandle handle = 3; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | // UpdateOperation |
| 224 | message UpdateOperationRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 225 | OperationHandle handle = 1; |
| 226 | KeyParameters params = 2; |
| 227 | bytes input = 3; |
nagendra modadugu | 251238b | 2018-05-07 16:24:49 -0700 | [diff] [blame] | 228 | HardwareAuthToken auth_token = 4; |
| 229 | VerificationToken verification_token = 5; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 230 | } |
| 231 | message UpdateOperationResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 232 | ErrorCode error_code = 1; |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 233 | uint32 consumed = 2; |
| 234 | KeyParameters params = 3; |
| 235 | bytes output = 4; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | // FinishOperation |
| 239 | message FinishOperationRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 240 | OperationHandle handle = 1; |
| 241 | KeyParameters params = 2; |
| 242 | bytes input = 3; |
| 243 | bytes signature = 4; |
nagendra modadugu | 251238b | 2018-05-07 16:24:49 -0700 | [diff] [blame] | 244 | HardwareAuthToken auth_token = 5; |
| 245 | VerificationToken verification_token = 6; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 246 | }; |
| 247 | message FinishOperationResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 248 | ErrorCode error_code = 1; |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 249 | KeyParameters params = 2; |
| 250 | bytes output = 3; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 251 | }; |
| 252 | |
| 253 | // AbortOperation |
| 254 | message AbortOperationRequest { |
Andrew Scull | 36ebf2d | 2017-10-10 11:25:21 +0100 | [diff] [blame] | 255 | OperationHandle handle = 1; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 256 | }; |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 257 | message AbortOperationResponse { |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 258 | ErrorCode error_code = 1; |
nagendra modadugu | 3696694 | 2017-09-26 15:56:24 -0700 | [diff] [blame] | 259 | }; |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 260 | |
| 261 | /* |
| 262 | * KM4 messages. |
| 263 | */ |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 264 | |
| 265 | // ImportWrappedKey |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 266 | message ImportWrappedKeyRequest { |
nagendra modadugu | bdf53cd | 2017-12-04 21:28:02 -0800 | [diff] [blame] | 267 | uint32 key_format = 1; |
| 268 | KeyParameters params = 2; |
| 269 | bytes rsa_envelope = 3; |
| 270 | bytes initialization_vector = 4; // Fixed sized array. |
| 271 | bytes encrypted_import_key = 5; |
| 272 | bytes aad = 6; |
| 273 | bytes gcm_tag = 7; // Fixed sized array. |
| 274 | KeyBlob wrapping_key_blob = 8; |
| 275 | bytes masking_key = 9; // Fixed sized array. |
nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 276 | } |
nagendra modadugu | bdf53cd | 2017-12-04 21:28:02 -0800 | [diff] [blame] | 277 | // ImportWrappedKey returns a ImportKeyResponse. |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 278 | |
nagendra modadugu | 251238b | 2018-05-07 16:24:49 -0700 | [diff] [blame] | 279 | // GetHmacSharingParametersRequest |
| 280 | message GetHmacSharingParametersRequest { |
| 281 | } |
| 282 | message GetHmacSharingParametersResponse { |
| 283 | ErrorCode error_code = 1; |
| 284 | HmacSharingParameters hmac_sharing_params = 2; |
| 285 | } |
| 286 | |
| 287 | // ComputeSharedHmacRequest |
| 288 | message ComputeSharedHmacRequest { |
| 289 | repeated HmacSharingParameters hmac_sharing_params = 1; |
| 290 | } |
| 291 | message ComputeSharedHmacResponse { |
| 292 | ErrorCode error_code = 1; |
| 293 | bytes sharing_check = 2; |
| 294 | } |
| 295 | |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 296 | /* |
| 297 | * Vendor HAL. |
| 298 | */ |
| 299 | |
| 300 | // SetRootOfTrustRequest |
| 301 | // Only callable by the Bootloader. |
| 302 | message SetRootOfTrustRequest { |
nagendra modadugu | 5f490a7 | 2018-05-16 13:02:23 -0700 | [diff] [blame] | 303 | bytes digest = 1; // This is a SHA256 digest. |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 304 | } |
| 305 | message SetRootOfTrustResponse { |
| 306 | // Specified in keymaster_defs.proto:ErrorCode |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 307 | ErrorCode error_code = 1; |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 308 | } |
| 309 | |
| 310 | // SetBootStateRequest |
| 311 | // Only callable by the Bootloader. |
| 312 | message SetBootStateRequest { |
| 313 | bool is_unlocked = 1; |
nagendra modadugu | 5f490a7 | 2018-05-16 13:02:23 -0700 | [diff] [blame] | 314 | bytes public_key = 2; // This is a SHA256 digest. |
nagendra modadugu | 53158e9 | 2018-05-29 12:40:54 -0700 | [diff] [blame] | 315 | BootColor color = 3; |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 316 | uint32 system_version = 4; |
| 317 | uint32 system_security_level = 5; |
Allen Webb | adfb8a0 | 2018-05-25 15:26:13 -0700 | [diff] [blame] | 318 | bytes boot_hash = 6; // This is a SHA256 digest. |
nagendra modadugu | 6023a7d | 2017-11-08 14:40:49 -0800 | [diff] [blame] | 319 | } |
| 320 | message SetBootStateResponse { |
| 321 | // Specified in keymaster_defs.proto:ErrorCode |
nagendra modadugu | 4405b6b | 2017-12-28 11:17:18 -0800 | [diff] [blame] | 322 | ErrorCode error_code = 1; |
nagendra modadugu | 0121ffb | 2018-03-08 22:37:33 -0800 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | // ProvisionDeviceIds |
| 326 | // Only callable at the Device Factory |
| 327 | message ProvisionDeviceIdsRequest { |
| 328 | bytes product_brand = 1; |
| 329 | bytes product_device = 2; |
| 330 | bytes product_name = 3; |
| 331 | bytes serialno = 4; |
| 332 | bytes product_manufacturer = 5; |
| 333 | bytes product_model = 6; |
| 334 | bytes imei = 7; |
| 335 | bytes meid = 8; |
| 336 | } |
| 337 | message ProvisionDeviceIdsResponse { |
| 338 | // Specified in keymaster_defs.proto:ErrorCode |
| 339 | ErrorCode error_code = 1; |
| 340 | } |
| 341 | |
| 342 | // ReadTeeBatchCertificate |
| 343 | // Only callable at the Device Factory |
| 344 | message ReadTeeBatchCertificateRequest { |
| 345 | Algorithm algorithm = 1; |
| 346 | } |
| 347 | message ReadTeeBatchCertificateResponse { |
| 348 | ErrorCode error_code = 1; |
| 349 | RSAKey rsa = 2; // rsa or ec set based on request algorithm selector. |
| 350 | ECKey ec = 3; |
| 351 | bytes batch_cert = 4; |
| 352 | } |
Janis Danisevskis | 4f705a7 | 2018-04-13 14:52:38 -0700 | [diff] [blame] | 353 | |
Janis Danisevskis | e0a319a | 2018-04-11 16:51:44 -0700 | [diff] [blame] | 354 | message DTupHandshakeRequest { |
| 355 | bytes nonce_client = 1; |
| 356 | } |
| 357 | |
| 358 | message DTupHandshakeResponse { |
| 359 | DTupError error_code = 1; |
| 360 | bytes nonce_citadel = 2; |
| 361 | bytes signature = 3; |
| 362 | } |
| 363 | |
| 364 | message DTupFetchInputEventRequest {} |
| 365 | |
| 366 | message DTupFetchInputEventResponse { |
| 367 | DTupError error_code = 1; |
| 368 | DTupKeyEvent event = 2; |
| 369 | bytes signature = 3; |
| 370 | } |
Allen Webb | 4424c2c | 2018-05-25 08:31:56 -0700 | [diff] [blame] | 371 | |
| 372 | message SetSystemVersionInfoRequest { |
| 373 | uint32 system_version = 1; // getprop "ro.build.version.release" |
| 374 | uint32 system_security_level = 2; // getprop "ro.build.version.security_patch" |
| 375 | uint32 vendor_security_level = 3; // getprop "ro.vendor.build.security_patch" |
| 376 | } |
| 377 | |
| 378 | message SetSystemVersionInfoResponse { |
| 379 | // Specified in keymaster_defs.proto:ErrorCode |
| 380 | ErrorCode error_code = 1; |
| 381 | } |
Allen Webb | f2e6dcf | 2018-05-30 14:31:28 -0700 | [diff] [blame] | 382 | |
| 383 | message GetBootInfoRequest {} |
| 384 | |
| 385 | message GetBootInfoResponse { |
| 386 | ErrorCode error_code = 1; |
| 387 | bool is_unlocked = 2; |
| 388 | BootColor boot_color = 3; |
| 389 | bytes boot_key = 4; // This is a SHA256 digest. |
| 390 | bytes boot_hash = 5; // This is a SHA256 digest. |
| 391 | } |
Janis Danisevskis | 64a6d54 | 2018-05-29 21:56:21 -0700 | [diff] [blame] | 392 | |
| 393 | message ProvisionPresharedSecretRequest { |
| 394 | bytes preshared_secret = 1; |
| 395 | bool get_status = 2; |
| 396 | } |
| 397 | message ProvisionPresharedSecretResponse { |
| 398 | ErrorCode error_code = 1; |
| 399 | PresharedSecretStatus status = 2; |
| 400 | } |