diff options
author | Guido van Rossum <guido@python.org> | 1993-11-01 16:19:05 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-11-01 16:19:05 (GMT) |
commit | 13ecc7a1a2ea79d76533cd55210d4f732c7d324a (patch) | |
tree | ef9c9962def421d5699a9696976abe8ae0871440 /Modules/md5module.c | |
parent | 74901d589d8ee4c29fddda7392100ae525ccc412 (diff) | |
download | cpython-13ecc7a1a2ea79d76533cd55210d4f732c7d324a.zip cpython-13ecc7a1a2ea79d76533cd55210d4f732c7d324a.tar.gz cpython-13ecc7a1a2ea79d76533cd55210d4f732c7d324a.tar.bz2 |
Simplify life for md5: include (slightly modified) md5.h and md5c.c
from RFC 1321 here, and point to that RFC instead of a non-existant
incompatible file on rsa.com.
Diffstat (limited to 'Modules/md5module.c')
-rw-r--r-- | Modules/md5module.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Modules/md5module.c b/Modules/md5module.c index 3347067..8bfbafb 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -128,23 +128,27 @@ md5_update(self, args) return None; } /* md5_update() */ +#define DIGESTLEN 16 /* this is used twice--walrus@umich.edu */ static object * md5_digest(self, args) md5object *self; object *args; { + MD5_CTX mdContext; - stringobject *strobjp; + char aDigest[DIGESTLEN]; + if (!getnoarg(args)) return NULL; /* make a temporary copy, and perform the final */ mdContext = self->md5; - MD5Final(&mdContext); + MD5Final(aDigest, &mdContext); - return newsizedstringobject((char *)mdContext.digest, 16); + return newsizedstringobject((char *)aDigest, DIGESTLEN); } /* md5_digest() */ +#undef DIGESTLEN static object * md5_copy(self, args) @@ -181,8 +185,10 @@ md5_getattr(self, name) return findmethod(md5_methods, (object *)self, name); } /* md5_getattr() */ - -static typeobject MD5type = { +#ifndef _AIX +static +#endif +typeobject MD5type = { OB_HEAD_INIT(&Typetype) 0, /*ob_size*/ "md5", /*tp_name*/ |