~ubuntu-branches/ubuntu/quantal/xdm/quantal

« back to all changes in this revision

Viewing changes to xdmauth.c

  • Committer: Bazaar Package Importer
  • Author(s): Brice Goglin
  • Date: 2010-03-14 11:44:38 UTC
  • mto: (9.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20100314114438-xce9zkmf88jtlq0l
Tags: upstream-1.1.9
ImportĀ upstreamĀ versionĀ 1.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Xorg: xdmauth.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */
2
1
/*
3
2
 
4
3
Copyright 1988, 1998  The Open Group
26
25
from The Open Group.
27
26
 
28
27
*/
29
 
/* $XFree86: xc/programs/xdm/xdmauth.c,v 1.6 2003/09/17 05:48:33 herrb Exp $ */
30
28
/*
31
29
 * xdm - display manager daemon
32
30
 * Author:  Keith Packard, MIT X Consortium
56
54
    Debug ("\n");
57
55
}
58
56
 
59
 
#ifdef XDMCP
 
57
# ifdef XDMCP
60
58
static void
61
59
XdmPrintArray8Hex (char *s, ARRAY8Ptr a)
62
60
{
63
61
    XdmPrintDataHex (s, (char *) a->data, a->length);
64
62
}
65
 
#endif
 
63
# endif
66
64
 
67
65
void
68
66
XdmInitAuth (unsigned short name_len, char *name)
74
72
}
75
73
 
76
74
/*
77
 
 * Generate authorization for XDM-AUTHORIZATION-1 
 
75
 * Generate authorization for XDM-AUTHORIZATION-1
78
76
 *
79
77
 * When being used with XDMCP, 8 bytes are generated for the session key
80
78
 * (sigma), as the random number (rho) is already shared between xdm and
137
135
    return XdmGetAuthHelper (namelen, name, TRUE);
138
136
}
139
137
 
140
 
#ifdef XDMCP
 
138
# ifdef XDMCP
141
139
 
142
140
void
143
 
XdmGetXdmcpAuth (struct protoDisplay *pdpy, 
 
141
XdmGetXdmcpAuth (struct protoDisplay *pdpy,
144
142
    unsigned short authorizationNameLen, char *authorizationName)
145
143
{
146
144
    Xauth   *fileauth, *xdmcpauth;
182
180
    XdmPrintDataHex ("Accept packet auth", xdmcpauth->data, xdmcpauth->data_length);
183
181
    XdmPrintDataHex ("Auth file auth", fileauth->data, fileauth->data_length);
184
182
    /* encrypt the session key for its trip back to the server */
185
 
    XdmcpWrap (xdmcpauth->data, (unsigned char *)&pdpy->key, xdmcpauth->data, 8);
 
183
    XdmcpWrap ((unsigned char *)xdmcpauth->data, (unsigned char *)&pdpy->key,
 
184
               (unsigned char *)xdmcpauth->data, 8);
186
185
    pdpy->fileAuthorization = fileauth;
187
186
    pdpy->xdmcpAuthorization = xdmcpauth;
188
187
}
189
188
 
190
 
#define atox(c) ('0' <= c && c <= '9' ? c - '0' : \
 
189
#  define atox(c)       ('0' <= c && c <= '9' ? c - '0' : \
191
190
                 'a' <= c && c <= 'f' ? c - 'a' + 10 : \
192
191
                 'A' <= c && c <= 'F' ? c - 'A' + 10 : -1)
193
192
 
262
261
 
263
262
/*ARGSUSED*/
264
263
int
265
 
XdmCheckAuthentication(struct protoDisplay *pdpy, ARRAY8Ptr displayID, 
 
264
XdmCheckAuthentication(struct protoDisplay *pdpy, ARRAY8Ptr displayID,
266
265
    ARRAY8Ptr authenticationName, ARRAY8Ptr authenticationData)
267
266
{
268
267
    XdmAuthKeyPtr   incoming;
283
282
    return TRUE;
284
283
}
285
284
 
286
 
#endif /* XDMCP */
 
285
# endif /* XDMCP */
287
286
#endif /* HASXDMAUTH (covering the entire file) */