Index: base/md5.cc |
diff --git a/base/md5.cc b/base/md5.cc |
index 754994c0e562b45b2bc4b90cc2a7c612d14ec5a7..e77885e3a352be137aecba2b6686c85f048e895a 100644 |
--- a/base/md5.cc |
+++ b/base/md5.cc |
@@ -260,6 +260,14 @@ void MD5Final(MD5Digest* digest, MD5Context* context) { |
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ |
} |
+void MD5IntermediateFinal(MD5Digest* digest, const MD5Context* context) { |
+ /* MD5Final mutates the MD5Context*. Make a copy for generating the |
+ intermediate value. */ |
+ MD5Context context_copy; |
+ memcpy(&context_copy, context, sizeof(context_copy)); |
+ MD5Final(digest, &context_copy); |
+} |
+ |
std::string MD5DigestToBase16(const MD5Digest& digest) { |
static char const zEncode[] = "0123456789abcdef"; |