aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2021-12-13 21:41:32 -0800
committerXin Li <delphij@google.com>2021-12-14 08:39:04 -0800
commit36af9f20f3a38f979d2a2b65616b0fd67c922132 (patch)
treec7566fc6b36b42899f632ad5dfe0843da19031f8
parent73d54361a181a9fd59ae9f503a7c30504266195b (diff)
parentc1726eca5c283d4bd913f4c1e10daa2dc496d5a8 (diff)
downloadgeneric-36af9f20f3a38f979d2a2b65616b0fd67c922132.tar.gz
Bug: 210511427 Merged-In: Id03b97cc6d3651627cbfda9d09ce4fe8be9f8ec9 Change-Id: Ie53d636bf39b7101eb9dceac54909a5947a30a1a
-rw-r--r--libnos_transport/transport.c9
-rw-r--r--nugget/proto/nugget/app/avb/avb.proto5
-rw-r--r--nugget/proto/nugget/app/keymaster/keymaster.proto16
3 files changed, 25 insertions, 5 deletions
diff --git a/libnos_transport/transport.c b/libnos_transport/transport.c
index 85ba312..855b884 100644
--- a/libnos_transport/transport.c
+++ b/libnos_transport/transport.c
@@ -155,6 +155,10 @@ static int get_status(const struct transport_context *ctx,
uint8_t data[STATUS_MAX_LENGTH];
} st;
int retries = CRC_RETRY_COUNT;
+
+ /* All unset fields will be 0. */
+ memset(out, 0, sizeof(*out));
+
while (retries--) {
/* Get the status from the device */
const uint32_t command = CMD_ID(ctx->app_id) | CMD_IS_READ | CMD_TRANSPORT;
@@ -163,9 +167,6 @@ static int get_status(const struct transport_context *ctx,
return -1;
}
- /* All unset fields will be 0. */
- memset(out, 0, sizeof(*out));
-
/* Examine v0 fields */
out->status = le32toh(st.status.status);
out->reply_len = le16toh(st.status.reply_len);
@@ -295,7 +296,7 @@ static uint32_t send_command(const struct transport_context *ctx) {
/* Any further Writes needed to send all the args must set the MORE bit */
command |= CMD_MORE_TO_COME;
- args += ulen;
+ if (args) args += ulen;
arg_len -= ulen;
} while (arg_len);
diff --git a/nugget/proto/nugget/app/avb/avb.proto b/nugget/proto/nugget/app/avb/avb.proto
index bc0c700..9aec71e 100644
--- a/nugget/proto/nugget/app/avb/avb.proto
+++ b/nugget/proto/nugget/app/avb/avb.proto
@@ -53,13 +53,16 @@ enum LockIndex {
}
// GetState
-message GetStateRequest {}
+message GetStateRequest {
+ bool keysclear_reset = 1;
+}
message GetStateResponse {
uint64 version = 1;
bool bootloader = 2;
bool production = 3;
uint32 number_of_locks = 4;
bytes locks = 5;
+ bool keysclear_required = 6;
}
// Load
diff --git a/nugget/proto/nugget/app/keymaster/keymaster.proto b/nugget/proto/nugget/app/keymaster/keymaster.proto
index e6fec75..1cb50bd 100644
--- a/nugget/proto/nugget/app/keymaster/keymaster.proto
+++ b/nugget/proto/nugget/app/keymaster/keymaster.proto
@@ -138,6 +138,11 @@ service Keymaster {
rpc VigoReleaseSecret(VigoReleaseSecretRequest)
returns (VigoReleaseSecretResponse);
+ /*
+ * pKVM implementation
+ */
+ rpc GetPerFactoryResetValue(GetPerFactoryResetValueRequest) returns (GetPerFactoryResetValueResponse);
+
// These are implemented with a enum, so new RPCs must be appended, and
// deprecated RPCs need placeholders.
}
@@ -564,3 +569,14 @@ message IdentityFinishAttestKeyResponse {
ChipFusing chip_fusing = 3;
bool nodelocked_ro = 4;
}
+
+// pKVM messages
+message GetPerFactoryResetValueRequest {
+ bool bootloader_only = 1;
+ bytes input = 2;
+}
+
+message GetPerFactoryResetValueResponse {
+ ErrorCode error_code = 1;
+ bytes output = 2;
+}