Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1685)

Unified Diff: mozilla/security/nss/lib/freebl/md5.c

Issue 12207073: Update to NSS 3.14.3 Beta 1 for the TLS CBC constant-time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mozilla/security/nss/lib/freebl/md5.c
===================================================================
--- mozilla/security/nss/lib/freebl/md5.c (revision 180595)
+++ mozilla/security/nss/lib/freebl/md5.c (working copy)
@@ -523,7 +523,8 @@
md5_compress(cx, cx->u.w);
/* Copy the resulting values out of the chain variables into return buf. */
- *digestLen = MD5_HASH_LEN;
+ if (digestLen)
+ *digestLen = MD5_HASH_LEN;
#ifndef IS_LITTLE_ENDIAN
cx->cv[0] = lendian(cx->cv[0]);
cx->cv[1] = lendian(cx->cv[1]);
@@ -533,6 +534,32 @@
memcpy(digest, cx->cv, MD5_HASH_LEN);
}
+void
+MD5_EndRaw(MD5Context *cx, unsigned char *digest,
+ unsigned int *digestLen, unsigned int maxDigestLen)
+{
+#ifndef IS_LITTLE_ENDIAN
+ PRUint32 tmp;
+#endif
+ PRUint32 cv[4];
+
+ if (maxDigestLen < MD5_HASH_LEN) {
+ PORT_SetError(SEC_ERROR_INVALID_ARGS);
+ return;
+ }
+
+ memcpy(cv, cx->cv, sizeof(cv));
wtc 2013/02/08 02:17:52 Why do the <Hash>_EndRaw functions need to copy th
agl 2013/02/08 02:26:03 (Late - brain may not be working.) The EndRaw fun
+#ifndef IS_LITTLE_ENDIAN
+ cv[0] = lendian(cv[0]);
+ cv[1] = lendian(cv[1]);
+ cv[2] = lendian(cv[2]);
+ cv[3] = lendian(cv[3]);
+#endif
+ memcpy(digest, cv, MD5_HASH_LEN);
+ if (digestLen)
+ *digestLen = MD5_HASH_LEN;
+}
+
unsigned int
MD5_FlattenSize(MD5Context *cx)
{

Powered by Google App Engine
This is Rietveld 408576698