Validate payload data for each operation

For streaming update, we currently verify:
1. the hash of manifest before applying ops
2. the hash of the entire payload after we apply all ops
3. the final patched on filesystems after the update

So there is some potential to exploit the patching libraries, if
some attacker manage to provide us malicious patch data after the
manifest verification. Therefore, this cl enables the validation of
patch data for each install operation. The hash itself is embedded
in the payload manifest; and thus has been verified upfront.

Bug: 160800689
Test: unittests, apply an OTA
Change-Id: Idd4cbe167ce63f197d821752f75e45add0ea829c
(cherry picked from commit ef49160c9bd2621dd3084fa061f09d176304ca49)
1 file changed
tree: 988b705ee5a8b6da6b8fbaca0ee60461c5ddc267
  1. binder_bindings/
  2. client_library/
  3. common/
  4. dbus_bindings/
  5. fuzz/
  6. init/
  7. payload_consumer/
  8. payload_generator/
  9. sample_images/
  10. scripts/
  11. update_engine/
  12. update_manager/
  13. update_payload_key/
  14. .clang-format
  15. .gitignore
  16. Android.bp
  17. binder_service_android.cc
  18. binder_service_android.h
  19. binder_service_brillo.cc
  20. binder_service_brillo.h
  21. boot_control_android.cc
  22. boot_control_android.h
  23. boot_control_chromeos.cc
  24. boot_control_chromeos.h
  25. boot_control_chromeos_unittest.cc
  26. certificate_checker.cc
  27. certificate_checker.h
  28. certificate_checker_unittest.cc
  29. chrome_browser_proxy_resolver.cc
  30. chrome_browser_proxy_resolver.h
  31. cleanup_previous_update_action.cc
  32. cleanup_previous_update_action.h
  33. COMMIT-QUEUE.ini
  34. common_service.cc
  35. common_service.h
  36. common_service_unittest.cc
  37. connection_manager.cc
  38. connection_manager.h
  39. connection_manager_android.cc
  40. connection_manager_android.h
  41. connection_manager_interface.h
  42. connection_manager_unittest.cc
  43. connection_utils.cc
  44. connection_utils.h
  45. CPPLINT.cfg
  46. daemon.cc
  47. daemon.h
  48. daemon_state_android.cc
  49. daemon_state_android.h
  50. daemon_state_interface.h
  51. dbus_connection.cc
  52. dbus_connection.h
  53. dbus_service.cc
  54. dbus_service.h
  55. dbus_test_utils.h
  56. dlcservice_chromeos.cc
  57. dlcservice_chromeos.h
  58. dynamic_partition_control_android.cc
  59. dynamic_partition_control_android.h
  60. dynamic_partition_control_android_unittest.cc
  61. dynamic_partition_test_utils.h
  62. dynamic_partition_utils.cc
  63. dynamic_partition_utils.h
  64. fake_file_writer.h
  65. fake_p2p_manager.h
  66. fake_p2p_manager_configuration.h
  67. fake_shill_proxy.cc
  68. fake_shill_proxy.h
  69. fake_system_state.cc
  70. fake_system_state.h
  71. generate_pc_file.sh
  72. hardware_android.cc
  73. hardware_android.h
  74. hardware_chromeos.cc
  75. hardware_chromeos.h
  76. hardware_chromeos_unittest.cc
  77. image_properties.h
  78. image_properties_android.cc
  79. image_properties_android_unittest.cc
  80. image_properties_chromeos.cc
  81. image_properties_chromeos_unittest.cc
  82. libcurl_http_fetcher.cc
  83. libcurl_http_fetcher.h
  84. libupdate_engine-client-test.pc.in
  85. libupdate_engine-client.pc.in
  86. local_coverage_rate
  87. logging.cc
  88. logging.h
  89. logging_android.cc
  90. main.cc
  91. metrics_constants.h
  92. metrics_reporter_android.cc
  93. metrics_reporter_android.h
  94. metrics_reporter_interface.h
  95. metrics_reporter_omaha.cc
  96. metrics_reporter_omaha.h
  97. metrics_reporter_omaha_unittest.cc
  98. metrics_reporter_stub.cc
  99. metrics_reporter_stub.h
  100. metrics_utils.cc
  101. metrics_utils.h
  102. metrics_utils_unittest.cc
  103. mock_boot_control_hal.h
  104. mock_certificate_checker.h
  105. mock_connection_manager.h
  106. mock_dynamic_partition_control.h
  107. mock_file_writer.h
  108. mock_metrics_reporter.h
  109. mock_omaha_request_params.h
  110. mock_p2p_manager.h
  111. mock_payload_state.h
  112. mock_power_manager.h
  113. mock_service_observer.h
  114. mock_update_attempter.h
  115. MODULE_LICENSE_APACHE2
  116. network_selector.h
  117. network_selector_android.cc
  118. network_selector_android.h
  119. network_selector_interface.h
  120. network_selector_stub.cc
  121. network_selector_stub.h
  122. NOTICE
  123. omaha_request_action.cc
  124. omaha_request_action.h
  125. omaha_request_action_fuzzer.cc
  126. omaha_request_action_unittest.cc
  127. omaha_request_params.cc
  128. omaha_request_params.h
  129. omaha_request_params_unittest.cc
  130. omaha_response.h
  131. omaha_response_handler_action.cc
  132. omaha_response_handler_action.h
  133. omaha_response_handler_action_unittest.cc
  134. omaha_utils.cc
  135. omaha_utils.h
  136. omaha_utils_unittest.cc
  137. otacerts.zip
  138. OWNERS
  139. p2p_manager.cc
  140. p2p_manager.h
  141. p2p_manager_unittest.cc
  142. parcelable_update_engine_status.cc
  143. parcelable_update_engine_status.h
  144. parcelable_update_engine_status_unittest.cc
  145. payload_state.cc
  146. payload_state.h
  147. payload_state_interface.h
  148. payload_state_unittest.cc
  149. power_manager_android.cc
  150. power_manager_android.h
  151. power_manager_chromeos.cc
  152. power_manager_chromeos.h
  153. power_manager_interface.h
  154. PRESUBMIT.cfg
  155. PREUPLOAD.cfg
  156. pylintrc
  157. real_system_state.cc
  158. real_system_state.h
  159. run_unittests
  160. sample_omaha_v3_response.xml
  161. service_delegate_android_interface.h
  162. service_observer_interface.h
  163. shill_proxy.cc
  164. shill_proxy.h
  165. shill_proxy_interface.h
  166. sideload_main.cc
  167. system_state.h
  168. tar_bunzip2.gypi
  169. test_config.xml
  170. test_http_server.cc
  171. test_subprocess.cc
  172. testrunner.cc
  173. unittest_key.pem
  174. unittest_key2.pem
  175. unittest_key_EC.pem
  176. unittest_key_RSA4096.pem
  177. update_attempter.cc
  178. update_attempter.h
  179. update_attempter_android.cc
  180. update_attempter_android.h
  181. update_attempter_android_unittest.cc
  182. update_attempter_unittest.cc
  183. update_boot_flags_action.cc
  184. update_boot_flags_action.h
  185. update_boot_flags_action_unittest.cc
  186. update_engine-client.gyp
  187. update_engine.conf
  188. update_engine.gyp
  189. update_engine.rc
  190. update_engine_client.cc
  191. update_engine_client_android.cc
  192. update_metadata.proto
  193. update_status_utils.cc
  194. update_status_utils.h
  195. UpdateEngine.conf