5 Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
7 Copyright (C) 1997 - 2001 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
24 /* SILC client protocol types */
25 #define SILC_PROTOCOL_SERVER_NONE 0
26 #define SILC_PROTOCOL_SERVER_CONNECTION_AUTH 1
27 #define SILC_PROTOCOL_SERVER_KEY_EXCHANGE 2
28 #define SILC_PROTOCOL_SERVER_REKEY 3
29 #define SILC_PROTOCOL_SERVER_BACKUP 4
30 /* #define SILC_PROTOCOL_SERVER_MAX 255 */
32 /* Internal context for Key Exchange protocol. */
36 SilcSocketConnection sock;
39 /* TRUE if we are receiveing part of the protocol */
42 /* Destinations ID taken from authenticataed packet so that we can
43 get the destinations ID. */
45 SilcIdType dest_id_type;
47 /* Pointers to the configurations. Defined only when responder is TRUE */
48 SilcServerConfigRef cconfig;
49 SilcServerConfigRef sconfig;
50 SilcServerConfigRef rconfig;
52 SilcTask timeout_task;
53 SilcPacketContext *packet;
54 SilcSKESecurityPropertyFlag flags;
56 SilcSKEKeyMaterial *keymat;
57 } SilcServerKEInternalContext;
59 /* Internal context for connection authentication protocol */
63 SilcSocketConnection sock;
65 /* TRUE if we are receiving part of the protocol */
68 /* SKE object from Key Exchange protocol. */
71 /* Authentication method and data if we alreay know it. This is filled
72 before starting the protocol if we know the authentication data.
73 Otherwise these are and remain NULL. Used when we are initiating. */
76 SilcUInt32 auth_data_len;
78 /* Destinations ID from KE protocol context */
80 SilcIdType dest_id_type;
82 /* Pointers to the configurations. Defined only when responder is TRUE */
83 SilcServerConfigRef cconfig;
84 SilcServerConfigRef sconfig;
85 SilcServerConfigRef rconfig;
87 SilcTask timeout_task;
88 SilcPacketContext *packet;
90 } SilcServerConnAuthInternalContext;
92 /* Internal context for the rekey protocol */
96 SilcSocketConnection sock;
97 bool responder; /* TRUE if we are receiving party */
98 bool pfs; /* TRUE if PFS is to be used */
99 SilcSKE ske; /* Defined if PFS is used */
100 SilcPacketContext *packet;
101 } SilcServerRekeyInternalContext;
104 void silc_server_protocols_register(void);
105 void silc_server_protocols_unregister(void);
106 int silc_server_protocol_ke_set_keys(SilcServer server,
108 SilcSocketConnection sock,
109 SilcSKEKeyMaterial *keymat,
114 SilcSKEDiffieHellmanGroup group,