add more spacing
[personal-kdebase.git] / workspace / kdm / backend / dm_auth.h
blobd802c5f87181f01bd9475160a063e510fed76ec5
1 /************************************************************
3 Copyright 1998 by Thomas E. Dickey <dickey@clark.net>
5 All Rights Reserved
7 Permission is hereby granted, free of charge, to any person obtaining a
8 copy of this software and associated documentation files (the
9 "Software"), to deal in the Software without restriction, including
10 without limitation the rights to use, copy, modify, merge, publish,
11 distribute, sublicense, and/or sell copies of the Software, and to
12 permit persons to whom the Software is furnished to do so, subject to
13 the following conditions:
15 The above copyright notice and this permission notice shall be included
16 in all copies or substantial portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
22 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 Except as contained in this notice, the name(s) of the above copyright
27 holders shall not be used in advertising or otherwise to promote the
28 sale, use or other dealings in this Software without prior written
29 authorization.
31 ********************************************************/
33 #ifndef _DM_AUTH_H_
34 #define _DM_AUTH_H_ 1
36 #include "dm.h"
38 void mitInitAuth( unsigned short name_len, const char *name );
39 Xauth *mitGetAuth( unsigned short namelen, const char *name );
41 #ifdef HASXDMAUTH
42 void xdmInitAuth( unsigned short name_len, const char *name );
43 Xauth *xdmGetAuth( unsigned short namelen, const char *name );
44 # ifdef XDMCP
45 void xdmGetXdmcpAuth( struct protoDisplay *pdpy,
46 unsigned short authorizationNameLen,
47 const char *authorizationName );
48 int xdmcheckAuthentication( struct protoDisplay *pdpy,
49 ARRAY8Ptr displayID,
50 ARRAY8Ptr authenticationName,
51 ARRAY8Ptr authenticationData );
52 # else
53 # define xdmGetXdmcpAuth NULL
54 # endif
55 #endif
57 #ifdef SECURE_RPC
58 void secureRPCInitAuth( unsigned short name_len, const char *name );
59 Xauth *secureRPCGetAuth( unsigned short name_len, const char *name );
60 #endif
62 #ifdef K5AUTH
63 void krb5InitAuth( unsigned short name_len, const char *name );
64 Xauth *krb5GetAuth( unsigned short name_len, const char *name );
66 Xauth *krb5GetAuthFor( unsigned short name_len, const char *name, const char *dname );
67 char *krb5Init( const char *user, const char *passwd, const char *dname );
68 void krb5Destroy( const char *dname );
69 #endif
71 /* auth.c */
72 int validAuthorization( unsigned short name_length, const char *name );
75 #ifdef XDMCP
77 void
78 setProtoDisplayAuthorization( struct protoDisplay *pdpy,
79 unsigned short authorizationNameLen,
80 const char *authorizationName );
82 #endif /* XDMCP */
84 int saveServerAuthorizations( struct display *d, Xauth **auths, int count );
85 void cleanUpFileName( const char *src, char *dst, int len );
86 void removeUserAuthorization( struct display *d );
87 void setAuthorization( struct display *d );
88 void setLocalAuthorization( struct display *d );
89 void setUserAuthorization( struct display *d );
91 /* genauth.c */
92 int generateAuthData( char *auth, int len );
93 #ifdef NEED_ENTROPY
94 void addPreGetEntropy( void );
95 void addOtherEntropy( void );
96 void addTimerEntropy( void );
97 #endif
98 #ifdef HAVE_ARC4RANDOM
99 # define secureRandom() arc4random()
100 #else
101 int secureRandom( void );
102 #endif
104 #endif /* _DM_AUTH_H_ */