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