summaryrefslogtreecommitdiff
path: root/android_keymaster_test.cpp
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2015-11-16 14:56:41 -0700
committerShawn Willden <swillden@google.com>2015-11-25 09:00:04 -0700
commit01d8f24c45067bc3d909e3aae9a72582f3c985a1 (patch)
tree54c1204ffa24b05835116f8bb13c34c9677345af /android_keymaster_test.cpp
parentfabacaf3e6019804cc8a98a2b8296be1d0125519 (diff)
downloadkeymaster-01d8f24c45067bc3d909e3aae9a72582f3c985a1.tar.gz
Fix pass-through of deletion on wrapped KM0 and KM1.
SoftKeymasterDevice was incorrectly directly sending deletion requests to wrapped hardware. In some cases the key blob passed in by SoftKeymasterDevice is a hardware blob encapsulated by a wrapper, and we need to remove the encapsulation before passing it on. Bug: 25676862 Change-Id: Ic315c6b08d9ec15aa0be8f28f485a221bc7f1135
Diffstat (limited to 'android_keymaster_test.cpp')
-rw-r--r--android_keymaster_test.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/android_keymaster_test.cpp b/android_keymaster_test.cpp
index 5fb3699..dd8ec0b 100644
--- a/android_keymaster_test.cpp
+++ b/android_keymaster_test.cpp
@@ -427,8 +427,10 @@ TEST_P(NewKeyGeneration, Rsa) {
EXPECT_TRUE(contains(crypto_params, TAG_RSA_PUBLIC_EXPONENT, 3));
EXPECT_FALSE(contains(non_crypto_params, TAG_RSA_PUBLIC_EXPONENT, 3));
+ EXPECT_EQ(KM_ERROR_OK, DeleteKey());
+
if (GetParam()->algorithm_in_km0_hardware(KM_ALGORITHM_RSA))
- EXPECT_EQ(1, GetParam()->keymaster0_calls());
+ EXPECT_EQ(2, GetParam()->keymaster0_calls());
}
TEST_P(NewKeyGeneration, RsaDefaultSize) {
@@ -813,7 +815,6 @@ TEST_P(SigningOperationsTest, RsaSignTooLargeMessage) {
string output;
ASSERT_EQ(KM_ERROR_INVALID_ARGUMENT, FinishOperation(&output));
-
if (GetParam()->algorithm_in_km0_hardware(KM_ALGORITHM_RSA))
EXPECT_EQ(3, GetParam()->keymaster0_calls());
}