MCPcopy Create free account
hub / github.com/apache/httpd / ap_md5_binary

Function ap_md5_binary

server/util_md5.c:53–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51#include "util_ebcdic.h"
52
53AP_DECLARE(char *) ap_md5_binary(apr_pool_t *p, const unsigned char *buf, int length)
54{
55 apr_md5_ctx_t my_md5;
56 unsigned char hash[APR_MD5_DIGESTSIZE];
57 char *result;
58
59 /*
60 * Take the MD5 hash of the string argument.
61 */
62
63 apr_md5_init(&my_md5);
64#if APR_CHARSET_EBCDIC
65 apr_md5_set_xlate(&my_md5, ap_hdrs_to_ascii);
66#endif
67 apr_md5_update(&my_md5, buf, (unsigned int)length);
68 apr_md5_final(hash, &my_md5);
69
70 result = apr_palloc(p, 2 * APR_MD5_DIGESTSIZE + 1);
71 ap_bin2hex(hash, APR_MD5_DIGESTSIZE, result); /* sets final '\0' */
72 return result;
73}
74
75AP_DECLARE(char *) ap_md5(apr_pool_t *p, const unsigned char *string)
76{

Callers 4

ssl_init_ssl_connectionFunction · 0.85
ssl_find_vhostFunction · 0.85
lua_apr_md5Function · 0.85
ap_md5Function · 0.85

Calls 1

ap_bin2hexFunction · 0.85

Tested by

no test coverage detected