Loading trusty/keymaster/TrustyKeymaster.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -279,4 +279,10 @@ ConfigureVendorPatchlevelResponse TrustyKeymaster::ConfigureVendorPatchlevel( return response; } GetRootOfTrustResponse TrustyKeymaster::GetRootOfTrust(const GetRootOfTrustRequest& request) { GetRootOfTrustResponse response(message_version()); ForwardCommand(KM_GET_ROOT_OF_TRUST, request, &response); return response; } } // namespace keymaster trusty/keymaster/include/trusty_keymaster/TrustyKeymaster.h +1 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ class TrustyKeymaster { DeviceLockedResponse DeviceLocked(const DeviceLockedRequest& request); ConfigureVendorPatchlevelResponse ConfigureVendorPatchlevel( const ConfigureVendorPatchlevelRequest& request); GetRootOfTrustResponse GetRootOfTrust(const GetRootOfTrustRequest& request); uint32_t message_version() const { return message_version_; } Loading trusty/keymaster/include/trusty_keymaster/ipc/keymaster_ipc.h +1 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ enum keymaster_command : uint32_t { KM_GENERATE_RKP_KEY = (31 << KEYMASTER_REQ_SHIFT), KM_GENERATE_CSR = (32 << KEYMASTER_REQ_SHIFT), KM_CONFIGURE_VENDOR_PATCHLEVEL = (33 << KEYMASTER_REQ_SHIFT), KM_GET_ROOT_OF_TRUST = (34 << KEYMASTER_REQ_SHIFT), // Bootloader/provisioning calls. KM_SET_BOOT_PARAMS = (0x1000 << KEYMASTER_REQ_SHIFT), Loading trusty/keymaster/keymint/TrustyKeyMintDevice.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -325,9 +325,20 @@ ScopedAStatus TrustyKeyMintDevice::getRootOfTrustChallenge(array<uint8_t, 16>* / return kmError2ScopedAStatus(KM_ERROR_UNIMPLEMENTED); } ScopedAStatus TrustyKeyMintDevice::getRootOfTrust(const array<uint8_t, 16>& /* challenge */, vector<uint8_t>* /* rootOfTrust */) { return kmError2ScopedAStatus(KM_ERROR_UNIMPLEMENTED); ScopedAStatus TrustyKeyMintDevice::getRootOfTrust(const array<uint8_t, 16>& challenge, vector<uint8_t>* rootOfTrust) { if (!rootOfTrust) { return kmError2ScopedAStatus(KM_ERROR_UNEXPECTED_NULL_POINTER); } keymaster::GetRootOfTrustRequest request(impl_->message_version(), {challenge.begin(), challenge.end()}); keymaster::GetRootOfTrustResponse response = impl_->GetRootOfTrust(request); if (response.error != KM_ERROR_OK) { return kmError2ScopedAStatus(response.error); } *rootOfTrust = std::move(response.rootOfTrust); return ScopedAStatus::ok(); } ScopedAStatus TrustyKeyMintDevice::sendRootOfTrust(const vector<uint8_t>& /* rootOfTrust */) { Loading Loading
trusty/keymaster/TrustyKeymaster.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -279,4 +279,10 @@ ConfigureVendorPatchlevelResponse TrustyKeymaster::ConfigureVendorPatchlevel( return response; } GetRootOfTrustResponse TrustyKeymaster::GetRootOfTrust(const GetRootOfTrustRequest& request) { GetRootOfTrustResponse response(message_version()); ForwardCommand(KM_GET_ROOT_OF_TRUST, request, &response); return response; } } // namespace keymaster
trusty/keymaster/include/trusty_keymaster/TrustyKeymaster.h +1 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ class TrustyKeymaster { DeviceLockedResponse DeviceLocked(const DeviceLockedRequest& request); ConfigureVendorPatchlevelResponse ConfigureVendorPatchlevel( const ConfigureVendorPatchlevelRequest& request); GetRootOfTrustResponse GetRootOfTrust(const GetRootOfTrustRequest& request); uint32_t message_version() const { return message_version_; } Loading
trusty/keymaster/include/trusty_keymaster/ipc/keymaster_ipc.h +1 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ enum keymaster_command : uint32_t { KM_GENERATE_RKP_KEY = (31 << KEYMASTER_REQ_SHIFT), KM_GENERATE_CSR = (32 << KEYMASTER_REQ_SHIFT), KM_CONFIGURE_VENDOR_PATCHLEVEL = (33 << KEYMASTER_REQ_SHIFT), KM_GET_ROOT_OF_TRUST = (34 << KEYMASTER_REQ_SHIFT), // Bootloader/provisioning calls. KM_SET_BOOT_PARAMS = (0x1000 << KEYMASTER_REQ_SHIFT), Loading
trusty/keymaster/keymint/TrustyKeyMintDevice.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -325,9 +325,20 @@ ScopedAStatus TrustyKeyMintDevice::getRootOfTrustChallenge(array<uint8_t, 16>* / return kmError2ScopedAStatus(KM_ERROR_UNIMPLEMENTED); } ScopedAStatus TrustyKeyMintDevice::getRootOfTrust(const array<uint8_t, 16>& /* challenge */, vector<uint8_t>* /* rootOfTrust */) { return kmError2ScopedAStatus(KM_ERROR_UNIMPLEMENTED); ScopedAStatus TrustyKeyMintDevice::getRootOfTrust(const array<uint8_t, 16>& challenge, vector<uint8_t>* rootOfTrust) { if (!rootOfTrust) { return kmError2ScopedAStatus(KM_ERROR_UNEXPECTED_NULL_POINTER); } keymaster::GetRootOfTrustRequest request(impl_->message_version(), {challenge.begin(), challenge.end()}); keymaster::GetRootOfTrustResponse response = impl_->GetRootOfTrust(request); if (response.error != KM_ERROR_OK) { return kmError2ScopedAStatus(response.error); } *rootOfTrust = std::move(response.rootOfTrust); return ScopedAStatus::ok(); } ScopedAStatus TrustyKeyMintDevice::sendRootOfTrust(const vector<uint8_t>& /* rootOfTrust */) { Loading