diff options
| author | 2019-02-07 18:58:10 -0800 | |
|---|---|---|
| committer | 2019-02-08 23:00:24 +0000 | |
| commit | c5da14c2252d363788f65f623949b8ae53e4bb27 (patch) | |
| tree | 050225a24f359706f373aee55bb7f9ad18d01619 | |
| parent | 699905e5c77f352a8937720cfa56cf4091e460c9 (diff) | |
Write ADB keys to adb_keys as well for backwards compat
The original design of revoking adb keys after a period of
inactivity did not properly verify that the system held the
corresponding private key. There will need to be additional
coordination between adbd and the framework after a system
passes the SIGNATURE challenge to determine if the key should
be allowed, but this change will restore the original behavior
for beta 1.
Bug: 124076524
Test: Manually verified key is written to adb_keys and subsequent
connections went through the SIGNATURE challenge
Change-Id: Ib735f8a4d83518d4f6b5e939dcd1a2f5ae6f4837
| -rw-r--r-- | services/core/java/com/android/server/adb/AdbDebuggingManager.java | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/services/core/java/com/android/server/adb/AdbDebuggingManager.java b/services/core/java/com/android/server/adb/AdbDebuggingManager.java index c7b9a3cb7847..01aa0b4ec252 100644 --- a/services/core/java/com/android/server/adb/AdbDebuggingManager.java +++ b/services/core/java/com/android/server/adb/AdbDebuggingManager.java @@ -322,6 +322,9 @@ public class AdbDebuggingManager { mConnectedKey = key; mAdbKeyStore.setLastConnectionTime(key, System.currentTimeMillis()); scheduleJobToUpdateAdbKeyStore(); + // write this key to adb_keys as well so that subsequent connections can + // go through the expected SIGNATURE interaction. + writeKey(key); } logAdbConnectionChanged(key, AdbProtoEnums.USER_ALLOWED, alwaysAllow); } @@ -354,20 +357,9 @@ public class AdbDebuggingManager { } break; } - // Check if the key should be allowed without user interaction. - if (mAdbKeyStore.isKeyAuthorized(key)) { - if (mThread != null) { - mThread.sendResponse("OK"); - mAdbKeyStore.setLastConnectionTime(key, System.currentTimeMillis()); - logAdbConnectionChanged(key, AdbProtoEnums.AUTOMATICALLY_ALLOWED, true); - mConnectedKey = key; - scheduleJobToUpdateAdbKeyStore(); - } - } else { - logAdbConnectionChanged(key, AdbProtoEnums.AWAITING_USER_APPROVAL, false); - mFingerprints = fingerprints; - startConfirmation(key, mFingerprints); - } + logAdbConnectionChanged(key, AdbProtoEnums.AWAITING_USER_APPROVAL, false); + mFingerprints = fingerprints; + startConfirmation(key, mFingerprints); break; } |