1485f0483Smrg/*
2485f0483SmrgCopyright 1996, 1998  The Open Group
3485f0483Smrg
4485f0483SmrgPermission to use, copy, modify, distribute, and sell this software and its
5485f0483Smrgdocumentation for any purpose is hereby granted without fee, provided that
6485f0483Smrgthe above copyright notice appear in all copies and that both that
7485f0483Smrgcopyright notice and this permission notice appear in supporting
8485f0483Smrgdocumentation.
9485f0483Smrg
10485f0483SmrgThe above copyright notice and this permission notice shall be included
11485f0483Smrgin all copies or substantial portions of the Software.
12485f0483Smrg
13485f0483SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14485f0483SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15485f0483SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16485f0483SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17485f0483SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18485f0483SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19485f0483SmrgOTHER DEALINGS IN THE SOFTWARE.
20485f0483Smrg
21485f0483SmrgExcept as contained in this notice, the name of The Open Group shall
22485f0483Smrgnot be used in advertising or otherwise to promote the sale, use or
23485f0483Smrgother dealings in this Software without prior written authorization
24485f0483Smrgfrom The Open Group.
25485f0483Smrg*/
26485f0483Smrg
27485f0483Smrg#ifndef _SECURITY_H
28485f0483Smrg#define _SECURITY_H
29485f0483Smrg
30485f0483Smrg#define _XAUTH_STRUCT_ONLY
31485f0483Smrg#include <X11/Xauth.h>
32485f0483Smrg
33485f0483Smrg#include <X11/extensions/secur.h>
34485f0483Smrg
35485f0483Smrg_XFUNCPROTOBEGIN
36485f0483Smrg
37485f0483SmrgStatus XSecurityQueryExtension (
38485f0483Smrg    Display *dpy,
39485f0483Smrg    int *major_version_return,
40485f0483Smrg    int *minor_version_return);
41485f0483Smrg
42485f0483SmrgXauth *XSecurityAllocXauth(void);
43485f0483Smrg
44485f0483Smrgvoid XSecurityFreeXauth(Xauth *auth);
45485f0483Smrg
46485f0483Smrg/* type for returned auth ids */
47485f0483Smrgtypedef unsigned long XSecurityAuthorization;
48485f0483Smrg
49485f0483Smrgtypedef struct {
50485f0483Smrg    unsigned int timeout;
51485f0483Smrg    unsigned int trust_level;
52485f0483Smrg    XID          group;
53485f0483Smrg    long	 event_mask;
54485f0483Smrg} XSecurityAuthorizationAttributes;
55485f0483Smrg
56485f0483SmrgXauth *XSecurityGenerateAuthorization(
57485f0483Smrg    Display *dpy,
58485f0483Smrg    Xauth *auth_in,
59485f0483Smrg    unsigned long valuemask,
60485f0483Smrg    XSecurityAuthorizationAttributes *attributes,
61485f0483Smrg    XSecurityAuthorization *auth_id_return);
62485f0483Smrg
63485f0483SmrgStatus XSecurityRevokeAuthorization(
64485f0483Smrg    Display *dpy,
65485f0483Smrg    XSecurityAuthorization auth_id);
66485f0483Smrg
67485f0483Smrg_XFUNCPROTOEND
68485f0483Smrg
69485f0483Smrgtypedef struct {
70485f0483Smrg    int type;		      /* event base + XSecurityAuthorizationRevoked */
71485f0483Smrg    unsigned long serial;     /* # of last request processed by server */
72485f0483Smrg    Bool send_event;	      /* true if this came from a SendEvent request */
73485f0483Smrg    Display *display;	      /* Display the event was read from */
74485f0483Smrg    XSecurityAuthorization auth_id; /* revoked authorization id */
75485f0483Smrg} XSecurityAuthorizationRevokedEvent;
76485f0483Smrg
77485f0483Smrg#endif /* _SECURITY_H */
78