summaryrefslogtreecommitdiff
path: root/transport.h
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2016-08-18 22:00:12 -0700
committerJosh Gao <jmgao@google.com>2016-08-19 17:32:50 -0700
commitad425ff375958d16fe69173f4db5804d55b72da6 (patch)
tree9784a650bbae74ea5f0afe733337b0e5e74340e9 /transport.h
parent0caae18a8749c2dc5b8fedd130ed20236b2eccf0 (diff)
downloadadb-ad425ff375958d16fe69173f4db5804d55b72da6.tar.gz
adb: add support for vendor key directories.
Allow directories to be specified in ADB_VENDOR_KEYS. On Linux, monitor this directory for new keys to be added. Additionally, deduplicate keys by hashing their public key. Bug: http://b/29273531 Bug: http://b/30927527 Change-Id: I8d3312b216b7f2c11900f2235f1f1b1d1c7aa767 Test: manually tested by adding a key to a directory, and verifying that devices became authorized after replugging.
Diffstat (limited to 'transport.h')
-rw-r--r--transport.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/transport.h b/transport.h
index d41c8bd..959681f 100644
--- a/transport.h
+++ b/transport.h
@@ -21,6 +21,7 @@
#include <deque>
#include <list>
+#include <memory>
#include <string>
#include <unordered_set>
@@ -107,7 +108,7 @@ public:
return type == kTransportLocal && local_port_for_emulator_ == -1;
}
- RSA* NextKey();
+ std::shared_ptr<RSA> NextKey();
unsigned char token[TOKEN_SIZE] = {};
size_t failed_auth_attempts = 0;
@@ -160,7 +161,7 @@ private:
// A list of adisconnect callbacks called when the transport is kicked.
std::list<adisconnect*> disconnects_;
- std::deque<RSA*> keys_;
+ std::deque<std::shared_ptr<RSA>> keys_;
DISALLOW_COPY_AND_ASSIGN(atransport);
};