1 /* rxgk/rxgk_client.c - Client-only security object routines */
3 * Copyright (C) 2013, 2014 by the Massachusetts Institute of Technology.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 * OF THE POSSIBILITY OF SUCH DAMAGE.
33 * Client-only security object routines.
36 #include <afsconfig.h>
37 #include <afs/param.h>
40 /* OS-specific system headers go here */
43 #include <rx/rx_packet.h>
46 #include "rxgk_private.h"
48 /* Pre-declare the securityclass routines for the securityOps definition. */
49 static int rxgk_ClientClose(struct rx_securityClass *aobj);
50 static int rxgk_NewClientConnection(struct rx_securityClass *aobj,
51 struct rx_connection *aconn);
52 static int rxgk_ClientPreparePacket(struct rx_securityClass *aobj,
53 struct rx_call *acall,
54 struct rx_packet *apacket);
55 static int rxgk_GetResponse(struct rx_securityClass *aobj,
56 struct rx_connection *aconn,
57 struct rx_packet *apacket);
58 static int rxgk_ClientCheckPacket(struct rx_securityClass *aobj,
59 struct rx_call *acall,
60 struct rx_packet *apacket);
61 static int rxgk_DestroyClientConnection(struct rx_securityClass *aobj,
62 struct rx_connection *aconn);
63 static int rxgk_ClientGetStats(struct rx_securityClass *aobj,
64 struct rx_connection *aconn,
65 struct rx_securityObjectStats *astats);
67 static struct rx_securityOps rxgk_client_ops = {
69 rxgk_NewClientConnection, /* every new connection */
70 rxgk_ClientPreparePacket, /* once per packet creation */
71 0, /* send packet (once per retrans) */
75 rxgk_GetResponse, /* respond to challenge packet */
77 rxgk_ClientCheckPacket, /* check data packet */
78 rxgk_DestroyClientConnection,
85 static struct rx_securityClass dummySC = {
91 struct rx_securityClass *
92 rxgk_NewClientSecurityObject(RXGK_Level level, afs_int32 enctype, rxgk_key k0,
93 RXGK_Data *token, afsUUID *uuid)
99 rxgk_ClientClose(struct rx_securityClass *aobj)
101 return RXGK_INCONSISTENCY;
105 rxgk_NewClientConnection(struct rx_securityClass *aobj,
106 struct rx_connection *aconn)
108 return RXGK_INCONSISTENCY;
112 rxgk_ClientPreparePacket(struct rx_securityClass *aobj, struct rx_call *acall,
113 struct rx_packet *apacket)
115 return RXGK_INCONSISTENCY;
119 rxgk_GetResponse(struct rx_securityClass *aobj, struct rx_connection *aconn,
120 struct rx_packet *apacket)
122 return RXGK_INCONSISTENCY;
126 rxgk_ClientCheckPacket(struct rx_securityClass *aobj, struct rx_call *acall,
127 struct rx_packet *apacket)
129 return RXGK_INCONSISTENCY;
133 rxgk_DestroyClientConnection(struct rx_securityClass *aobj,
134 struct rx_connection *aconn)
136 return RXGK_INCONSISTENCY;
140 rxgk_ClientGetStats(struct rx_securityClass *aobj, struct rx_connection *aconn,
141 struct rx_securityObjectStats *astats)
143 return RXGK_INCONSISTENCY;