You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by be...@hyperreal.org on 1998/09/06 19:12:19 UTC
cvs commit: apache-1.3/src/main util_md5.c
ben 98/09/06 10:12:19
Modified: src/include util_md5.h
src/main util_md5.c
Log:
Add binary MD5.
Reviewed by: Martin Kraemer
Revision Changes Path
1.16 +2 -1 apache-1.3/src/include/util_md5.h
Index: util_md5.h
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/include/util_md5.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- util_md5.h 1998/05/29 18:20:49 1.15
+++ util_md5.h 1998/09/06 17:12:18 1.16
@@ -64,7 +64,8 @@
#include "ap_md5.h"
-API_EXPORT(char *) ap_md5(pool *a, unsigned char *string);
+API_EXPORT(char *) ap_md5(pool *a, const unsigned char *string);
+API_EXPORT(char *) ap_md5_binary(pool *a, const unsigned char *buf, int len);
API_EXPORT(char *) ap_md5contextTo64(pool *p, AP_MD5_CTX * context);
API_EXPORT(char *) ap_md5digest(pool *p, FILE *infile);
1.15 +7 -2 apache-1.3/src/main/util_md5.c
Index: util_md5.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/util_md5.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- util_md5.c 1998/04/11 12:00:32 1.14
+++ util_md5.c 1998/09/06 17:12:18 1.15
@@ -87,7 +87,7 @@
#include "httpd.h"
#include "util_md5.h"
-API_EXPORT(char *) ap_md5(pool *p, unsigned char *string)
+API_EXPORT(char *) ap_md5_binary(pool *p, const unsigned char *buf, int length)
{
AP_MD5_CTX my_md5;
unsigned char hash[16];
@@ -99,7 +99,7 @@
*/
ap_MD5Init(&my_md5);
- ap_MD5Update(&my_md5, string, strlen((const char *) string));
+ ap_MD5Update(&my_md5, buf, length);
ap_MD5Final(hash, &my_md5);
for (i = 0, r = result; i < 16; i++, r += 2)
@@ -107,6 +107,11 @@
*r = '\0';
return ap_pstrdup(p, result);
+}
+
+API_EXPORT(char *) ap_md5(pool *p, const unsigned char *string)
+{
+ return ap_md5_binary(p, string, strlen(string));
}
/* these portions extracted from mpack, John G. Myers - jgm+@cmu.edu */
Re: cvs commit: apache-1.3/src/main util_md5.c
Posted by Alexei Kosut <ak...@leland.Stanford.EDU>.
On 6 Sep 1998 ben@hyperreal.org wrote:
> ben 98/09/06 10:12:19
>
> Modified: src/include util_md5.h
> src/main util_md5.c
> Log:
> Add binary MD5.
You might want to adjust MODULE_MAGIC_NUMBER (and recall that until we get
a Win32 .def file set up, adding functions does necessitate a full major
number bump)...
-- Alexei Kosut <ak...@stanford.edu> <http://www.stanford.edu/~akosut/>
Stanford University, Class of 2001 * Apache <http://www.apache.org> *