Set CKA_LABEL attribute for importing X509 certificates via p11_replay.

X509 certificates will only be shown under "Your Certificates" in the
Certificate Manager if both of the following two conditions are met:
 (a) a corresponding private key is imported.
 (b) the CKA_LABEL attribute is set, and set to a non-empty string.
If either of these conditions are not met, the certificate is displayed under
"Others" in the Certificate Manager.

Note: The corresponding private key does not need to have the CKA_LABEL
attribute to be set, nor does it have to match.

This label is set in different ways based on the type of certificate
(see chromium:202503 and chromium:237870). How the label is set doesn't
actually affect where the certificate is displayed, so for testing purposes
we just set this to "testing_cert".

BUG=chromium:196315
TEST=Built image and successfully imported certificate via p11_replay. Certificate is correctly displayed under "Your Certificates" in the Certificate Manager.

Change-Id: I0aec63aa20dd8118011ce102336ebb82d82d7011
Reviewed-on: https://gerrit.chromium.org/gerrit/57681
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>
1 file changed
tree: 03c76d5f54e35d18d0c17760a5346c5a022b3bb1
  1. pkcs11/
  2. attributes.cc
  3. attributes.h
  4. attributes.proto
  5. chaps.cc
  6. chaps.h
  7. chaps_adaptor.cc
  8. chaps_adaptor.h
  9. chaps_client.cc
  10. chaps_factory.h
  11. chaps_factory_impl.cc
  12. chaps_factory_impl.h
  13. chaps_factory_mock.cc
  14. chaps_factory_mock.h
  15. chaps_interface.h
  16. chaps_interface.xml
  17. chaps_pam_module.cc
  18. chaps_pam_module_test.cc
  19. chaps_proxy.cc
  20. chaps_proxy.h
  21. chaps_proxy_mock.h
  22. chaps_service.cc
  23. chaps_service.h
  24. chaps_service_redirect.cc
  25. chaps_service_redirect.h
  26. chaps_service_test.cc
  27. chaps_test.cc
  28. chaps_utility.cc
  29. chaps_utility.h
  30. chapsd.cc
  31. chapsd.conf
  32. chapsd_test.cc
  33. common.mk
  34. handle_generator.h
  35. handle_generator_mock.h
  36. isolate.h
  37. isolate_chromeos.cc
  38. isolate_linux.cc
  39. isolate_login_client.cc
  40. isolate_login_client.h
  41. isolate_login_client_mock.h
  42. isolate_login_client_test.cc
  43. isolate_mock.h
  44. LICENSE
  45. Makefile
  46. object.h
  47. object_impl.cc
  48. object_impl.h
  49. object_importer.h
  50. object_importer_mock.cc
  51. object_importer_mock.h
  52. object_mock.cc
  53. object_mock.h
  54. object_policy.h
  55. object_policy_cert.cc
  56. object_policy_cert.h
  57. object_policy_common.cc
  58. object_policy_common.h
  59. object_policy_data.cc
  60. object_policy_data.h
  61. object_policy_key.cc
  62. object_policy_key.h
  63. object_policy_mock.cc
  64. object_policy_mock.h
  65. object_policy_private_key.cc
  66. object_policy_private_key.h
  67. object_policy_public_key.cc
  68. object_policy_public_key.h
  69. object_policy_secret_key.cc
  70. object_policy_secret_key.h
  71. object_policy_test.cc
  72. object_pool.h
  73. object_pool_impl.cc
  74. object_pool_impl.h
  75. object_pool_mock.cc
  76. object_pool_mock.h
  77. object_pool_test.cc
  78. object_store.h
  79. object_store_fake.h
  80. object_store_impl.cc
  81. object_store_impl.h
  82. object_store_mock.cc
  83. object_store_mock.h
  84. object_store_test.cc
  85. object_test.cc
  86. opencryptoki_importer.cc
  87. opencryptoki_importer.h
  88. opencryptoki_importer_test.cc
  89. opencryptoki_sample_token.tgz
  90. org.chromium.Chaps.conf.in
  91. org.chromium.Chaps.service
  92. OWNERS
  93. p11_replay.cc
  94. pam_chaps.cfg
  95. pam_helper.cc
  96. pam_helper.h
  97. pam_helper_mock.cc
  98. pam_helper_mock.h
  99. platform_globals.h
  100. platform_globals_chromeos.cc
  101. platform_globals_linux.cc
  102. README
  103. session.h
  104. session_impl.cc
  105. session_impl.h
  106. session_mock.cc
  107. session_mock.h
  108. session_test.cc
  109. slot_manager.h
  110. slot_manager_impl.cc
  111. slot_manager_impl.h
  112. slot_manager_mock.cc
  113. slot_manager_mock.h
  114. slot_manager_test.cc
  115. token_file_manager.h
  116. token_file_manager_chromeos.cc
  117. token_file_manager_linux.cc
  118. token_file_manager_mock.h
  119. token_manager_client.cc
  120. token_manager_client.h
  121. token_manager_client_mock.h
  122. token_manager_interface.h
  123. tpm_utility.h
  124. tpm_utility_impl.cc
  125. tpm_utility_impl.h
  126. tpm_utility_mock.cc
  127. tpm_utility_mock.h
  128. tpm_utility_test.cc