updates.
[silc.git] / lib / silcske / payload.h
1 /*
2
3   payload.h
4
5   Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
6
7   Copyright (C) 2000 - 2001 Pekka Riikonen
8
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.
13   
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.
18
19 */
20
21 #ifndef PAYLOAD_H
22 #define PAYLOAD_H
23
24 #include "silcske_status.h"
25
26 /* Forward declarations */
27 typedef struct SilcSKEStartPayloadStruct SilcSKEStartPayload;
28 typedef struct SilcSKEKEPayloadStruct SilcSKEKEPayload;
29
30 /* SILC Key Exchange Start Payload */
31 struct SilcSKEStartPayloadStruct {
32   unsigned char flags;
33   uint16 len;
34
35   unsigned char *cookie;
36   uint16 cookie_len;
37
38   unsigned char *version;
39   uint16 version_len;
40
41   uint16 ke_grp_len;
42   unsigned char *ke_grp_list;
43
44   uint16 pkcs_alg_len;
45   unsigned char *pkcs_alg_list;
46
47   uint16 enc_alg_len;
48   unsigned char *enc_alg_list;
49   
50   uint16 hash_alg_len;
51   unsigned char *hash_alg_list;
52
53   uint16 hmac_alg_len;
54   unsigned char *hmac_alg_list;
55
56   uint16 comp_alg_len;
57   unsigned char *comp_alg_list;
58 };
59
60 /* SILC Key Exchange Payload */
61 struct SilcSKEKEPayloadStruct {
62   uint16 pk_len;
63   unsigned char *pk_data;
64   uint16 pk_type;
65
66   SilcMPInt x;
67
68   uint16 sign_len;
69   unsigned char *sign_data;
70 };
71
72 /* Prototypes */
73 SilcSKEStatus silc_ske_payload_start_encode(SilcSKE ske,
74                                             SilcSKEStartPayload *payload,
75                                             SilcBuffer *return_buffer);
76 SilcSKEStatus 
77 silc_ske_payload_start_decode(SilcSKE ske,
78                               SilcBuffer buffer,
79                               SilcSKEStartPayload **return_payload);
80 void silc_ske_payload_start_free(SilcSKEStartPayload *payload);
81 SilcSKEStatus silc_ske_payload_ke_encode(SilcSKE ske,
82                                          SilcSKEKEPayload *payload,
83                                          SilcBuffer *return_buffer);
84 SilcSKEStatus silc_ske_payload_ke_decode(SilcSKE ske,
85                                          SilcBuffer buffer,
86                                          SilcSKEKEPayload **return_payload);
87 void silc_ske_payload_ke_free(SilcSKEKEPayload *payload);
88
89 #endif