]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Finished move of ap_md5 routines to apr_md5. Removed ap_md5.h.
authorRoy T. Fielding <fielding@apache.org>
Sun, 23 Apr 2000 02:32:58 +0000 (02:32 +0000)
committerRoy T. Fielding <fielding@apache.org>
Sun, 23 Apr 2000 02:32:58 +0000 (02:32 +0000)
Replaced more magic numbers with MD5_DIGESTSIZE.  Yuck.

Submitted by: William Rowe, Roy Fielding

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85017 13f79535-47bb-0310-9956-ffa450edef68

include/util_md5.h
modules/http/http_core.c
modules/proxy/proxy_util.c
server/util_md5.c
support/htdigest.c

index 9f94e265a5b35068a15cc3f53da07d5ab6ff3951..5f03ccfa3e36b5b03520ccaea1e3fa6a3d16accf 100644 (file)
 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
index 25d9b7e464bf620422e1d656e00657771b07b464..63f55a324b22dcc5a9204773a3869d04de103643 100644 (file)
@@ -2560,7 +2560,7 @@ static int default_handler(request_rec *r)
     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);
index 8380258870b2ca9ba80af125662874436cb811f4..79f346ab96adbb0ef9d8b2b1037b24980def4151 100644 (file)
@@ -59,7 +59,7 @@
 /* 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. */
@@ -667,8 +667,8 @@ int ap_proxy_liststr(const char *list, const char *val)
  */
 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;
@@ -714,8 +714,8 @@ void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength)
 
 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;
index 8af5cc61624e3adbed6d04a56ef22d7a39203eb9..f9e58ad127f5f296decdefd8024e31e2a88c881a 100644 (file)
@@ -93,8 +93,8 @@
 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;
 
@@ -106,7 +106,7 @@ API_EXPORT(char *) ap_md5_binary(ap_pool_t *p, const unsigned char *buf, int len
     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];
     }
@@ -165,7 +165,7 @@ API_EXPORT(char *) ap_md5(ap_pool_t *p, const unsigned char *string)
 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;
@@ -194,7 +194,7 @@ API_EXPORT(char *) ap_md5contextTo64(ap_pool_t *a, AP_MD5_CTX * context)
 
 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;
@@ -216,7 +216,7 @@ API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile, int convert)
 
 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;
index 8730c5f34581eba92c5f5c26dbc5fc1d5cfcb907..0b2c176da32d26198d2a1420116fae1d5c3882d4 100644 (file)
  */
 
 #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
@@ -142,8 +140,8 @@ static void putline(FILE *f, char *l)
 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];
@@ -174,7 +172,7 @@ static void add_password(char *user, char *realm, FILE *f)
     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");