steps to support modern FreeBSD. After Robert Watson <rwatson@FreeBSD.org> and Alec...
[arla.git] / rxdef / ka.xg
blob671f2aa3a2b9b23534b8fcb7b544a61a8148a4eb
1 /* This is -*-c-*- */
3 /*
4  * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
5  * (Royal Institute of Technology, Stockholm, Sweden).
6  * All rights reserved.
7  * 
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 
19  * 3. Neither the name of the Institute nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  * 
23  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  */
38  * Interface to KAS
39  */
41 const AUTHENTICATE_OLD          = 1;
42 const CHANGEPASSWORD            = 2;
43 const GETTICKET_OLD             = 3;
44 const SETPASSWORD               = 4;
45 const SETFIELDS                 = 5;
46 const CREATEUSER                = 6;
47 const DELETEUSER                = 7;
48 const GETENTRY                  = 8;
49 const LISTENTRY                 = 9;
50 const GETSTATS                  = 10;
51 const DEBUG                     = 11;
52 const GETPASSWORD               = 12;
53 const GETRANDOMKEY              = 13;
54 const AUTHENTICATE              = 21;
55 const GETTICKET                 = 23;
57 const MAXKAKVNO                 = 127;
59 /* Flags (note 0 is illegal) */
61 const KAFNORMAL                 = 0x1;
62 /* For the two following the KAFNORMAL MUST not be set */
63 const KAFREE                    = 0x2;  /* on freelist */
64 const KAOLDKEYS                 = 0x10; /* used to store old keys */
65 /* misc flags */
66 const KASPECIAL                 = 0x100; /* special authserver principal */
67 const KAFASSOCROOT              = 0x200; /* root of associate tree */
68 const KAFASSOC                  = 0x300; /* associate entry */
70 /* The following flags are used on KAA_SetFields() */
71 const KAFADMIN                  = 0x004; /* administrator */
72 const KAFNOTGS                  = 0x008; /* can't get or use TGT */
73 const KAFNOSEAL                 = 0x020; /* can't be used as server */
74 const KAFNOCPW                  = 0x040; /* can't change password */
75 const KAFNEWASSOC               = 0x080; /* can create associates */
77 /* MISC stuff */
79 const KAMAJORVERSION            = 5;
80 const KAMINORVERSION            = 1;
81 const NEVERDATE                 = 037777777777;
82 const KADEBUGKCINFOSIZE         = 25;
84 #define Date uint32_t
86 /* Errors */
88 const  KADATABASEINCONSISTENT                   = 180480;
89 const  KAEXIST                                  = 180481;
90 const  KAIO                                     = 180482;
91 const  KACREATEFAIL                             = 180483;
92 const  KANOENT                                  = 180484;
93 const  KAEMPTY                                  = 180485;
94 const  KABADNAME                                = 180486;
95 const  KABADINDEX                               = 180487;
96 const  KANOAUTH                                 = 180488;
97 const  KAANSWERTOOLONG                          = 180489;
98 const  KABADREQUEST                             = 180490;
99 const  KAOLDINTERFACE                           = 180491;
100 const  KABADARGUMENT                            = 180492;
101 const  KABADCMD                                 = 180493;
102 const  KANOKEYS                                 = 180494;
103 const  KAREADPW                                 = 180495;
104 const  KABADKEY                                 = 180496;
105 const  KAUBIKINIT                               = 180497;
106 const  KAUBIKCALL                               = 180498;
107 const  KABADPROTOCOL                            = 180499;
108 const  KANOCELLS                                = 180500;
109 const  KANOCELL                                 = 180501;
110 const  KATOOMANYUBIKS                           = 180502;
111 const  KATOOMANYKEYS                            = 180503;
112 const  KABADTICKET                              = 180504;
113 const  KAUNKNOWNKEY                             = 180505;
114 const  KAKEYCACHEINVALID                        = 180506;
115 const  KABADSERVER                              = 180507;
116 const  KABADUSER                                = 180508;
117 const  KABADCPW                                 = 180509;
118 const  KABADCREATE                              = 180510;
119 const  KANOTICKET                               = 180511;
120 const  KAASSOCUSER                              = 180512;
121 const  KANOTSPECIAL                             = 180513;
122 const  KACLOCKSKEW                              = 180514;
123 const  KANORECURSE                              = 180515;
124 const  KARXFAIL                                 = 180516;
125 const  KANULLPASSWORD                           = 180517;
126 const  KAINTERNALERROR                          = 180518;
127 const  KAPWEXPIRED                              = 180519;
128 const  KAREUSED                                 = 180520;
129 const  KATOOSOON                                = 180521;
130 const  KALOCKED                                 = 180522;
134 struct ka_CBS {
135     opaque Seq<>;
138 struct ka_BBS {
139     int32_t MaxSeqLen;
140     opaque Seq<>;
143 struct EncryptionKey {
144     char key[8];
147 const MAXKANAMELEN      = 64;
148 #define MAXKANAMELEN    64
149 const KA_LABELSIZE    = 4;
151 %#ifndef MAXKTCTICKETLEN
152 const MAXKTCTICKETLEN = 344;
153 %#endif
155 typedef string kaname<MAXKANAMELEN>;
157 struct kaident {
158     char name[MAXKANAMELEN];
159     char instance[MAXKANAMELEN];
162 struct kaentryinfo {
163     int32_t minor_version;
164     int32_t flags;
165     uint32_t user_expiration;
166     Date modification_time;
167     kaident modification_user;
168     Date change_password_time;
169     long max_ticket_lifetime;
170     long key_version;
171     EncryptionKey key;
172     uint32_t keyCheckSym;
173     int32_t reserved2;
174     int32_t reserved3;
175     int32_t reserved4;
179 package KAA_
181 Authenticate (IN kaname name,
182               IN kaname instance,
183               IN Date start_time,
184               IN Date end_time,
185               IN ka_CBS *request,
186               INOUT ka_BBS *answer) = 21;
188 ChangePassword (IN kaname name,
189                 IN kaname instance,
190                 IN ka_CBS arequest,
191                 INOUT ka_BBS *oanswer) = 2;
193 package KAM_
195 SetPassword (IN kaname name,
196              IN kaname instance,
197              IN int32_t kvno,
198              IN EncryptionKey password) = 4;
200 SetFields (IN kaname name,
201            IN kaname instance,
202            IN int32_t flags,
203            IN Date user_expiration,
204            IN int32_t max_ticket_lifetime,
205            IN int32_t maxAssociates,
206            IN int32_t spare1,
207            IN int32_t spare2) = 5;
209 CreateUser (IN kaname name,
210             IN kaname instance,
211             IN EncryptionKey password) = 6;
213 GetEntry (IN kaname name,
214           IN kaname instance,
215           IN long major_version,
216           OUT kaentryinfo *entry) = 8;
219 package KAT_
221 GetTicket_old (IN int32_t kvno,
222                IN kaname auth_domain,
223                IN struct ka_CBS *aticket,
224                IN kaname name,
225                IN kaname instance,
226                IN struct ka_CBS *atimes,
227                INOUT struct ka_BBS *oanswer) = 3;
229 GetTicket (IN int32_t kvno,
230            IN kaname auth_domain,
231            IN struct ka_CBS *aticket,
232            IN kaname name,
233            IN kaname instance,
234            IN struct ka_CBS *atimes,
235            INOUT struct ka_BBS *oanswer) = 23;