[xserver-commit] xserver/os osdep.h,3.19,3.20 xdmauth.c,1.14,1.15

Keith Packard xserver-commit@pdx.freedesktop.org
Sun, 02 Nov 2003 12:10:28 -0800


Committed by: keithp

Update of /cvs/xserver/xserver/os
In directory pdx:/tmp/cvs-serv24871/os

Modified Files:
	osdep.h xdmauth.c 
Log Message:
	* os/osdep.h:
	* os/xdmauth.c: (XdmAuthenticationValidator),
	(XdmAuthenticationGenerator), (XdmAuthenticationAddAuth),
	(XdmAuthenticationInit):
	Fix warnings (prototypes and type errors)


Index: osdep.h
===================================================================
RCS file: /cvs/xserver/xserver/os/osdep.h,v
retrieving revision 3.19
retrieving revision 3.20
diff -u -d -r3.19 -r3.20
--- osdep.h	11 Sep 2003 05:12:51 -0000	3.19
+++ osdep.h	2 Nov 2003 20:10:26 -0000	3.20
@@ -283,6 +283,7 @@
 extern int  XdmFromID         (AuthFromIDArgs);
 extern int  XdmRemoveCookie   (AuthRemCArgs);
 extern int  XdmResetCookie    (AuthRstCArgs);
+extern void XdmAuthenticationInit (char *cookie, int cookie_len);
 #endif
 
 /* in rpcauth.c */

Index: xdmauth.c
===================================================================
RCS file: /cvs/xserver/xserver/os/xdmauth.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- xdmauth.c	2 Nov 2003 19:56:11 -0000	1.14
+++ xdmauth.c	2 Nov 2003 20:10:26 -0000	1.15
@@ -62,12 +62,14 @@
 static XdmAuthKeyRec	rho;
 
 static Bool 
-XdmAuthenticationValidator (ARRAY8Ptr privateData, ARRAY8Ptr incomingData, 
-    xdmOpCode packet_type)
+XdmAuthenticationValidator (ARRAY8Ptr	privateData,
+			    ARRAY8Ptr	incomingData, 
+			    int		i_packet_type)
 {
+    xdmOpCode		packet_type = i_packet_type;
     XdmAuthKeyPtr	incoming;
 
-    XdmcpUnwrap (incomingData->data, &privateKey,
+    XdmcpUnwrap (incomingData->data, (unsigned char *) &privateKey,
 			      incomingData->data,incomingData->length);
     switch (packet_type)
     {
@@ -77,31 +79,41 @@
     	incoming = (XdmAuthKeyPtr) incomingData->data;
     	XdmcpDecrementKey (incoming);
     	return XdmcpCompareKeys (incoming, &rho);
+    default:
+	break;
     }
     return FALSE;
 }
 
 static Bool
-XdmAuthenticationGenerator (ARRAY8Ptr privateData, ARRAY8Ptr outgoingData, 
-    xdmOpCode packet_type)
+XdmAuthenticationGenerator (ARRAY8Ptr	privateData,
+			    ARRAY8Ptr	outgoingData, 
+			    int		i_packet_type)
 {
+    xdmOpCode		packet_type = i_packet_type;
     outgoingData->length = 0;
     outgoingData->data = 0;
     switch (packet_type)
     {
     case REQUEST:
 	if (XdmcpAllocARRAY8 (outgoingData, 8))
-	    XdmcpWrap (&rho, &privateKey, outgoingData->data, 8);
+	    XdmcpWrap ((unsigned char *) &rho,
+		       (unsigned char *) &privateKey,
+		       outgoingData->data, 8);
+    default:
+	break;
     }
     return TRUE;
 }
 
 static Bool
-XdmAuthenticationAddAuth (int name_len, char *name, 
-    int data_len, char *data)
+XdmAuthenticationAddAuth (unsigned	name_len,
+			  char		*name, 
+			  unsigned	data_len,
+			  char		*data)
 {
     Bool    ret;
-    XdmcpUnwrap (data, &privateKey, data, data_len);
+    XdmcpUnwrap (data, (unsigned char *) &privateKey, data, (int) data_len);
     authFromXDMCP = TRUE;
     ret = AddAuthorization (name_len, name, data_len, data);
     authFromXDMCP = FALSE;
@@ -153,8 +165,9 @@
     	memmove (privateKey.data + 1, cookie, cookie_len);
     }
     XdmcpGenerateKey (&rho);
-    XdmcpRegisterAuthentication (XdmAuthenticationName, XdmAuthenticationNameLen,
-				 &rho,
+    XdmcpRegisterAuthentication (XdmAuthenticationName,
+				 XdmAuthenticationNameLen,
+				 (char *) &rho,
 				 sizeof (rho),
 				 XdmAuthenticationValidator,
 				 XdmAuthenticationGenerator,