5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2000 - 2002 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; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
20 /****h* silcske/SilcSKEPayloads
24 * This interface defines the implementation of the SKE Payloads, as
25 * defined by the SKE protocol. This interface is mainly used by the SKE
26 * library, however all structures are public and the interface can be used
27 * by the application if needed. Usually application does not need use this
32 #ifndef SILCSKE_PAYLOAD_H
33 #define SILCSKE_PAYLOAD_H
35 /****s* silcske/SilcSKEPayloads/SilcSKEStartPayload
39 * typedef struct SilcSKEStartPayloadStruct SilcSKEStartPayload;
43 * This context is the actual Key Exchange Start Payload and is allocated
44 * by silc_ske_payload_start_decode. It is freed by calling the
45 * silc_ske_payload_start_free function.
48 typedef struct SilcSKEStartPayloadStruct SilcSKEStartPayload;
50 /****s* silcske/SilcSKEPayloads/SilcSKEKEPayload
54 * typedef struct SilcSKEKEPayloadStruct SilcSKEKEPayload;
58 * This context is the actual Key Exchange Payload and is allocated
59 * by silc_ske_payload_ke_decode. It is freed by calling the
60 * silc_ske_payload_ke_free function.
63 typedef struct SilcSKEKEPayloadStruct SilcSKEKEPayload;
65 /* SILC Key Exchange Start Payload */
66 struct SilcSKEStartPayloadStruct {
70 unsigned char *cookie;
71 SilcUInt16 cookie_len;
73 unsigned char *version;
74 SilcUInt16 version_len;
76 SilcUInt16 ke_grp_len;
77 unsigned char *ke_grp_list;
79 SilcUInt16 pkcs_alg_len;
80 unsigned char *pkcs_alg_list;
82 SilcUInt16 enc_alg_len;
83 unsigned char *enc_alg_list;
85 SilcUInt16 hash_alg_len;
86 unsigned char *hash_alg_list;
88 SilcUInt16 hmac_alg_len;
89 unsigned char *hmac_alg_list;
91 SilcUInt16 comp_alg_len;
92 unsigned char *comp_alg_list;
95 /* SILC Key Exchange Payload */
96 struct SilcSKEKEPayloadStruct {
98 unsigned char *pk_data;
104 unsigned char *sign_data;
109 /****f* silcske/SilcSKEPayloads/silc_ske_payload_start_encode
113 * SilcSKEStatus silc_ske_payload_start_encode(SilcSKE ske,
114 * SilcSKEStartPayload *payload,
115 * SilcBuffer *return_buffer);
119 * Utility function used to encode Key Exchange Start Payload from the
120 * `payload' structure. The encoded buffer is returned into the
121 * `return_buffer' and the caller must free it.
124 SilcSKEStatus silc_ske_payload_start_encode(SilcSKE ske,
125 SilcSKEStartPayload *payload,
126 SilcBuffer *return_buffer);
128 /****f* silcske/SilcSKEPayloads/silc_ske_payload_start_decode
133 * silc_ske_payload_start_decode(SilcSKE ske,
135 * SilcSKEStartPayload **return_payload);
139 * Utility function used to decode Key Exchange Start Payload from the
140 * `buffer' data buffer. The decoded payload is returned into the
141 * `return_payload' and the caller must free it.
145 silc_ske_payload_start_decode(SilcSKE ske,
147 SilcSKEStartPayload **return_payload);
149 /****f* silcske/SilcSKEPayloads/silc_ske_payload_start_free
153 * void silc_ske_payload_start_free(SilcSKEStartPayload *payload);
157 * Frees the Key Exchange Start Payload indicated by `payload'.
160 void silc_ske_payload_start_free(SilcSKEStartPayload *payload);
162 /****f* silcske/SilcSKEPayloads/silc_ske_payload_ke_encode
166 * SilcSKEStatus silc_ske_payload_ke_encode(SilcSKE ske,
167 * SilcSKEKEPayload *payload,
168 * SilcBuffer *return_buffer);
172 * Utility function used to encode Key Exchange Payload from the
173 * `payload' structure. The encoded buffer is returned into the
174 * `return_buffer' and the caller must free it.
177 SilcSKEStatus silc_ske_payload_ke_encode(SilcSKE ske,
178 SilcSKEKEPayload *payload,
179 SilcBuffer *return_buffer);
181 /****f* silcske/SilcSKEPayloads/silc_ske_payload_ke_decode
185 * SilcSKEStatus silc_ske_payload_ke_decode(SilcSKE ske,
192 * Utility function used to decode Key Exchange Payload from the
193 * `buffer' data buffer. The decoded payload is returned into the
194 * `return_payload' and the caller must free it.
197 SilcSKEStatus silc_ske_payload_ke_decode(SilcSKE ske,
199 SilcSKEKEPayload **return_payload);
201 /****f* silcske/SilcSKEPayloads/silc_ske_payload_ke_free
205 * void silc_ske_payload_ke_free(SilcSKEKEPayload *payload);
209 * Frees the Key Exchange Payload indicated by `payload'.
212 void silc_ske_payload_ke_free(SilcSKEKEPayload *payload);
214 #endif /* SILCSKE_PAYLOAD_H */