• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • Directories
  • File List
  • Globals

md5utils.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
00003  * rights reserved.
00004  * 
00005  * License to copy and use this software is granted provided that it
00006  * is identified as the "RSA Data Security, Inc. MD5 Message-Digest
00007  * Algorithm" in all material mentioning or referencing this software
00008  * or this function.
00009  * 
00010  * License is also granted to make and use derivative works provided
00011  * that such works are identified as "derived from the RSA Data
00012  * Security, Inc. MD5 Message-Digest Algorithm" in all material
00013  * mentioning or referencing the derived work.
00014  * 
00015  * RSA Data Security, Inc. makes no representations concerning either
00016  * the merchantability of this software or the suitability of this
00017  * software for any particular purpose. It is provided "as is"
00018  * without express or implied warranty of any kind.
00019  * 
00020  * These notices must be retained in any copies of any part of this
00021  * documentation and/or software.
00022  */
00023 
00031 #include <stdio.h>
00032 #include <time.h>
00033 #include <string.h>
00034 #include "md5.h"
00035 #include "md5utils.h"
00036 #include "dprint.h"
00037 #include "ut.h"
00038 
00039 
00050 void MD5StringArray (char *dst, str src[], int size)
00051 {
00052         MD5_CTX context;
00053         unsigned char digest[16];
00054         int i;
00055         int len;
00056         char *s;
00057 
00058         MD5Init (&context);
00059         for (i=0; i<size; i++) {
00060                 trim_len( len, s, src[i] );
00061                 if (len > 0)
00062                         MD5Update (&context, s, len);
00063   }
00064   U_MD5Final (digest, &context);
00065 
00066   string2hex(digest, 16, dst );
00067   DBG("DEBUG: MD5 calculated: %.*s\n", MD5_LEN, dst );
00068 
00069 }

Generated on Tue May 22 2012 13:10:11 for SIP Router by  doxygen 1.7.1