summaryrefslogtreecommitdiff
path: root/trusty/keymaster/keymint/TrustyKeyMintDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'trusty/keymaster/keymint/TrustyKeyMintDevice.cpp')
-rw-r--r--trusty/keymaster/keymint/TrustyKeyMintDevice.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/trusty/keymaster/keymint/TrustyKeyMintDevice.cpp b/trusty/keymaster/keymint/TrustyKeyMintDevice.cpp
index 44780e835..7d58162cc 100644
--- a/trusty/keymaster/keymint/TrustyKeyMintDevice.cpp
+++ b/trusty/keymaster/keymint/TrustyKeyMintDevice.cpp
@@ -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 */) {