summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2013-04-10 09:22:02 -0700
committerKenny Root <kroot@google.com>2013-09-25 09:26:34 -0700
commit8e5b63d045e988f13d1ee9b7797db28fde15bbfc (patch)
treeaaac24d144489aeeca8dcd002579e882445233a6 /adb
parent3c8bdef029cbaa8d8fa18e4e55e51b60e938dd6e (diff)
downloadsystem_core-8e5b63d045e988f13d1ee9b7797db28fde15bbfc.zip
system_core-8e5b63d045e988f13d1ee9b7797db28fde15bbfc.tar.gz
system_core-8e5b63d045e988f13d1ee9b7797db28fde15bbfc.tar.bz2
mincrypt: support SHA-256 hash algorithm
- adds a library to compute the SHA-256 hash - updates the RSA verifier to take an argument specifying either SHA-1 or SHA-256 - updates DumpPublicKey to with new "key" version numbers for specifying SHA-256 - adds new argument to adb auth code to maintain existing behavior (cherry picked from commit 515e1639ef0ab5e3149fafeffce826cf654d616f) Change-Id: Ib35643b3d864742e817ac6e725499b451e45afcf
Diffstat (limited to 'adb')
-rw-r--r--adb/adb_auth_client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/adb/adb_auth_client.c b/adb/adb_auth_client.c
index 763b448..f8d7306 100644
--- a/adb/adb_auth_client.c
+++ b/adb/adb_auth_client.c
@@ -25,6 +25,7 @@
#include "adb_auth.h"
#include "fdevent.h"
#include "mincrypt/rsa.h"
+#include "mincrypt/sha.h"
#define TRACE_TAG TRACE_AUTH
@@ -149,7 +150,7 @@ int adb_auth_verify(void *token, void *sig, int siglen)
list_for_each(item, &key_list) {
key = node_to_item(item, struct adb_public_key, node);
- ret = RSA_verify(&key->key, sig, siglen, token);
+ ret = RSA_verify(&key->key, sig, siglen, token, SHA_DIGEST_SIZE);
if (ret)
break;
}