MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / MD5StringArray

Function MD5StringArray

md5utils.c:46–62  ·  view source on GitHub ↗

! \brief * Calculate a MD5 digests over a string array and stores * the result in the destination char array. * This function assumes 32 bytes in the destination buffer. * \param dest destination * \param src string input array * \param size elements in the input array */

Source from the content-addressed store, hash-verified

44 * \param size elements in the input array
45 */
46void MD5StringArray(char *dest, str src[], unsigned int size)
47{
48 MD5_CTX context;
49 char digest[16];
50 int i, len;
51 char *tmp;
52
53 MD5Init (&context);
54 for (i=0; i < size; i++) {
55 trim_len(len, tmp, src[i]);
56 MD5Update(&context, tmp, len);
57 }
58 MD5Final(digest, &context);
59
60 string2hex(digest, 16, dest);
61 LM_DBG("MD5 calculated: %.*s\n", MD5_LEN, dest);
62}
63
64/*! \brief
65 * Calculate a MD5 digest over a file.

Callers 13

set_sl_branchFunction · 0.85
calc_tag_suffixFunction · 0.85
gen_call_id_ftagFunction · 0.85
msrpua_gen_idFunction · 0.85
generate_tagFunction · 0.85
reginfo_usrloc_cbFunction · 0.85
uac_initFunction · 0.85
gen_fromtagFunction · 0.85
msrp_fwd_requestFunction · 0.85
msrp_send_reportFunction · 0.85
msrp_send_requestFunction · 0.85

Calls 4

MD5InitFunction · 0.85
MD5UpdateFunction · 0.85
MD5FinalFunction · 0.85
string2hexFunction · 0.85

Tested by

no test coverage detected