Commit graph

55788 commits

Author SHA1 Message Date
Joshua Duong
49dd8e560e Add adb_pairing* tests to TEST_MAPPING.
Bug: 111434128

Test: This is the test
Change-Id: I97e4d4ed6318de34a62b60144e790142d00e1629
Exempt-From-Owner-Approval: missed adding it in previous CL.
2020-02-21 16:06:27 -08:00
Josh Gao
744ba42d2d Merge "adbd: remove static dependency on libcutils." 2020-02-22 00:03:21 +00:00
Joshua Duong
e20d3a006a Merge changes from topic "adbwifi-system-core"
* changes:
  [adbwifi] Add A_STLS command.
  [adbwifi] Add adbwifi_libs, TLS connection, and MDNS implementation.
  [adbd-apex] Export adbd libraries used by system_server.
  [adbwifi] Add pairing_connection library.
2020-02-21 21:07:27 +00:00
Joshua Duong
5cf7868b7e [adbwifi] Add A_STLS command.
This command will be sent by adbd to notify the client that the
connection will be over TLS.

When client connects, it will send the CNXN packet, as usual. If the
server connection has TLS enabled, it will send the A_STLS packet
(regardless of whether auth is required). At this point, the client's
only valid response is to send a A_STLS packet. Once both sides have
exchanged the A_STLS packet, both will start the TLS handshake.

If auth is required, then the client will receive a CertificateRequest
with a list of known public keys (SHA256 hash) that it can use in its
certificate. Otherwise, the list will be empty and the client can assume
that either any key will work, or none will work.

If the handshake was successful, the server will send the CNXN packet
and the usual adb protocol is resumed over TLS. If the handshake failed,
both sides will disconnect, as there's no point to retry because the
server's known keys have already been communicated.

Bug: 111434128

Test: WIP; will add to adb_test.py/adb_device.py.

Enable wireless debugging in the Settings, then 'adb connect
<ip>:<port>'. Connection should succeed if key is in keystore. Used
wireshark to check for packet encryption.

Change-Id: I3d60647491c6c6b92297e4f628707a6457fa9420
2020-02-21 21:07:13 +00:00
Joshua Duong
d85f5c0130 [adbwifi] Add adbwifi_libs, TLS connection, and MDNS implementation.
Bug: 111434128, 119493510, 119494503

Test: Enable wireless debugging in Settings UI, click "pair with pairing code"
to generate pairing code.
On client, 'adb pair <ip_address>', enter pairing code at prompt and hit
enter. Pairing should complete.
'adb logcat'.
Change-Id: I86527bd3fc52e30a8e08ec5843dc3e100abf91fa
Exempt-From-Owner-Approval: approved already
2020-02-21 21:06:40 +00:00
Joshua Duong
16d5bc6ed5 [adbd-apex] Export adbd libraries used by system_server.
Bug: b/111434128
Bug: b/149181583

Test: cat proc/`pidof system_server`/maps | grep libadb
Test: cat proc/`pidof adbd`/maps | grep libadb
Change-Id: Idd36ca31cba7e4dc2d8836d229b23665e69b42fb
Exempt-From-Owner-Approval: approved already
2020-02-21 21:06:28 +00:00
Joshua Duong
c7a1fb8fd9 [adbwifi] Add pairing_connection library.
Bug: 111434128
Bug: 119494503

Test: atest adb_pairing_connection_test
Change-Id: I54d68c65067809832266d6c3043b63222c98a9cd
Exempt-From-Owner-Approval: approved already
2020-02-21 21:06:12 +00:00
Joshua Duong
df8f1217d0 Merge "[adbwifi] Add pairing_auth library." 2020-02-21 21:04:48 +00:00
Joshua Duong
340a5e86d2 [adbwifi] Add pairing_auth library.
Bug: 111434128
Bug: 119494503

Test: atest adb_pairing_auth_test
Change-Id: Ieada7b8d9d8817292175623af55eac235b938c65
Exempt-From-Owner-Approval: approved already
2020-02-21 21:04:39 +00:00
Joshua Duong
d62c817cce Merge "adbd_auth function signature changes." 2020-02-21 21:02:33 +00:00
Joshua Duong
51378f41a1 adbd_auth function signature changes.
Bug: 111434128

Test: make
Change-Id: If801346e436dc7d7a7dfbbc296f7b2393d1e91af
Exempt-From-Owner-Approval: approved already
2020-02-21 20:12:23 +00:00
Jaegeuk Kim
04bf79dcb4 Merge "fs_mgr: support metadata_csum for ext4 partition" 2020-02-21 05:40:48 +00:00
Yurii Zubrytskyi
b182a3582c Merge "Initialize |sentBlocksCount|" 2020-02-21 05:29:45 +00:00
Kiyoung Kim
5694a9559b Merge "Remove ld.config.txt from adbd APEX" 2020-02-21 04:10:13 +00:00
Josh Gao
f10099d79a Merge "Fix the MacOS build of incremental*" 2020-02-21 01:48:52 +00:00
Yurii Zubrytskyi
12051a0937 Initialize |sentBlocksCount|
It happened to always be 0 during all tests.

