Merge "Keymint: Use ndk_platform." am: dfe843477b
am: 24f8ba41c4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1532211 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I9e5e0c12977b5cefe4a1df68a0dfb64192af9f12
This commit is contained in:
commit
c670b8d592
17 changed files with 119 additions and 123 deletions
|
@ -9,7 +9,7 @@ cc_binary {
|
|||
"-Wextra",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.security.keymint-ndk_platform",
|
||||
"android.hardware.security.keymint-unstable-ndk_platform",
|
||||
"libbase",
|
||||
"libbinder_ndk",
|
||||
"libcppbor",
|
||||
|
|
|
@ -25,13 +25,13 @@ cc_test {
|
|||
"VerificationTokenTest.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbinder",
|
||||
"libbinder_ndk",
|
||||
"libcrypto",
|
||||
"libkeymint",
|
||||
"libkeymint_support",
|
||||
],
|
||||
static_libs: [
|
||||
"android.hardware.security.keymint-cpp",
|
||||
"android.hardware.security.keymint-unstable-ndk_platform",
|
||||
"libcppbor_external",
|
||||
"libkeymint_vts_test_utils",
|
||||
],
|
||||
|
@ -54,13 +54,13 @@ cc_test_library {
|
|||
".",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbinder",
|
||||
"libbinder_ndk",
|
||||
"libcrypto",
|
||||
"libkeymint",
|
||||
"libkeymint_support",
|
||||
],
|
||||
static_libs: [
|
||||
"android.hardware.security.keymint-cpp",
|
||||
"android.hardware.security.keymint-unstable-ndk_platform",
|
||||
"libcppbor",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -20,11 +20,12 @@
|
|||
#include <vector>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
|
||||
#include <keymint_support/key_param_output.h>
|
||||
#include <keymint_support/keymint_utils.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
using namespace std::literals::chrono_literals;
|
||||
using std::endl;
|
||||
|
@ -42,19 +43,19 @@ using std::optional;
|
|||
|
||||
namespace test {
|
||||
|
||||
ErrorCode KeyMintAidlTestBase::GetReturnErrorCode(Status result) {
|
||||
ErrorCode KeyMintAidlTestBase::GetReturnErrorCode(const Status& result) {
|
||||
if (result.isOk()) return ErrorCode::OK;
|
||||
|
||||
if (result.exceptionCode() == binder::Status::EX_SERVICE_SPECIFIC) {
|
||||
return static_cast<ErrorCode>(result.serviceSpecificErrorCode());
|
||||
if (result.getExceptionCode() == EX_SERVICE_SPECIFIC) {
|
||||
return static_cast<ErrorCode>(result.getServiceSpecificError());
|
||||
}
|
||||
|
||||
return ErrorCode::UNKNOWN_ERROR;
|
||||
}
|
||||
|
||||
void KeyMintAidlTestBase::InitializeKeyMint(sp<IKeyMintDevice> keyMint) {
|
||||
void KeyMintAidlTestBase::InitializeKeyMint(std::shared_ptr<IKeyMintDevice> keyMint) {
|
||||
ASSERT_NE(keyMint, nullptr);
|
||||
keymint_ = keyMint;
|
||||
keymint_ = std::move(keyMint);
|
||||
|
||||
KeyMintHardwareInfo info;
|
||||
ASSERT_TRUE(keymint_->getHardwareInfo(&info).isOk());
|
||||
|
@ -68,8 +69,12 @@ void KeyMintAidlTestBase::InitializeKeyMint(sp<IKeyMintDevice> keyMint) {
|
|||
}
|
||||
|
||||
void KeyMintAidlTestBase::SetUp() {
|
||||
InitializeKeyMint(
|
||||
android::waitForDeclaredService<IKeyMintDevice>(String16(GetParam().c_str())));
|
||||
if (AServiceManager_isDeclared(GetParam().c_str())) {
|
||||
::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str()));
|
||||
InitializeKeyMint(IKeyMintDevice::fromBinder(binder));
|
||||
} else {
|
||||
InitializeKeyMint(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
|
||||
|
@ -176,7 +181,7 @@ ErrorCode KeyMintAidlTestBase::DeleteKey(vector<uint8_t>* key_blob, bool keep_ke
|
|||
*key_blob = vector<uint8_t>();
|
||||
}
|
||||
|
||||
EXPECT_TRUE(result.isOk()) << result.serviceSpecificErrorCode() << endl;
|
||||
EXPECT_TRUE(result.isOk()) << result.getServiceSpecificError() << endl;
|
||||
return GetReturnErrorCode(result);
|
||||
}
|
||||
|
||||
|
@ -186,7 +191,7 @@ ErrorCode KeyMintAidlTestBase::DeleteKey(bool keep_key_blob) {
|
|||
|
||||
ErrorCode KeyMintAidlTestBase::DeleteAllKeys() {
|
||||
Status result = keymint_->deleteAllKeys();
|
||||
EXPECT_TRUE(result.isOk()) << result.serviceSpecificErrorCode() << endl;
|
||||
EXPECT_TRUE(result.isOk()) << result.getServiceSpecificError() << endl;
|
||||
return GetReturnErrorCode(result);
|
||||
}
|
||||
|
||||
|
@ -201,7 +206,8 @@ void KeyMintAidlTestBase::CheckedDeleteKey() {
|
|||
|
||||
ErrorCode KeyMintAidlTestBase::Begin(KeyPurpose purpose, const vector<uint8_t>& key_blob,
|
||||
const AuthorizationSet& in_params,
|
||||
AuthorizationSet* out_params, sp<IKeyMintOperation>& op) {
|
||||
AuthorizationSet* out_params,
|
||||
std::shared_ptr<IKeyMintOperation>& op) {
|
||||
SCOPED_TRACE("Begin");
|
||||
Status result;
|
||||
BeginResult out;
|
||||
|
@ -326,7 +332,7 @@ ErrorCode KeyMintAidlTestBase::Finish(const AuthorizationSet& in_params, const s
|
|||
output->append(oPut.begin(), oPut.end());
|
||||
}
|
||||
|
||||
op_.clear(); // So dtor doesn't Abort().
|
||||
op_.reset();
|
||||
return GetReturnErrorCode(result);
|
||||
}
|
||||
|
||||
|
@ -358,7 +364,7 @@ ErrorCode KeyMintAidlTestBase::Finish(const string& message, const string& signa
|
|||
return result;
|
||||
}
|
||||
|
||||
ErrorCode KeyMintAidlTestBase::Abort(const sp<IKeyMintOperation>& op) {
|
||||
ErrorCode KeyMintAidlTestBase::Abort(const std::shared_ptr<IKeyMintOperation>& op) {
|
||||
SCOPED_TRACE("Abort");
|
||||
|
||||
EXPECT_NE(op, nullptr);
|
||||
|
@ -368,7 +374,7 @@ ErrorCode KeyMintAidlTestBase::Abort(const sp<IKeyMintOperation>& op) {
|
|||
|
||||
Status retval = op->abort();
|
||||
EXPECT_TRUE(retval.isOk());
|
||||
return static_cast<ErrorCode>(retval.serviceSpecificErrorCode());
|
||||
return static_cast<ErrorCode>(retval.getServiceSpecificError());
|
||||
}
|
||||
|
||||
ErrorCode KeyMintAidlTestBase::Abort() {
|
||||
|
@ -380,14 +386,14 @@ ErrorCode KeyMintAidlTestBase::Abort() {
|
|||
}
|
||||
|
||||
Status retval = op_->abort();
|
||||
return static_cast<ErrorCode>(retval.serviceSpecificErrorCode());
|
||||
return static_cast<ErrorCode>(retval.getServiceSpecificError());
|
||||
}
|
||||
|
||||
void KeyMintAidlTestBase::AbortIfNeeded() {
|
||||
SCOPED_TRACE("AbortIfNeeded");
|
||||
if (op_) {
|
||||
EXPECT_EQ(ErrorCode::OK, Abort());
|
||||
op_.clear();
|
||||
op_.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -522,7 +528,7 @@ void KeyMintAidlTestBase::VerifyMessage(const vector<uint8_t>& key_blob, const s
|
|||
AuthorizationSet finish_out_params;
|
||||
EXPECT_EQ(ErrorCode::OK, Finish(finish_params, message.substr(consumed), signature,
|
||||
&finish_out_params, &output));
|
||||
op_.clear();
|
||||
op_.reset();
|
||||
EXPECT_TRUE(output.empty());
|
||||
}
|
||||
|
||||
|
@ -750,4 +756,4 @@ vector<Digest> KeyMintAidlTestBase::ValidDigests(bool withNone, bool withMD5) {
|
|||
|
||||
} // namespace test
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
#include <binder/ProcessState.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <android/hardware/security/keymint/ErrorCode.h>
|
||||
#include <android/hardware/security/keymint/IKeyMintDevice.h>
|
||||
#include <aidl/android/hardware/security/keymint/ErrorCode.h>
|
||||
#include <aidl/android/hardware/security/keymint/IKeyMintDevice.h>
|
||||
|
||||
#include <keymint_support/authorization_set.h>
|
||||
|
||||
namespace android::hardware::security::keymint::test {
|
||||
namespace aidl::android::hardware::security::keymint::test {
|
||||
|
||||
using ::android::sp;
|
||||
using binder::Status;
|
||||
using Status = ::ndk::ScopedAStatus;
|
||||
using ::std::shared_ptr;
|
||||
using ::std::string;
|
||||
using ::std::vector;
|
||||
|
@ -49,12 +49,12 @@ class KeyMintAidlTestBase : public ::testing::TestWithParam<string> {
|
|||
AbortIfNeeded();
|
||||
}
|
||||
|
||||
void InitializeKeyMint(sp<IKeyMintDevice> keyMint);
|
||||
void InitializeKeyMint(std::shared_ptr<IKeyMintDevice> keyMint);
|
||||
IKeyMintDevice& keyMint() { return *keymint_; }
|
||||
uint32_t os_version() { return os_version_; }
|
||||
uint32_t os_patch_level() { return os_patch_level_; }
|
||||
|
||||
ErrorCode GetReturnErrorCode(Status result);
|
||||
ErrorCode GetReturnErrorCode(const Status& result);
|
||||
ErrorCode GenerateKey(const AuthorizationSet& key_desc, vector<uint8_t>* key_blob,
|
||||
KeyCharacteristics* key_characteristics);
|
||||
|
||||
|
@ -80,7 +80,7 @@ class KeyMintAidlTestBase : public ::testing::TestWithParam<string> {
|
|||
|
||||
ErrorCode Begin(KeyPurpose purpose, const vector<uint8_t>& key_blob,
|
||||
const AuthorizationSet& in_params, AuthorizationSet* out_params,
|
||||
sp<IKeyMintOperation>& op);
|
||||
std::shared_ptr<IKeyMintOperation>& op);
|
||||
ErrorCode Begin(KeyPurpose purpose, const vector<uint8_t>& key_blob,
|
||||
const AuthorizationSet& in_params, AuthorizationSet* out_params);
|
||||
ErrorCode Begin(KeyPurpose purpose, const AuthorizationSet& in_params,
|
||||
|
@ -98,7 +98,7 @@ class KeyMintAidlTestBase : public ::testing::TestWithParam<string> {
|
|||
ErrorCode Finish(string* output) { return Finish(string(), output); }
|
||||
|
||||
ErrorCode Abort();
|
||||
ErrorCode Abort(const sp<IKeyMintOperation>& op);
|
||||
ErrorCode Abort(const shared_ptr<IKeyMintOperation>& op);
|
||||
void AbortIfNeeded();
|
||||
|
||||
string ProcessMessage(const vector<uint8_t>& key_blob, KeyPurpose operation,
|
||||
|
@ -159,17 +159,17 @@ class KeyMintAidlTestBase : public ::testing::TestWithParam<string> {
|
|||
vector<Digest> ValidDigests(bool withNone, bool withMD5);
|
||||
|
||||
static vector<string> build_params() {
|
||||
auto params = android::getAidlHalInstanceNames(IKeyMintDevice::descriptor);
|
||||
auto params = ::android::getAidlHalInstanceNames(IKeyMintDevice::descriptor);
|
||||
return params;
|
||||
}
|
||||
|
||||
sp<IKeyMintOperation> op_;
|
||||
std::shared_ptr<IKeyMintOperation> op_;
|
||||
vector<Certificate> certChain_;
|
||||
vector<uint8_t> key_blob_;
|
||||
KeyCharacteristics key_characteristics_;
|
||||
|
||||
private:
|
||||
sp<IKeyMintDevice> keymint_;
|
||||
std::shared_ptr<IKeyMintDevice> keymint_;
|
||||
uint32_t os_version_;
|
||||
uint32_t os_patch_level_;
|
||||
|
||||
|
@ -182,6 +182,6 @@ class KeyMintAidlTestBase : public ::testing::TestWithParam<string> {
|
|||
#define INSTANTIATE_KEYMINT_AIDL_TEST(name) \
|
||||
INSTANTIATE_TEST_SUITE_P(PerInstance, name, \
|
||||
testing::ValuesIn(KeyMintAidlTestBase::build_params()), \
|
||||
android::PrintInstanceNameToString)
|
||||
::android::PrintInstanceNameToString)
|
||||
|
||||
} // namespace android::hardware::security::keymint::test
|
||||
} // namespace aidl::android::hardware::security::keymint::test
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <cutils/properties.h>
|
||||
|
||||
#include <android/hardware/security/keymint/KeyFormat.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyFormat.h>
|
||||
|
||||
#include <keymint_support/attestation_record.h>
|
||||
#include <keymint_support/key_param_output.h>
|
||||
|
@ -37,21 +37,21 @@
|
|||
static bool arm_deleteAllKeys = false;
|
||||
static bool dump_Attestations = false;
|
||||
|
||||
using android::hardware::security::keymint::AuthorizationSet;
|
||||
using android::hardware::security::keymint::KeyCharacteristics;
|
||||
using android::hardware::security::keymint::KeyFormat;
|
||||
using aidl::android::hardware::security::keymint::AuthorizationSet;
|
||||
using aidl::android::hardware::security::keymint::KeyCharacteristics;
|
||||
using aidl::android::hardware::security::keymint::KeyFormat;
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
bool operator==(const keymint::AuthorizationSet& a, const keymint::AuthorizationSet& b) {
|
||||
return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin());
|
||||
}
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
||||
namespace std {
|
||||
|
||||
using namespace android::hardware::security::keymint;
|
||||
using namespace aidl::android::hardware::security::keymint;
|
||||
|
||||
template <>
|
||||
struct std::equal_to<KeyCharacteristics> {
|
||||
|
@ -73,7 +73,7 @@ struct std::equal_to<KeyCharacteristics> {
|
|||
|
||||
} // namespace std
|
||||
|
||||
namespace android::hardware::security::keymint::test {
|
||||
namespace aidl::android::hardware::security::keymint::test {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -834,7 +834,7 @@ TEST_P(SigningOperationsTest, RsaAbort) {
|
|||
EXPECT_EQ(ErrorCode::INVALID_OPERATION_HANDLE, Abort());
|
||||
|
||||
// Set to sentinel, so TearDown() doesn't try to abort again.
|
||||
op_.clear();
|
||||
op_.reset();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3115,7 +3115,7 @@ TEST_P(EncryptionOperationsTest, AesGcmAadOutOfOrder) {
|
|||
EXPECT_EQ(ErrorCode::INVALID_TAG,
|
||||
Update(update_params, "", &update_out_params, &ciphertext, &input_consumed));
|
||||
|
||||
op_.clear();
|
||||
op_.reset();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3973,7 +3973,7 @@ TEST_P(ClearOperationsTest, TooManyOperations) {
|
|||
|
||||
auto params = AuthorizationSetBuilder().Padding(PaddingMode::NONE);
|
||||
constexpr size_t max_operations = 100; // set to arbituary large number
|
||||
sp<IKeyMintOperation> op_handles[max_operations];
|
||||
std::shared_ptr<IKeyMintOperation> op_handles[max_operations];
|
||||
AuthorizationSet out_params;
|
||||
ErrorCode result;
|
||||
size_t i;
|
||||
|
@ -4040,7 +4040,7 @@ TEST_P(TransportLimitTest, LargeFinishInput) {
|
|||
|
||||
INSTANTIATE_KEYMINT_AIDL_TEST(TransportLimitTest);
|
||||
|
||||
} // namespace android::hardware::security::keymint::test
|
||||
} // namespace aidl::android::hardware::security::keymint::test
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "KeyMintAidlTestBase.h"
|
||||
|
||||
namespace android::hardware::security::keymint::test {
|
||||
namespace aidl::android::hardware::security::keymint::test {
|
||||
|
||||
class VerificationTokenTest : public KeyMintAidlTestBase {
|
||||
protected:
|
||||
|
@ -165,4 +165,4 @@ TEST_P(VerificationTokenTest, MacChangesOnChangingTimestamp) {
|
|||
|
||||
INSTANTIATE_KEYMINT_AIDL_TEST(VerificationTokenTest);
|
||||
|
||||
} // namespace android::hardware::security::keymint::test
|
||||
} // namespace aidl::android::hardware::security::keymint::test
|
||||
|
|
|
@ -31,7 +31,7 @@ cc_library {
|
|||
"include",
|
||||
],
|
||||
shared_libs: [
|
||||
"android.hardware.security.keymint-cpp",
|
||||
"android.hardware.security.keymint-unstable-ndk_platform",
|
||||
"libbase",
|
||||
"libcrypto",
|
||||
"libutils",
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
#include <android/hardware/security/keymint/Tag.h>
|
||||
#include <android/hardware/security/keymint/TagType.h>
|
||||
#include <aidl/android/hardware/security/keymint/Tag.h>
|
||||
#include <aidl/android/hardware/security/keymint/TagType.h>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
|
||||
#define AT __FILE__ ":" << __LINE__
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
struct stack_st_ASN1_TYPE_Delete {
|
||||
void operator()(stack_st_ASN1_TYPE* p) { sk_ASN1_TYPE_free(p); }
|
||||
|
@ -380,4 +380,4 @@ ErrorCode parse_root_of_trust(const uint8_t* asn1_key_desc, size_t asn1_key_desc
|
|||
return ErrorCode::OK; // KM_ERROR_OK;
|
||||
}
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -16,19 +16,13 @@
|
|||
|
||||
#include <keymint_support/authorization_set.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <sstream>
|
||||
#include <aidl/android/hardware/security/keymint/Algorithm.h>
|
||||
#include <aidl/android/hardware/security/keymint/BlockMode.h>
|
||||
#include <aidl/android/hardware/security/keymint/Digest.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyParameter.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyPurpose.h>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
|
||||
#include <android/hardware/security/keymint/Algorithm.h>
|
||||
#include <android/hardware/security/keymint/BlockMode.h>
|
||||
#include <android/hardware/security/keymint/Digest.h>
|
||||
#include <android/hardware/security/keymint/KeyParameter.h>
|
||||
#include <android/hardware/security/keymint/KeyPurpose.h>
|
||||
#include <android/hardware/security/keymint/TagType.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
void AuthorizationSet::Sort() {
|
||||
std::sort(data_.begin(), data_.end());
|
||||
|
@ -218,7 +212,7 @@ AuthorizationSetBuilder& AuthorizationSetBuilder::GcmModeMacLen(uint32_t macLeng
|
|||
}
|
||||
|
||||
AuthorizationSetBuilder& AuthorizationSetBuilder::BlockMode(
|
||||
std::initializer_list<android::hardware::security::keymint::BlockMode> blockModes) {
|
||||
std::initializer_list<aidl::android::hardware::security::keymint::BlockMode> blockModes) {
|
||||
for (auto mode : blockModes) {
|
||||
push_back(TAG_BLOCK_MODE, mode);
|
||||
}
|
||||
|
@ -240,4 +234,4 @@ AuthorizationSetBuilder& AuthorizationSetBuilder::Padding(
|
|||
return *this;
|
||||
}
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <android/hardware/security/keymint/ErrorCode.h>
|
||||
#include <android/hardware/security/keymint/IKeyMintDevice.h>
|
||||
#include <aidl/android/hardware/security/keymint/ErrorCode.h>
|
||||
#include <aidl/android/hardware/security/keymint/IKeyMintDevice.h>
|
||||
|
||||
#include <keymint_support/attestation_record.h>
|
||||
#include <keymint_support/authorization_set.h>
|
||||
#include <keymint_support/openssl_utils.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
class AuthorizationSet;
|
||||
|
||||
|
@ -84,4 +84,4 @@ ErrorCode parse_root_of_trust(const uint8_t* asn1_key_desc, size_t asn1_key_desc
|
|||
VerifiedBoot* verified_boot_state, bool* device_locked,
|
||||
std::vector<uint8_t>* verified_boot_hash);
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -18,14 +18,14 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include <android/hardware/security/keymint/BlockMode.h>
|
||||
#include <android/hardware/security/keymint/Digest.h>
|
||||
#include <android/hardware/security/keymint/EcCurve.h>
|
||||
#include <android/hardware/security/keymint/PaddingMode.h>
|
||||
#include <aidl/android/hardware/security/keymint/BlockMode.h>
|
||||
#include <aidl/android/hardware/security/keymint/Digest.h>
|
||||
#include <aidl/android/hardware/security/keymint/EcCurve.h>
|
||||
#include <aidl/android/hardware/security/keymint/PaddingMode.h>
|
||||
|
||||
#include <keymint_support/keymint_tags.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
using std::vector;
|
||||
|
||||
|
@ -307,4 +307,4 @@ class AuthorizationSetBuilder : public AuthorizationSet {
|
|||
}
|
||||
};
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -19,24 +19,24 @@
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <android/hardware/security/keymint/Algorithm.h>
|
||||
#include <android/hardware/security/keymint/BlockMode.h>
|
||||
#include <android/hardware/security/keymint/Digest.h>
|
||||
#include <android/hardware/security/keymint/EcCurve.h>
|
||||
#include <android/hardware/security/keymint/ErrorCode.h>
|
||||
#include <android/hardware/security/keymint/HardwareAuthenticatorType.h>
|
||||
#include <android/hardware/security/keymint/KeyCharacteristics.h>
|
||||
#include <android/hardware/security/keymint/KeyOrigin.h>
|
||||
#include <android/hardware/security/keymint/KeyParameter.h>
|
||||
#include <android/hardware/security/keymint/KeyPurpose.h>
|
||||
#include <android/hardware/security/keymint/PaddingMode.h>
|
||||
#include <android/hardware/security/keymint/SecurityLevel.h>
|
||||
#include <android/hardware/security/keymint/Tag.h>
|
||||
#include <android/hardware/security/keymint/TagType.h>
|
||||
#include <aidl/android/hardware/security/keymint/Algorithm.h>
|
||||
#include <aidl/android/hardware/security/keymint/BlockMode.h>
|
||||
#include <aidl/android/hardware/security/keymint/Digest.h>
|
||||
#include <aidl/android/hardware/security/keymint/EcCurve.h>
|
||||
#include <aidl/android/hardware/security/keymint/ErrorCode.h>
|
||||
#include <aidl/android/hardware/security/keymint/HardwareAuthenticatorType.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyCharacteristics.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyOrigin.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyParameter.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyPurpose.h>
|
||||
#include <aidl/android/hardware/security/keymint/PaddingMode.h>
|
||||
#include <aidl/android/hardware/security/keymint/SecurityLevel.h>
|
||||
#include <aidl/android/hardware/security/keymint/Tag.h>
|
||||
#include <aidl/android/hardware/security/keymint/TagType.h>
|
||||
|
||||
#include "keymint_tags.h"
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
inline ::std::ostream& operator<<(::std::ostream& os, Algorithm value) {
|
||||
return os << toString(value);
|
||||
|
@ -96,4 +96,4 @@ inline ::std::ostream& operator<<(::std::ostream& os, Tag tag) {
|
|||
return os << toString(tag);
|
||||
}
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -16,20 +16,20 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <android/hardware/security/keymint/Algorithm.h>
|
||||
#include <android/hardware/security/keymint/BlockMode.h>
|
||||
#include <android/hardware/security/keymint/Digest.h>
|
||||
#include <android/hardware/security/keymint/EcCurve.h>
|
||||
#include <android/hardware/security/keymint/HardwareAuthenticatorType.h>
|
||||
#include <android/hardware/security/keymint/KeyOrigin.h>
|
||||
#include <android/hardware/security/keymint/KeyParameter.h>
|
||||
#include <android/hardware/security/keymint/KeyPurpose.h>
|
||||
#include <android/hardware/security/keymint/PaddingMode.h>
|
||||
#include <android/hardware/security/keymint/SecurityLevel.h>
|
||||
#include <android/hardware/security/keymint/Tag.h>
|
||||
#include <android/hardware/security/keymint/TagType.h>
|
||||
#include <aidl/android/hardware/security/keymint/Algorithm.h>
|
||||
#include <aidl/android/hardware/security/keymint/BlockMode.h>
|
||||
#include <aidl/android/hardware/security/keymint/Digest.h>
|
||||
#include <aidl/android/hardware/security/keymint/EcCurve.h>
|
||||
#include <aidl/android/hardware/security/keymint/HardwareAuthenticatorType.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyOrigin.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyParameter.h>
|
||||
#include <aidl/android/hardware/security/keymint/KeyPurpose.h>
|
||||
#include <aidl/android/hardware/security/keymint/PaddingMode.h>
|
||||
#include <aidl/android/hardware/security/keymint/SecurityLevel.h>
|
||||
#include <aidl/android/hardware/security/keymint/Tag.h>
|
||||
#include <aidl/android/hardware/security/keymint/TagType.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
constexpr TagType typeFromTag(Tag tag) {
|
||||
return static_cast<TagType>(static_cast<uint32_t>(tag) & static_cast<uint32_t>(0xf0000000));
|
||||
|
@ -325,4 +325,4 @@ inline NullOr<const typename TypedTag2ValueType<TypedTag<tag_type, tag>>::type&>
|
|||
return accessTagValue(ttag, param);
|
||||
}
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <android/hardware/security/keymint/HardwareAuthToken.h>
|
||||
#include <aidl/android/hardware/security/keymint/HardwareAuthToken.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
using std::vector;
|
||||
|
||||
|
@ -39,4 +39,4 @@ vector<uint8_t> authToken2vector(const HardwareAuthToken& token);
|
|||
uint32_t getOsVersion();
|
||||
uint32_t getOsPatchlevel();
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <android/hardware/security/keymint/Digest.h>
|
||||
#include <aidl/android/hardware/security/keymint/Digest.h>
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
template <typename T, void (*F)(T*)>
|
||||
struct UniquePtrDeleter {
|
||||
|
@ -61,4 +61,4 @@ inline const EVP_MD* openssl_digest(Digest digest) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <keymint_support/keymint_tags.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
using ::std::endl;
|
||||
using ::std::ostream;
|
||||
|
@ -69,4 +69,4 @@ ostream& operator<<(ostream& os, const KeyParameter& param) {
|
|||
return os << "UNKNOWN TAG TYPE!";
|
||||
}
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
|
@ -16,14 +16,10 @@
|
|||
|
||||
#include <regex.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <android-base/properties.h>
|
||||
#include <hardware/hw_auth_token.h>
|
||||
|
||||
#include <keymint_support/keymint_utils.h>
|
||||
|
||||
namespace android::hardware::security::keymint {
|
||||
namespace aidl::android::hardware::security::keymint {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -112,4 +108,4 @@ uint32_t getOsPatchlevel() {
|
|||
return getOsPatchlevel(patchlevel.c_str());
|
||||
}
|
||||
|
||||
} // namespace android::hardware::security::keymint
|
||||
} // namespace aidl::android::hardware::security::keymint
|
||||
|
|
Loading…
Reference in a new issue