diff options
| author | Sami Tolvanen <samitolvanen@google.com> | 2015-01-28 14:48:49 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-28 14:48:49 +0000 |
| commit | 519ec1aab8b65e1be65a27c5aec6bfb5e8de4704 (patch) | |
| tree | 4ca24f39ff4ecfeacc516ca3e85d8586ded37b0c /adb/adb_auth_host.c | |
| parent | 2017f01f1221b59ad1618def6c88dc2f2c300ab7 (diff) | |
| parent | 42f058f7e867ccb7b3a3dc955b83ee6e236c031f (diff) | |
| download | system_core-519ec1aab8b65e1be65a27c5aec6bfb5e8de4704.zip system_core-519ec1aab8b65e1be65a27c5aec6bfb5e8de4704.tar.gz system_core-519ec1aab8b65e1be65a27c5aec6bfb5e8de4704.tar.bz2 | |
am 42f058f7: am 9c4c5a6e: Merge "Verify token length before adb signs it"
* commit '42f058f7e867ccb7b3a3dc955b83ee6e236c031f':
Verify token length before adb signs it
Diffstat (limited to 'adb/adb_auth_host.c')
| -rw-r--r-- | adb/adb_auth_host.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/adb/adb_auth_host.c b/adb/adb_auth_host.c index a859199..1d48667 100644 --- a/adb/adb_auth_host.c +++ b/adb/adb_auth_host.c @@ -395,6 +395,11 @@ int adb_auth_sign(void *node, void *token, size_t token_size, void *sig) unsigned int len; struct adb_private_key *key = node_to_item(node, struct adb_private_key, node); + if (token_size != TOKEN_SIZE) { + D("Unexpected token size %zd\n", token_size); + return 0; + } + if (!RSA_sign(NID_sha1, token, token_size, sig, &len, key->rsa)) { return 0; } |