Test: manual
Change-Id: I2f5089096a8ecda2ec52756199412c7d43f6903c
2020-02-20 16:03:10 -08:00
Yurii Zubrytskyi
b65950642d Fix the MacOS build of incremental*
Test: local build, no feature code changes

Change-Id: Ic0072b06f6bfd6b12f26c4056bd3192cd3fdd778
2020-02-20 15:39:36 -08:00
Alessio Balsini
20d9d6a630 Merge "libsnapshot: fix stats write in Resume()" 2020-02-20 19:37:25 +00:00
Alessio Balsini
91da9dfeef libsnapshot: fix stats write in Resume()
The Resume() operation is supposed to increment the resume counter, but
the updated counter value was not written to the device.
Fix by adding the write operation and refactoring the code.

Bug: none
Test: m
Change-Id: I3fffd61cc779c59e2780900809f0ce0b84258e78
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-20 15:05:13 +00:00
Nikita Ioffe
e53f8b8f9d Merge "Store reason in case of userspace-reboot watchdog reboot" 2020-02-20 11:37:32 +00:00
Yurii Zubrytskyi
aab85d3b4c Merge "[adb] Add a version field to v4 signature format" 2020-02-20 11:28:18 +00:00
Kiyoung Kim
f611e41e14 Remove ld.config.txt from adbd APEX
Dynamic linker will use generated linker configuration in general. As
ld.config.txt file in the APEX module will not be used, we can remove
this to avoid confusion.

Bug: 149887007
Test: m -j passed
Test: Boot succeeded from cuttlefish and walleye
Change-Id: Ic98aca819b5a4d0e0af4fe0ea25145a483aa7d53
2020-02-20 16:06:53 +09:00
Treehugger Robot
c5c3f54806 Merge "Adding new GSI public keys" 2020-02-20 06:18:41 +00:00
Josh Gao
a9b62d5452 adbd: remove static dependency on libcutils.
We were previously statically linking libcutils into adbd for several
different reasons, which were addressed as follows:

  socket functions: extracted to a statically linked libcutils_network
  fs_config: wrapped with a shared library on /system
  ATRACE: deleted the single use in adbd

Test: treehugger
Change-Id: I821fa174cfcbfa8e29a4be10de4016b817adbaf8
2020-02-19 17:44:38 -08:00
Yurii Zubrytskyi
516c441fd8 [adb] Add a version field to v4 signature format
Test: manual
Change-Id: I8a1034d7131905463749d5b131dd9a3c8703fe96
2020-02-19 14:46:16 -08:00
Mitch Phillips
2dd81da3b4 Merge "[GWP-ASan] Add GWP-ASan information to tombstones." 2020-02-19 20:35:10 +00:00
Nikita Ioffe
d0bc0b6f1e Store reason in case of userspace-reboot watchdog reboot
Test: adb reboot userspace
Bug: 148767783
Change-Id: I58cf103fd5ce47eadae334376109492d0cc1c1c6
2020-02-19 20:12:07 +00:00
Yurii Zubrytskyi
2bca658a3b Merge "Incremental installations in adb, client/host side." 2020-02-19 19:25:10 +00:00
Treehugger Robot
db6650a905 Merge "Rename ro.device_owner system property" 2020-02-19 17:12:43 +00:00
Alex Buynytskyy
96ff54bf34 Incremental installations in adb, client/host side.
Test: adb install --incremental <apk>

Change-Id: I74e3eaf9718a16272bc533bc8298dfcf81120caa
2020-02-19 08:01:06 -08:00
Rubin Xu
7a5cbfc645 Rename ro.device_owner system property
This is renamed to ro.organization_owned to cover the extended
usage now that there is a new management mode for fully-managed
organization owned devices: organization-owned managed profile.
A device is considered fully-managed if there is a device owner
or an organization-owned managed profile.

Test: atest liblog-unit-tests
Test: atest propertyinfoserializer_tests
Bug: 148437300
Change-Id: Iaa8ea246c973732526abc1da5b307af8bce1a0af
2020-02-19 10:34:36 +00:00
Bowgo Tsai
b697d47eb3 Adding new GSI public keys
Adding two new public keys for R-Developer-GSI and S-Developer-GSI,
respectively.

Bug: 149805495
Test: m r-developer-gsi.avbpubkey
Test: m s-developer-gsi.avbpubkey
Change-Id: Iaa7521ef40b94f13fe3c9c61d276678f47c60b98
2020-02-19 08:50:26 +00:00
Martijn Coenen
529605bc9e Merge "Add project ID constants." 2020-02-19 05:23:20 +00:00
Martijn Coenen
1cc2f9d77f Add project ID constants.
These will be used for quota tracking on external storage devices
that don't have sdcardfs.

