HAMMER - Formalize the maximum number of volumes (256).
[dragonfly.git] / include / rpc / auth_kerb.h
blobcefd20c59e431dcec32558e14909f439bb24d3fc
1 /*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
25 * Sun Microsystems, Inc.
26 * 2550 Garcia Avenue
27 * Mountain View, California 94043
29 * $FreeBSD: src/include/rpc/auth_kerb.h,v 1.3 2007/02/02 18:11:18 schweikh Exp $
32 * auth_kerb.h, Protocol for Kerberos style authentication for RPC
34 * Copyright (C) 1986, Sun Microsystems, Inc.
37 #ifndef _RPC_AUTH_KERB_H
38 #define _RPC_AUTH_KERB_H
40 #ifdef KERBEROS
42 #include <kerberos/krb.h>
43 #include <sys/socket.h>
44 #include <sys/t_kuser.h>
45 #include <netinet/in.h>
46 #include <rpc/svc.h>
49 * There are two kinds of "names": fullnames and nicknames
51 enum authkerb_namekind {
52 AKN_FULLNAME,
53 AKN_NICKNAME
56 * A fullname contains the ticket and the window
58 struct authkerb_fullname {
59 KTEXT_ST ticket;
60 u_long window; /* associated window */
64 * cooked credential stored in rq_clntcred
66 struct authkerb_clnt_cred {
67 /* start of AUTH_DAT */
68 unsigned char k_flags; /* Flags from ticket */
69 char pname[ANAME_SZ]; /* Principal's name */
70 char pinst[INST_SZ]; /* His Instance */
71 char prealm[REALM_SZ]; /* His Realm */
72 unsigned long checksum; /* Data checksum (opt) */
73 C_Block session; /* Session Key */
74 int life; /* Life of ticket */
75 unsigned long time_sec; /* Time ticket issued */
76 unsigned long address; /* Address in ticket */
77 /* KTEXT_ST reply; Auth reply (opt) */
78 /* end of AUTH_DAT */
79 unsigned long expiry; /* time the ticket is expiring */
80 u_long nickname; /* Nickname into cache */
81 u_long window; /* associated window */
84 typedef struct authkerb_clnt_cred authkerb_clnt_cred;
87 * A credential
89 struct authkerb_cred {
90 enum authkerb_namekind akc_namekind;
91 struct authkerb_fullname akc_fullname;
92 u_long akc_nickname;
96 * A kerb authentication verifier
98 struct authkerb_verf {
99 union {
100 struct timeval akv_ctime; /* clear time */
101 des_block akv_xtime; /* crypt time */
102 } akv_time_u;
103 u_long akv_int_u;
107 * des authentication verifier: client variety
109 * akv_timestamp is the current time.
110 * akv_winverf is the credential window + 1.
111 * Both are encrypted using the conversation key.
113 #ifndef akv_timestamp
114 #define akv_timestamp akv_time_u.akv_ctime
115 #define akv_xtimestamp akv_time_u.akv_xtime
116 #define akv_winverf akv_int_u
117 #endif
119 * des authentication verifier: server variety
121 * akv_timeverf is the client's timestamp + client's window
122 * akv_nickname is the server's nickname for the client.
123 * akv_timeverf is encrypted using the conversation key.
125 #ifndef akv_timeverf
126 #define akv_timeverf akv_time_u.akv_ctime
127 #define akv_xtimeverf akv_time_u.akv_xtime
128 #define akv_nickname akv_int_u
129 #endif
132 * Register the service name, instance and realm.
134 extern int authkerb_create(char *, char *, char *, u_int,
135 struct netbuf *, int *, dev_t, int, AUTH **);
136 extern bool_t xdr_authkerb_cred(XDR *, struct authkerb_cred *);
137 extern bool_t xdr_authkerb_verf(XDR *, struct authkerb_verf *);
138 extern int svc_kerb_reg(SVCXPRT *, char *, char *, char *);
139 extern enum auth_stat _svcauth_kerb(struct svc_req *, struct rpc_msg *);
141 #endif /* KERBEROS */
142 #endif /* !_RPC_AUTH_KERB_H */