Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 64688 invoked by uid 500); 29 Apr 2000 16:00:37 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 64671 invoked by uid 500); 29 Apr 2000 16:00:35 -0000 Delivered-To: apmail-apache-2.0-cvs@apache.org Date: 29 Apr 2000 16:00:34 -0000 Message-ID: <20000429160034.64660.qmail@locus.apache.org> From: wrowe@locus.apache.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/modules/standard mod_auth_digest.c wrowe 00/04/29 09:00:33 Modified: src/include ap.h ap_hooks.h ap_sha1.h src/ap ap_base64.c ap_hooks.c ap_sha1.c ap.dsp src/main util.c src/lib/apr/lib apr_snprintf.c src/modules/standard mod_auth_digest.c Added: src/include ap_base64.h Log: Submitted by: William Rowe Created ap_base64.h to extract those declarations for clarity from ap.h CORE_PRIVATE, httpd.h do not belong in library functions, removed from ap.lib Use apr headers for declarations in ap.lib stuff, kill AP_LONG from ap_sha1.h Move credit to lib/apr/lib/ap_snprintf.c from ap.h for authorship Revision Changes Path 1.11 +0 -23 apache-2.0/src/include/ap.h Index: ap.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/ap.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ap.h 2000/03/31 07:18:46 1.10 +++ ap.h 2000/04/29 16:00:27 1.11 @@ -51,9 +51,6 @@ * information on the Apache Software Foundation, please see * . * - * The ap_vsnprintf/ap_snprintf functions are based on, and used with the - * permission of, the SIO stdio-replacement strx_* functions by Panos - * Tsirigotis for xinetd. */ #ifndef APACHE_AP_H @@ -95,26 +92,6 @@ #ifndef CORE_EXPORT_NONSTD #define CORE_EXPORT_NONSTD API_EXPORT_NONSTD #endif - -/* Simple BASE64 encode/decode functions. - * - * As we might encode binary strings, hence we require the length of - * the incoming plain source. And return the length of what we decoded. - * - * The decoding function takes any non valid char (i.e. whitespace, \0 - * or anything non A-Z,0-9 etc as terminal. - * - * plain strings/binary sequences are not assumed '\0' terminated. Encoded - * strings are neither. But propably should. - * - */ -API_EXPORT(int) ap_base64encode_len(int len); -API_EXPORT(int) ap_base64encode(char * coded_dst, const char *plain_src,int len_plain_src); -API_EXPORT(int) ap_base64encode_binary(char * coded_dst, const unsigned char *plain_src,int len_plain_src); - -API_EXPORT(int) ap_base64decode_len(const char * coded_src); -API_EXPORT(int) ap_base64decode(char * plain_dst, const char *coded_src); -API_EXPORT(int) ap_base64decode_binary(unsigned char * plain_dst, const char *coded_src); #ifdef __cplusplus } 1.14 +57 -0 apache-2.0/src/include/ap_hooks.h Index: ap_hooks.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/ap_hooks.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ap_hooks.h 2000/04/26 07:14:30 1.13 +++ ap_hooks.h 2000/04/29 16:00:28 1.14 @@ -1,5 +1,62 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + #ifndef APACHE_AP_HOOKS_H #define APACHE_AP_HOOKS_H + +/* For ap_array_header_t */ +#include "apr_lib.h" #define AP_DECLARE_HOOK(ret,name,args) \ typedef ret HOOK_##name args; \ 1.4 +4 -6 apache-2.0/src/include/ap_sha1.h Index: ap_sha1.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/ap_sha1.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ap_sha1.h 2000/03/31 07:18:54 1.3 +++ ap_sha1.h 2000/04/29 16:00:28 1.4 @@ -74,13 +74,11 @@ #define AP_SHA1PW_ID "{SHA}" #define AP_SHA1PW_IDLEN 5 -typedef unsigned long AP_LONG; /* a 32-bit quantity */ - typedef struct { - AP_LONG digest[5]; /* message digest */ - AP_LONG count_lo, count_hi; /* 64-bit bit count */ - AP_LONG data[16]; /* SHA data buffer */ - int local; /* unprocessed amount in data */ + ap_uint32_t digest[5]; /* message digest */ + ap_uint32_t count_lo, count_hi; /* 64-bit bit count */ + ap_uint32_t data[16]; /* SHA data buffer */ + int local; /* unprocessed amount in data */ } AP_SHA1_CTX; API_EXPORT(void) ap_sha1_base64(const char *clear, int len, char *out); 1.1 apache-2.0/src/include/ap_base64.h Index: ap_base64.h =================================================================== /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * * The ap_vsnprintf/ap_snprintf functions are based on, and used with the * permission of, the SIO stdio-replacement strx_* functions by Panos * Tsirigotis for xinetd. */ #ifndef APACHE_BASE64_H #define APACHE_BASE64_H #ifdef __cplusplus extern "C" { #endif /* Simple BASE64 encode/decode functions. * * As we might encode binary strings, hence we require the length of * the incoming plain source. And return the length of what we decoded. * * The decoding function takes any non valid char (i.e. whitespace, \0 * or anything non A-Z,0-9 etc as terminal. * * plain strings/binary sequences are not assumed '\0' terminated. Encoded * strings are neither. But propably should. * */ API_EXPORT(int) ap_base64encode_len(int len); API_EXPORT(int) ap_base64encode(char * coded_dst, const char *plain_src,int len_plain_src); API_EXPORT(int) ap_base64encode_binary(char * coded_dst, const unsigned char *plain_src,int len_plain_src); API_EXPORT(int) ap_base64decode_len(const char * coded_src); API_EXPORT(int) ap_base64decode(char * plain_dst, const char *coded_src); API_EXPORT(int) ap_base64decode_binary(unsigned char * plain_dst, const char *coded_src); #ifdef __cplusplus } #endif #endif /* !APACHE_BASE64_H */ 1.7 +1 -5 apache-2.0/src/ap/ap_base64.c Index: ap_base64.c =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/ap_base64.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ap_base64.c 2000/04/07 02:45:11 1.6 +++ ap_base64.c 2000/04/29 16:00:29 1.7 @@ -62,12 +62,8 @@ * ugly 'len' functions, which is quite a nasty cost. */ -#define CORE_PRIVATE -#include - -#include "ap.h" - #include "ap_config.h" +#include "ap_base64.h" #ifdef CHARSET_EBCDIC #include "ebcdic.h" #endif /* CHARSET_EBCDIC */ 1.13 +0 -2 apache-2.0/src/ap/ap_hooks.c Index: ap_hooks.c =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/ap_hooks.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ap_hooks.c 2000/04/14 15:58:16 1.12 +++ ap_hooks.c 2000/04/29 16:00:30 1.13 @@ -1,8 +1,6 @@ #include "ap_config.h" -#include "httpd.h" #include "ap_hooks.h" #include -#include #if 0 #define ap_palloc(pool,size) malloc(size) 1.7 +13 -15 apache-2.0/src/ap/ap_sha1.c Index: ap_sha1.c =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/ap_sha1.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ap_sha1.c 2000/03/31 07:02:31 1.6 +++ ap_sha1.c 2000/04/29 16:00:30 1.7 @@ -82,12 +82,10 @@ * This code is hereby placed in the public domain */ -#include - #include "ap_config.h" -#include "httpd.h" #include "ap_sha1.h" -#include "ap.h" +#include "ap_base64.h" +#include "apr_lib.h" #ifdef CHARSET_EBCDIC #include "ebcdic.h" #endif /*CHARSET_EBCDIC*/ @@ -126,7 +124,7 @@ static void sha_transform(AP_SHA1_CTX *sha_info) { int i; - AP_LONG temp, A, B, C, D, E, W[80]; + ap_uint32_t temp, A, B, C, D, E, W[80]; for (i = 0; i < 16; ++i) { W[i] = sha_info->data[i]; @@ -198,13 +196,13 @@ /* change endianness of data */ /* count is the number of bytes to do an endian flip */ -static void maybe_byte_reverse(AP_LONG *buffer, int count) +static void maybe_byte_reverse(ap_uint32_t *buffer, int count) { int i; AP_BYTE ct[4], *cp; if (isLittleEndian()) { /* do the swap only if it is little endian */ - count /= sizeof(AP_LONG); + count /= sizeof(ap_uint32_t); cp = (AP_BYTE *) buffer; for (i = 0; i < count; ++i) { ct[0] = cp[0]; @@ -215,7 +213,7 @@ cp[1] = ct[2]; cp[2] = ct[1]; cp[3] = ct[0]; - cp += sizeof(AP_LONG); + cp += sizeof(ap_uint32_t); } } } @@ -242,11 +240,11 @@ { unsigned int i; - if ((sha_info->count_lo + ((AP_LONG) count << 3)) < sha_info->count_lo) { + if ((sha_info->count_lo + ((ap_uint32_t) count << 3)) < sha_info->count_lo) { ++sha_info->count_hi; } - sha_info->count_lo += (AP_LONG) count << 3; - sha_info->count_hi += (AP_LONG) count >> 29; + sha_info->count_lo += (ap_uint32_t) count << 3; + sha_info->count_hi += (ap_uint32_t) count >> 29; if (sha_info->local) { i = SHA_BLOCKSIZE - sha_info->local; if (i > count) { @@ -282,11 +280,11 @@ int i; const AP_BYTE *buffer = (const AP_BYTE *) buf; - if ((sha_info->count_lo + ((AP_LONG) count << 3)) < sha_info->count_lo) { + if ((sha_info->count_lo + ((ap_uint32_t) count << 3)) < sha_info->count_lo) { ++sha_info->count_hi; } - sha_info->count_lo += (AP_LONG) count << 3; - sha_info->count_hi += (AP_LONG) count >> 29; + sha_info->count_lo += (ap_uint32_t) count << 3; + sha_info->count_hi += (ap_uint32_t) count >> 29; /* Is there a remainder of the previous Update operation? */ if (sha_info->local) { i = SHA_BLOCKSIZE - sha_info->local; @@ -326,7 +324,7 @@ AP_SHA1_CTX *sha_info) { int count, i, j; - AP_LONG lo_bit_count, hi_bit_count, k; + ap_uint32_t lo_bit_count, hi_bit_count, k; lo_bit_count = sha_info->count_lo; hi_bit_count = sha_info->count_hi; 1.7 +12 -0 apache-2.0/src/ap/ap.dsp Index: ap.dsp =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/ap.dsp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ap.dsp 2000/03/21 23:26:31 1.6 +++ ap.dsp 2000/04/29 16:00:30 1.7 @@ -95,6 +95,18 @@ # Begin Group "Header Files" # PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\ap_base64.h +# End Source File +# Begin Source File + +SOURCE=..\include\ap_hooks.h +# End Source File +# Begin Source File + +SOURCE=..\include\ap_sha1.h +# End Source File # End Group # End Target # End Project 1.40 +1 -1 apache-2.0/src/main/util.c Index: util.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/util.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- util.c 2000/04/24 12:00:43 1.39 +++ util.c 2000/04/29 16:00:31 1.40 @@ -72,7 +72,7 @@ #define CORE_PRIVATE #include "ap_config.h" -#include "ap.h" +#include "ap_base64.h" #include "httpd.h" #include "http_main.h" #include "http_log.h" 1.18 +4 -0 apache-2.0/src/lib/apr/lib/apr_snprintf.c Index: apr_snprintf.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/lib/apr_snprintf.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- apr_snprintf.c 2000/04/28 18:27:40 1.17 +++ apr_snprintf.c 2000/04/29 16:00:32 1.18 @@ -50,6 +50,10 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . + * + * The ap_vsnprintf/ap_snprintf functions are based on, and used with the + * permission of, the SIO stdio-replacement strx_* functions by Panos + * Tsirigotis for xinetd. */ #ifdef WIN32 1.14 +1 -1 apache-2.0/src/modules/standard/mod_auth_digest.c Index: mod_auth_digest.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_auth_digest.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_auth_digest.c 2000/04/26 07:14:37 1.13 +++ mod_auth_digest.c 2000/04/29 16:00:33 1.14 @@ -94,7 +94,7 @@ #include "http_request.h" #include "http_log.h" #include "http_protocol.h" -#include "ap.h" +#include "ap_base64.h" #include "ap_ctype.h" #include "util_uri.h" #include "util_md5.h"