diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.cc index ebb8c40e1b7..50502e4cdc8 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.cc @@ -53,19 +53,19 @@ bool FileID::FileIdentifier(unsigned char identifier[16]) { if (fd == -1) return false; - MD5_CTX md5; - MD5_Init(&md5); + MD5Context md5; + MD5Init(&md5); // Read 4k x 2 bytes at a time. This is faster than just 4k bytes, but // doesn't seem to be an unreasonable size for the stack. unsigned char buffer[4096 * 2]; size_t buffer_size = sizeof(buffer); while ((buffer_size = read(fd, buffer, buffer_size) > 0)) { - MD5_Update(&md5, buffer, buffer_size); + MD5Update(&md5, buffer, buffer_size); } close(fd); - MD5_Final(identifier, &md5); + MD5Final(identifier, &md5); return true; } diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc index 486cf53625a..f3e839ea0ef 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc @@ -37,7 +37,6 @@ extern "C" { // necessary for Leopard #include #include #include - #include #include #include #include @@ -47,6 +46,7 @@ extern "C" { // necessary for Leopard #include } +#include "common/md5.h" #include "common/mac/macho_id.h" #include "common/mac/macho_walker.h" #include "common/mac/macho_utilities.h" @@ -117,7 +117,7 @@ void MachoID::UpdateCRC(unsigned char *bytes, size_t size) { } void MachoID::UpdateMD5(unsigned char *bytes, size_t size) { - MD5_Update(&md5_context_, bytes, size); + MD5Update(&md5_context_, bytes, size); } void MachoID::UpdateSHA1(unsigned char *bytes, size_t size) { @@ -225,15 +225,12 @@ bool MachoID::MD5(int cpu_type, unsigned char identifier[16]) { MachoWalker walker(path_, WalkerCB, this); update_function_ = &MachoID::UpdateMD5; - if (MD5_Init(&md5_context_)) { - if (!walker.WalkHeader(cpu_type)) - return false; + MD5Init(&md5_context_); + if (!walker.WalkHeader(cpu_type)) + return false; - MD5_Final(identifier, &md5_context_); - return true; - } - - return false; + MD5Final(identifier, &md5_context_); + return true; } bool MachoID::SHA1(int cpu_type, unsigned char identifier[16]) { diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h index ea01a6d7a97..9f4ea823fa7 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h @@ -36,9 +36,10 @@ #include #include -#include #include +#include "common/md5.h" + namespace MacFileUtilities { class MachoWalker; @@ -110,7 +111,7 @@ class MachoID { uint32_t crc_; // The MD5 context - MD5_CTX md5_context_; + MD5Context md5_context_; // The SHA1 context SHA_CTX sha1_context_;