platform_system_core/adb
Benoit Goby f4ed516643 adb: Add public key authentification
Secure adb using a public key authentication, to allow USB debugging
only from authorized hosts.

When a device is connected to an unauthorized host, the adb daemon sends
the user public key to the device. A popup is shown to ask the user to
allow debugging once or permanantly from the host. The public key is
installed on the device in the later case. Other keys may be installed
at build time.

On the host, the user public/private key pair is automatically generated,
if it does not exist, when the adb daemon starts and is stored in
$HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed,
the ADB_KEYS_PATH env variable may be set to a ;-separated list of private
keys, e.g. company-wide or vendor keys.

On the device, vendors public keys are installed at build time in
/adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys.

ADB Protocol change:
If the device needs to authenticate the host, it replies to CNXN
packets with an AUTH packet. The AUTH packet payload is a random token.
The host signs the token with one of its private keys and sends an AUTH(0)
packet. If the signature verification succeeds, the device replies with
a CNXN packet. Otherwise, it sends a new AUTH packet with a new token so
that the host can retry with another private key. Once the host has tried
all its keys, it can send an AUTH(1) packet with a public key as
payload. adbd then sends the public key to the framework (if it has been
started) for confirmation.

Change-Id: Idce931a7bfe4ce878428eaa47838e5184ac6073f
2012-08-16 21:36:26 -07:00
..
adb.c adb: Add public key authentification 2012-08-16 21:36:26 -07:00
adb.h adb: Add public key authentification 2012-08-16 21:36:26 -07:00
adb_auth.h adb: Add public key authentification 2012-08-16 21:36:26 -07:00
adb_auth_client.c adb: Add public key authentification 2012-08-16 21:36:26 -07:00
adb_auth_host.c adb: Add public key authentification 2012-08-16 21:36:26 -07:00
adb_client.c adb: fix subprocess exit handling, oom adjust fixes, extra debugging. 2011-03-28 14:12:22 -07:00
adb_client.h Make adb's daemon-port on the host machine configurable. 2010-04-28 11:38:34 -04:00
Android.mk adb: Add public key authentification 2012-08-16 21:36:26 -07:00
backup_service.c Fix hang after end of backup 2011-06-21 16:05:17 -07:00
commandline.c am 2ca3e6b3: adb: Generalizing -s to take qualifiers. 2012-06-05 16:21:04 -07:00
console.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
fdevent.c adb: keep mac build happy 2011-03-29 12:36:22 -07:00
fdevent.h adb: fix subprocess exit handling, oom adjust fixes, extra debugging. 2011-03-28 14:12:22 -07:00
file_sync_client.c adb: fix subprocess exit handling, oom adjust fixes, extra debugging. 2011-03-28 14:12:22 -07:00
file_sync_service.c adb: fix subprocess exit handling, oom adjust fixes, extra debugging. 2011-03-28 14:12:22 -07:00
file_sync_service.h adb: Improved detection of big endian architecture 2010-10-16 14:35:28 +02:00
framebuffer_service.c Avoid zombies on androidscreencast 2012-07-23 15:23:20 +03:00
get_my_path_darwin.c eclair snapshot 2009-11-12 18:46:23 -08:00
get_my_path_freebsd.c FreeBSD support for usb-connected devices in adb 2009-10-25 01:56:35 +11:00
get_my_path_linux.c Make get_my_path() safer 2009-10-22 02:55:00 +11:00
get_my_path_windows.c Make get_my_path() safer 2009-10-22 02:55:00 +11:00
jdwp_service.c Fix adb leaking file descriptors to forked processes 2011-02-03 15:26:45 -05:00
log_service.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
MODULE_LICENSE_APACHE2 eclair snapshot 2009-11-12 18:46:23 -08:00
mutex_list.h adb: fix subprocess exit handling, oom adjust fixes, extra debugging. 2011-03-28 14:12:22 -07:00
NOTICE eclair snapshot 2009-11-12 18:46:23 -08:00
OVERVIEW.TXT Fixing spelling errors in adb docs 2010-04-28 11:38:39 -04:00
protocol.txt adb: Add public key authentification 2012-08-16 21:36:26 -07:00
remount_service.c Fix adb remount on non-MTD devices 2010-05-24 11:27:16 -04:00
services.c adb: Don't synchronize with transport using sleep 2012-03-16 15:30:05 -07:00
SERVICES.TXT adb: Add ability to specify device path 2012-04-20 11:21:14 -07:00
sockets.c am 504dccec: am aeceb517: adb: Fix adb tcpip command 2012-06-12 16:46:48 -07:00
sockets.dia auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
sysdeps.h adb: Use bionic's strtok_r() for Windows 2012-06-05 17:54:27 -07:00
sysdeps_win32.c adb: Use bionic's strtok_r() for Windows 2012-06-05 17:54:27 -07:00
test_track_devices.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
test_track_jdwp.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
transport.c am 2ca3e6b3: adb: Generalizing -s to take qualifiers. 2012-06-05 16:21:04 -07:00
transport.h adb: fix subprocess exit handling, oom adjust fixes, extra debugging. 2011-03-28 14:12:22 -07:00
transport_local.c Trivial signed/unsigned warning fix for adbd 2012-08-02 09:17:53 -04:00
transport_usb.c adb: Improved detection of big endian architecture 2010-10-16 14:35:28 +02:00
usb_libusb.c adb: Add ability to specify device path 2012-04-20 11:21:14 -07:00
usb_linux.c adb: Add ability to specify device path 2012-04-20 11:21:14 -07:00
usb_linux_client.c FunctionFS: initial implementation 2012-05-31 15:00:41 -07:00
usb_osx.c adb: Add ability to specify device path 2012-04-20 11:21:14 -07:00
usb_vendors.c Add Kobo's USB vendor ID to adb 2012-07-09 16:29:44 -07:00
usb_vendors.h adb: Add vendor IDs for iRiver, Compal and T & A Mobile Phones 2011-07-11 09:39:39 -04:00
usb_windows.c am 9dbcbe08: am 9bdedb59: am a36e1aa3: Merge "adb: usb_windows: fix adb connection lost issue" 2012-05-14 08:37:37 -07:00
utils.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
utils.h auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00