Check return codes in softkeymaster.
Also add some more logging and a test for ECDSA-192.
Change-Id: Icc4327bb1f5cb14bc22a63e80592e29a349f1bc2
diff --git a/google_keymaster_test.cpp b/google_keymaster_test.cpp
index 91aef7b..f16b6f8 100644
--- a/google_keymaster_test.cpp
+++ b/google_keymaster_test.cpp
@@ -533,8 +533,7 @@
free(key_blob);
}
-TEST_F(OldKeyGeneration, Ecdsa) {
-
+TEST_F(OldKeyGeneration, Ecdsa256) {
keymaster_ec_keygen_params_t params = {.field_size = 256};
uint8_t* key_blob;
size_t key_blob_length;
@@ -545,6 +544,14 @@
free(key_blob);
}
+TEST_F(OldKeyGeneration, Ecdsa192Fails) {
+ keymaster_ec_keygen_params_t params = {.field_size = 192};
+ uint8_t* key_blob;
+ size_t key_blob_length;
+ EXPECT_EQ(KM_ERROR_UNSUPPORTED_KEY_SIZE,
+ device()->generate_keypair(device(), TYPE_EC, ¶ms, &key_blob, &key_blob_length));
+}
+
class NewKeyGeneration : public KeymasterTest {
protected:
void CheckBaseParams() {