summaryrefslogtreecommitdiff
path: root/android_keymaster_test.cpp
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2015-07-23 20:18:31 +0000
committerShawn Willden <swillden@google.com>2015-07-23 20:18:31 +0000
commit0e0cea3bc8aea903a50c1ee18e9f3309e9f67515 (patch)
treee45b4d16c9f9c23a459a21cb75f0e39445f32d72 /android_keymaster_test.cpp
parent9972a539acb4d17368ee607465d61b48acd71bde (diff)
downloadkeymaster-0e0cea3bc8aea903a50c1ee18e9f3309e9f67515.tar.gz
Revert "Report keymaster0 keys as hardware-backed, origin unknown."
This reverts commit 9972a539acb4d17368ee607465d61b48acd71bde. Change-Id: Id5beb9c8ae8f3b106adc5f5e62eca0194b926be8
Diffstat (limited to 'android_keymaster_test.cpp')
-rw-r--r--android_keymaster_test.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/android_keymaster_test.cpp b/android_keymaster_test.cpp
index 3e9d125..96fc8b2 100644
--- a/android_keymaster_test.cpp
+++ b/android_keymaster_test.cpp
@@ -325,6 +325,7 @@ class NewKeyGeneration : public Keymaster1Test {
EXPECT_FALSE(contains(auths, TAG_AUTH_TIMEOUT, 301));
// Now check that unspecified, defaulted tags are correct.
+ EXPECT_TRUE(contains(auths, TAG_ORIGIN, KM_ORIGIN_GENERATED));
EXPECT_TRUE(contains(auths, KM_TAG_CREATION_DATETIME));
}
};
@@ -1673,10 +1674,7 @@ TEST_P(ImportKeyTest, RsaSuccess) {
TAG_RSA_PUBLIC_EXPONENT, 65537U));
// And values provided by AndroidKeymaster
- if (GetParam()->algorithm_in_hardware(KM_ALGORITHM_RSA))
- EXPECT_TRUE(contains(hw_enforced(), TAG_ORIGIN, KM_ORIGIN_UNKNOWN));
- else
- EXPECT_TRUE(contains(sw_enforced(), TAG_ORIGIN, KM_ORIGIN_IMPORTED));
+ EXPECT_TRUE(contains(sw_enforced(), TAG_ORIGIN, KM_ORIGIN_IMPORTED));
EXPECT_TRUE(contains(sw_enforced(), KM_TAG_CREATION_DATETIME));
string message(1024 / 8, 'a');
@@ -1759,10 +1757,7 @@ TEST_P(ImportKeyTest, EcdsaSuccess) {
TAG_KEY_SIZE, 256));
// And values provided by AndroidKeymaster
- if (GetParam()->algorithm_in_hardware(KM_ALGORITHM_EC))
- EXPECT_TRUE(contains(hw_enforced(), TAG_ORIGIN, KM_ORIGIN_UNKNOWN));
- else
- EXPECT_TRUE(contains(sw_enforced(), TAG_ORIGIN, KM_ORIGIN_IMPORTED));
+ EXPECT_TRUE(contains(sw_enforced(), TAG_ORIGIN, KM_ORIGIN_IMPORTED));
EXPECT_TRUE(contains(sw_enforced(), KM_TAG_CREATION_DATETIME));
string message(32, 'a');
@@ -1791,10 +1786,7 @@ TEST_P(ImportKeyTest, EcdsaSizeSpecified) {
TAG_KEY_SIZE, 256));
// And values provided by AndroidKeymaster
- if (GetParam()->algorithm_in_hardware(KM_ALGORITHM_EC))
- EXPECT_TRUE(contains(hw_enforced(), TAG_ORIGIN, KM_ORIGIN_UNKNOWN));
- else
- EXPECT_TRUE(contains(sw_enforced(), TAG_ORIGIN, KM_ORIGIN_IMPORTED));
+ EXPECT_TRUE(contains(sw_enforced(), TAG_ORIGIN, KM_ORIGIN_IMPORTED));
EXPECT_TRUE(contains(sw_enforced(), KM_TAG_CREATION_DATETIME));
string message(32, 'a');
@@ -1972,7 +1964,7 @@ TEST_P(EncryptionOperationsTest, RsaOaepInvalidDigest) {
TEST_P(EncryptionOperationsTest, RsaOaepUnauthorizedDigest) {
ASSERT_EQ(KM_ERROR_OK, GenerateKey(AuthorizationSetBuilder()
- .RsaEncryptionKey(512, 3)
+ .RsaEncryptionKey(512, 3)
.Padding(KM_PAD_RSA_OAEP)
.Digest(KM_DIGEST_SHA_2_256)));
string message = "Hello World!";