diff --git a/trusty/keymaster/TrustyKeymaster.cpp b/trusty/keymaster/TrustyKeymaster.cpp index e77940a1f..e4791e6ea 100644 --- a/trusty/keymaster/TrustyKeymaster.cpp +++ b/trusty/keymaster/TrustyKeymaster.cpp @@ -285,4 +285,10 @@ GetRootOfTrustResponse TrustyKeymaster::GetRootOfTrust(const GetRootOfTrustReque return response; } +GetHwInfoResponse TrustyKeymaster::GetHwInfo() { + GetHwInfoResponse response(message_version()); + ForwardCommand(KM_GET_HW_INFO, GetHwInfoRequest(message_version()), &response); + return response; +} + } // namespace keymaster diff --git a/trusty/keymaster/include/trusty_keymaster/TrustyKeymaster.h b/trusty/keymaster/include/trusty_keymaster/TrustyKeymaster.h index 9f4f39bf5..ec5281103 100644 --- a/trusty/keymaster/include/trusty_keymaster/TrustyKeymaster.h +++ b/trusty/keymaster/include/trusty_keymaster/TrustyKeymaster.h @@ -67,6 +67,7 @@ class TrustyKeymaster { ConfigureVendorPatchlevelResponse ConfigureVendorPatchlevel( const ConfigureVendorPatchlevelRequest& request); GetRootOfTrustResponse GetRootOfTrust(const GetRootOfTrustRequest& request); + GetHwInfoResponse GetHwInfo(); uint32_t message_version() const { return message_version_; } diff --git a/trusty/keymaster/include/trusty_keymaster/ipc/keymaster_ipc.h b/trusty/keymaster/include/trusty_keymaster/ipc/keymaster_ipc.h index bf0cb703f..9b55e9dd7 100644 --- a/trusty/keymaster/include/trusty_keymaster/ipc/keymaster_ipc.h +++ b/trusty/keymaster/include/trusty_keymaster/ipc/keymaster_ipc.h @@ -60,6 +60,7 @@ enum keymaster_command : uint32_t { KM_GENERATE_CSR = (32 << KEYMASTER_REQ_SHIFT), KM_CONFIGURE_VENDOR_PATCHLEVEL = (33 << KEYMASTER_REQ_SHIFT), KM_GET_ROOT_OF_TRUST = (34 << KEYMASTER_REQ_SHIFT), + KM_GET_HW_INFO = (35 << KEYMASTER_REQ_SHIFT), // Bootloader/provisioning calls. KM_SET_BOOT_PARAMS = (0x1000 << KEYMASTER_REQ_SHIFT), diff --git a/trusty/keymaster/keymint/TrustyRemotelyProvisionedComponentDevice.cpp b/trusty/keymaster/keymint/TrustyRemotelyProvisionedComponentDevice.cpp index 099f18961..7f03f8677 100644 --- a/trusty/keymaster/keymint/TrustyRemotelyProvisionedComponentDevice.cpp +++ b/trusty/keymaster/keymint/TrustyRemotelyProvisionedComponentDevice.cpp @@ -30,6 +30,8 @@ using keymaster::GenerateCsrRequest; using keymaster::GenerateCsrResponse; using keymaster::GenerateRkpKeyRequest; using keymaster::GenerateRkpKeyResponse; +using keymaster::GetHwInfoRequest; +using keymaster::GetHwInfoResponse; using keymaster::KeymasterBlob; using ::std::string; using ::std::unique_ptr; @@ -71,10 +73,15 @@ class Status { } // namespace ScopedAStatus TrustyRemotelyProvisionedComponentDevice::getHardwareInfo(RpcHardwareInfo* info) { - info->versionNumber = 2; - info->rpcAuthorName = "Google"; - info->supportedEekCurve = RpcHardwareInfo::CURVE_25519; - info->uniqueId = "Trusty: My password is ******"; + GetHwInfoResponse response = impl_->GetHwInfo(); + if (response.error != KM_ERROR_OK) { + return Status(-static_cast(response.error), "Failed to get hardware info."); + } + + info->versionNumber = response.version; + info->rpcAuthorName = std::move(response.rpcAuthorName); + info->supportedEekCurve = response.supportedEekCurve; + info->uniqueId = std::move(response.uniqueId); return ScopedAStatus::ok(); }