aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/file_id.cc
diff options
context:
space:
mode:
authorluly81 <luly81@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-05-03 20:45:27 +0000
committerluly81 <luly81@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-05-03 20:45:27 +0000
commit265726e56ccfe5960dc7656a7b52db66b47ad482 (patch)
tree5fa919b07d83734c03ed8d7567cabf339a6361f8 /src/common/linux/file_id.cc
parentIssue 152 - Patch by Dave Camp, Reviewer Chris Rogers (diff)
downloadbreakpad-265726e56ccfe5960dc7656a7b52db66b47ad482.tar.xz
Add md5 implementation into code base to get rid of
openssl dependency. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@153 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux/file_id.cc')
-rw-r--r--src/common/linux/file_id.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/linux/file_id.cc b/src/common/linux/file_id.cc
index db074fe1..f8bb586e 100644
--- a/src/common/linux/file_id.cc
+++ b/src/common/linux/file_id.cc
@@ -38,11 +38,11 @@
#include <fcntl.h>
#include <link.h>
#include <sys/mman.h>
-#include <openssl/md5.h>
#include <string.h>
#include <unistd.h>
#include "common/linux/file_id.h"
+#include "common/linux/md5.h"
namespace google_breakpad {
@@ -109,10 +109,12 @@ bool FileID::ElfFileIdentifier(unsigned char identifier[16]) {
const void *text_section = NULL;
int text_size = 0;
if (FindElfTextSection(base, &text_section, &text_size) && (text_size > 0)) {
- MD5_CTX md5;
- MD5_Init(&md5);
- MD5_Update(&md5, text_section, text_size);
- MD5_Final(identifier, &md5);
+ struct MD5Context md5;
+ MD5Init(&md5);
+ MD5Update(&md5,
+ static_cast<const unsigned char*>(text_section),
+ text_size);
+ MD5Final(identifier, &md5);
success = true;
}