Add confirmation UI support libaray
Includes:
A light weight CBOR generator
This patch adds a header only CBOR generator and unit tests.
It allows expressing CBOR datastructures in C++ for subsequent
serialization. The implementation performs no memory allocation
and only depends on stdint.h (for (u)intx_t) and stddefs.h (for size_t).
It is tailored for use in constrained environments such as TEEs.
Convenience method for generating a SHA256 HMAC
Bug: 63928580
Test: android.hardware.confirmationui@support-lib-tests
Change-Id: I1d93a85503f861281e71e09b1ede5cbb74219694
diff --git a/confirmationui/support/Android.bp b/confirmationui/support/Android.bp
new file mode 100644
index 0000000..62156b3
--- /dev/null
+++ b/confirmationui/support/Android.bp
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2017 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.
+//
+
+cc_library {
+ name: "android.hardware.confirmationui-support-lib",
+ vendor_available: true,
+ host_supported: true,
+ vndk: {
+ enabled: true,
+ },
+ srcs: [
+ "src/cbor.cpp",
+ "src/confirmationui_utils.cpp",
+ ],
+ export_include_dirs: [
+ "include",
+ ]
+}
+
+cc_test {
+ name: "android.hardware.confirmationui-support-lib-tests",
+ srcs: [
+ "test/gtest_main.cpp",
+ "test/android_cbor_test.cpp",
+ "test/msg_formatting_test.cpp",
+ ],
+ static_libs: [
+ "libgtest",
+ "android.hardware.confirmationui-support-lib",
+ ],
+ shared_libs: [
+ "android.hardware.confirmationui@1.0",
+ "android.hardware.keymaster@4.0",
+ "libhidlbase",
+ ],
+ clang: true,
+ cflags: [ "-O0" ],
+}