summaryrefslogtreecommitdiff
path: root/kex.c
diff options
context:
space:
mode:
Diffstat (limited to 'kex.c')
-rw-r--r--kex.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/kex.c b/kex.c
index 6b68ba504..25b3b8f8a 100644
--- a/kex.c
+++ b/kex.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: kex.c,v 1.34 2001/04/30 15:50:46 markus Exp $"); 26RCSID("$OpenBSD: kex.c,v 1.35 2001/06/23 15:12:18 itojun Exp $");
27 27
28#include <openssl/crypto.h> 28#include <openssl/crypto.h>
29 29
@@ -43,11 +43,12 @@ RCSID("$OpenBSD: kex.c,v 1.34 2001/04/30 15:50:46 markus Exp $");
43 43
44#define KEX_COOKIE_LEN 16 44#define KEX_COOKIE_LEN 16
45 45
46void kex_kexinit_finish(Kex *kex); 46/* prototype */
47void kex_choose_conf(Kex *k); 47static void kex_kexinit_finish(Kex *);
48static void kex_choose_conf(Kex *);
48 49
49/* put algorithm proposal into buffer */ 50/* put algorithm proposal into buffer */
50void 51static void
51kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX]) 52kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX])
52{ 53{
53 u_int32_t rand = 0; 54 u_int32_t rand = 0;
@@ -67,7 +68,7 @@ kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX])
67} 68}
68 69
69/* parse buffer and return algorithm proposal */ 70/* parse buffer and return algorithm proposal */
70char ** 71static char **
71kex_buf2prop(Buffer *raw) 72kex_buf2prop(Buffer *raw)
72{ 73{
73 Buffer b; 74 Buffer b;
@@ -95,7 +96,7 @@ kex_buf2prop(Buffer *raw)
95 return proposal; 96 return proposal;
96} 97}
97 98
98void 99static void
99kex_prop_free(char **proposal) 100kex_prop_free(char **proposal)
100{ 101{
101 int i; 102 int i;
@@ -105,13 +106,13 @@ kex_prop_free(char **proposal)
105 xfree(proposal); 106 xfree(proposal);
106} 107}
107 108
108void 109static void
109kex_protocol_error(int type, int plen, void *ctxt) 110kex_protocol_error(int type, int plen, void *ctxt)
110{ 111{
111 error("Hm, kex protocol error: type %d plen %d", type, plen); 112 error("Hm, kex protocol error: type %d plen %d", type, plen);
112} 113}
113 114
114void 115static void
115kex_clear_dispatch(void) 116kex_clear_dispatch(void)
116{ 117{
117 int i; 118 int i;
@@ -210,7 +211,7 @@ kex_setup(char *proposal[PROPOSAL_MAX])
210 return kex; 211 return kex;
211} 212}
212 213
213void 214static void
214kex_kexinit_finish(Kex *kex) 215kex_kexinit_finish(Kex *kex)
215{ 216{
216 if (!(kex->flags & KEX_INIT_SENT)) 217 if (!(kex->flags & KEX_INIT_SENT))
@@ -230,7 +231,7 @@ kex_kexinit_finish(Kex *kex)
230 } 231 }
231} 232}
232 233
233void 234static void
234choose_enc(Enc *enc, char *client, char *server) 235choose_enc(Enc *enc, char *client, char *server)
235{ 236{
236 char *name = match_list(client, server, NULL); 237 char *name = match_list(client, server, NULL);
@@ -244,7 +245,7 @@ choose_enc(Enc *enc, char *client, char *server)
244 enc->iv = NULL; 245 enc->iv = NULL;
245 enc->key = NULL; 246 enc->key = NULL;
246} 247}
247void 248static void
248choose_mac(Mac *mac, char *client, char *server) 249choose_mac(Mac *mac, char *client, char *server)
249{ 250{
250 char *name = match_list(client, server, NULL); 251 char *name = match_list(client, server, NULL);
@@ -259,7 +260,7 @@ choose_mac(Mac *mac, char *client, char *server)
259 mac->key = NULL; 260 mac->key = NULL;
260 mac->enabled = 0; 261 mac->enabled = 0;
261} 262}
262void 263static void
263choose_comp(Comp *comp, char *client, char *server) 264choose_comp(Comp *comp, char *client, char *server)
264{ 265{
265 char *name = match_list(client, server, NULL); 266 char *name = match_list(client, server, NULL);
@@ -274,7 +275,7 @@ choose_comp(Comp *comp, char *client, char *server)
274 } 275 }
275 comp->name = name; 276 comp->name = name;
276} 277}
277void 278static void
278choose_kex(Kex *k, char *client, char *server) 279choose_kex(Kex *k, char *client, char *server)
279{ 280{
280 k->name = match_list(client, server, NULL); 281 k->name = match_list(client, server, NULL);
@@ -287,7 +288,7 @@ choose_kex(Kex *k, char *client, char *server)
287 } else 288 } else
288 fatal("bad kex alg %s", k->name); 289 fatal("bad kex alg %s", k->name);
289} 290}
290void 291static void
291choose_hostkeyalg(Kex *k, char *client, char *server) 292choose_hostkeyalg(Kex *k, char *client, char *server)
292{ 293{
293 char *hostkeyalg = match_list(client, server, NULL); 294 char *hostkeyalg = match_list(client, server, NULL);
@@ -299,7 +300,7 @@ choose_hostkeyalg(Kex *k, char *client, char *server)
299 xfree(hostkeyalg); 300 xfree(hostkeyalg);
300} 301}
301 302
302void 303static void
303kex_choose_conf(Kex *kex) 304kex_choose_conf(Kex *kex)
304{ 305{
305 Newkeys *newkeys; 306 Newkeys *newkeys;
@@ -359,7 +360,7 @@ kex_choose_conf(Kex *kex)
359 kex_prop_free(peer); 360 kex_prop_free(peer);
360} 361}
361 362
362u_char * 363static u_char *
363derive_key(Kex *kex, int id, int need, u_char *hash, BIGNUM *shared_secret) 364derive_key(Kex *kex, int id, int need, u_char *hash, BIGNUM *shared_secret)
364{ 365{
365 Buffer b; 366 Buffer b;