Don't bother parsing keymaster0 signing params.

The keymaster0 signing API includes a void* to a structure that depends
on key type (RSA or EC).  Previously we've tried to determine what the
key type is and to extract proper parameters, by calling
get_key_characteristics and examining the result.  But this is all
pointless.  The possible contents of that signing structure is fixed, so
we may as well just set the values directly.  This does mean that we set
KM_TAG_PADDING for EC keys, even though ECDSA doesn't use padding.
That's okay, though.  Keymaster1 implementations should ignore
extraneous tags.  And in any case, we'll soon stop even providing the
keymaster0 APIs, so the issue will disappear.

Cherry-picked from internal.

Change-Id: I3228aa8c05a009f67e17b259544aa2481edace7c
2 files changed
tree: 675084b4f946d1acea6db21fdc2363d2233c18c1
  1. include/
  2. .clang-format
  3. .gitignore
  4. ae.h
  5. aead_mode_operation.cpp
  6. aead_mode_operation.h
  7. aes_key.cpp
  8. aes_key.h
  9. aes_operation.cpp
  10. aes_operation.h
  11. Android.mk
  12. android_keymaster.cpp
  13. android_keymaster_messages.cpp
  14. android_keymaster_messages_test.cpp
  15. android_keymaster_test.cpp
  16. android_keymaster_test_utils.cpp
  17. android_keymaster_test_utils.h
  18. android_keymaster_utils.cpp
  19. asymmetric_key.cpp
  20. asymmetric_key.h
  21. asymmetric_key_factory.cpp
  22. auth_encrypted_key_blob.cpp
  23. auth_encrypted_key_blob.h
  24. authorization_set.cpp
  25. authorization_set_test.cpp
  26. ec_key.cpp
  27. ec_key.h
  28. ec_key_factory.cpp
  29. ec_keymaster0_key.cpp
  30. ec_keymaster0_key.h
  31. ec_privkey_pk8.der
  32. ecdsa_operation.cpp
  33. ecdsa_operation.h
  34. gtest_main.cpp
  35. hkdf.cpp
  36. hkdf.h
  37. hkdf_test.cpp
  38. hmac.cpp
  39. hmac.h
  40. hmac_key.cpp
  41. hmac_key.h
  42. hmac_operation.cpp
  43. hmac_operation.h
  44. hmac_test.cpp
  45. integrity_assured_key_blob.cpp
  46. integrity_assured_key_blob.h
  47. key.cpp
  48. key.h
  49. key_blob_test.cpp
  50. keymaster0_engine.cpp
  51. keymaster0_engine.h
  52. keymaster_enforcement.cpp
  53. keymaster_enforcement.h
  54. keymaster_enforcement_test.cpp
  55. km0_sw_rsa_512.blob
  56. km1_sw_ecdsa_256.blob
  57. km1_sw_rsa_512.blob
  58. logger.cpp
  59. Makefile
  60. ocb.c
  61. ocb_utils.cpp
  62. ocb_utils.h
  63. openssl_err.cpp
  64. openssl_err.h
  65. openssl_utils.cpp
  66. openssl_utils.h
  67. operation.cpp
  68. operation.h
  69. operation_table.cpp
  70. operation_table.h
  71. rsa_key.cpp
  72. rsa_key.h
  73. rsa_key_factory.cpp
  74. rsa_keymaster0_key.cpp
  75. rsa_keymaster0_key.h
  76. rsa_operation.cpp
  77. rsa_operation.h
  78. rsa_privkey_pk8.der
  79. serializable.cpp
  80. soft_keymaster_context.cpp
  81. soft_keymaster_device.cpp
  82. soft_keymaster_logger.cpp
  83. symmetric_key.cpp
  84. symmetric_key.h
  85. valgrind.supp