1 /************************************************************
3 Copyright 1998 by Thomas E. Dickey <dickey@clark.net>
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
31 ********************************************************/
38 void mitInitAuth( unsigned short name_len
, const char *name
);
39 Xauth
*mitGetAuth( unsigned short namelen
, const char *name
);
42 void xdmInitAuth( unsigned short name_len
, const char *name
);
43 Xauth
*xdmGetAuth( unsigned short namelen
, const char *name
);
45 void xdmGetXdmcpAuth( struct protoDisplay
*pdpy
,
46 unsigned short authorizationNameLen
,
47 const char *authorizationName
);
48 int xdmcheckAuthentication( struct protoDisplay
*pdpy
,
50 ARRAY8Ptr authenticationName
,
51 ARRAY8Ptr authenticationData
);
53 # define xdmGetXdmcpAuth NULL
58 void secureRPCInitAuth( unsigned short name_len
, const char *name
);
59 Xauth
*secureRPCGetAuth( unsigned short name_len
, const char *name
);
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
);
72 int validAuthorization( unsigned short name_length
, const char *name
);
78 setProtoDisplayAuthorization( struct protoDisplay
*pdpy
,
79 unsigned short authorizationNameLen
,
80 const char *authorizationName
);
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
);
92 int generateAuthData( char *auth
, int len
);
94 void addPreGetEntropy( void );
95 void addOtherEntropy( void );
96 void addTimerEntropy( void );
98 #ifdef HAVE_ARC4RANDOM
99 # define secureRandom() arc4random()
101 int secureRandom( void );
104 #endif /* _DM_AUTH_H_ */