Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc6efddf authored by David Drysdale's avatar David Drysdale Committed by Gerrit Code Review
Browse files

Merge "Move Trusty C++ KeyMint to v4" into main

parents 17cd0080 487584da
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -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 {
+7 −0
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -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_;
+2 −0
Original line number Diff line number Diff line
@@ -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_; }
+1 −0
Original line number Diff line number Diff line
@@ -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),
Loading