commit | 9c4c5a6ed934490ba0fcce661594975a6f4c2c89 | [log] [tgz] |
---|---|---|
author | Sami Tolvanen <samitolvanen@google.com> | Wed Jan 28 14:32:51 2015 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Wed Jan 28 14:32:52 2015 +0000 |
tree | 2dbffcd0c85f1d8ae911ed4d759e7acd805e1802 | |
parent | a034362be4dc69d3432d7587089d371dc871e811 [diff] | |
parent | 7b9c20d3b2aad8b2f67de9478d3d44cc6deff52c [diff] |
Merge "Verify token length before adb signs it"
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 @@ 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; }