aboutsummaryrefslogtreecommitdiff
path: root/libnos_transport
AgeCommit message (Collapse)Author
2021-04-07Merge remote-tracking branch 'goog/upstream-master' into nos2-2Bill Richardson
* goog/upstream-master: MockNuggetClient: add Reset method to mock Define UPGRADE_EN_FW_FAIL for upgrade state sjtag: add new command for sjtag user consent cfg identity: Add support NDK version 3 for Andorid 12 Tweak: fix typos in debug strings Refactor NuggetClient a bit Bug: 170775487 Bug: 178353028 Bug: 181691419 Test: release tests, QMC Change-Id: I03dc7c270939fc049350eac4ab4625f7f74c37be
2021-02-20Tweak: fix typos in debug stringsBill Richardson
Bug: None Test: None Change-Id: I922758e7c64caa339b1ce03eb5e44e3c685ead72 Signed-off-by: Bill Richardson <wfrichar@google.com> Reviewed-on: https://nugget-os-review.googlesource.com/c/host/generic/+/40284 Presubmit-Verified: TreeHugger Robot
2021-02-12[LSC] Add LOCAL_LICENSE_KINDS to external/nos/host/genericandroid-s-preview-1Bob Badour
Added SPDX-license-identifier-Apache-2.0 to: libnos/Android.bp libnos/generator/Android.bp libnos/generator/test/Android.bp libnos/test/Android.bp libnos_datagram/Android.bp libnos_transport/Android.bp nugget/proto/nugget/app/avb/Android.bp nugget/proto/nugget/app/identity/Android.bp nugget/proto/nugget/app/keymaster/Android.bp nugget/proto/nugget/app/weaver/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: Android.bp nugget/proto/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I81ad1b4c58c6d57550857471dc894063619162c3
2020-08-13Enlarge the timeout from 300 to 1200 msecChungjui Fan
Wiping data can't be finished within 300 msec that leads the polling timeout APP_ERROR_IO while doing factory reset. Bug: 163076061 Test: succeed to finish factory reset 100 times Change-Id: Iee106ffc02db385270da605fad4119f31c8ec4cc Signed-off-by: Chungjui Fan <chungjuifan@google.com>
2020-05-01Only one WORKSPACE in entire repoKenny Root
This allows us to run bazel from anywhere in the nugget checkout and have it function correctly. Bug: 120442369 Test: bazel build ... Signed-off-by: Kenny Root <kroot@google.com> Change-Id: I0cc2404cc807df1a5d4b2128162c204ab07720ee
2020-04-06bazel build: one WORKSPACE per gitKenny Root
Consolidate each git repo to only have one WORKSPACE. This makes the rules a bit more easy to manage. Bug: 120442369 Test: bazel build ... Signed-off-by: Kenny Root <kroot@google.com> Change-Id: I00a8f9f8635b0e500e10c0852bc1bb52073994dd
2020-03-02Transport: Add retryng mechanism while calling nos application.dybertwang
Citadel chip sometimes give the response "APP_ERROR_TOO_MUCH", which is to complain AP sent it a count different from what AP claimed or more than it can accept - but this should not happen. Give to the chip a little bit of time and retry calling again. Also increase CRC_RETRY_COUNT from 3 to 5. Bug: 147200739 Change-Id: I10308cecab382b29c7846d9b79ff3edf36534c8d Signed-off-by: dybertwang <dybertwang@google.com>
2019-04-19libnos_transport: Don't show crc in log messagesBill Richardson
We don't need to see it, and some hypothetical attacker *might* find it slightly useful to know. Bug: None Test: manual (logcat | grep libnos_transport) Change-Id: I701514b3da58dee7107340c578aa778f9dfa9bfa Signed-off-by: Bill Richardson <wfrichar@google.com>
2019-01-24host/generic: Upgrade googletest to 1.8.1Garret Kelly
The new 1.8.1 release has its own BUILD.bazel and doesn't require an overridden build file. Bug: 123083638 Test: bazel build :all Change-Id: Icd7b42f8ad01f4a6035b240f71f7e72a026cedc6 Signed-off-by: Garret Kelly <gdk@google.com>
2018-07-18Transport: timeout after 60 secondsAndrew Scull
If the app doesn't respond within 60 seconds then we give up on it. It may finish at some point in the future but we'll just have to see next time we call in as there isn't a way to have the app abort the call. Bug: 110758319 Test: TransportTest.Timeout Change-Id: I1448df0a266515c813868f5f9327d25ecb7e933f
2018-07-11Transport: improve logs for debuggingAndrew Scull
Add the app ID and details about the call so we can infer what the AP is doing with Citadel. The app ID acts as a transaction ID as there will only be one transaction with an app at a time. This also fixes the logging priorities. Debug is a higher priority than verbose and verbose is off by default in the Android build. The tracing logs should be in debug and the extra spammy details are in verbose so they can be enabled when needed. Test: run on a phone and view the logs Change-Id: I0a11e04c56ec64f8018c041055fe247deb633d9d
2018-07-10Transport protocol v1 -- masterAndrew Scull
This adds CRC-16 checksums for the call_application() function. The command from the master includes and additional packet containing the CRC which the slave can verify. The status from the slave after an app has processed the command included the CRC of the reply data and the status message itself. The protocol is backward compatible by detecting the v0 protocol from the status response and ignoring any CRCs. In the event of a CRC failure when reading the status or response data, the read operation is retried 3 times. In the event of a CRC failure of the request, the transaction is restarted a maximum of 3 times. Bug: 66104849 Bug: 80133226 Test: TransportTest Test: Update Android and unlock, update Citadel and can still unlock, reboot and unlock again Change-Id: If0d37ee492ecddcc17c4dbde3ca992698a48a5e7
2018-06-04Add NOTICE files to get copyright info publishedBill Richardson
Just adding the NOTICE files next to Android.bp is enough to make the binaries appear in the Legal Info file on the phone. Bug: b/69868595 Test: Build, observe files appear in the list Change-Id: Ib5cde48a4a494faaed08fa0c52bb72250e06c54a Signed-off-by: Bill Richardson <wfrichar@google.com>
2018-05-25Transport: increase datagram retried to 300msAndrew Scull
Originally it as 125ms which only gave a small margin over the expected ~100ms of a reboot. By increasing this margin we aim to improve reliability. Bug: 80238564 Change-Id: Ic67dace2c654f42164a4da7518b2f568bbff5552
2018-05-03Revert "Support message CRCs in the transport protocol."Bill Richardson
This reverts commit 8cec2e5d378b530dcf3de66ac2d5b52602aec6e7. We need fastboot support first Change-Id: I67251eb7ccb8f3416218c96aa3eb9de2f5e74193 Signed-off-by: Bill Richardson <wfrichar@google.com>
2018-05-03Support message CRCs in the transport protocol.Bill Richardson
This adds CRC-16 checksums for the call_application() function. The command from the master includes and additional packet containing the CRC which the slave can verify. The status from the slave after an app has processed the command included the CRC of the reply data and the status message itself. The protocol is backward compatible by detecting the legacy protocol from the status response and ignoring any CRCs. In the event of a CRC failure when reading the status or response data, the read operation is retried 3 times. In the event of a CRC failure of the request, the transaction is restarted a maximum of 3 times. Bug: 66104849 Change-Id: Id8c8e1ce0425af66a3a41e59cf7bb3843a4bf740
2018-04-04Add retry functionality to all read/write device operationsAnatol Pomazau
Test: harness tests passed 80 times Bug: 73959155 Change-Id: I9a664e9584eb7ee04f0f94bbcee7763b0e3a19bb
2018-03-27Add retry logic to get_status() functionAnatol Pomazau
In case of chip is asleep then Linux kernel driver returns EAGAIN error code for get_status operation. In this case we retry the operation again. Currently limit is set to 10 retries. Remove retry logic from clear_status() that is duplicated now. Test: harness tests pass Bug: 73959155 Change-Id: I72ae3e0b7f6002a61147bbd96d668a5f690c135c
2018-03-08Fix Android buildBill Richardson
Change-Id: I6fef846a3944da91fdcc6ec33add5ea3f9dd95dd Signed-off-by: Bill Richardson <wfrichar@google.com>
2018-03-06Add LOG_TAG for libnos_transport functionsBill Richardson
So they're easier to spot in the logcat output Change-Id: Ia7928ba7de9b92a164af343825a2a659db51b32e Signed-off-by: Bill Richardson <wfrichar@google.com>
2018-01-17Update after Android build file defaults refactorAndrew Scull
Change-Id: I60d81c28946847f001a4f75bb56c9d7306a1a4fb
2017-12-21Fix android build.Allen Webb
Change-Id: I094a80d0f4f12b6bdddf3709e30386738c853cac
2017-12-14Retry status datagram to handle sleep / reboot.Allen Webb
Change-Id: If4959b2ca940fe4c6d1eb2202480afbddc033c7f
2017-10-11nos_call_application returns error code.Andrew Scull
Instead of killing the process, it logs the error and returns an error code. Change-Id: Ia71ccf6fc5a93abf7a07dd7d8004d779df0b46cb
2017-10-10Replace tabs with 2 spaces.Andrew Scull
This repo is going to mostly use the Google style guidelines. This code has been moving around between repos and the most noticable style difference is tabs vs spaces IMO. Change-Id: Iccfa3e3ce00c2350815c0fd9a97da933ac301f4a
2017-09-28Formalise Citadel client for Linux.Andrew Scull
It now resides in host/linux and does not depend on the driver from core/nugget/util/poker. Change-Id: I555631bcf659e31f647a4f12d32c10883b10412f
2017-09-28Provide missing file descriptor to fprintf()Bill Richardson
Oops. Change-Id: I35bf99d564546af013dd0e7c2bce628f0fe3b8c8 Signed-off-by: Bill Richardson <wfrichar@google.com>
2017-09-26Create a home for the host transport library.Andrew Scull
libnos_transport implements the transport protocol on top of libnos_datagram which defines the datagram API. Change-Id: Ie91e4072cac953b244a7f6fed381d67b561ff48d