adb: fix public key authorization.
This was broken by commit e8b663fe, which removed the null-terminator
from the message sent. For some reason, adbd requires the key to be
null terminated, despite an explicit length being part of the message.
Bug: http://b/30971808
Change-Id: I9761298a57ed76ca2bc02b05490f98cdffbaa0c3
Test: manually tested, adb authorization dialog box shows up
diff --git a/adb/adb_auth.cpp b/adb/adb_auth.cpp
index 33da4bd..0b07158 100644
--- a/adb/adb_auth.cpp
+++ b/adb/adb_auth.cpp
@@ -64,7 +64,9 @@
p->msg.command = A_AUTH;
p->msg.arg0 = ADB_AUTH_RSAPUBLICKEY;
- p->msg.data_length = key.size();
+
+ // adbd expects a null-terminated string.
+ p->msg.data_length = key.size() + 1;
send_packet(p, t);
}