Index: base/md5.cc |
diff --git a/base/md5.cc b/base/md5.cc |
index 754994c0e562b45b2bc4b90cc2a7c612d14ec5a7..4e26febda0f1c0db25514a39bb00834de7da100f 100644 |
--- a/base/md5.cc |
+++ b/base/md5.cc |
@@ -260,6 +260,15 @@ void MD5Final(MD5Digest* digest, MD5Context* context) { |
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ |
} |
+/* |
+ * Clone the context and use the clone to generate the digest. |
+ */ |
+void MD5IntermediateFinal(MD5Digest* digest, MD5Context* context) { |
+ 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"; |