Bug: 146419093
Test: N/A
Change-Id: If00961cc3807bcc3e93675e5d27dd6444007fdba
2020-02-18 17:19:09 -08:00
Howard Ro
6c364f94ad Merge "Allow apexes to link against more libs" 2020-02-19 01:17:09 +00:00
Mitch Phillips
e0b4bb1b2e [GWP-ASan] Add GWP-ASan information to tombstones.
GWP-ASan can provide information about a crash that it caused. Grab the
GWP-ASan regions from the globals shared by the linker for crash-handler
purpopses, pull the information from GWP-ASan, and display it.

This adds two regions:
 1. Causality tracking by GWP-ASan. We now print a cause header about
 the crash, like `Cause: [GWP-ASan]: Use After Free on a 1-byte
 allocation at 0x7365bb3ff8`
 2. Allocation and deallocation stack traces.

Bug: 135634846
Test: atest debuggerd_test

Change-Id: Id28d5400c9a9a053fcde83a4788f971e677d4643
2020-02-18 16:49:50 -08:00
Paul Crowley
5ed0698b41 Merge "Add wrapped key support for metadata encryption" 2020-02-18 23:17:06 +00:00
Tom Cherry
83c7d04493 Merge "Specify argument types for function prototype" 2020-02-18 22:44:58 +00:00
Joshua Duong
8f04b0ca58 Merge "Some minor fixes to libadb_tls_connection." 2020-02-18 22:15:00 +00:00
Joshua Duong
663b3c9d88 Some minor fixes to libadb_tls_connection.
Bug: 111434128

Test: atest adb_tls_connection_test
Exempt-From-Owner-Approval: approved
Change-Id: I4c23cc6ba5b14b65122e61297554dedabf43d0b4
2020-02-18 22:14:48 +00:00
Treehugger Robot
9d261c3fed Merge "Add UNSUPPORTED to health HAL 2.1 values" 2020-02-18 20:45:15 +00:00
Barani Muthukumaran
2ca1d83ddb Add wrapped key support for metadata encryption
Change metadata_cipher fstab option to metadata_encryption
that includes encryption flags in addition to the cipher.
wrappedkey_v0 encryption flag is used to denote that the
inline encryption hardware supports wrapped keys. dm-default-key
device is created and a wrappedkey is provided along with the
optional wrappedkey_v0 argument.

Bug: 147733587

Test: FBE validation with Fscrypt v2 + inline crypt + wrapped
key changes kernel and metadata encryption with wrapped key.

Change-Id: Id1a18db175680dd6b0adb4594d06566eb1285785
2020-02-18 12:44:40 -08:00
Anders Frostad Pedersen
c54b30e106 Specify argument types for function prototype
__android_log_get_minimum_priority caused build failures
when used in combination with strict prototypes compiler flags.

Fix this by specifying void argument.

Bug: 116329414
Bug: 119867234
Change-Id: Icbb8f66a5e35f02b57d772f5acdb9de8638d252c
Test: Manual
2020-02-18 20:25:54 +00:00
Treehugger Robot
4862127432 Merge "logcat: add 'device shut down' to error message upon EOF" 2020-02-18 18:23:09 +00:00
Treehugger Robot
cf4f56df9f Merge "libsnapshot: Temporarily disable flaky ImageManagerTest" 2020-02-18 17:43:00 +00:00
Alessio Balsini
41b00ca46e libsnapshot: Temporarily disable flaky ImageManagerTest
This test was causing the failure of vts_libsnapshot_test.
Disable until a fix is found and tests are stable again.

Bug: 149738928
Test: atests vts_libsnapshot_test
Change-Id: Ibbe5cd72aad93d9ade4ac1542f08dec9cd926a3b
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-18 15:53:45 +00:00
Alessio Balsini
beb3125d3d Merge "SnaspshotManager uses SnapshotMergeStats" 2020-02-18 10:52:47 +00:00
Treehugger Robot
b9ac1178aa Merge "base: remove Errorf/ErrnoErrorf work around" 2020-02-18 05:20:14 +00:00
Joshua Duong
a71ba615ea Merge changes from topic "adbwifi-client-mdns"
* changes:
  add a version TXT record to adb secure mdns services
  adbd: only register dnsservices via explicit API
  adb client interface for secure services
  get the ip address info for all DNS services
  make the client browse for appropriate mdns services
  Add mDNS services for pairing and connect
2020-02-18 05:14:19 +00:00
Lingfeng Yang
39e54b8c5b add a version TXT record to adb secure mdns services
In the context of secure connect, allows adbd and host adb to reject
each other based on incompatible versions without even having to
actually connect (since it is a DNS TXT).

Bug: 111434128, 119490749

Test: N/A
Exempt-From-Owner-Approval: already approved
Change-Id: I54312d8b67370c397ba81ecdbca1b27e3ee58572
2020-02-18 05:13:06 +00:00