2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 /* Declarations of data structures associated with rxkad security objects. */
12 #ifndef RXKAD_PRIVATE_DATA_H
13 #define RXKAD_PRIVATE_DATA_H
21 afs_uint32 bytesReceived, bytesSent, packetsReceived, packetsSent;
24 /* Private data structure representing an RX server end point for rxkad.
25 * This structure is encrypted in network byte order and transmitted as
26 * part of a challenge response. It is also used as part of the per-packet
27 * checksum sent on every packet, to ensure that the per-packet checksum
28 * is not used in the context of another end point.
30 * THIS STRUCTURE MUST BE A MULTIPLE OF 8 BYTES LONG SINCE IT IS
33 struct rxkad_endpoint {
34 afs_int32 cuid[2]; /* being used for connection routing */
35 afs_uint32 cksum; /* cksum of challenge response */
36 afs_int32 securityIndex; /* security index */
39 /* structure used for generating connection IDs; must be encrypted in network
40 * byte order. Also must be a multiple of 8 bytes for encryption to work
44 struct clock time; /* time now */
45 afs_int32 random1; /* some implementation-specific random info */
46 afs_int32 random2; /* more random info */
47 afs_int32 counter; /* a counter */
48 afs_int32 ipAddr; /* or an approximation to it */
51 #define PDATA_SIZE(l) (sizeof(struct rxkad_cprivate) - MAXKTCTICKETLEN + (l))
53 /* private data in client-side security object */
54 struct rxkad_cprivate {
55 afs_int32 kvno; /* key version of ticket */
56 afs_int16 ticketLen; /* length of ticket */
57 rxkad_type type; /* always client */
58 rxkad_level level; /* minimum security level of client */
59 fc_KeySchedule keysched; /* the session key */
60 fc_InitializationVector ivec; /* initialization vector for cbc */
61 char ticket[MAXKTCTICKETLEN]; /* the ticket for the server */
64 /* Per connection client-side info */
66 fc_InitializationVector preSeq; /* used in computing checksum */
67 struct connStats stats;
68 char cksumSeen; /* rx: header.spare is a checksum */
71 /* private data in server-side security object */
72 struct rxkad_sprivate {
73 char *get_key_rock; /* rock for get_key function */
74 int (*get_key) (); /* func. of kvno and server key ptr */
75 int (*user_ok) (); /* func called with new client name */
76 rxkad_type type; /* always server */
77 rxkad_level level; /* minimum security level of server */
80 /* private data in server-side connection */
82 rxkad_level level; /* security level of connection */
83 char tried; /* did we ever try to auth this conn */
84 char authenticated; /* connection is good */
85 char cksumSeen; /* rx: header.spare is a checksum */
86 afs_uint32 expirationTime; /* when the ticket expires */
87 afs_int32 challengeID; /* unique challenge */
88 struct connStats stats; /* per connection stats */
89 fc_KeySchedule keysched; /* session key */
90 fc_InitializationVector ivec; /* initialization vector for cbc */
91 fc_InitializationVector preSeq; /* used in computing checksum */
92 struct rxkad_serverinfo *rock; /* info about client if saved */
95 struct rxkad_serverinfo {
97 struct ktc_principal client;
100 #define RXKAD_CHALLENGE_PROTOCOL_VERSION 2
102 /* An old style (any version predating 2) challenge packet */
103 struct rxkad_oldChallenge {
104 afs_int32 challengeID;
105 afs_int32 level; /* minimum security level */
108 /* A version 2 challenge */
109 struct rxkad_v2Challenge {
111 afs_int32 challengeID;
116 /* An old challenge response packet */
117 struct rxkad_oldChallengeResponse {
118 struct { /* encrypted with session key */
119 afs_int32 incChallengeID;
125 /* <ticketLen> bytes of ticket follow here */
127 /* A version 2 challenge response also includes connection routing (Rx server
128 * end point) and client call number state as well as version and spare fields.
129 * The encrypted part probably doesn't need to start on an 8 byte boundary, but
130 * just in case we put in a spare. */
131 struct rxkad_v2ChallengeResponse {
134 struct { /* encrypted with session key */
135 struct rxkad_endpoint endpoint; /* for connection routing */
136 afs_int32 callNumbers[RX_MAXCALLS]; /* client call # state */
137 afs_int32 incChallengeID;
143 /* <ticketLen> bytes of ticket follow here */
145 The above structure requires
146 that(RX_MAXCALLS == 4).
148 #endif /* RXKAD_PRIVATE_DATA_H */