diff --git a/keystore/Android.bp b/keystore/Android.bp index f3a7531a..cbb174d4 100644 --- a/keystore/Android.bp +++ b/keystore/Android.bp @@ -55,6 +55,7 @@ cc_binary { "android.hardware.confirmationui@1.0", "android.hardware.keymaster@3.0", "android.hardware.keymaster@4.0", + "android.hardware.keymaster@4.1", "libbase", "libbinder", "libcrypto", @@ -62,6 +63,7 @@ cc_binary { "libhardware", "libhidlbase", "libkeymaster4support", + "libkeymaster4_1support", "libkeymaster_messages", "libkeymaster_portable", "libkeystore_aidl", @@ -154,19 +156,22 @@ cc_library_shared { ], shared_libs: [ "android.hardware.keymaster@4.0", + "android.hardware.keymaster@4.1", "libbinder", "libhardware", "libhidlbase", "libkeymaster4support", + "libkeymaster4_1support", "liblog", "libprotobuf-cpp-lite", "libutils", ], export_shared_lib_headers: [ "android.hardware.keymaster@4.0", + "android.hardware.keymaster@4.1", "libbinder", "libhidlbase", - "libkeymaster4support", + "libkeymaster4_1support", ], } // Library for keystore clients diff --git a/keystore/KeyStore.h b/keystore/KeyStore.h index a7fbab46..0027ec89 100644 --- a/keystore/KeyStore.h +++ b/keystore/KeyStore.h @@ -18,7 +18,7 @@ #define KEYSTORE_KEYSTORE_H_ #include -#include +#include #include #include diff --git a/keystore/OperationResult.cpp b/keystore/OperationResult.cpp index 3ff8bc33..dec4d40c 100644 --- a/keystore/OperationResult.cpp +++ b/keystore/OperationResult.cpp @@ -29,8 +29,8 @@ namespace android { namespace security { namespace keymaster { -using keystore::keymaster::ErrorCode; using ::android::status_t; +using ::keystore::ErrorCode; OperationResult::OperationResult() : resultCode(), token(), handle(0), inputConsumed(0), data() {} diff --git a/keystore/auth_token_table.h b/keystore/auth_token_table.h index 86d65de5..787b9b15 100644 --- a/keystore/auth_token_table.h +++ b/keystore/auth_token_table.h @@ -25,8 +25,6 @@ namespace keystore { -using keymaster::HardwareAuthToken; - namespace test { class AuthTokenTableTest; } // namespace test diff --git a/keystore/include/keystore/keymaster_types.h b/keystore/include/keystore/keymaster_types.h index f3c69079..8da9682a 100644 --- a/keystore/include/keystore/keymaster_types.h +++ b/keystore/include/keystore/keymaster_types.h @@ -16,11 +16,11 @@ #define SECURITY_KEYSTORE_INCLUDE_KEYSTORE_KEYMASTER_TYPES_H_ #include -#include -#include +#include +#include -#include -#include +#include +#include /** * This header lifts the types from the current Keymaster version into the keystore namespace. @@ -29,7 +29,7 @@ namespace keystore { // Changing this namespace alias will change the keymaster version. -namespace keymaster = ::android::hardware::keymaster::V4_0; +namespace keymaster = ::android::hardware::keymaster::V4_1; using android::hardware::hidl_vec; using android::hardware::Return; @@ -40,11 +40,17 @@ using keymaster::SecurityLevel; using keymaster::AuthorizationSet; using keymaster::AuthorizationSetBuilder; +// It's more convenient to use the V4.0 error and tag types by default. +using ::android::hardware::keymaster::V4_0::ErrorCode; +using ::android::hardware::keymaster::V4_0::Tag; + +using V4_1_ErrorCode = ::android::hardware::keymaster::V4_1::ErrorCode; +using V4_1_Tag = ::android::hardware::keymaster::V4_1::Tag; + using keymaster::Algorithm; using keymaster::BlockMode; using keymaster::Digest; using keymaster::EcCurve; -using keymaster::ErrorCode; using keymaster::HardwareAuthenticatorType; using keymaster::HardwareAuthToken; using keymaster::HmacSharingParameters; @@ -55,7 +61,6 @@ using keymaster::KeyPurpose; using keymaster::OperationHandle; using keymaster::PaddingMode; using keymaster::SecurityLevel; -using keymaster::Tag; using keymaster::TagType; using keymaster::VerificationToken; diff --git a/keystore/include/keystore/keystore_return_types.h b/keystore/include/keystore/keystore_return_types.h index f8cf1cc4..2762f8d1 100644 --- a/keystore/include/keystore/keystore_return_types.h +++ b/keystore/include/keystore/keystore_return_types.h @@ -23,8 +23,6 @@ namespace keystore { -using keymaster::ErrorCode; - class KeyStoreServiceReturnCode; class KeyStoreNativeReturnCode; diff --git a/keystore/key_proto_handler.cpp b/keystore/key_proto_handler.cpp index a1062136..f8400af6 100644 --- a/keystore/key_proto_handler.cpp +++ b/keystore/key_proto_handler.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/keystore/keymaster_worker.h b/keystore/keymaster_worker.h index 31657636..8e35c16f 100644 --- a/keystore/keymaster_worker.h +++ b/keystore/keymaster_worker.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "blob.h" @@ -43,16 +44,7 @@ using android::sp; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using android::hardware::keymaster::V4_0::ErrorCode; -using android::hardware::keymaster::V4_0::HardwareAuthToken; -using android::hardware::keymaster::V4_0::HmacSharingParameters; -using android::hardware::keymaster::V4_0::KeyCharacteristics; -using android::hardware::keymaster::V4_0::KeyFormat; -using android::hardware::keymaster::V4_0::KeyParameter; -using android::hardware::keymaster::V4_0::KeyPurpose; -using android::hardware::keymaster::V4_0::VerificationToken; -using android::hardware::keymaster::V4_0::support::Keymaster; -// using KeystoreCharacteristics = ::android::security::keymaster::KeyCharacteristics; +using android::hardware::keymaster::V4_1::support::Keymaster; using ::android::security::keymaster::KeymasterBlob; class KeyStore; diff --git a/keystore/keystore_aidl_hidl_marshalling_utils.cpp b/keystore/keystore_aidl_hidl_marshalling_utils.cpp index 49e18f0b..823ca587 100644 --- a/keystore/keystore_aidl_hidl_marshalling_utils.cpp +++ b/keystore/keystore_aidl_hidl_marshalling_utils.cpp @@ -205,7 +205,7 @@ namespace security { namespace keymaster { using ::android::status_t; -using ::keystore::keymaster::ErrorCode; +using ::keystore::ErrorCode; ExportResult::ExportResult() : resultCode() {} diff --git a/keystore/keystore_main.cpp b/keystore/keystore_main.cpp index 91ebd12f..02c2139a 100644 --- a/keystore/keystore_main.cpp +++ b/keystore/keystore_main.cpp @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/keystore/operation.h b/keystore/operation.h index e0865a40..ef880a75 100644 --- a/keystore/operation.h +++ b/keystore/operation.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/keystore/operation_proto_handler.cpp b/keystore/operation_proto_handler.cpp index dfc06928..3b3d3fc3 100644 --- a/keystore/operation_proto_handler.cpp +++ b/keystore/operation_proto_handler.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/keystore/operation_struct.h b/keystore/operation_struct.h index 84265b60..23e79fc5 100644 --- a/keystore/operation_struct.h +++ b/keystore/operation_struct.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/keystore/tests/Android.bp b/keystore/tests/Android.bp index bbcc1c2f..a5a2c331 100644 --- a/keystore/tests/Android.bp +++ b/keystore/tests/Android.bp @@ -24,6 +24,7 @@ cc_test { "libgtest_main", "libhidlbase", "libkeymaster4support", + "libkeymaster4_1support", "libkeystore_test", "liblog", "libutils",