cryptohome: Add Firmware Management Parameters API

This adds the get, set, and remove methods for the firmware management
parameters.

BUG=chromium:601492
TEST=as part of subsequent cryptohome change (CL:339262)

Change-Id: Iece4e4a4320fbd5393d8e12f0f11e6b12c36d6f6
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/339224
diff --git a/dbus/cryptohome/dbus-constants.h b/dbus/cryptohome/dbus-constants.h
index 27eaa40..2835aaa 100644
--- a/dbus/cryptohome/dbus-constants.h
+++ b/dbus/cryptohome/dbus-constants.h
@@ -115,6 +115,12 @@
 const char kCryptohomeGetTpmStatus[] = "GetTpmStatus";
 const char kCryptohomeGetEndorsementInfo[] = "GetEndorsementInfo";
 const char kCryptohomeRenameCryptohome[] = "RenameCryptohome";
+const char kCryptohomeGetFirmwareManagementParameters[] =
+    "GetFirmwareManagementParameters";
+const char kCryptohomeSetFirmwareManagementParameters[] =
+    "SetFirmwareManagementParameters";
+const char kCryptohomeRemoveFirmwareManagementParameters[] =
+    "RemoveFirmwareManagementParameters";
 
 // Signals
 const char kSignalAsyncCallStatus[] = "AsyncCallStatus";
diff --git a/dbus/cryptohome/rpc.proto b/dbus/cryptohome/rpc.proto
index 9e72563..333eed7 100644
--- a/dbus/cryptohome/rpc.proto
+++ b/dbus/cryptohome/rpc.proto
@@ -54,6 +54,9 @@
   CRYPTOHOME_ERROR_CA_REFUSED_ENROLLMENT = 23;
   CRYPTOHOME_ERROR_CA_REFUSED_CERTIFICATE = 24;
   CRYPTOHOME_ERROR_INTERNAL_ATTESTATION_ERROR = 25;
+  CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_INVALID = 26;
+  CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_CANNOT_STORE = 27;
+  CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_CANNOT_REMOVE = 28;
 }
 
 message AccountIdentifier {
@@ -278,3 +281,37 @@
 
 message InitializeCastKeyRequest {
 }
+
+// Flags for GetFirmwareManagementParametersReply and
+// SetFirmwareManagementParametersRequest
+enum FirmwareManagementParametersFlags {
+  NONE = 0;
+  DEVELOPER_DISABLE_BOOT = 1;
+  DEVELOPER_DISABLE_RECOVERY_INSTALL = 2;
+  DEVELOPER_DISABLE_RECOVERY_ROOTFS = 4;
+  DEVELOPER_ENABLE_USB = 8;
+  DEVELOPER_ENABLE_LEGACY = 16;
+  DEVELOPER_USE_KEY_HASH = 32;
+}
+
+message GetFirmwareManagementParametersRequest {
+}
+
+message GetFirmwareManagementParametersReply {
+  extend BaseReply {
+    optional GetFirmwareManagementParametersReply reply = 1008;
+  }
+
+  // Flags (zero or more from FirmwareManagementParametersFlags)
+  optional int32 flags = 1;
+  optional bytes developer_key_hash = 2;
+}
+
+message SetFirmwareManagementParametersRequest {
+  // Flags (zero or more from FirmwareManagementParametersFlags)
+  optional int32 flags = 1;
+  optional bytes developer_key_hash = 2;
+}
+
+message RemoveFirmwareManagementParametersRequest {
+}