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_MAX 255 */
31 /* Internal context for Key Exchange protocol. */
35 SilcSocketConnection sock;
38 /* TRUE if we are receiveing part of the protocol */
41 /* Destinations ID taken from authenticataed packet so that we can
42 get the destinations ID. */
44 SilcIdType dest_id_type;
46 SilcTask timeout_task;
47 SilcPacketContext *packet;
49 SilcSKEKeyMaterial *keymat;
50 } SilcServerKEInternalContext;
52 /* Internal context for connection authentication protocol */
56 SilcSocketConnection sock;
58 /* TRUE if we are receiving part of the protocol */
61 /* SKE object from Key Exchange protocol. */
64 /* Auth method that must be used. This is resolved before this
65 connection authentication protocol is started. Used when we are
69 /* Authentication data if we alreay know it. This is filled before
70 starting the protocol if we know the authentication data. Otherwise
71 these are and remain NULL. Used when we are initiating. */
75 /* Destinations ID from KE protocol context */
77 SilcIdType dest_id_type;
79 SilcTask timeout_task;
80 SilcPacketContext *packet;
82 } SilcServerConnAuthInternalContext;
84 /* Internal context for the rekey protocol */
88 SilcSocketConnection sock;
89 bool responder; /* TRUE if we are receiving party */
90 bool pfs; /* TRUE if PFS is to be used */
91 SilcSKE ske; /* Defined if PFS is used */
92 SilcPacketContext *packet;
93 } SilcServerRekeyInternalContext;
96 void silc_server_protocols_register(void);
97 void silc_server_protocols_unregister(void);
98 int silc_server_protocol_ke_set_keys(SilcSKE ske,
99 SilcSocketConnection sock,
100 SilcSKEKeyMaterial *keymat,
105 SilcSKEDiffieHellmanGroup group,
107 void silc_server_protocol_rekey_generate(SilcServer server,
108 SilcServerRekeyInternalContext *ctx);
110 silc_server_protocol_rekey_generate_pfs(SilcServer server,
111 SilcServerRekeyInternalContext *ctx);