Use libkeymaster4support in keystore.

Test: CTS
Change-Id: Iee8f308a5255a03b02fce162cc4184d45f75fd1b
diff --git a/keystore/tests/Android.bp b/keystore/tests/Android.bp
index 6d8f75d..0ddaa00 100644
--- a/keystore/tests/Android.bp
+++ b/keystore/tests/Android.bp
@@ -5,6 +5,7 @@
         "-Wall",
         "-Werror",
         "-Wextra",
+        "-O0",
     ],
     srcs: [
         "auth_token_table_test.cpp",
@@ -14,7 +15,10 @@
     name: "keystore_unit_tests",
     tags: ["test"],
     static_libs: [
+        "libbase",
         "libgtest_main",
+        "libhidlbase",
+        "libkeymaster4support",
         "libkeystore_test",
         "liblog",
     ],
diff --git a/keystore/tests/auth_token_formatting_test.cpp b/keystore/tests/auth_token_formatting_test.cpp
index 511256f..2677718 100644
--- a/keystore/tests/auth_token_formatting_test.cpp
+++ b/keystore/tests/auth_token_formatting_test.cpp
@@ -16,18 +16,22 @@
 
 #include <gtest/gtest.h>
 
-#include <android/hardware/keymaster/3.0/types.h>
 #include <endian.h>
-#include <hardware/hw_auth_token.h>
 #include <hidl/HidlSupport.h>
 #include <keymaster/logger.h>
 
-#include "../auth_token_table.h"
+#include <keystore/keymaster_types.h>
 #include <keystore/keystore_hidl_support.h>
 
+#include "../auth_token_table.h"
+
 using std::vector;
 
 namespace keystore {
+
+using android::hardware::hidl_array;
+using android::hardware::hidl_vec;
+
 namespace test {
 
 namespace {
@@ -66,9 +70,6 @@
 
 }  // namespace
 
-using android::hardware::hidl_array;
-using android::hardware::hidl_vec;
-
 constexpr const uint8_t test_token[69] = {
     0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
     0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
diff --git a/keystore/tests/auth_token_table_test.cpp b/keystore/tests/auth_token_table_test.cpp
index 1a5ef90..511a78d 100644
--- a/keystore/tests/auth_token_table_test.cpp
+++ b/keystore/tests/auth_token_table_test.cpp
@@ -62,8 +62,8 @@
     AuthTokenTable table;
 }
 
-HardwareAuthToken make_token(uint64_t rsid, uint64_t ssid = 0, uint64_t challenge = 0,
-                             uint64_t timestamp = 0) {
+static HardwareAuthToken make_token(uint64_t rsid, uint64_t ssid = 0, uint64_t challenge = 0,
+                                    uint64_t timestamp = 0) {
     HardwareAuthToken token;
     token.userId = rsid;
     token.authenticatorId = ssid;