2 * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 /* KClient.h - KClient glue to krb4.dll
35 * Author: Jörgen Karlsson - d93-jka@nada.kth.se
39 /* $Id: KClient.h,v 1.8 1999/12/02 16:58:40 joda Exp $ */
49 #ifdef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
53 enum { KClientLoggedIn, KClientNotLoggedIn };
57 unsigned char keyBytes[8];
59 typedef struct _KClientKey KClientKey;
61 struct _KClientSessionInfo
72 typedef struct _KClientSessionInfo KClientSessionInfo;
78 Kerr KClientMessage(char *text, Kerr error);
80 /* KClientInitSession */
81 Kerr KClientInitSession(KClientSessionInfo *session,
85 unsigned short fPort);
87 /* KClientGetTicketForService */
88 Kerr KClientGetTicketForService(KClientSessionInfo *session,
91 unsigned long *buflen);
95 Kerr KClientLogin(KClientSessionInfo *session,
96 KClientKey *privateKey );
98 /* KClientPasswordLogin */
99 Kerr KClientPasswordLogin(KClientSessionInfo *session,
101 KClientKey *privateKey);
103 /* KClientKeyLogin */
104 Kerr KClientKeyLogin(KClientSessionInfo *session, KClientKey *privateKey);
107 Kerr KClientLogout(void);
110 short KClientStatus(KClientSessionInfo *session);
112 /* KClientGetUserName */
113 Kerr KClientGetUserName(char *user);
115 /* KClientSetUserName */
116 Kerr KClientSetUserName(char *user);
118 /* KClientCacheInitialTicket */
119 Kerr KClientCacheInitialTicket(KClientSessionInfo *session,
122 /* KClientGetSessionKey */
123 Kerr KClientGetSessionKey(KClientSessionInfo *session,
124 KClientKey *sessionKey);
126 /* KClientMakeSendAuth */
127 Kerr KClientMakeSendAuth(KClientSessionInfo *session,
130 unsigned long *buflen,
132 char *applicationVersion);
134 /* KClientVerifySendAuth */
135 Kerr KClientVerifySendAuth(KClientSessionInfo *session,
137 unsigned long *buflen);
140 Kerr KClientEncrypt(KClientSessionInfo *session,
142 unsigned long buflen,
144 unsigned long *encryptLength);
147 Kerr KClientDecrypt(KClientSessionInfo *session,
149 unsigned long buflen,
150 unsigned long *decryptOffset,
151 unsigned long *decryptLength);
153 /* KClientErrorText */
154 char *KClientErrorText(Kerr err, char *text);
160 #endif /* KCLIENT_H */