PayloadVerifier should not depend on DeltaPerformer to load payload.

The implementation in DeltaPerformer is designed for situation that payload
might only partially available, but in PayloadVerifier we already have the
whole payload. So I implemented LoadPayload in PayloadSigner which logic is
simpler and supports both version 1 and 2.

VerifySignedPayload is also moved to PayloadSigner since it's not used in
update engine daemon.
This patch also fixed wrong metadata size out in version 2 and misspelling
of metadata in WritePayload in PayloadFile.

Bug: 23981164
TEST=unit test added.

Change-Id: Id1917fc891dbf2075978a273d1a4ee3c4ecf0571
9 files changed
tree: 449ca1323764d609b5fd3c3bd721a8e232726fc9
  1. client_library/
  2. dbus_bindings/
  3. include/
  4. init/
  5. payload_generator/
  6. sample_images/
  7. update_manager/
  8. update_payload_key/
  9. .gitignore
  10. action.h
  11. action_pipe.h
  12. action_pipe_unittest.cc
  13. action_processor.cc
  14. action_processor.h
  15. action_processor_unittest.cc
  16. action_unittest.cc
  17. Android.mk
  18. boot_control.h
  19. boot_control_android.cc
  20. boot_control_android.h
  21. boot_control_chromeos.cc
  22. boot_control_chromeos.h
  23. boot_control_chromeos_unittest.cc
  24. boot_control_interface.h
  25. boot_control_stub.cc
  26. boot_control_stub.h
  27. bzip.cc
  28. bzip.h
  29. bzip_extent_writer.cc
  30. bzip_extent_writer.h
  31. bzip_extent_writer_unittest.cc
  32. certificate_checker.cc
  33. certificate_checker.h
  34. certificate_checker_unittest.cc
  35. chrome_browser_proxy_resolver.cc
  36. chrome_browser_proxy_resolver.h
  37. chrome_browser_proxy_resolver_unittest.cc
  38. clock.cc
  39. clock.h
  40. clock_interface.h
  41. connection_manager.cc
  42. connection_manager.h
  43. connection_manager_interface.h
  44. connection_manager_unittest.cc
  45. constants.cc
  46. constants.h
  47. daemon.cc
  48. daemon.h
  49. dbus_service.cc
  50. dbus_service.h
  51. dbus_service_unittest.cc
  52. dbus_test_utils.h
  53. delta_performer.cc
  54. delta_performer.h
  55. delta_performer_integration_test.cc
  56. delta_performer_unittest.cc
  57. download_action.cc
  58. download_action.h
  59. download_action_unittest.cc
  60. error_code.h
  61. extent_writer.cc
  62. extent_writer.h
  63. extent_writer_unittest.cc
  64. fake_boot_control.h
  65. fake_clock.h
  66. fake_extent_writer.h
  67. fake_file_writer.h
  68. fake_hardware.h
  69. fake_p2p_manager.h
  70. fake_p2p_manager_configuration.h
  71. fake_prefs.cc
  72. fake_prefs.h
  73. fake_shill_proxy.cc
  74. fake_shill_proxy.h
  75. fake_system_state.cc
  76. fake_system_state.h
  77. file_descriptor.cc
  78. file_descriptor.h
  79. file_writer.cc
  80. file_writer.h
  81. file_writer_unittest.cc
  82. filesystem_verifier_action.cc
  83. filesystem_verifier_action.h
  84. filesystem_verifier_action_unittest.cc
  85. generate_pc_file.sh
  86. hardware.h
  87. hardware_android.cc
  88. hardware_android.h
  89. hardware_chromeos.cc
  90. hardware_chromeos.h
  91. hardware_interface.h
  92. http_common.cc
  93. http_common.h
  94. http_fetcher.cc
  95. http_fetcher.h
  96. http_fetcher_unittest.cc
  97. hwid_override.cc
  98. hwid_override.h
  99. hwid_override_unittest.cc
  100. image_properties.h
  101. image_properties_android.cc
  102. image_properties_chromeos.cc
  103. install_plan.cc
  104. install_plan.h
  105. libcros_proxy.cc
  106. libcros_proxy.h
  107. libcurl_http_fetcher.cc
  108. libcurl_http_fetcher.h
  109. libupdate_engine-client-test.pc.in
  110. libupdate_engine-client.pc.in
  111. local_coverage_rate
  112. main.cc
  113. metrics.cc
  114. metrics.h
  115. mock_action.h
  116. mock_action_processor.h
  117. mock_certificate_checker.h
  118. mock_connection_manager.h
  119. mock_file_writer.h
  120. mock_hardware.h
  121. mock_http_fetcher.cc
  122. mock_http_fetcher.h
  123. mock_omaha_request_params.h
  124. mock_p2p_manager.h
  125. mock_payload_state.h
  126. mock_prefs.h
  127. mock_update_attempter.h
  128. MODULE_LICENSE_APACHE2
  129. mtd_file_descriptor.cc
  130. mtd_file_descriptor.h
  131. multi_range_http_fetcher.cc
  132. multi_range_http_fetcher.h
  133. NOTICE
  134. omaha_hash_calculator.cc
  135. omaha_hash_calculator.h
  136. omaha_hash_calculator_unittest.cc
  137. omaha_request_action.cc
  138. omaha_request_action.h
  139. omaha_request_action_unittest.cc
  140. omaha_request_params.cc
  141. omaha_request_params.h
  142. omaha_request_params_unittest.cc
  143. omaha_response.h
  144. omaha_response_handler_action.cc
  145. omaha_response_handler_action.h
  146. omaha_response_handler_action_unittest.cc
  147. OWNERS
  148. p2p_manager.cc
  149. p2p_manager.h
  150. p2p_manager_unittest.cc
  151. payload_constants.cc
  152. payload_constants.h
  153. payload_state.cc
  154. payload_state.h
  155. payload_state_interface.h
  156. payload_state_unittest.cc
  157. payload_verifier.cc
  158. payload_verifier.h
  159. platform_constants.h
  160. platform_constants_android.cc
  161. platform_constants_chromeos.cc
  162. postinstall_runner_action.cc
  163. postinstall_runner_action.h
  164. postinstall_runner_action_unittest.cc
  165. prefs.cc
  166. prefs.h
  167. prefs_interface.h
  168. prefs_unittest.cc
  169. PRESUBMIT.cfg
  170. proxy_resolver.cc
  171. proxy_resolver.h
  172. real_system_state.cc
  173. real_system_state.h
  174. run_unittests
  175. sample_omaha_v3_response.xml
  176. shill_proxy.cc
  177. shill_proxy.h
  178. shill_proxy_interface.h
  179. subprocess.cc
  180. subprocess.h
  181. subprocess_unittest.cc
  182. system_state.h
  183. tar_bunzip2.gypi
  184. terminator.cc
  185. terminator.h
  186. terminator_unittest.cc
  187. test_http_server.cc
  188. test_utils.cc
  189. test_utils.h
  190. test_utils_unittest.cc
  191. testrunner.cc
  192. unittest_key.pem
  193. unittest_key2.pem
  194. update_attempter.cc
  195. update_attempter.h
  196. update_attempter_unittest.cc
  197. update_engine-client.gyp
  198. update_engine.conf
  199. update_engine.gyp
  200. update_engine.rc
  201. update_engine_client.cc
  202. update_metadata.proto
  203. update_status_utils.cc
  204. update_status_utils.h
  205. UpdateEngine.conf
  206. utils.cc
  207. utils.h
  208. utils_unittest.cc
  209. WATCHLISTS
  210. xz_extent_writer.cc
  211. xz_extent_writer.h
  212. xz_extent_writer_unittest.cc
  213. zip_unittest.cc