Merge "Move Trusty C++ KeyMint to v4" into main am: bc6efddf79
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3375712 Change-Id: I47ec3395aaa9a13ce7e8f3bc2ac514d0663f4371 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
e59a7fb20c
7 changed files with 32 additions and 6 deletions
|
|
@ -106,11 +106,11 @@ cc_binary {
|
|||
"keymint/service.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.security.keymint-V3-ndk",
|
||||
"android.hardware.security.keymint-V4-ndk",
|
||||
"android.hardware.security.rkp-V3-ndk",
|
||||
"android.hardware.security.secureclock-V1-ndk",
|
||||
"android.hardware.security.sharedsecret-V1-ndk",
|
||||
"lib_android_keymaster_keymint_utils_V3",
|
||||
"lib_android_keymaster_keymint_utils",
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"libhardware",
|
||||
|
|
@ -120,9 +120,10 @@ cc_binary {
|
|||
"libtrusty",
|
||||
"libutils",
|
||||
],
|
||||
required: [
|
||||
"android.hardware.hardware_keystore_V3.xml",
|
||||
],
|
||||
required: select(release_flag("RELEASE_AIDL_USE_UNFROZEN"), {
|
||||
true: ["android.hardware.hardware_keystore.xml"],
|
||||
default: ["android.hardware.hardware_keystore_V3.xml"],
|
||||
}),
|
||||
}
|
||||
|
||||
prebuilt_etc {
|
||||
|
|
|
|||
|
|
@ -295,6 +295,13 @@ GetRootOfTrustResponse TrustyKeymaster::GetRootOfTrust(const GetRootOfTrustReque
|
|||
return response;
|
||||
}
|
||||
|
||||
SetAdditionalAttestationInfoResponse TrustyKeymaster::SetAdditionalAttestationInfo(
|
||||
const SetAdditionalAttestationInfoRequest& request) {
|
||||
SetAdditionalAttestationInfoResponse response(message_version());
|
||||
ForwardCommand(KM_SET_ADDITIONAL_ATTESTATION_INFO, request, &response);
|
||||
return response;
|
||||
}
|
||||
|
||||
GetHwInfoResponse TrustyKeymaster::GetHwInfo() {
|
||||
GetHwInfoResponse response(message_version());
|
||||
ForwardCommand(KM_GET_HW_INFO, GetHwInfoRequest(message_version()), &response);
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ class TrustyKeyMintDevice : public BnKeyMintDevice {
|
|||
ScopedAStatus getRootOfTrust(const array<uint8_t, 16>& challenge,
|
||||
vector<uint8_t>* rootOfTrust) override;
|
||||
ScopedAStatus sendRootOfTrust(const vector<uint8_t>& rootOfTrust) override;
|
||||
ScopedAStatus setAdditionalAttestationInfo(const vector<KeyParameter>& info) override;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<TrustyKeymaster> impl_;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ class TrustyKeymaster {
|
|||
ConfigureVendorPatchlevelResponse ConfigureVendorPatchlevel(
|
||||
const ConfigureVendorPatchlevelRequest& request);
|
||||
GetRootOfTrustResponse GetRootOfTrust(const GetRootOfTrustRequest& request);
|
||||
SetAdditionalAttestationInfoResponse SetAdditionalAttestationInfo(
|
||||
const SetAdditionalAttestationInfoRequest& request);
|
||||
GetHwInfoResponse GetHwInfo();
|
||||
|
||||
uint32_t message_version() const { return message_version_; }
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ enum keymaster_command : uint32_t {
|
|||
KM_GET_ROOT_OF_TRUST = (34 << KEYMASTER_REQ_SHIFT),
|
||||
KM_GET_HW_INFO = (35 << KEYMASTER_REQ_SHIFT),
|
||||
KM_GENERATE_CSR_V2 = (36 << KEYMASTER_REQ_SHIFT),
|
||||
KM_SET_ADDITIONAL_ATTESTATION_INFO = (37 << KEYMASTER_REQ_SHIFT),
|
||||
|
||||
// Bootloader/provisioning calls.
|
||||
KM_SET_BOOT_PARAMS = (0x1000 << KEYMASTER_REQ_SHIFT),
|
||||
|
|
|
|||
|
|
@ -349,4 +349,18 @@ ScopedAStatus TrustyKeyMintDevice::sendRootOfTrust(const vector<uint8_t>& /* roo
|
|||
return kmError2ScopedAStatus(KM_ERROR_UNIMPLEMENTED);
|
||||
}
|
||||
|
||||
ScopedAStatus TrustyKeyMintDevice::setAdditionalAttestationInfo(const vector<KeyParameter>& info) {
|
||||
keymaster::SetAdditionalAttestationInfoRequest request(impl_->message_version());
|
||||
request.info.Reinitialize(KmParamSet(info));
|
||||
|
||||
keymaster::SetAdditionalAttestationInfoResponse response =
|
||||
impl_->SetAdditionalAttestationInfo(request);
|
||||
|
||||
if (response.error != KM_ERROR_OK) {
|
||||
return kmError2ScopedAStatus(response.error);
|
||||
} else {
|
||||
return ScopedAStatus::ok();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace aidl::android::hardware::security::keymint::trusty
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.security.keymint</name>
|
||||
<version>3</version>
|
||||
<version>4</version>
|
||||
<fqname>IKeyMintDevice/default</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue