[Asterisk-cvs] asterisk utils.c,1.27,1.28
markster at lists.digium.com
markster at lists.digium.com
Thu Feb 17 23:30:31 CST 2005
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv30288
Modified Files:
utils.c
Log Message:
Add OEJ's md5 app (bug #3604)
Index: utils.c
===================================================================
RCS file: /usr/cvsroot/asterisk/utils.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- utils.c 21 Jan 2005 07:06:24 -0000 1.27
+++ utils.c 18 Feb 2005 05:29:31 -0000 1.28
@@ -25,6 +25,7 @@
#include <asterisk/lock.h>
#include <asterisk/utils.h>
#include <asterisk/logger.h>
+#include <asterisk/md5.h>
static char base64[64];
static char b2a[256];
@@ -245,6 +246,21 @@
return(test_errors); /* return 0 on success. */
}
+/*--- ast_md5_hash: Produce 16 char MD5 hash of value. ---*/
+void ast_md5_hash(char *output, char *input)
+{
+ struct MD5Context md5;
+ unsigned char digest[16];
+ char *ptr;
+ int x;
+ MD5Init(&md5);
+ MD5Update(&md5, input, strlen(input));
+ MD5Final(digest, &md5);
+ ptr = output;
+ for (x=0;x<16;x++)
+ ptr += sprintf(ptr, "%2.2x", digest[x]);
+}
+
int ast_base64decode(unsigned char *dst, char *src, int max)
{
int cnt = 0;
More information about the svn-commits
mailing list