Store the signature blob as part of the update checkpoint.

If a signed update is interrupted after the download phase, then on resume we
don't re-download the signature blob from the server and fail the update due to
missing signature. This patch makes it so that the signature blob is stored and
restored as part of the update state checkpoint.

Some alternatives that we may want to consider in the future are:

- Redownload the signature blob from the server and re-verify it.

- Verify the signature as soon as it's received and don't checkpoint the blob
  and the signed sha-256 context.

BUG=chromium-os:15711
TEST=unit tests, tested manually interrupting updates on the device

Reviewed-on: http://gerrit.chromium.org/gerrit/1594
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
(cherry picked from commit 4f0a07bc1bc46c3c1ac36ba57d693c61a71227ce)

Change-Id: I07ed754bdd0398c42b122874dfeb9e462d2f45b4
Reviewed-on: http://gerrit.chromium.org/gerrit/1652
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Ryan Cairns <rtc@chromium.org>
4 files changed
tree: ebea123a2c28c74b96c1ada9f9ea8450732f3991
  1. .gitignore
  2. action.h
  3. action_mock.h
  4. action_pipe.h
  5. action_pipe_unittest.cc
  6. action_processor.cc
  7. action_processor.h
  8. action_processor_mock.h
  9. action_processor_unittest.cc
  10. action_unittest.cc
  11. buffered_file_writer.cc
  12. buffered_file_writer.h
  13. buffered_file_writer_unittest.cc
  14. bzip.cc
  15. bzip.h
  16. bzip_extent_writer.cc
  17. bzip_extent_writer.h
  18. bzip_extent_writer_unittest.cc
  19. chrome_browser_proxy_resolver.cc
  20. chrome_browser_proxy_resolver.h
  21. chrome_browser_proxy_resolver_unittest.cc
  22. chrome_proxy_resolver.cc
  23. chrome_proxy_resolver.h
  24. chrome_proxy_resolver_unittest.cc
  25. cycle_breaker.cc
  26. cycle_breaker.h
  27. cycle_breaker_unittest.cc
  28. dbus_constants.h
  29. dbus_interface.h
  30. dbus_service.cc
  31. dbus_service.h
  32. decompressing_file_writer.cc
  33. decompressing_file_writer.h
  34. decompressing_file_writer_unittest.cc
  35. delta_diff_generator.cc
  36. delta_diff_generator.h
  37. delta_diff_generator_unittest.cc
  38. delta_performer.cc
  39. delta_performer.h
  40. delta_performer_unittest.cc
  41. download_action.cc
  42. download_action.h
  43. download_action_unittest.cc
  44. extent_mapper.cc
  45. extent_mapper.h
  46. extent_mapper_unittest.cc
  47. extent_ranges.cc
  48. extent_ranges.h
  49. extent_ranges_unittest.cc
  50. extent_writer.cc
  51. extent_writer.h
  52. extent_writer_unittest.cc
  53. file_writer.cc
  54. file_writer.h
  55. file_writer_mock.h
  56. file_writer_unittest.cc
  57. filesystem_copier_action.cc
  58. filesystem_copier_action.h
  59. filesystem_copier_action_unittest.cc
  60. filesystem_iterator.cc
  61. filesystem_iterator.h
  62. filesystem_iterator_unittest.cc
  63. flimflam_proxy.cc
  64. flimflam_proxy.h
  65. flimflam_proxy_unittest.cc
  66. full_update_generator.cc
  67. full_update_generator.h
  68. full_update_generator_unittest.cc
  69. gen_coverage_html.sh
  70. generate_delta_main.cc
  71. graph_types.h
  72. graph_utils.cc
  73. graph_utils.h
  74. graph_utils_unittest.cc
  75. gzip.cc
  76. gzip.h
  77. http_fetcher.cc
  78. http_fetcher.h
  79. http_fetcher_unittest.cc
  80. inherit-review-settings-ok
  81. install_plan.h
  82. integration_unittest.cc
  83. libcurl_http_fetcher.cc
  84. libcurl_http_fetcher.h
  85. LICENSE
  86. local_coverage_rate.sh
  87. main.cc
  88. marshal.list
  89. metadata.cc
  90. metadata.h
  91. metadata_unittest.cc
  92. mock_dbus_interface.h
  93. mock_file_writer.h
  94. mock_http_fetcher.cc
  95. mock_http_fetcher.h
  96. multi_range_http_fetcher.cc
  97. multi_range_http_fetcher.h
  98. omaha_hash_calculator.cc
  99. omaha_hash_calculator.h
  100. omaha_hash_calculator_unittest.cc
  101. omaha_request_action.cc
  102. omaha_request_action.h
  103. omaha_request_action_unittest.cc
  104. omaha_request_params.cc
  105. omaha_request_params.h
  106. omaha_request_params_unittest.cc
  107. omaha_response_handler_action.cc
  108. omaha_response_handler_action.h
  109. omaha_response_handler_action_unittest.cc
  110. org.chromium.UpdateEngine.service
  111. payload_signer.cc
  112. payload_signer.h
  113. payload_signer_unittest.cc
  114. postinstall_runner_action.cc
  115. postinstall_runner_action.h
  116. postinstall_runner_action_unittest.cc
  117. prefs.cc
  118. prefs.h
  119. prefs_interface.h
  120. prefs_mock.h
  121. prefs_unittest.cc
  122. proxy_resolver.cc
  123. proxy_resolver.h
  124. SConstruct
  125. setup_dev_packages
  126. simple_key_value_store.cc
  127. simple_key_value_store.h
  128. simple_key_value_store_unittest.cc
  129. split_file_writer.cc
  130. split_file_writer.h
  131. split_file_writer_unittest.cc
  132. subprocess.cc
  133. subprocess.h
  134. subprocess_unittest.cc
  135. tarjan.cc
  136. tarjan.h
  137. tarjan_unittest.cc
  138. terminator.cc
  139. terminator.h
  140. terminator_unittest.cc
  141. test_http_server.cc
  142. test_utils.cc
  143. test_utils.h
  144. testrunner.cc
  145. topological_sort.cc
  146. topological_sort.h
  147. topological_sort_unittest.cc
  148. unittest_key.pem
  149. update_attempter.cc
  150. update_attempter.h
  151. update_attempter_mock.h
  152. update_attempter_unittest.cc
  153. update_check_scheduler.cc
  154. update_check_scheduler.h
  155. update_check_scheduler_unittest.cc
  156. update_engine.xml
  157. update_engine_client.cc
  158. update_metadata.proto
  159. UpdateEngine.conf
  160. utils.cc
  161. utils.h
  162. utils_unittest.cc
  163. WATCHLISTS
  164. zip_unittest.cc