[DO NOT MERGE] Titan-M firmware: D3-UDC-001a am: 30ce5bfe58

Original change: https://googleplex-android-review.googlesource.com/c/platform/external/nos/host/generic/+/20677747

Change-Id: I3a2acb1625a9d71ef8669e144b9f9744b4b33da9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libnos/generator/main.cpp b/libnos/generator/main.cpp
index 04dfa89..25178c3 100644
--- a/libnos/generator/main.cpp
+++ b/libnos/generator/main.cpp
@@ -240,7 +240,7 @@
         methodVars.insert(vars.begin(), vars.end());
         printer.Print(methodVars, R"(
 uint32_t $class$::$method_name$(const $method_input_type$& request, $method_output_type$* response) {
-    const size_t request_size = request.ByteSize();
+    const size_t request_size = request.ByteSizeLong();
     if (request_size > $max_request_size$) {
         return APP_ERROR_TOO_MUCH;
     }
diff --git a/libnos_transport/test/test.cpp b/libnos_transport/test/test.cpp
index 1090de4..c995c60 100644
--- a/libnos_transport/test/test.cpp
+++ b/libnos_transport/test/test.cpp
@@ -201,7 +201,7 @@
   status->length = STATUS_MAX_LENGTH;
   status->version = 42;
   status->flags = STATUS_FLAG_WORKING;
-  status->crc = 0xaec0;
+  status->crc = 0xf781;
   status->reply_crc = 0;
 }
 
diff --git a/nugget/include/app_nugget.h b/nugget/include/app_nugget.h
index cbeac47..82554c5 100644
--- a/nugget/include/app_nugget.h
+++ b/nugget/include/app_nugget.h
@@ -562,7 +562,17 @@
  * @param args         GSA noise handshake state
  * @param arg_len      1
  * @param reply        <none>
- * @param reply_len    0
+ * @param reply_len    1
+ */
+#define NUGGET_PARAM_GET_BIG_EVENT_REPORT 0x001b
+/*
+ * This retrieves one pending big_event_report (defined in citadel_events.h).
+ * If none are pending, it returns nothing.
+ *
+ * @param args         <none>
+ * @param arg_len      0
+ * @param reply        struct big_event_report
+ * @param reply_len    sizeof struct big_event_report  OR  0
  */
 #define NUGGET_PARAM_GET_BIG_EVENT_REPORT 0x001b
 /*
diff --git a/nugget/include/application.h b/nugget/include/application.h
index 1d485c6..2f897b6 100644
--- a/nugget/include/application.h
+++ b/nugget/include/application.h
@@ -239,7 +239,7 @@
 
 /* Valid range of lengths for the status message */
 #define STATUS_MIN_LENGTH 0x10
-#define STATUS_MAX_LENGTH 0xff
+#define STATUS_MAX_LENGTH (sizeof(struct transport_status)) /* 0x10 */
 
 /* Flags used in the status message */
 #define STATUS_FLAG_WORKING 0x0001 /* added in v1 */
diff --git a/nugget/proto/nugget/app/identity/identity.proto b/nugget/proto/nugget/app/identity/identity.proto
index a29aa16..8532f6a 100644
--- a/nugget/proto/nugget/app/identity/identity.proto
+++ b/nugget/proto/nugget/app/identity/identity.proto
@@ -251,7 +251,7 @@
   uint64 secureUserId = 5;
   bytes mac = 6;
   uint32 publicKeyOffset = 7;
-  uint32 publicKeysize = 8;
+  uint32 publicKeySize = 8;
 }
 
 message ICvalidateAccessControlProfileResponse{
@@ -297,6 +297,7 @@
 message ICstartRetrieveEntryValueResponse{
   AccessResult accessCheckResult = 1;
   uint32 sessionCookie = 2;
+  Result result = 3;
 }
 
 // ICretrieveEntryValue
diff --git a/nugget/proto/nugget/app/keymaster/keymaster.proto b/nugget/proto/nugget/app/keymaster/keymaster.proto
index 89710e6..d4c5a6f 100644
--- a/nugget/proto/nugget/app/keymaster/keymaster.proto
+++ b/nugget/proto/nugget/app/keymaster/keymaster.proto
@@ -149,6 +149,11 @@
   rpc GenerateRkpKey(GenerateRkpKeyRequest) returns (GenerateRkpKeyResponse);
   rpc GenerateRkpCsr(GenerateRkpCsrRequest) returns (GenerateRkpCsrResponse);
 
+  /*
+   * Vendor specific method. To export IMEI/DSU to trusty only
+   */
+  rpc ExportDeviceIds(ExportDeviceIdsRequest) returns (ExportDeviceIdsResponse);
+
   // These are implemented with a enum, so new RPCs must be appended, and
   // deprecated RPCs need placeholders.
 }
@@ -439,6 +444,24 @@
   bool nodelocked_ro = 3;
 }
 
+message ExportDeviceIdsRequest {
+  bytes challenge = 1;
+  bytes challenge_hmac = 2;
+}
+
+message ExportDeviceIdsResponse {
+  ErrorCode error_code = 1;
+  bytes product_brand = 2;
+  bytes product_device = 3;
+  bytes product_name = 4;
+  bytes serialno = 5;
+  bytes product_manufacturer = 6;
+  bytes product_model = 7;
+  bytes imei = 8;
+  bytes meid = 9;
+  bytes ids_hmac = 10;
+}
+
 // ReadTeeBatchCertificate
 // Only callable at the Device Factory
 message ReadTeeBatchCertificateRequest {