trunks: make timeout calculations more accurate

The existing timeout calculation assumes that actual communication
with the chip is instantaneous. It is an almost true assumption for a
hardware interfaced device (LPC), but is wrong for the FTDI case.

Let's use system clock to make sure that timeouts are accurate and
while we are at it set the default timeout to 10 s.

TEST=observed proper timeouts during the test run
BUG=chrome-os-partner:43025

Change-Id: Ibc3dd47d4125bcb61a4af46207ff611bde59f597
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/295551
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2 files changed
tree: 0aa5230098c84571c37f7c14b60ae57e02990126
  1. CPPLINT.cfg
  2. Makefile
  3. OWNERS
  4. README
  5. authorization_delegate.h
  6. background_command_transceiver.cc
  7. background_command_transceiver.h
  8. background_command_transceiver_test.cc
  9. blob_parser.cc
  10. blob_parser.h
  11. command_transceiver.h
  12. dbus_interface.h
  13. dbus_interface.proto
  14. error_codes.cc
  15. error_codes.h
  16. ftdi/
  17. generator/
  18. hmac_authorization_delegate.cc
  19. hmac_authorization_delegate.h
  20. hmac_authorization_delegate_unittest.cc
  21. hmac_session.h
  22. hmac_session_impl.cc
  23. hmac_session_impl.h
  24. hmac_session_test.cc
  25. mock_authorization_delegate.cc
  26. mock_authorization_delegate.h
  27. mock_blob_parser.cc
  28. mock_blob_parser.h
  29. mock_command_transceiver.cc
  30. mock_command_transceiver.h
  31. mock_hmac_session.cc
  32. mock_hmac_session.h
  33. mock_policy_session.cc
  34. mock_policy_session.h
  35. mock_session_manager.cc
  36. mock_session_manager.h
  37. mock_tpm.cc
  38. mock_tpm.h
  39. mock_tpm_state.cc
  40. mock_tpm_state.h
  41. mock_tpm_utility.cc
  42. mock_tpm_utility.h
  43. org.chromium.Trunks.conf
  44. password_authorization_delegate.cc
  45. password_authorization_delegate.h
  46. password_authorization_delegate_unittest.cc
  47. policy_session.h
  48. policy_session_impl.cc
  49. policy_session_impl.h
  50. policy_session_test.cc
  51. resource_manager.cc
  52. resource_manager.h
  53. resource_manager_test.cc
  54. scoped_key_handle.cc
  55. scoped_key_handle.h
  56. scoped_key_handle_test.cc
  57. session_manager.h
  58. session_manager_impl.cc
  59. session_manager_impl.h
  60. session_manager_test.cc
  61. tpm_constants.h
  62. tpm_generated.cc
  63. tpm_generated.h
  64. tpm_generated_test.cc
  65. tpm_handle.cc
  66. tpm_handle.h
  67. tpm_simulator_handle.cc
  68. tpm_simulator_handle.h
  69. tpm_state.h
  70. tpm_state_impl.cc
  71. tpm_state_impl.h
  72. tpm_state_test.cc
  73. tpm_utility.h
  74. tpm_utility_impl.cc
  75. tpm_utility_impl.h
  76. tpm_utility_test.cc
  77. trunks.gyp
  78. trunks_client.cc
  79. trunks_client_test.cc
  80. trunks_client_test.h
  81. trunks_export.h
  82. trunks_factory.h
  83. trunks_factory_for_test.cc
  84. trunks_factory_for_test.h
  85. trunks_factory_impl.cc
  86. trunks_factory_impl.h
  87. trunks_ftdi_spi.cc
  88. trunks_ftdi_spi.h
  89. trunks_proxy.cc
  90. trunks_proxy.h
  91. trunks_service.cc
  92. trunks_service.h
  93. trunks_testrunner.cc
  94. trunksd-seccomp-amd64.policy
  95. trunksd-seccomp-arm.policy
  96. trunksd-seccomp-x86.policy
  97. trunksd.cc
  98. trunksd.conf