• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17syntax = "proto3";
18
19package nugget.app.weaver;
20
21import "nugget/protobuf/options.proto";
22
23// Weaver is the app used to implement Android's Weaver HAL.
24//
25// The documentation for the HAL applies to this implementation.
26service Weaver {
27  option (nugget.protobuf.app_id) = "WEAVER";
28  option (nugget.protobuf.app_name) = "Weaver";
29  option (nugget.protobuf.app_version) = 1;
30  option (nugget.protobuf.request_buffer_size) = 64;
31  option (nugget.protobuf.response_buffer_size) = 64;
32
33  // RPCs for the Weaver HAL
34  rpc GetConfig (GetConfigRequest) returns (GetConfigResponse);
35  rpc Write (WriteRequest) returns (WriteResponse);
36  rpc Read (ReadRequest) returns (ReadResponse);
37
38  // To support credential FRP, the key should remain to allow the credential to
39  // be verified but the secret value is not required so it is safest to zero it
40  // out so it doesn't leak.
41  rpc EraseValue (EraseValueRequest) returns (EraseValueResponse);
42}
43
44// GetConfig
45message GetConfigRequest {}
46message GetConfigResponse {
47  uint32 number_of_slots = 1;
48  uint32 key_size = 2;
49  uint32 value_size = 3;
50}
51
52// Write
53message WriteRequest {
54  uint32 slot = 1;
55  bytes key = 2;
56  bytes value = 3;
57}
58message WriteResponse {}
59
60// Read
61message ReadRequest {
62  uint32 slot = 1;
63  bytes key = 2;
64}
65message ReadResponse {
66  enum Error {
67    NONE = 0;
68    WRONG_KEY = 1;
69    THROTTLE = 2;
70  }
71
72  Error error = 1;
73  uint32 throttle_msec = 2;
74  bytes value = 3;
75}
76
77// EraseValue
78message EraseValueRequest {
79  uint32 slot = 1;
80}
81message EraseValueResponse {}
82