--------------------- PatchSet 1700 Date: 2001/03/09 08:24:15 Author: rbcollins Branch: auth_rewrite Tag: (none) Log: type fixes so both NTLM helpers should build on slowaris. Members: include/ntlmauth.h:1.1.4.5->1.1.4.6 src/auth/ntlm/helpers/NTLMSSP/libntlmssp.c:1.1.2.7->1.1.2.8 src/auth/ntlm/helpers/NTLMSSP/ntlm.h:1.1.2.6->1.1.2.7 src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c:1.1.2.15->1.1.2.16 src/auth/ntlm/helpers/NTLMSSP/smbval/md4.c:1.1.2.2->1.1.2.3 src/auth/ntlm/helpers/NTLMSSP/smbval/rfcnb-util.h:1.1.2.1->1.1.2.2 src/auth/ntlm/helpers/NTLMSSP/smbval/smblib-priv.h:1.1.2.1->1.1.2.2 src/auth/ntlm/helpers/NTLMSSP/smbval/std-defines.h:1.1.2.1->1.1.2.2 src/auth/ntlm/helpers/NTLMSSP/smbval/std-includes.h:1.1.2.1->1.1.2.2 src/auth/ntlm/helpers/fakeauth/fakeauth_auth.c:1.1.2.1->1.1.2.2 src/auth/ntlm/helpers/fakeauth/ntlm.h:1.1.2.2->1.1.2.3 Index: squid/include/ntlmauth.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/ntlmauth.h,v retrieving revision 1.1.4.5 retrieving revision 1.1.4.6 diff -u -r1.1.4.5 -r1.1.4.6 --- squid/include/ntlmauth.h 26 Feb 2001 05:27:02 -0000 1.1.4.5 +++ squid/include/ntlmauth.h 9 Mar 2001 08:24:15 -0000 1.1.4.6 @@ -133,7 +133,7 @@ * among the different signature types. */ typedef struct _ntlmhdr { char signature[8]; /* "NTLMSSP" */ - int32_t type; /* LSWAP(0x1) */ + int32_t type; /* One of the NTLM_* types above. */ } ntlmhdr; /* Negotiation request sent by client */ Index: squid/src/auth/ntlm/helpers/NTLMSSP/libntlmssp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/Attic/libntlmssp.c,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- squid/src/auth/ntlm/helpers/NTLMSSP/libntlmssp.c 10 Feb 2001 17:58:35 -0000 1.1.2.7 +++ squid/src/auth/ntlm/helpers/NTLMSSP/libntlmssp.c 9 Mar 2001 08:24:15 -0000 1.1.2.8 @@ -137,7 +137,7 @@ return 0; } -const char * +char * make_challenge(char *domain, char *domain_controller) { if (init_challenge(domain, domain_controller) > 0) { Index: squid/src/auth/ntlm/helpers/NTLMSSP/ntlm.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/Attic/ntlm.h,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- squid/src/auth/ntlm/helpers/NTLMSSP/ntlm.h 8 Mar 2001 12:01:36 -0000 1.1.2.6 +++ squid/src/auth/ntlm/helpers/NTLMSSP/ntlm.h 9 Mar 2001 08:24:15 -0000 1.1.2.7 @@ -81,7 +81,7 @@ #define NTLM_NOT_CONNECTED 10 -const char *make_challenge(char *domain, char *controller); +char *make_challenge(char *domain, char *controller); extern char *ntlm_check_auth(ntlm_authenticate * auth, int auth_length); extern char *fetch_credentials(ntlm_authenticate * auth, int auth_length); void dc_disconnect(void); Index: squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/Attic/ntlm_auth.c,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -u -r1.1.2.15 -r1.1.2.16 --- squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c 8 Mar 2001 12:01:36 -0000 1.1.2.15 +++ squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c 9 Mar 2001 08:24:15 -0000 1.1.2.16 @@ -211,22 +211,28 @@ obtain_challenge() { int j = 0; - const char *ch; + char *ch=NULL; debug("obtain_challenge: getting new challenge\n"); for (j = 0; j < numcontrollers; j++) { if (current_dc->status == DC_OK) { - debug("getting challenge from %s%s\n", current_dc->domain, current_dc->controller); + debug("getting challenge from %s\\%s (attempt no. %d)\n", current_dc->domain, current_dc->controller, j+1); ch = make_challenge(current_dc->domain, current_dc->controller); - if (ch) + debug("make_challenge retuned %p\n",ch); + if (ch) { + debug("Got it\n"); return ch; /* All went OK, returning */ + } /* Huston, we've got a problem. Take this DC out of the loop */ debug("Marking DC as DEAD\n"); current_dc->status = DC_DEAD; need_dc_resurrection = 1; + } else { + debug ("controller %s\\%s not OK, skipping\n",current_dc->domain, current_dc->controller); } if (failover_enabled == 0) /* No failover. Just return */ return NULL; /* Try with the next */ + debug("moving on to next controller\n"); current_dc = current_dc->next; } /* DC (all DCs if failover is enabled) failed. */ Index: squid/src/auth/ntlm/helpers/NTLMSSP/smbval/md4.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/smbval/Attic/md4.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/src/auth/ntlm/helpers/NTLMSSP/smbval/md4.c 8 Jan 2001 00:14:58 -0000 1.1.2.2 +++ squid/src/auth/ntlm/helpers/NTLMSSP/smbval/md4.c 9 Mar 2001 08:24:16 -0000 1.1.2.3 @@ -25,8 +25,7 @@ * It assumes that a int is at least 32 bits long */ #include - -typedef unsigned int uint32; +#include "std-defines.h" /* for the types */ static uint32 A, B, C, D; Index: squid/src/auth/ntlm/helpers/NTLMSSP/smbval/rfcnb-util.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/smbval/Attic/rfcnb-util.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/src/auth/ntlm/helpers/NTLMSSP/smbval/rfcnb-util.h 7 Jan 2001 14:52:26 -0000 1.1.2.1 +++ squid/src/auth/ntlm/helpers/NTLMSSP/smbval/rfcnb-util.h 9 Mar 2001 08:24:16 -0000 1.1.2.2 @@ -23,6 +23,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "std-includes.h" + void RFCNB_CvtPad_Name(char *name1, char *name2); Index: squid/src/auth/ntlm/helpers/NTLMSSP/smbval/smblib-priv.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/smbval/Attic/smblib-priv.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/src/auth/ntlm/helpers/NTLMSSP/smbval/smblib-priv.h 7 Jan 2001 14:52:26 -0000 1.1.2.1 +++ squid/src/auth/ntlm/helpers/NTLMSSP/smbval/smblib-priv.h 9 Mar 2001 08:24:16 -0000 1.1.2.2 @@ -28,12 +28,8 @@ #include "std-defines.h" #include "smblib-common.h" -#include #include -typedef unsigned short uint16; -typedef unsigned int uint32; - #include "byteorder.h" /* Hmmm ... hot good */ #define max(a,b) (a < b ? b : a) Index: squid/src/auth/ntlm/helpers/NTLMSSP/smbval/std-defines.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/smbval/Attic/std-defines.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/src/auth/ntlm/helpers/NTLMSSP/smbval/std-defines.h 7 Jan 2001 14:52:26 -0000 1.1.2.1 +++ squid/src/auth/ntlm/helpers/NTLMSSP/smbval/std-defines.h 9 Mar 2001 08:24:16 -0000 1.1.2.2 @@ -26,8 +26,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define BOOL int -typedef short int16; +#include "squid_types.h" +#define BOOL int16_t +#define int16 int16_t +#define uint16 u_int16_t +#define int32 int32_t +#define uint32 u_int32_t #include #include Index: squid/src/auth/ntlm/helpers/NTLMSSP/smbval/std-includes.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/smbval/Attic/std-includes.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/src/auth/ntlm/helpers/NTLMSSP/smbval/std-includes.h 7 Jan 2001 14:52:26 -0000 1.1.2.1 +++ squid/src/auth/ntlm/helpers/NTLMSSP/smbval/std-includes.h 9 Mar 2001 08:24:16 -0000 1.1.2.2 @@ -23,8 +23,10 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define BOOL int -typedef short int16; +/* the types are provided by squid's configure preocess */ +#include "squid_types.h" +#define BOOL int16_t +#define int16 int16_t #include #include Index: squid/src/auth/ntlm/helpers/fakeauth/fakeauth_auth.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/fakeauth/Attic/fakeauth_auth.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/src/auth/ntlm/helpers/fakeauth/fakeauth_auth.c 7 Jan 2001 14:52:26 -0000 1.1.2.1 +++ squid/src/auth/ntlm/helpers/fakeauth/fakeauth_auth.c 9 Mar 2001 08:24:16 -0000 1.1.2.2 @@ -13,6 +13,8 @@ */ #include "config.h" +#include "squid_types.h" +#include "ntlmauth.h" #include "ntlm.h" #include "util.h" @@ -111,7 +113,7 @@ * Check the vailidity of a request header. Return -1 on error. */ int -ntlmCheckHeader(struct ntlmhdr *hdr, int type) +ntlmCheckHeader(ntlmhdr *hdr, int type) { /* * Must be the correct security package and request type. The @@ -262,7 +264,7 @@ printf("TT %s\n", data); } else if (strncasecmp(buf, "KK ", 3) == 0) { cleartext = (char *) uudecode(buf + 3); - if (!ntlmCheckHeader((struct ntlmhdr *) cleartext, NTLM_AUTHENTICATE)) { + if (!ntlmCheckHeader((ntlmhdr *) cleartext, NTLM_AUTHENTICATE)) { if (!ntlmDecodeAuth((struct ntlm_authenticate *) cleartext, user, 256)) { lc(user); printf("AF %s\n", user); Index: squid/src/auth/ntlm/helpers/fakeauth/ntlm.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/fakeauth/Attic/ntlm.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/src/auth/ntlm/helpers/fakeauth/ntlm.h 23 Jan 2001 10:14:24 -0000 1.1.2.2 +++ squid/src/auth/ntlm/helpers/fakeauth/ntlm.h 9 Mar 2001 08:24:16 -0000 1.1.2.3 @@ -55,19 +55,6 @@ #define NTLM_AUTHENTICATE 3 #define NTLM_ANY 0 -/* Header proceeding each request */ -typedef struct ntlmhdr { - char signature[8]; /* NTLMSSP */ - int32_t type; /* One of NTLM_* from above */ -} ntlmhdr; - -/* String header. String data resides at the end of the request */ -typedef struct strhdr { - int16_t len; /* Length in bytes */ - int16_t maxlen; /* Allocated space in bytes */ - int32_t offset; /* Offset from start of request */ -} strhdr; - /* Negotiation request sent by client */ struct ntlm_negotiate { ntlmhdr hdr; /* NTLM header */ @@ -102,7 +89,7 @@ char *ntlmGetString(ntlmhdr * hdr, strhdr * str, int flags); void ntlmMakeChallenge(struct ntlm_challenge *chal); -int ntlmCheckHeader(struct ntlmhdr *hdr, int type); +int ntlmCheckHeader(ntlmhdr *hdr, int type); int ntlmCheckNegotiation(struct ntlm_negotiate *neg); int ntlmAuthenticate(struct ntlm_authenticate *neg);