summaryrefslogtreecommitdiff
path: root/android_keymaster_test.cpp
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2015-06-11 10:51:12 -0600
committerShawn Willden <swillden@google.com>2015-06-11 11:03:58 -0600
commitbfd9ed7f5c50cdfa310cb0f21c7706e99b780738 (patch)
treeeb8e3cd860438224c699620f8240f0bc4ec02ba0 /android_keymaster_test.cpp
parent466cca5f2dbdfcbedc4b247af8a77c6cde2baf63 (diff)
downloadkeymaster-bfd9ed7f5c50cdfa310cb0f21c7706e99b780738.tar.gz
Make KM_PAD_NONE and KM_DIGEST_NONE mean any padding or digest.
Bug: 21777596 Change-Id: I3574156902c8e28b42f36462a9aef3f11ce938d3
Diffstat (limited to 'android_keymaster_test.cpp')
-rw-r--r--android_keymaster_test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/android_keymaster_test.cpp b/android_keymaster_test.cpp
index 0f7beea..2b4f5db 100644
--- a/android_keymaster_test.cpp
+++ b/android_keymaster_test.cpp
@@ -460,6 +460,19 @@ TEST_P(SigningOperationsTest, RsaPssSha256Success) {
EXPECT_EQ(3, GetParam()->keymaster0_calls());
}
+TEST_P(SigningOperationsTest, RsaPaddingNoneAllowsOther) {
+ ASSERT_EQ(KM_ERROR_OK, GenerateKey(AuthorizationSetBuilder()
+ .RsaSigningKey(512, 3)
+ .Digest(KM_DIGEST_NONE)
+ .Padding(KM_PAD_NONE)));
+ string message = "12345678901234567890123456789012";
+ string signature;
+ SignMessage(message, &signature, KM_DIGEST_SHA_2_256, KM_PAD_RSA_PSS);
+
+ if (GetParam()->algorithm_in_hardware(KM_ALGORITHM_RSA))
+ EXPECT_EQ(3, GetParam()->keymaster0_calls());
+}
+
TEST_P(SigningOperationsTest, RsaPkcs1Sha256Success) {
ASSERT_EQ(KM_ERROR_OK, GenerateKey(AuthorizationSetBuilder()
.RsaSigningKey(512, 3)