Building Python 0.9.9: problems with MD5 support

Bennett Todd (bet@std.sbi.com)
Wed, 17 Nov 1993 17:39:57 -0500 (EST)

I'm using gcc 2.4.5 to build Python on a sun4c running sunos4.1.1. When I
tried to add in the MD5 support I ran across a lot of inconsistencies. I'm
still not sure whether it's working right, as I haven't been able to get the
demo/md5test to work, but at least I got a clean compile.

- the comments in the python/src/Makefile suggest that you want a
file md5.doc from rsa.com. The only file I could find there was
md5.txt.

- It claims you wand md5.c, extracted from that text file. In fact,
you want md5c.c, which you then have to rename md5.c.

- md5module.c doesn't compile without some changes. Apparently the
interface to md5.c was different from the interface to md5c.c. I
append diffs after my .signature.

-Bennett
bet@sbi.com

*** python-0.9.9.orig/python/src/md5module.c Mon Dec 14 11:59:44 1992
--- python-0.9.9/python/src/md5module.c Wed Nov 17 16:27:37 1993
***************
*** 31,36 ****
--- 31,37 ----
#include "allobjects.h"
#include "modsupport.h" /* For getargs() etc. */

+ #include "global.h"
#include "md5.h"
typedef struct {
OB_HEAD
***************
*** 134,139 ****
--- 135,141 ----
object *args;
{
MD5_CTX mdContext;
+ unsigned char digest[16];
stringobject *strobjp;

if (!getnoarg(args))
***************
*** 141,149 ****

/* make a temporary copy, and perform the final */
mdContext = self->md5;
! MD5Final(&mdContext);

! return newsizedstringobject((char *)mdContext.digest, 16);
} /* md5_digest() */

static object *
--- 143,151 ----

/* make a temporary copy, and perform the final */
mdContext = self->md5;
! MD5Final(digest, &mdContext);

! return newsizedstringobject(digest, 16);
} /* md5_digest() */

static object *