summaryrefslogtreecommitdiffstats
path: root/libs/input/EventHub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/input/EventHub.cpp')
-rw-r--r--libs/input/EventHub.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/libs/input/EventHub.cpp b/libs/input/EventHub.cpp
index ed63b2d..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;
@@ -827,7 +828,7 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz
if (readSize == 0 || (readSize < 0 && errno == ENODEV)) {
// Device was removed before INotify noticed.
ALOGW("could not get event, removed? (fd: %d size: %d bufferSize: %d "
- "capacity: %d errno: %d)\n",
+ "capacity: %zu errno: %d)\n",
device->fd, readSize, bufferSize, capacity, errno);
deviceChanged = true;
closeDeviceLocked(device);