diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:22 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:22 +0000 |
commit | 6c29c43354706a933c0bc73a9c800bdfd1a9a827 (patch) | |
tree | 37ab6c9430469a3d73ea08c12cfeda668dcb1a34 /xdmauth.c | |
parent | fa5d4a38a4dae7f24cdf3b8650dd931294c0fdc6 (diff) |
XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1
Diffstat (limited to 'xdmauth.c')
-rw-r--r-- | xdmauth.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ - +/* $XFree86: xc/programs/xdm/xdmauth.c,v 1.5 2001/12/14 20:01:25 dawes Exp $ */ /* * xdm - display manager daemon * Author: Keith Packard, MIT X Consortium @@ -37,12 +37,15 @@ from The Open Group. */ #include "dm.h" +#include "dm_auth.h" +#include "dm_error.h" #ifdef HASXDMAUTH static char auth_name[256]; static int auth_name_len; +void XdmPrintDataHex (s, a, l) char *s; char *a; @@ -57,6 +60,7 @@ XdmPrintDataHex (s, a, l) } #ifdef notdef /* not used */ +void XdmPrintKey (s, k) char *s; XdmAuthKeyRec *k; @@ -66,6 +70,7 @@ XdmPrintKey (s, k) #endif #ifdef XDMCP +void XdmPrintArray8Hex (s, a) char *s; ARRAY8Ptr a; @@ -74,6 +79,7 @@ XdmPrintArray8Hex (s, a) } #endif +void XdmInitAuth (name_len, name) unsigned short name_len; char *name; @@ -194,7 +200,7 @@ XdmGetXdmcpAuth (pdpy,authorizationNameLen, authorizationName) XdmPrintDataHex ("Accept packet auth", xdmcpauth->data, xdmcpauth->data_length); XdmPrintDataHex ("Auth file auth", fileauth->data, fileauth->data_length); /* encrypt the session key for its trip back to the server */ - XdmcpWrap (xdmcpauth->data, &pdpy->key, xdmcpauth->data, 8); + XdmcpWrap (xdmcpauth->data, (unsigned char *)&pdpy->key, xdmcpauth->data, 8); pdpy->fileAuthorization = fileauth; pdpy->xdmcpAuthorization = xdmcpauth; } @@ -203,7 +209,7 @@ XdmGetXdmcpAuth (pdpy,authorizationNameLen, authorizationName) 'a' <= c && c <= 'f' ? c - 'a' + 10 : \ 'A' <= c && c <= 'F' ? c - 'A' + 10 : -1) -static +static int HexToBinary (key) char *key; { @@ -234,6 +240,7 @@ HexToBinary (key) * routine accepts either plain ascii strings for keys, or hex-encoded numbers */ +int XdmGetKey (pdpy, displayID) struct protoDisplay *pdpy; ARRAY8Ptr displayID; @@ -275,6 +282,7 @@ XdmGetKey (pdpy, displayID) } /*ARGSUSED*/ +int XdmCheckAuthentication (pdpy, displayID, authenticationName, authenticationData) struct protoDisplay *pdpy; ARRAY8Ptr displayID, authenticationName, authenticationData; @@ -285,14 +293,14 @@ XdmCheckAuthentication (pdpy, displayID, authenticationName, authenticationData) return FALSE; if (authenticationData->length != 8) return FALSE; - XdmcpUnwrap (authenticationData->data, &pdpy->key, + XdmcpUnwrap (authenticationData->data, (unsigned char *)&pdpy->key, authenticationData->data, 8); XdmPrintArray8Hex ("Request packet auth", authenticationData); if (!XdmcpCopyARRAY8(authenticationData, &pdpy->authenticationData)) return FALSE; incoming = (XdmAuthKeyPtr) authenticationData->data; XdmcpIncrementKey (incoming); - XdmcpWrap (authenticationData->data, &pdpy->key, + XdmcpWrap (authenticationData->data, (unsigned char *)&pdpy->key, authenticationData->data, 8); return TRUE; } |