diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-04 04:05:34 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-04 04:05:34 +0000 |
commit | ce9a0b7459733b1c74d196f6076fdd77858596a9 (patch) | |
tree | ef383426d6a691d67f95b3285a996b13754ccd21 /utils.c | |
parent | 1d2cc0bca445bdfd8a45920b6f52553215ca5414 (diff) |
add MD5 and CHECK_MD5 functions, deprecate MD5 and MD5Check apps (bug #4123)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5567 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils.c')
-rwxr-xr-x | utils.c | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -252,16 +252,17 @@ int test_for_thread_safety(void) /*--- 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]); + 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) |