mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
add MD5 and CHECK_MD5 functions, deprecate MD5 and MD5Check apps (bug #4123)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
21
utils.c
21
utils.c
@@ -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)
|
||||
|
Reference in New Issue
Block a user