1 /* Declarations of data structures associated with rxkad security objects. */
4 ****************************************************************************
5 * Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
7 * Permission to use, copy, modify, and distribute this software and its *
8 * documentation for any purpose and without fee is hereby granted, *
9 * provided that the above copyright notice appear in all copies and *
10 * that both that copyright notice and this permission notice appear in *
11 * supporting documentation, and that the name of IBM not be used in *
12 * advertising or publicity pertaining to distribution of the software *
13 * without specific, written prior permission. *
15 * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
18 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
19 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
20 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
21 ****************************************************************************
24 /* Copyright (C) 1991, 1990 Transarc Corporation - All rights reserved */
27 #ifndef TRANSARC_RXKAD_PRIVATE_DATA_H
28 #define TRANSARC_RXKAD_PRIVATE_DATA_H
37 bytesReceived, bytesSent, packetsReceived, packetsSent;
40 /* Private data structure representing an RX server end point for rxkad.
41 * This structure is encrypted in network byte order and transmitted as
42 * part of a challenge response. It is also used as part of the per-packet
43 * checksum sent on every packet, to ensure that the per-packet checksum
44 * is not used in the context of another end point.
46 * THIS STRUCTURE MUST BE A MULTIPLE OF 8 BYTES LONG SINCE IT IS
49 struct rxkad_endpoint {
50 afs_int32 cuid[2]; /* being used for connection routing */
51 afs_uint32 cksum; /* cksum of challenge response */
52 afs_int32 securityIndex; /* security index */
55 /* structure used for generating connection IDs; must be encrypted in network
56 * byte order. Also must be a multiple of 8 bytes for encryption to work
60 struct clock time; /* time now */
61 afs_int32 random1; /* some implementation-specific random info */
62 afs_int32 random2; /* more random info */
63 afs_int32 counter; /* a counter */
64 afs_int32 ipAddr; /* or an approximation to it */
67 /* private data in client-side security object */
68 struct rxkad_cprivate {
69 afs_int32 kvno; /* key version of ticket */
70 afs_int32 ticketLen; /* length of ticket */
71 fc_KeySchedule keysched; /* the session key */
72 fc_InitializationVector ivec; /* initialization vector for cbc */
73 char ticket[MAXKTCTICKETLEN]; /* the ticket for the server */
74 rxkad_type type; /* always client */
75 rxkad_level level; /* minimum security level of client */
78 /* Per connection client-side info */
80 fc_InitializationVector preSeq; /* used in computing checksum */
81 struct connStats stats;
82 char cksumSeen; /* rx: header.spare is a checksum */
85 /* private data in server-side security object */
86 struct rxkad_sprivate {
87 char *get_key_rock; /* rock for get_key function */
88 int (*get_key)(); /* func. of kvno and server key ptr */
89 int (*user_ok)(); /* func called with new client name */
90 rxkad_type type; /* always server */
91 rxkad_level level; /* minimum security level of server */
94 /* private data in server-side connection */
96 rxkad_level level; /* security level of connection */
97 char tried; /* did we ever try to auth this conn */
98 char authenticated; /* connection is good */
99 char cksumSeen; /* rx: header.spare is a checksum */
100 afs_uint32 expirationTime; /* when the ticket expires */
101 afs_int32 challengeID; /* unique challenge */
102 struct connStats stats; /* per connection stats */
103 fc_KeySchedule keysched; /* session key */
104 fc_InitializationVector ivec; /* initialization vector for cbc */
105 fc_InitializationVector preSeq; /* used in computing checksum */
106 struct rxkad_serverinfo *rock; /* info about client if saved */
109 struct rxkad_serverinfo {
111 struct ktc_principal client;
114 #define RXKAD_CHALLENGE_PROTOCOL_VERSION 2
116 /* An old style (any version predating 2) challenge packet */
117 struct rxkad_oldChallenge {
118 afs_int32 challengeID;
119 afs_int32 level; /* minimum security level */
122 /* A version 2 challenge */
123 struct rxkad_v2Challenge {
125 afs_int32 challengeID;
130 /* An old challenge response packet */
131 struct rxkad_oldChallengeResponse {
132 struct { /* encrypted with session key */
133 afs_int32 incChallengeID;
139 /* <ticketLen> bytes of ticket follow here */
141 /* A version 2 challenge response also includes connection routing (Rx server
142 * end point) and client call number state as well as version and spare fields.
143 * The encrypted part probably doesn't need to start on an 8 byte boundary, but
144 * just in case we put in a spare. */
145 struct rxkad_v2ChallengeResponse {
148 struct { /* encrypted with session key */
149 struct rxkad_endpoint endpoint; /* for connection routing */
150 afs_int32 callNumbers[RX_MAXCALLS]; /* client call # state */
151 afs_int32 incChallengeID;
157 /* <ticketLen> bytes of ticket follow here */
159 The above structure requires that (RX_MAXCALLS == 4).
162 /* This should be afs_int32, but the RXS ops are defined as int returning */
163 #define rxs_return_t int
166 rxkad_NewConnection(),
167 rxkad_CheckAuthentication(),
168 rxkad_CreateChallenge(),
169 rxkad_GetChallenge(),
172 rxkad_PreparePacket(),
173 rxkad_CheckResponse(),
174 rxkad_DestroyConnection(),
178 #endif /* TRANSARC_RXKAD_PRIVATE_DATA_H */