summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Tolvanen2015-01-28 08:32:51 -0600
committerGerrit Code Review2015-01-28 08:32:52 -0600
commit9c4c5a6ed934490ba0fcce661594975a6f4c2c89 (patch)
tree2dbffcd0c85f1d8ae911ed4d759e7acd805e1802
parenta034362be4dc69d3432d7587089d371dc871e811 (diff)
parent7b9c20d3b2aad8b2f67de9478d3d44cc6deff52c (diff)
downloadplatform-system-core-9c4c5a6ed934490ba0fcce661594975a6f4c2c89.tar.gz
platform-system-core-9c4c5a6ed934490ba0fcce661594975a6f4c2c89.tar.xz
platform-system-core-9c4c5a6ed934490ba0fcce661594975a6f4c2c89.zip
Merge "Verify token length before adb signs it"
-rw-r--r--adb/adb_auth_host.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/adb/adb_auth_host.c b/adb/adb_auth_host.c
index a85919989..1d486676e 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)
395 unsigned int len; 395 unsigned int len;
396 struct adb_private_key *key = node_to_item(node, struct adb_private_key, node); 396 struct adb_private_key *key = node_to_item(node, struct adb_private_key, node);
397 397
398 if (token_size != TOKEN_SIZE) {
399 D("Unexpected token size %zd\n", token_size);
400 return 0;
401 }
402
398 if (!RSA_sign(NID_sha1, token, token_size, sig, &len, key->rsa)) { 403 if (!RSA_sign(NID_sha1, token, token_size, sig, &len, key->rsa)) {
399 return 0; 404 return 0;
400 } 405 }