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. .clang-format
  2. .gitignore
  3. Android.mk
  4. Makefile
  5. ae.h
  6. aead_mode_operation.cpp
  7. aead_mode_operation.h
  8. aes_key.cpp
  9. aes_key.h
  10. aes_operation.cpp
  11. aes_operation.h
  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. include/
  46. integrity_assured_key_blob.cpp
  47. integrity_assured_key_blob.h
  48. key.cpp
  49. key.h
  50. key_blob_test.cpp
  51. keymaster0_engine.cpp
  52. keymaster0_engine.h
  53. keymaster_enforcement.cpp
  54. keymaster_enforcement.h
  55. keymaster_enforcement_test.cpp
  56. km0_sw_rsa_512.blob
  57. km1_sw_ecdsa_256.blob
  58. km1_sw_rsa_512.blob
  59. logger.cpp
  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