Merge "Fingerprint vts tests."
diff --git a/keymaster/3.0/IKeymasterDevice.hal b/keymaster/3.0/IKeymasterDevice.hal
index 0c59e6c..2664765 100644
--- a/keymaster/3.0/IKeymasterDevice.hal
+++ b/keymaster/3.0/IKeymasterDevice.hal
@@ -59,22 +59,6 @@
string keymasterAuthorName);
/**
- * Parses a hardware authentication token blob to extract the details needed to determine if the
- * token is applicable to a given keymaster operation. This method is intended to be
- * implemented by the HAL, without requiring a call into the trusted hardware. It is not
- * necessary for this method to verify that the values in the blob are correct.
- *
- * @param token The token blob provided by the authentication app.
- *
- * @return error ErrorCode::OK or, if the blob is invalid, ErrorCode::INVALD_ARGUMENT if the
- * blob is the wrong size, the wrong version, or incorrectly structured.
- *
- * @return tokenInfo Information extracted from the auth token.
- */
- parseHardwareAuthToken(vec<uint8_t> token)
- generates(ErrorCode error, HardwareAuthTokenInfo tokenInfo);
-
- /**
* Adds entropy to the RNG used by keymaster. Entropy added through this method is guaranteed
* not to be the only source of entropy used, and the mixing function is required to be secure,
* in the sense that if the RNG is seeded (from any source) with any data the attacker cannot
diff --git a/keymaster/3.0/default/KeymasterDevice.cpp b/keymaster/3.0/default/KeymasterDevice.cpp
index b2baa2b..720b946 100644
--- a/keymaster/3.0/default/KeymasterDevice.cpp
+++ b/keymaster/3.0/default/KeymasterDevice.cpp
@@ -33,8 +33,6 @@
using ::keymaster::SoftKeymasterDevice;
-namespace {
-
class SoftwareOnlyHidlKeymasterEnforcement : public ::keymaster::KeymasterEnforcement {
public:
SoftwareOnlyHidlKeymasterEnforcement() : KeymasterEnforcement(64, 64) {}
@@ -62,7 +60,7 @@
std::unique_ptr<::keymaster::KeymasterEnforcement> enforcement_;
};
-int keymaster0_device_initialize(const hw_module_t* mod, keymaster2_device_t** dev) {
+static int keymaster0_device_initialize(const hw_module_t* mod, keymaster2_device_t** dev) {
assert(mod->module_api_version < KEYMASTER_MODULE_API_VERSION_1_0);
ALOGI("Found keymaster0 module %s, version %x", mod->name, mod->module_api_version);
@@ -139,7 +137,7 @@
return rc;
}
-int keymaster2_device_initialize(const hw_module_t* mod, keymaster2_device_t** dev) {
+static int keymaster2_device_initialize(const hw_module_t* mod, keymaster2_device_t** dev) {
assert(mod->module_api_version >= KEYMASTER_MODULE_API_VERSION_2_0);
ALOGI("Found keymaster2 module %s, version %x", mod->name, mod->module_api_version);
@@ -193,30 +191,6 @@
}
}
-template <typename IntType, uint32_t byteOrder> struct choose_ntoh;
-
-template <typename IntType> struct choose_ntoh<IntType, __ORDER_LITTLE_ENDIAN__> {
- inline static IntType ntoh(const IntType& value) {
- IntType result = 0;
- const unsigned char* inbytes = reinterpret_cast<const unsigned char*>(&value);
- unsigned char* outbytes = reinterpret_cast<unsigned char*>(&result);
- for (int i = sizeof(IntType) - 1; i >= 0; --i) {
- *(outbytes++) = inbytes[i];
- }
- return result;
- }
-};
-
-template <typename IntType> struct choose_ntoh<IntType, __ORDER_BIG_ENDIAN__> {
- inline static IntType hton(const IntType& value) { return value; }
-};
-
-template <typename IntType> inline IntType ntoh(const IntType& value) {
- return choose_ntoh<IntType, __BYTE_ORDER__>::ntoh(value);
-}
-
-} // anonymous namespace
-
KeymasterDevice::~KeymasterDevice() {
if (keymaster_device_) keymaster_device_->common.close(&keymaster_device_->common);
}
@@ -402,34 +376,6 @@
return Void();
}
-Return<void> KeymasterDevice::parseHardwareAuthToken(const hidl_vec<uint8_t>& token,
- parseHardwareAuthToken_cb _hidl_cb) {
- HardwareAuthTokenInfo parsedToken;
- if (token.size() != sizeof(hw_auth_token_t)) {
- ALOGE("Received auth token of length %zu, expected %zu", token.size(),
- sizeof(hw_auth_token_t));
- _hidl_cb(ErrorCode::INVALID_ARGUMENT, parsedToken);
- return Void();
- }
-
- const hw_auth_token_t* authToken = reinterpret_cast<const hw_auth_token_t*>(token.data());
- if (authToken->version != 0) {
- ALOGE("Auth token version %u, expected version ", authToken->version);
- _hidl_cb(ErrorCode::INVALID_ARGUMENT, parsedToken);
- return Void();
- }
-
- parsedToken.challenge = authToken->challenge;
- parsedToken.userId = authToken->user_id;
- parsedToken.authenticatorId = authToken->authenticator_id;
- parsedToken.authenticatorType =
- static_cast<HardwareAuthenticatorType>(ntoh(authToken->authenticator_type));
- parsedToken.timestamp = ntoh(authToken->timestamp);
-
- _hidl_cb(ErrorCode::OK, parsedToken);
- return Void();
-}
-
Return<ErrorCode> KeymasterDevice::addRngEntropy(const hidl_vec<uint8_t>& data) {
if (!data.size()) return ErrorCode::OK;
return legacy_enum_conversion(
diff --git a/keymaster/3.0/default/KeymasterDevice.h b/keymaster/3.0/default/KeymasterDevice.h
index 8198eca..e048d5b 100644
--- a/keymaster/3.0/default/KeymasterDevice.h
+++ b/keymaster/3.0/default/KeymasterDevice.h
@@ -53,8 +53,6 @@
// Methods from ::android::hardware::keymaster::V3_0::IKeymasterDevice follow.
Return<void> getHardwareFeatures(getHardwareFeatures_cb _hidl_cb);
- Return<void> parseHardwareAuthToken(const hidl_vec<uint8_t>& token,
- parseHardwareAuthToken_cb _hidl_cb);
Return<ErrorCode> addRngEntropy(const hidl_vec<uint8_t>& data) override;
Return<void> generateKey(const hidl_vec<KeyParameter>& keyParams,
generateKey_cb _hidl_cb) override;
diff --git a/keymaster/3.0/types.hal b/keymaster/3.0/types.hal
index 3ff4145..1f4a0cc 100644
--- a/keymaster/3.0/types.hal
+++ b/keymaster/3.0/types.hal
@@ -400,15 +400,19 @@
};
/**
- * Data used to describe an authentication. This data is retrieved from an authentication token by
- * calling the parseHardwareAuthToken method of the HAL.
+ * Data used to prove successful authentication.
*/
-struct HardwareAuthTokenInfo {
+struct HardwareAuthToken {
uint64_t challenge;
- uint64_t userId; // Secure User ID, not Android user ID.
- uint64_t authenticatorId; // Secure authenticator ID.
- HardwareAuthenticatorType authenticatorType;
- uint64_t timestamp;
+ uint64_t userId; // Secure User ID, not Android user ID.
+ uint64_t authenticatorId; // Secure authenticator ID.
+ uint32_t authenticatorType; // HardwareAuthenticatorType, in network order.
+ uint64_t timestamp; // In network order.
+ uint8_t[32] hmac; // HMAC is computed over 0 || challenge || user_id ||
+ // authenticator_id || authenticator_type || timestamp, with a
+ // prefixed 0 byte (which was a version field in Keymaster1 and
+ // Keymaster2) and the fields packed (no padding; so you probably
+ // can't just compute over the bytes of the struct).
};
enum SecurityLevel : uint32_t {
diff --git a/tv/input/1.0/Android.mk b/tv/input/1.0/Android.mk
index f9e3276..87654da 100644
--- a/tv/input/1.0/Android.mk
+++ b/tv/input/1.0/Android.mk
@@ -1,19 +1,41 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# This file is autogenerated by hidl-gen. Do not edit manually.
LOCAL_PATH := $(call my-dir)
-include $(call all-subdir-makefiles)
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.tv.input@1.0-java-constants
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+#
+GEN := $(intermediates)/android/hardware/tv/input/V1_0/Constants.java
+$(GEN): $(HIDL)
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/ITvInput.hal
+$(GEN): $(LOCAL_PATH)/ITvInputCallback.hal
+
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava-constants \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.tv.input@1.0
+
+$(GEN):
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+# Avoid dependency cycle of framework.jar -> this-library -> framework.jar
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES := core-oj
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tv/input/1.0/default/TvInput.cpp b/tv/input/1.0/default/TvInput.cpp
index 0bc6401..4ea1dec 100644
--- a/tv/input/1.0/default/TvInput.cpp
+++ b/tv/input/1.0/default/TvInput.cpp
@@ -19,8 +19,6 @@
#include "TvInput.h"
-const native_handle_t kNullNativeHandle{sizeof(native_handle_t), 0, 0, {}};
-
namespace android {
namespace hardware {
namespace tv {
@@ -117,8 +115,6 @@
sidebandStream = stream.sideband_stream_source_handle;
}
} else {
- // TODO(b/30814137)
- sidebandStream = const_cast<native_handle_t*>(&kNullNativeHandle);
if (ret == -EBUSY) {
res = Result::NO_RESOURCE;
} else if (ret == -EEXIST) {
diff --git a/tv/input/1.0/types.hal b/tv/input/1.0/types.hal
index 55eb6ad..60a3b7b 100644
--- a/tv/input/1.0/types.hal
+++ b/tv/input/1.0/types.hal
@@ -27,6 +27,7 @@
};
/* Type of physical TV input. */
+@export(name="", value_prefix="TV_INPUT_TYPE_")
enum TvInputType : int32_t {
OTHER = 1, // Generic hardware.
TUNER = 2, // Tuner. e.g. built-in terrestrial tuner
@@ -46,6 +47,7 @@
* regardless of whether the connected external device is electrically on or not.
* If the device does not have such capability, you must use UNKNOWN.
*/
+@export(name="", value_prefix="CABLE_CONNECTION_STATUS_")
enum CableConnectionStatus : int32_t {
UNKNOWN = 0,
CONNECTED = 1,
@@ -63,6 +65,7 @@
// must be filled with 0s.
};
+@export(name="", value_prefix="EVENT_")
enum TvInputEventType : int32_t {
/*
* Hardware notifies the framework that a device is available.
diff --git a/wifi/1.0/default/Android.mk b/wifi/1.0/default/Android.mk
index cc5e1c6..13f6cc1 100644
--- a/wifi/1.0/default/Android.mk
+++ b/wifi/1.0/default/Android.mk
@@ -48,6 +48,5 @@
libwifi-hal \
libwifi-system \
libcld80211
-LOCAL_WHOLE_STATIC_LIBRARIES := $(LIB_WIFI_HAL)
LOCAL_INIT_RC := android.hardware.wifi@1.0-service.rc
include $(BUILD_EXECUTABLE)