1 /* Copyright 1993-95 by Carl Harris, Jr.
4 * Distribute freely, except: don't remove my name from the source or
5 * documentation (don't take credit for my work), mark your changes (don't
6 * get me blamed for your possible bugs), don't alter or remove this
7 * notice. May be sold if buildable source is provided to buyer. No
8 * warrantee of any kind, express or implied, is included with this
9 * software; use at your own risk, responsibility for damages (if any) to
10 * anyone resulting from the use of this software rests entirely with the
13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
14 * I'll try to keep a version up to date. I can be reached as follows:
15 * Carl Harris <ceharris@mal.com>
19 /***********************************************************************
22 programmer: Carl Harris, ceharris@mal.com
23 description: Simple interface to MD5 module.
26 Revision 1.1 1996/06/28 14:36:57 esr
29 Revision 1.1 1995/08/10 00:32:33 ceharris
30 Preparation for 3.0b3 beta release:
31 - added code for --kill/--keep, --limit, --protocol, --flush
32 options; --pop2 and --pop3 options now obsoleted by --protocol.
33 - added support for APOP authentication, including --with-APOP
34 argument for configure.
35 - provisional and broken support for RPOP
36 - added buffering to SockGets and SockRead functions.
37 - fixed problem of command-line options not being correctly
38 carried into the merged options record.
40 ***********************************************************************/
44 #if defined(STDC_HEADERS)
56 unsigned char digest[16];
57 static char ascii_digest [33];
60 MD5Update(&context, s, strlen(s));
61 MD5Final(digest, &context);
63 for (i = 0; i < 16; i++)
64 sprintf(ascii_digest+2*i, "%02x", digest[i]);