diff options
author | Dan Albert <danalbert@google.com> | 2014-06-20 22:40:25 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-20 22:40:25 +0000 |
commit | 70c47d70257bb9c448ef935c0c3ae7dfe2f9c07e (patch) | |
tree | ee1e75f16200d3f7ebebea35d2ffb5b4c4872f3c /libs | |
parent | 02616aff5acac6f12864716baaa8eab656367afa (diff) | |
parent | a642a9ea3b2288b431ecb284b94a4657ae62889d (diff) | |
download | frameworks_base-70c47d70257bb9c448ef935c0c3ae7dfe2f9c07e.zip frameworks_base-70c47d70257bb9c448ef935c0c3ae7dfe2f9c07e.tar.gz frameworks_base-70c47d70257bb9c448ef935c0c3ae7dfe2f9c07e.tar.bz2 |
am a642a9ea: am d24f5577: Merge "Use openssl\'s SHA1 instead of bionic\'s."
* commit 'a642a9ea3b2288b431ecb284b94a4657ae62889d':
Use openssl's SHA1 instead of bionic's.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/input/Android.mk | 6 | ||||
-rw-r--r-- | libs/input/EventHub.cpp | 15 |
2 files changed, 12 insertions, 9 deletions
diff --git a/libs/input/Android.mk b/libs/input/Android.mk index 6e944ef..09ecd3a 100644 --- a/libs/input/Android.mk +++ b/libs/input/Android.mk @@ -37,10 +37,12 @@ LOCAL_SHARED_LIBRARIES := \ libskia \ libgui \ libui \ - libinput + libinput \ + libcrypto \ LOCAL_C_INCLUDES := \ - external/skia/include/core + external/openssl/include \ + external/skia/include/core \ LOCAL_MODULE:= libinputservice diff --git a/libs/input/EventHub.cpp b/libs/input/EventHub.cpp index e30a772..e7a691d 100644 --- a/libs/input/EventHub.cpp +++ b/libs/input/EventHub.cpp @@ -48,7 +48,8 @@ #include <sys/epoll.h> #include <sys/ioctl.h> #include <sys/limits.h> -#include <sys/sha1.h> + +#include <openssl/sha.h> /* this macro is used to tell if "bit" is set in "array" * it selects a byte from the array, and does a boolean AND @@ -80,14 +81,14 @@ static inline const char* toString(bool value) { } static String8 sha1(const String8& in) { - SHA1_CTX ctx; - SHA1Init(&ctx); - SHA1Update(&ctx, reinterpret_cast<const u_char*>(in.string()), in.size()); - u_char digest[SHA1_DIGEST_LENGTH]; - SHA1Final(digest, &ctx); + SHA_CTX ctx; + SHA1_Init(&ctx); + SHA1_Update(&ctx, reinterpret_cast<const u_char*>(in.string()), in.size()); + u_char digest[SHA_DIGEST_LENGTH]; + SHA1_Final(digest, &ctx); String8 out; - for (size_t i = 0; i < SHA1_DIGEST_LENGTH; i++) { + for (size_t i = 0; i < SHA_DIGEST_LENGTH; i++) { out.appendFormat("%02x", digest[i]); } return out; |