1/************************************************************
2
3Copyright 1998 by Thomas E. Dickey <dickey@clark.net>
4
5                        All Rights Reserved
6
7Permission is hereby granted, free of charge, to any person obtaining a
8copy of this software and associated documentation files (the
9"Software"), to deal in the Software without restriction, including
10without limitation the rights to use, copy, modify, merge, publish,
11distribute, sublicense, and/or sell copies of the Software, and to
12permit persons to whom the Software is furnished to do so, subject to
13the following conditions:
14
15The above copyright notice and this permission notice shall be included
16in all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
22CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26Except as contained in this notice, the name(s) of the above copyright
27holders shall not be used in advertising or otherwise to promote the
28sale, use or other dealings in this Software without prior written
29authorization.
30
31********************************************************/
32
33#ifndef _DM_AUTH_H_
34# define _DM_AUTH_H_ 1
35
36# include "dm.h"	/* for struct display */
37
38extern void	MitInitAuth (unsigned short name_len, char *name);
39extern Xauth	*MitGetAuth (unsigned short namelen, char *name);
40
41# ifdef HASXDMAUTH
42extern void	XdmInitAuth (unsigned short name_len, char *name);
43extern Xauth	*XdmGetAuth (unsigned short namelen, char *name);
44#  ifdef XDMCP
45extern void	XdmGetXdmcpAuth (
46    struct protoDisplay	*pdpy,
47    unsigned short	authorizationNameLen,
48    char		*authorizationName);
49extern int XdmCheckAuthentication (struct protoDisplay *pdpy,
50    ARRAY8Ptr displayID, ARRAY8Ptr authenticationName,
51    ARRAY8Ptr authenticationData);
52#  else
53#   define XdmGetXdmcpAuth NULL
54#  endif
55# endif
56
57# ifdef SECURE_RPC
58extern void	SecureRPCInitAuth (unsigned short name_len, char *name);
59extern Xauth	*SecureRPCGetAuth (unsigned short namelen, char *name);
60# endif
61
62# ifdef K5AUTH
63extern void	Krb5InitAuth (unsigned short name_len, char *name);
64extern Xauth	*Krb5GetAuth (unsigned short namelen, char *name);
65# endif
66
67/* auth.c */
68extern int ValidAuthorization (unsigned short name_length, char *name);
69
70
71# ifdef XDMCP
72
73extern void
74SetProtoDisplayAuthorization (
75    struct protoDisplay	*pdpy,
76    unsigned short	authorizationNameLen,
77    char		*authorizationName);
78
79# endif /* XDMCP */
80
81extern int SaveServerAuthorizations (struct display *d, Xauth **auths, int count);
82extern void CleanUpFileName (char *src, char *dst, int len);
83extern void RemoveUserAuthorization (struct display *d, struct verify_info *verify);
84extern void SetAuthorization (struct display *d);
85extern void SetLocalAuthorization (struct display *d);
86extern void SetUserAuthorization (struct display *d, struct verify_info *verify);
87
88/* genauth.c */
89extern int GenerateAuthData (char *auth, int len);
90# if !defined(HAVE_ARC4RANDOM)
91extern void AddPreGetEntropy (void);
92extern void AddOtherEntropy (void);
93extern void AddTimerEntropy (void);
94# endif
95
96/* prngc.c */
97extern int get_prngd_bytes(char *, int, unsigned short, char *);
98
99#endif /* _DM_AUTH_H_ */
100