CVS patchset: 655
CVS date: 1996/06/20 03:08:31
void MD5Transform(uint32 buf[4], uint32 const in[16]);
int mdfile(char *fn, unsigned char *digest);
+int mdbinfile(char *fn, unsigned char *bindigest);
/*
* This is needed to make RSAREF happy on some MS-DOS compilers.
\r
return 0;\r
}\r
+
+int mdbinfile(char *fn, unsigned char *bindigest) {\r
+ unsigned char buf[1024];\r
+ FILE * fp;\r
+ MD5_CTX ctx;\r
+ int n;\r
+\r
+ fp = fopen(fn, "r");\r
+ if (!fp) {\r
+ return 1;\r
+ }\r
+\r
+ MD5Init(&ctx);\r
+ while ((n = fread(buf, 1, sizeof(buf), fp)) > 0)\r
+ MD5Update(&ctx, buf, n);\r
+ MD5Final(bindigest, &ctx);\r
+ if (ferror(fp)) {\r
+ fclose(fp);\r
+ return 1;\r
+ }\r
+\r
+ fclose(fp);\r
+\r
+ return 0;\r
+}\r