- MD_Update(&m,&(local_md[MD_DIGEST_LENGTH/2]),MD_DIGEST_LENGTH/2);
- MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c));
-#ifndef PURIFY
- MD_Update(&m,buf,j); /* purify complains */
+ if (curr_time) /* just in the first iteration to save time */
+ {
+ if (!MD_Update(&m,(unsigned char*)&curr_time,
+ sizeof curr_time))
+ goto err;
+ if (!MD_Update(&m,(unsigned char*)&tv,
+ sizeof tv))
+ goto err;
+ curr_time = 0;
+ }
+ if (!MD_Update(&m,local_md,MD_DIGEST_LENGTH))
+ goto err;
+ if (!MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c)))
+ goto err;
+
+#ifndef PURIFY /* purify complains */
+ /* The following line uses the supplied buffer as a small
+ * source of entropy: since this buffer is often uninitialised
+ * it may cause programs such as purify or valgrind to
+ * complain. So for those builds it is not used: the removal
+ * of such a small source of entropy has negligible impact on
+ * security.
+ */
+ if (!MD_Update(&m,buf,j))
+ goto err;