Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

md5.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  md5_ctx

Functions

Octstrmd5 (Octstr *data)
Octstrmd5digest (Octstr *data)


Function Documentation

Octstr* md5 Octstr data  ) 
 

Definition at line 387 of file md5.c.

References data, md5_final(), md5_init(), md5_update(), octstr_create_from_data, octstr_get_cstr, and octstr_len().

Referenced by main(), md5digest(), and radius_authenticate_pdu().

00388 {
00389     md5_ctx context;
00390     unsigned char digest[16];
00391     Octstr *enc;
00392 
00393     if (data == NULL)
00394         return NULL;
00395 
00396     md5_init(&context);
00397     md5_update(&context, octstr_get_cstr(data), octstr_len(data));
00398     md5_final(digest, &context);
00399 
00400     enc = octstr_create_from_data(digest, 16); 
00401 
00402     return enc; 
00403 }

Here is the call graph for this function:

Octstr* md5digest Octstr data  ) 
 

Definition at line 406 of file md5.c.

References data, md5(), md5_digest(), octstr_create, octstr_destroy(), and octstr_get_cstr.

00407 {
00408     char md5str[33];
00409     Octstr *digest;
00410 
00411     if (data == NULL)
00412         return NULL;
00413 
00414     md5str[0] = '\0';
00415     digest = md5(data);
00416     md5_digest(md5str, octstr_get_cstr(digest));
00417     octstr_destroy(digest);
00418 
00419     digest = octstr_create(md5str);
00420 
00421     return digest;
00422 }

Here is the call graph for this function:

See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.