rxkad: Remove DES include from header file
[openafs.git] / src / rxkad / rxkad_prototypes.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
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
8  */
9
10 #ifndef _RXKAD_PROTOTYPES_H
11 #define _RXKAD_PROTOTYPES_H
12
13 /* till the typedefs are moved elsewhere */
14 #include "fcrypt.h"
15 #include "rx/rx.h"
16
17 /* crypt_conn.c */
18 extern afs_int32 rxkad_DecryptPacket(const struct rx_connection *conn,
19                                      const fc_KeySchedule * schedule,
20                                      const fc_InitializationVector * ivec,
21                                      const int len, struct rx_packet *packet);
22 extern afs_int32 rxkad_EncryptPacket(const struct rx_connection *conn,
23                                      const fc_KeySchedule * schedule,
24                                      const fc_InitializationVector * ivec,
25                                      const int len, struct rx_packet *packet);
26
27
28 /* fcrypt.c */
29 extern int fc_keysched(struct ktc_encryptionKey *key,
30                        fc_KeySchedule schedule);
31 extern afs_int32 fc_ecb_encrypt(void * clear, void * cipher,
32                                 const fc_KeySchedule schedule, int encrypt);
33 extern afs_int32 fc_cbc_encrypt(void *input, void *output, afs_int32 length,
34                                 const fc_KeySchedule key, afs_uint32 * iv,
35                                 int encrypt);
36
37 /* rxkad_client.c */
38 extern int rxkad_AllocCID(struct rx_securityClass *aobj,
39                           struct rx_connection *aconn);
40 extern struct rx_securityClass *rxkad_NewClientSecurityObject(rxkad_level
41                                                               level, struct
42                                                               ktc_encryptionKey
43                                                               *sessionkey,
44                                                               afs_int32 kvno,
45                                                               int ticketLen,
46                                                               char *ticket);
47 extern int rxkad_GetResponse(struct rx_securityClass *aobj,
48                              struct rx_connection *aconn,
49                              struct rx_packet *apacket);
50 extern void rxkad_ResetState(void);
51
52 /* rxkad_common.c */
53 extern void rxkad_Init(void);
54
55 struct rxkad_endpoint;
56 extern int rxkad_SetupEndpoint(struct rx_connection *aconnp,
57                                struct rxkad_endpoint *aendpointp);
58 struct rxkad_v2ChallengeResponse;
59 extern afs_uint32 rxkad_CksumChallengeResponse(struct
60                                                rxkad_v2ChallengeResponse
61                                                *v2r);
62 extern int rxkad_DeriveXORInfo(struct rx_connection *aconnp,
63                                fc_KeySchedule * aschedule, char *aivec,
64                                char *aresult);
65 extern void rxkad_SetLevel(struct rx_connection *conn, rxkad_level level);
66 extern int rxkad_Close(struct rx_securityClass *aobj);
67 extern int rxkad_NewConnection(struct rx_securityClass *aobj,
68                                struct rx_connection *aconn);
69 extern int rxkad_DestroyConnection(struct rx_securityClass *aobj,
70                                    struct rx_connection *aconn);
71 extern int rxkad_CheckPacket(struct rx_securityClass *aobj,
72                              struct rx_call *acall,
73                              struct rx_packet *apacket);
74 extern int rxkad_PreparePacket(struct rx_securityClass *aobj,
75                                struct rx_call *acall,
76                                struct rx_packet *apacket);
77 extern int rxkad_GetStats(struct rx_securityClass *aobj,
78                           struct rx_connection *aconn,
79                           struct rx_securityObjectStats *astats);
80 extern rxkad_level rxkad_StringToLevel(char *string);
81 extern char *rxkad_LevelToString(rxkad_level level);
82
83 /* rxkad_errs.c */
84
85 /* rxkad_server.c */
86 extern struct rx_securityClass *rxkad_NewServerSecurityObject(rxkad_level
87                                                               level, void
88                                                               *get_key_rock,
89                                                               int (*get_key)
90
91
92
93                                                               (void
94                                                                *get_key_rock,
95                                                                int kvno,
96                                                                struct
97                                                                ktc_encryptionKey
98                                                                * serverKey),
99                                                               int (*user_ok)
100
101
102
103                                                               (char *name,
104                                                                char
105                                                                *instance,
106                                                                char *cell,
107                                                                afs_int32
108                                                                kvno));
109 extern int rxkad_CheckAuthentication(struct rx_securityClass *aobj,
110                                      struct rx_connection *aconn);
111 extern int rxkad_CreateChallenge(struct rx_securityClass *aobj,
112                                  struct rx_connection *aconn);
113 extern int rxkad_GetChallenge(struct rx_securityClass *aobj,
114                               struct rx_connection *aconn,
115                               struct rx_packet *apacket);
116 extern int rxkad_CheckResponse(struct rx_securityClass *aobj,
117                                struct rx_connection *aconn,
118                                struct rx_packet *apacket);
119 extern afs_int32 rxkad_GetServerInfo(struct rx_connection *aconn,
120                                      rxkad_level * level,
121                                      afs_uint32 * expiration, char *name,
122                                      char *instance, char *cell,
123                                      afs_int32 * kvno);
124 extern afs_int32 rxkad_SetConfiguration(struct rx_securityClass *aobj,
125                                         struct rx_connection *aconn,
126                                         rx_securityConfigVariables atype,
127                                         void * avalue, void **aresult);
128
129 /* ticket.c */
130 extern int tkt_DecodeTicket(char *asecret, afs_int32 ticketLen,
131                             struct ktc_encryptionKey *key, char *name,
132                             char *inst, char *cell, struct ktc_encryptionKey *sessionKey,
133                             afs_int32 * host, afs_uint32 * start,
134                             afs_uint32 * end);
135 extern int tkt_MakeTicket(char *ticket, int *ticketLen,
136                           struct ktc_encryptionKey *key, char *name,
137                           char *inst, char *cell, afs_uint32 start,
138                           afs_uint32 end,
139                           struct ktc_encryptionKey *sessionKey,
140                           afs_uint32 host, char *sname, char *sinst);
141 extern int tkt_CheckTimes(afs_uint32 start, afs_uint32 end, afs_uint32 now);
142 extern afs_int32 ktohl(char flags, afs_int32 l);
143 extern afs_uint32 life_to_time(afs_uint32 start, unsigned char life);
144 extern unsigned char time_to_life(afs_uint32 start, afs_uint32 end);
145
146 /* crc.c */
147 extern void _rxkad_crc_init_table(void);
148 extern afs_uint32 _rxkad_crc_update(const char *p, size_t len, afs_uint32 res);
149
150 /* ticket5.c */
151 extern int tkt_DecodeTicket5(char *ticket, afs_int32 ticket_len,
152                              int (*get_key) (void *, int,
153                                              struct ktc_encryptionKey *),
154                              char *get_key_rock, int serv_kvno, char *name,
155                              char *inst, char *cell, struct ktc_encryptionKey *session_key,
156                              afs_int32 * host, afs_uint32 * start,
157                              afs_uint32 * end, afs_int32 disableDotCheck);
158
159 #endif