extern "C" {
#endif
-#include "ap_md5.h"
+#include "apr_md5.h"
API_EXPORT(char *) ap_md5(ap_pool_t *a, const unsigned char *string);
API_EXPORT(char *) ap_md5_binary(ap_pool_t *a, const unsigned char *buf, int len);
-API_EXPORT(char *) ap_md5contextTo64(ap_pool_t *p, AP_MD5_CTX * context);
+API_EXPORT(char *) ap_md5contextTo64(ap_pool_t *p, ap_md5_ctx_t *context);
API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile);
#ifdef __cplusplus
ap_mmap_offset((void**)&addr, mm ,0);
if (d->content_md5 & 1) {
- AP_MD5_CTX context;
+ ap_md5_ctx_t context;
ap_MD5Init(&context);
ap_MD5Update(&context, addr, (unsigned int)r->finfo.size);
/* Utility routines for Apache proxy */
#include "mod_proxy.h"
#include "http_main.h"
-#include "ap_md5.h"
+#include "apr_md5.h"
#include "http_log.h"
#include "util_uri.h"
#include "util_date.h" /* get ap_checkmask() decl. */
*/
void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength)
{
- AP_MD5_CTX context;
- unsigned char digest[16];
+ ap_md5_ctx_t context;
+ unsigned char digest[MD5_DIGESTSIZE];
char tmp[26];
int i, k, d;
unsigned int x;
void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength)
{
- AP_MD5_CTX context;
- unsigned char digest[16];
+ ap_md5_ctx_t context;
+ unsigned char digest[MD5_DIGESTSIZE];
char tmp[22];
int i, k, d;
unsigned int x;
API_EXPORT(char *) ap_md5_binary(ap_pool_t *p, const unsigned char *buf, int length)
{
const char *hex = "0123456789abcdef";
- AP_MD5_CTX my_md5;
- unsigned char hash[16];
+ ap_md5_ctx_t my_md5;
+ unsigned char hash[MD5_DIGESTSIZE];
char *r, result[33];
int i;
ap_MD5Update(&my_md5, buf, (unsigned int)length);
ap_MD5Final(hash, &my_md5);
- for (i = 0, r = result; i < 16; i++) {
+ for (i = 0, r = result; i < MD5_DIGESTSIZE; i++) {
*r++ = hex[hash[i] >> 4];
*r++ = hex[hash[i] & 0xF];
}
static char basis_64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-API_EXPORT(char *) ap_md5contextTo64(ap_pool_t *a, AP_MD5_CTX * context)
+API_EXPORT(char *) ap_md5contextTo64(ap_pool_t *a, ap_md5_ctx_t *context)
{
unsigned char digest[18];
char *encodedDigest;
API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile, int convert)
{
- AP_MD5_CTX context;
+ ap_md5_ctx_t context;
unsigned char buf[1000];
long length = 0;
int nbytes;
API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile)
{
- AP_MD5_CTX context;
+ ap_md5_ctx_t context;
unsigned char buf[1000];
long length = 0;
ap_ssize_t nbytes;
*/
#include "apr_lib.h"
-#include "ap_config.h"
-#include <sys/types.h>
-#include "ap.h"
-#include "ap_md5.h"
+#include "apr_md5.h"
+#include "apr_portable.h"
#if defined(MPE) || defined(QNX) || defined(WIN32) || defined(__TANDEM) || defined(BEOS)
#include <signal.h>
#else
static void add_password(char *user, char *realm, FILE *f)
{
char *pw;
- AP_MD5_CTX context;
- unsigned char digest[16];
+ ap_md5_ctx_t context;
+ unsigned char digest[MD5_DIGESTSIZE];
char string[MAX_STRING_LEN];
char pwin[MAX_STRING_LEN];
char pwv[MAX_STRING_LEN];
ap_MD5Update(&context, (unsigned char *) string, strlen(string));
ap_MD5Final(digest, &context);
- for (i = 0; i < 16; i++)
+ for (i = 0; i < MD5_DIGESTSIZE; i++)
fprintf(f, "%02x", digest[i]);
fprintf(f, "\n");