ReactOS 0.4.15-dev-7924-g5949c20
auth_kerb.h
Go to the documentation of this file.
1/* $FreeBSD: src/include/rpc/auth_kerb.h,v 1.2 2002/09/04 23:58:23 alfred Exp $ */
2/*
3 * Copyright (c) 2009, Sun Microsystems, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * - Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * - Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * - Neither the name of Sun Microsystems, Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 */
29/*
30 * auth_kerb.h, Protocol for Kerberos style authentication for RPC
31 *
32 * Copyright (C) 1986, Sun Microsystems, Inc.
33 */
34
35#ifndef _RPC_AUTH_KERB_H
36#define _RPC_AUTH_KERB_H
37
38#ifdef KERBEROS
39
40#include <kerberos/krb.h>
41#include <sys/socket.h>
42#include <sys/t_kuser.h>
43#include <netinet/in.h>
44#include <rpc/svc.h>
45
46/*
47 * There are two kinds of "names": fullnames and nicknames
48 */
49enum authkerb_namekind {
50 AKN_FULLNAME,
51 AKN_NICKNAME
52};
53/*
54 * A fullname contains the ticket and the window
55 */
56struct authkerb_fullname {
57 KTEXT_ST ticket;
58 u_long window; /* associated window */
59};
60
61/*
62 * cooked credential stored in rq_clntcred
63 */
64struct authkerb_clnt_cred {
65 /* start of AUTH_DAT */
66 unsigned char k_flags; /* Flags from ticket */
67 char pname[ANAME_SZ]; /* Principal's name */
68 char pinst[INST_SZ]; /* His Instance */
69 char prealm[REALM_SZ]; /* His Realm */
70 unsigned long checksum; /* Data checksum (opt) */
71 C_Block session; /* Session Key */
72 int life; /* Life of ticket */
73 unsigned long time_sec; /* Time ticket issued */
74 unsigned long address; /* Address in ticket */
75 /* KTEXT_ST reply; Auth reply (opt) */
76 /* end of AUTH_DAT */
77 unsigned long expiry; /* time the ticket is expiring */
78 u_long nickname; /* Nickname into cache */
79 u_long window; /* associated window */
80};
81
82typedef struct authkerb_clnt_cred authkerb_clnt_cred;
83
84/*
85 * A credential
86 */
87struct authkerb_cred {
88 enum authkerb_namekind akc_namekind;
89 struct authkerb_fullname akc_fullname;
90 u_long akc_nickname;
91};
92
93/*
94 * A kerb authentication verifier
95 */
96struct authkerb_verf {
97 union {
98 struct timeval akv_ctime; /* clear time */
99 des_block akv_xtime; /* crypt time */
100 } akv_time_u;
101 u_long akv_int_u;
102};
103
104/*
105 * des authentication verifier: client variety
106 *
107 * akv_timestamp is the current time.
108 * akv_winverf is the credential window + 1.
109 * Both are encrypted using the conversation key.
110 */
111#ifndef akv_timestamp
112#define akv_timestamp akv_time_u.akv_ctime
113#define akv_xtimestamp akv_time_u.akv_xtime
114#define akv_winverf akv_int_u
115#endif
116/*
117 * des authentication verifier: server variety
118 *
119 * akv_timeverf is the client's timestamp + client's window
120 * akv_nickname is the server's nickname for the client.
121 * akv_timeverf is encrypted using the conversation key.
122 */
123#ifndef akv_timeverf
124#define akv_timeverf akv_time_u.akv_ctime
125#define akv_xtimeverf akv_time_u.akv_xtime
126#define akv_nickname akv_int_u
127#endif
128
129/*
130 * Register the service name, instance and realm.
131 */
132extern int authkerb_create(char *, char *, char *, u_int,
133 struct netbuf *, int *, dev_t, int, AUTH **);
134extern bool_t xdr_authkerb_cred(XDR *, struct authkerb_cred *);
135extern bool_t xdr_authkerb_verf(XDR *, struct authkerb_verf *);
136extern int svc_kerb_reg(SVCXPRT *, char *, char *, char *);
137extern enum auth_stat _svcauth_kerb(struct svc_req *, struct rpc_msg *);
138
139#endif KERBEROS
140#endif /* !_RPC_AUTH_KERB_H */
auth_stat
Definition: auth.h:144
UINT32 u_int
Definition: types.h:82
int32_t bool_t
Definition: types.h:101
static cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum)
Definition: fdi.c:353
__kernel_dev_t dev_t
Definition: linux.h:197
unsigned long u_long
Definition: linux.h:269
GLuint address
Definition: glext.h:9393
GLenum pname
Definition: glext.h:5645
static IHTMLWindow2 * window
Definition: events.c:77
Definition: auth.h:205
Definition: xdr.h:103
Definition: types.h:144
Definition: svc.h:132