diff --git a/keystore2/src/km_compat/km_compat.cpp b/keystore2/src/km_compat/km_compat.cpp index 429a038f..dedca6d4 100644 --- a/keystore2/src/km_compat/km_compat.cpp +++ b/keystore2/src/km_compat/km_compat.cpp @@ -500,6 +500,29 @@ ScopedAStatus KeyMintDevice::begin(KeyPurpose in_inPurpose, return convertErrorCode(errorCode); } +ScopedAStatus KeyMintDevice::deviceLocked(bool passwordOnly, + const std::optional& timestampToken) { + V4_0_VerificationToken token; + if (timestampToken.has_value()) { + token = convertTimestampTokenToLegacy(timestampToken.value()); + } + auto ret = mDevice->deviceLocked(passwordOnly, token); + if (!ret.isOk()) { + return convertErrorCode(KMV1::ErrorCode::UNKNOWN_ERROR); + } else { + return convertErrorCode(KMV1::ErrorCode::OK); + } +} + +ScopedAStatus KeyMintDevice::earlyBootEnded() { + auto ret = mDevice->earlyBootEnded(); + if (!ret.isOk()) { + return convertErrorCode(KMV1::ErrorCode::UNKNOWN_ERROR); + } else { + return convertErrorCode(KMV1::ErrorCode::OK); + } +} + ScopedAStatus KeyMintOperation::update(const std::optional& in_inParams, const std::optional>& in_input, const std::optional& in_inAuthToken, diff --git a/keystore2/src/km_compat/km_compat.h b/keystore2/src/km_compat/km_compat.h index 5637b583..7abccdeb 100644 --- a/keystore2/src/km_compat/km_compat.h +++ b/keystore2/src/km_compat/km_compat.h @@ -110,7 +110,9 @@ class KeyMintDevice : public aidl::android::hardware::security::keymint::BnKeyMi const std::vector& in_inParams, const HardwareAuthToken& in_inAuthToken, BeginResult* _aidl_return) override; - + ScopedAStatus deviceLocked(bool passwordOnly, + const std::optional& timestampToken) override; + ScopedAStatus earlyBootEnded() override; // These are public to allow testing code to use them directly. // This class should not be used publicly anyway.