Introduce "adb keygen"

Introduce the "adb keygen" command.

  Usage: adb keygen <filename>

This command creates an adb public/private key pair in a user
specified file. This can be used to create new adb keys, or rotate
existing keys.

Modify adb's key generation routines to use the HOSTNAME/LOGNAME
environment variables if available. This allows someone to override
the username/hostname embedded within the adb public key file if
desired. Fallback to the old mechanisms if those environment
variables aren't available.

Bug: 18342715
Change-Id: Ibccee6088d4609aa05ad6687d3a1d8a8689d3e8a

(cherry picked from commit af782b9f2ac4fb817ded80d4317a45345bb3f992)

Change-Id: Ic76ffc9412171dddc879af0bbf6e20fbe1a8f057
Merge "Introduce "adb keygen""
Fix adb/fastboot windows compilations.

Many of the windows files where not including stdlib.h even though they
are using malloc/free calls.

(cherry-pick of ae7bf0959bd3f79afbf365e41f015ed1c304afdc.)

Change-Id: If6959df9909d9d9928e9f4a2a96018166361cf3c
Merge "Fix adb/fastboot windows compilations."
Add more debug information.

Re-commit https://googleplex-android-review.googlesource.com/#/c/519430/
Add fix for win_sdk build.

Add socketpair debug log.
Also output thread information in log on host side.

(cherry-pick of adb09fa01a16d8c5c92c2f8d325e1678c531223f.)

Change-Id: I21021bc111a3f7362a91b70593e3738125878118
Merge "Add more debug information."
Fix build on mac.

On mac require a case.
Also, this code is not portable, will fix it in long run.

(cherry-pick of 0f1fda9ee80ba086e4c8960a7d153798e3cf3285.)

Change-Id: I76194b62cea29bd3d21c7ba6c3da4d549bea4738
Merge "Fix build on mac."
adbd & fastbootd: Support for new f_fs descriptor format

The patch "[RFC] usb: gadget: f_fs: Add flags
to  descriptors block" marks the current
usb_functionfs_descs_head format deprecated
and introduces support for sending SuperSpeed
descriptors.

This CL makes adbd to send Descriptors in the
new format. Adbd would fall back to the old
format, if kernel is not able to recognize
the new format. This is done to prevent
adbd from breaking in the older versions
of the kernel.

(cherry-pick of fad60336daa5a7adf82d8140cbddd1c735770e71.)

Bug: 17394972
Change-Id: I05095ccdcc74bf6953cbef847d7583eab137e12e
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Merge "adbd & fastbootd: Support for new f_fs descriptor format"
fastbootd: Use FASTBOOT constants instead of ADB constants

(cherry-pick of ae17fb8f24c2d4dbb000c8943e2caa428fbf4c9b.)

Change-Id: I4a67e7144b5c4a10e809821feb7f8c16540831cb
Merge "fastbootd: Use FASTBOOT constants instead of ADB constants"
adb warns on remount when verity is enabled

(cherry-pick of f643beced1d154726dca7115014d2d1fdfcca993.)

Bug: 18119147
Change-Id: I75e5edf83fa01dbf2495e24df4597dce41f13654
Merge "adb warns on remount when verity is enabled"
Revert "Revert "Enable verity on userdebug, and add disable-verity to adb""

This reverts commit 152d2d4234ba89e0c20c4af13e291b6049a7bc33.

Fixed build error, and also fixed memory leak spotted from warning.

(cherry-pick of bbb36319119edde9377fb80015235893c30d2bc9.)

Bug: 17691572
Change-Id: I23b5ba537f7b557432041d4338b38b9be434e981
Merge "Revert "Revert "Enable verity on userdebug, and add disable-verity to adb"""
Add adb enable-verity

Note that it is *easy* to break your phone with this feature. It is
not a bug that reenabling verity after changing one byte of the system
partition stops the device booting.

(cherry-pick of 7c442e1700e6312727283db402dec6f666f1b55a.)

Bug: 18529433
Change-Id: I632e91281884471a362960f1ba30312d2669b8ff
Merge "Add adb enable-verity"
Fix build

(cherry-pick of 731136ca36bb7af1490856373d463e3a6c4df1c8.)

Change-Id: I9b493fd5fc5c5f62f02bc5234ccca2a5118380b4
Merge "Fix build"